/* Навигация */
.nav-link {
    color: #374151;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--olive-dark) !important;
}

.btn-nav {
    background-color: var(--olive-btn);
    color: white;
    transition: var(--transition);
}

.btn-nav:hover {
    background-color: var(--olive-dark);
}

/* Кнопка бургера */
.mobile-menu-button {
    color: #4b5563;
    transition: var(--transition);
}

.mobile-menu-button:hover {
    color: var(--olive);
}

/* Мобильное меню */
.mobile-menu {
    position: fixed;
    inset: 0;
    background: white;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: translateY(-20px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

.mobile-menu.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.mobile-menu-link:hover {
    color: var(--olive) !important;
}

@media (max-width: 932px) {
    .desktop-menu       { display: none !important; }
    .mobile-menu-button { display: block !important; }
}

@media (min-width: 933px) {
    .desktop-menu       { display: flex !important; }
    .mobile-menu-button { display: none !important; }
    .mobile-menu        { display: none !important; }

    #share-container:hover .share-dropdown {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
        transition: opacity 0.17s ease, transform 0.17s ease, visibility 0s;
    }

    /* Прозрачный мост на контейнере — перекрывает зазор 8px между кнопкой и меню.
       Нельзя вешать на сам дропдаун: у него pointer-events:none пока скрыт. */
    #share-container::after {
        content: '';
        position: absolute;
        top: 100%;
        left: -110px;
        right: -110px;
        height: 8px;
    }
}

/* Кнопка Поделиться */
.btn-share {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: white;
    color: var(--olive-medium);
    border: 1px solid rgba(90, 125, 26, 0.28);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.btn-share:hover,
.btn-share[aria-expanded="true"] {
    background: rgba(107, 142, 35, 0.07);
    border-color: rgba(90, 125, 26, 0.45);
}

/* Выпадающее меню */
.share-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    margin-left: -114px; /* сдвиг влево на половину ширины (228/2) — центр под кнопкой */
    background: white;
    border: 1px solid rgba(107, 142, 35, 0.18);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.11);
    padding: 6px 0;
    width: 228px;
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.17s ease, transform 0.17s ease, visibility 0s 0.17s;
}

.share-dropdown--open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 0.17s ease, transform 0.17s ease, visibility 0s 0s;
}

.share-dropdown-title {
    padding: 8px 14px 5px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
}

.share-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 10px 14px;
    margin: 0 4px;
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 6px;
    transition: background 0.13s, color 0.13s;
    cursor: pointer;
}

.share-item i,
.share-item-icon {
    width: 18px;
    font-size: 1rem;
    text-align: center;
    color: var(--olive);
    flex-shrink: 0;
}

.share-item-icon {
    height: 18px;
    object-fit: contain;
    display: block;
}

.share-item:hover,
.share-item:focus {
    background: rgba(107, 142, 35, 0.09);
    color: #1f2937;
    outline: none;
}

.share-item:hover i,
.share-item:focus i {
    color: var(--olive-dark);
}

.share-separator {
    height: 1px;
    background: rgba(107, 142, 35, 0.1);
    margin: 4px 0;
}

/* Тост «Ссылка скопирована» */
.share-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: var(--olive-dark);
    color: white;
    padding: 8px 22px;
    border-radius: 20px;
    font-size: 0.875rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 1000;
    white-space: nowrap;
}

.share-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* QR-модал */
.qr-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-modal-box {
    background: white;
    border-radius: 16px;
    padding: 28px 24px 20px;
    max-width: 280px;
    width: calc(100% - 32px);
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.qr-modal-box h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
}

.qr-modal-box img {
    width: 192px;
    height: 192px;
    margin: 0 auto;
    display: block;
    border-radius: 8px;
}

.qr-modal-close {
    margin-top: 16px;
    font-size: 0.85rem;
    color: #6b7280;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.2s;
}

.qr-modal-close:hover {
    color: var(--olive-dark);
}

/* MAX fallback-модал */
.max-modal-hint {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 12px;
}

.max-modal-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 12px;
}

.max-modal-input {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.78rem;
    color: #374151;
    background: #f9fafb;
    outline: none;
}

.max-modal-copy-btn {
    padding: 6px 12px;
    background: var(--olive-btn);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    flex-shrink: 0;
}

.max-modal-copy-btn:hover { background: var(--olive-dark); }

.max-modal-open {
    display: inline-block;
    margin-bottom: 4px;
    font-size: 0.82rem;
    color: var(--olive-medium);
    text-decoration: none;
    border-bottom: 1px solid rgba(90, 125, 26, 0.3);
    transition: color 0.15s;
}

.max-modal-open:hover { color: var(--olive-dark); }
