/* ============ ГЛАВНАЯ СТРАНИЦА В ОБЩЕМ СКРОЛЛИНГЕ ============ */

/* Секция главной страницы */
.home-section {
    background-image: url('../images/background.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: scroll; /* Изменено с fixed на scroll для мобильных */
    padding: 0 !important;
    margin: 0 !important;
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background-color: #000; /* Резервный цвет фона */
}

/* Для десктопа оставляем fixed */
@media (min-width: 993px) {
    .home-section {
        background-attachment: fixed;
    }
}

.home-page-content {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Быстрые кнопки на главной странице - ТОЛЬКО ДЛЯ МОБИЛЬНЫХ И ТОЛЬКО НА ГЛАВНОЙ */
.quick-links-container-home {
    position: fixed !important; /* Изменено с absolute на fixed */
    top: 70px !important; /* Под хедером */
    right: 10px !important;
    z-index: 9999 !important;
    display: none;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: auto;
    transform: translateZ(0); /* Фикс для аппаратного ускорения iOS */
    -webkit-transform: translateZ(0); /* Для Safari */
}

/* Показываем быстрые кнопки только на мобильных И ТОЛЬКО НА ГЛАВНОЙ СТРАНИЦЕ */
@media (max-width: 992px) {
    /* Кнопки показываются только когда body имеет активную главную страницу */
    body:not(.home-section-active) .quick-links-container-home {
        display: none !important;
    }
}

/* На десктопе всегда скрываем быстрые кнопки */
@media (min-width: 993px) {
    .quick-links-container-home {
        display: none !important;
    }
}

/* Быстрые кнопки - ПОЛНОСТЬЮ ПРОЗРАЧНЫЕ */
.quick-link-home {
    display: inline-block;
    padding: 8px 12px;
    background: transparent !important;
    border-radius: 0;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none !important;
    backdrop-filter: none !important;
    margin: 0;
    text-align: center;
    box-sizing: border-box;
    white-space: nowrap;
    width: auto;
    min-width: fit-content;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
    font-size: inherit;
    outline: none;
    position: relative;
    z-index: 10001;
    -webkit-tap-highlight-color: transparent; /* Убираем подсветку при тапе на iOS */
    touch-action: manipulation; /* Улучшаем обработку касаний */
}

.quick-link-home:hover {
    background: transparent !important;
    transform: translateX(-3px);
}

/* Текст кнопок */
.quick-link-home span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 400;
    text-align: center;
    line-height: 1.2;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: inherit;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.quick-link-home:hover span {
    opacity: 1;
    color: rgba(255, 255, 255, 1) !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Гарантируем кликабельность */
.quick-links-container-home * {
    pointer-events: auto !important;
}

.quick-link-home, .quick-link-home * {
    pointer-events: auto !important;
    cursor: pointer !important;
}

.quick-link-home {
    z-index: 10001 !important;
    position: relative !important;
}

.quick-links-container-home {
    z-index: 10000 !important;
}

/* Адаптивность для разных размеров экрана */
@media (max-width: 768px) {
    .quick-links-container-home {
        top: 70px !important;
        right: 8px !important;
        gap: 6px;
    }
    
    .quick-link-home {
        padding: 6px 10px;
    }
    
    .quick-link-home span {
        font-size: 0.75rem;
        letter-spacing: 0.4px;
    }
}

@media (max-width: 576px) and (min-width: 421px) {
    .quick-links-container-home {
        top: 75px !important;
        gap: 7px;
    }
    
    .quick-link-home {
        padding: 7px 11px;
    }
    
    .quick-link-home span {
        font-size: 0.78rem;
    }
}

@media (max-width: 360px) {
    .quick-links-container-home {
        top: 65px !important;
        right: 6px !important;
        gap: 5px;
    }
    
    .quick-link-home {
        padding: 5px 8px;
    }
    
    .quick-link-home span {
        font-size: 0.7rem;
        letter-spacing: 0.3px;
    }
}

/* Исправления для iOS */
@supports (-webkit-touch-callout: none) {
    .home-section {
        background-attachment: scroll !important;
        height: -webkit-fill-available;
        min-height: 100vh;
    }
    
    .quick-links-container-home {
        position: fixed !important;
        top: 70px !important;
        right: 10px !important;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
}

/* Для устройств с маленькой высотой экрана */
@media (max-height: 700px) {
    .home-section {
        background-position: center top;
    }
    
    .quick-links-container-home {
        top: 60px !important;
        gap: 5px;
    }
}

/* Для ландшафтной ориентации */
@media (max-width: 992px) and (orientation: landscape) {
    .quick-links-container-home {
        top: 60px !important;
        right: 5px !important;
        gap: 4px;
    }
    
    .quick-link-home {
        padding: 4px 8px;
    }
    
    .quick-link-home span {
        font-size: 0.7rem;
    }
}