/* base.css */
/* ===========================================================================
   === БАЗОВЫЕ СТИЛИ =========================================================
   =========================================================================== */

/* === ЦВЕТОВЫЕ ПЕРЕМЕННЫЕ === */
:root {
    --color-primary: #315f91;
    --color-primary-hover: #315f91;
    --color-success: #6f927c;
    --color-warning: #b6945e;
    --color-error: #b85f5f;
    --color-text: #f0eee9;
    --color-text-muted: rgba(255, 255, 255, 0.6);
    --color-bg: #0b1626;
    --color-bg-card: rgba(153, 204, 255, 0.03);
    --color-border: rgba(49, 95, 145, 0.3);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* === ГЛОБАЛЬНЫЕ СТИЛИ ДЛЯ ССЫЛОК === */
a {
    text-decoration: none;
    color: inherit;
    outline: none;
}

a:hover, a:focus {
    text-decoration: none;
    outline: none;
    background: none !important;
    border: none !important;
}

/* === BOX-SIZING === */
*,
*:before,
*:after {
    box-sizing: border-box;
}

/* === ФОН НА ВСЕХ СТРАНИЦАХ === */
body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
}

/* === АНИМАЦИИ === */
@keyframes fadeInResults {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInProduct {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(5px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* === КАСКАДНОЕ ПОЯВЛЕНИЕ КАРТОЧЕК === */
.product:nth-child(1) { animation-delay: 0.05s; }
.product:nth-child(2) { animation-delay: 0.10s; }
.product:nth-child(3) { animation-delay: 0.15s; }
.product:nth-child(4) { animation-delay: 0.20s; }
.product:nth-child(5) { animation-delay: 0.25s; }
.product:nth-child(6) { animation-delay: 0.30s; }
.product:nth-child(7) { animation-delay: 0.35s; }
.product:nth-child(8) { animation-delay: 0.40s; }
.product:nth-child(9) { animation-delay: 0.45s; }
.product:nth-child(10) { animation-delay: 0.50s; }
.product:nth-child(11) { animation-delay: 0.55s; }
.product:nth-child(12) { animation-delay: 0.60s; }

/* === БЛОКИРОВКА СКРОЛЛА === */
body.page-transition {
    cursor: progress;
}

html {
    overflow-y: scroll !important;
    scrollbar-gutter: stable;
}

/* === УТИЛИТАРНЫЕ КЛАССЫ === */
.fade-out {
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 110ms ease-out;
}

.fade-in {
    opacity: 1;
    animation: pageContentIn 240ms ease both;
}

@keyframes pageContentIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-transition-loader {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 12000;
    display: flex;
    gap: 6px;
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(8, 19, 33, .72);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(.94);
    transition: opacity 160ms ease, transform 160ms ease, visibility 160ms;
    pointer-events: none;
}
.page-transition-loader.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.page-transition-loader span { width: 5px; height: 5px; border-radius: 50%; background: #315f91; animation: pageLoaderPulse 900ms ease-in-out infinite; }
.page-transition-loader span:nth-child(2) { animation-delay: 120ms; }
.page-transition-loader span:nth-child(3) { animation-delay: 240ms; }
@keyframes pageLoaderPulse { 0%, 100% { opacity: .35; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

.hidden {
    display: none !important;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* === ДОСТУПНОСТЬ === */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* === АДАПТИВНОСТЬ ИЗОБРАЖЕНИЙ === */
img {
    max-width: 100%;
    height: auto;
    display: block;
}



/* ===========================================================================
   === ФОН В СТИЛЕ AZZARO/BESNIK — СИНИЙ ВАРИАНТ ============================
   =========================================================================== */

body {
    /* Глубокий синий фон с радиальным градиентом */
    background: 
        radial-gradient(ellipse at 10% 66%, rgba(49, 95, 145, 0.26) 0%, rgba(25, 57, 91, 0.12) 40%, transparent 72%),
        radial-gradient(circle at 82% 18%, rgba(49, 95, 145, 0.08) 0%, transparent 56%),
        linear-gradient(to bottom, #050b12 0%, #0b1626 100%);
    
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}


/* Фоновые буквы временно отключены: фон остаётся чистым и спокойным. */
body::after {
    content: none;
    display: none;
}

@media (max-width: 1127px) {
    body {
        background-color: #050b12;
        background-image:
            radial-gradient(ellipse at 10% 66%, rgba(49, 95, 145, 0.30) 0%, rgba(25, 57, 91, 0.14) 38%, transparent 70%),
            linear-gradient(180deg, #050c15 0%, #071321 52%, #050b12 100%);
        background-repeat: no-repeat;
        background-size: cover, cover;
        background-position: center, center;
        background-attachment: fixed;
    }

    /* Фотография остаётся только на главной странице. */
    body.page-home-active {
        background-image:
            radial-gradient(circle at 66% 24%, rgba(49, 95, 145, 0.32) 0%, rgba(12, 34, 58, 0.46) 38%, rgba(5, 14, 25, 0.82) 76%),
            linear-gradient(180deg, rgba(5, 16, 29, 0.78) 0%, rgba(6, 20, 36, 0.90) 58%, rgba(4, 11, 20, 0.98) 100%),
            url('/static/images/hero-perfume.webp');
        background-size: cover, cover, auto 100dvh;
        background-position: center, center, 72% center;
    }
}



/* ===========================================================================
   === УЛУЧШЕНИЕ ЧИТАЕМОСТИ HERO НА ГЛАВНОЙ ================================
   =========================================================================== */

/* Оверлей поверх секции hero-besnik */
.hero-besnik {
    position: relative;
}

.hero-besnik::before {
    content: '';  /* ← ПУСТАЯ строка, без кавычек внутри */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
    pointer-events: none;
}

/* Текст и кнопки поверх оверлея */
.hero-besnik h1,
.hero-besnik h2,
.hero-besnik h3,
.hero-besnik p,
.hero-besnik span,
.hero-besnik button,
.hero-besnik a {
    position: relative;
    z-index: 2;
}

/* Мощная тень для заголовка */
.hero-besnik h1,
.hero-besnik h2 {
    text-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.9),
        0 4px 20px rgba(0, 0, 0, 0.7),
        0 0 40px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

/* Тень для подзаголовка и описания */
.hero-besnik p,
.hero-besnik span {
    text-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.9),
        0 4px 15px rgba(0, 0, 0, 0.7);
}



/* ===========================================================================
   === 6. ГЛАВНАЯ СТРАНИЦА И АДАПТИВ ========================================
   =========================================================================== */

.home-page {
    width: 100%;
    max-width: none;
    margin: 160px auto;
    position: relative;
    min-width: 1000px;
    border-radius: 30px;
    box-sizing: border-box;
    z-index: 0;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInResults 0.5s ease forwards;
}

.home-title {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif; 
    text-transform: uppercase; 
    font-weight: 400; 
    font-size: 80px; 
    letter-spacing: 10px; 
    color: #f0eee9;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    margin: 0;
    padding: 20px 0;
    z-index: 1000;
}

.home-subtitle {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f0eee9;
    font-size: 25px;
    letter-spacing: 2px;
    font-family: 'Nunito', sans-serif;
}

.search-design {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
}
.search-design img {
    max-width: 768px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.dashed-arrow-container {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    width: 400px;
    height: 400px;
}
.dashed-arrow-container img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
}

.perfume-bottle-container {
    position: absolute;
    bottom: -500px;
    width: 100%;
    z-index: 1;
}
.perfume-bottle-container img {
    width: 100%;
    height: auto;
}

/* --- Пагинация --- */
.page-info {
    text-align: center; padding: 24px; color: rgba(255, 255, 255, 0.6);
    font-family: 'Nunito', sans-serif; font-size: 14px; margin-top: 30px;
}



/* --- Индикатор загрузки --- */
.loading-spinner {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
}
.loading-spinner::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #315f91;
    animation: spin 1s linear infinite;
}

.loading-cell {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.7);
}

/* --- Копирование данных --- */
.copyable {
    cursor: copy;
    position: relative;
    transition: background 0.2s ease;
}
.copyable:hover {
    background: rgba(49, 95, 145, 0.1);
    border-radius: 4px;
}

.copy-tooltip {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: #315f91;
    color: #f0eee9;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    animation: fadeIn 0.2s ease;
    pointer-events: none;
    z-index: 100;
}
.copy-tooltip::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #315f91;
}

/* --- Валюта --- */
body[data-currency="RUB"] .price.usd { display: none !important; }
body[data-currency="USD"] .price.rub { display: none !important; }

/* --- Общий адаптив --- */
@media (max-width: 1127px) {
    .home-page, #results, .orders-page-wrapper, .cart-page-wrapper {
        min-width: auto !important; width: calc(100% - 40px) !important;
        margin-left: 20px; margin-right: 20px;
    }
}

@media (max-width: 768px) {
    .home-title { font-size: 40px !important; letter-spacing: 4px; }
    .home-subtitle { font-size: 18px !important; }
    .catalog-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .catalog-info { flex-wrap: wrap; gap: 10px; }
    .favorites-search-right { width: 100%; margin-left: 0; }
    .favorites-search-container { width: 100%; }
    .profile-modal { padding: 30px 20px !important;  }
}



/* === КАСТОМНЫЙ СКРОЛЛБАР ДЛЯ ВСЕГО САЙТА === */

/* Скрываем скроллбар для Chrome/Safari/Edge */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* Скрываем для Firefox */
* {
    scrollbar-width: none;
}


/* ===========================================================================
   === СКРЫТАЯ ПРОКРУТКА (INVISIBLE SCROLLBAR) ==============================
   =========================================================================== */

/* Для Chrome, Safari, Edge, Opera */
::-webkit-scrollbar {
    width: 0px;
    background: transparent; /* Делаем трек прозрачным */
}

/* Для Firefox */
* {
    scrollbar-width: none; /* Скрываем полосу полностью */
    -ms-overflow-style: none;  /* IE and Edge */
}

/* ===========================================================================
   === ПОЛНОСТЬЮ НЕВИДИМАЯ ПРОКРУТКА ========================================
   =========================================================================== */

/* Для Chrome, Safari, Opera и новых версий Edge */
::-webkit-scrollbar {
    display: none;
}

/* Для Firefox, IE и старых версий Edge */
html, body, * {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;     /* Firefox */
}





/* --- Мини-переключатель валюты (мобильная шапка) --- */
.currency-switcher-mini { display: none; }
@media (max-width: 1127px) {
    .currency-switcher-mini {
        display: flex;
        align-items: center;
        gap: 2px;
        margin-left: 8px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 20px;
        padding: 3px;
        flex-shrink: 0;
    }
    .currency-switcher-mini .cur-btn {
        border: none;
        background: transparent;
        color: rgba(255, 255, 255, 0.5);
        font-family: 'Montserrat', sans-serif;
        font-size: 11px;
        font-weight: 600;
        padding: 4px 8px;
        border-radius: 15px;
        cursor: pointer;
    }
    .currency-switcher-mini .cur-btn.active {
        background: #315f91;
        color: #f0eee9;
    }

    /* --- Подсветка активного пункта в мобильном меню --- */
    .mobile-menu .menu-item-wrapper.active {
        color: #315f91;
    }
    .mobile-menu .menu-item-wrapper.active img {
        opacity: 1;
        filter: brightness(0) invert(1) drop-shadow(0 0 6px rgba(49, 95, 145, 0.9));
    }
}

/* ===========================================================================
   === ИСПРАВЛЕНИЕ HERO НА МОБИЛЬНЫХ (КАРТИНКА ФОНОМ + ТЕКСТ ПОВЕРХ) ========
   =========================================================================== */

@media (max-width: 768px) {
    /* 1. Ломаем flex-раскладку, которая принудительно идёт из home.css */
    .hero-besnik {
        display: block !important;
        position: relative !important;
        min-height: 100vh !important;
        width: 100% !important;
    }

    /* 2. Картинка становится абсолютным фоном на весь блок */
    .hero-bg-image {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        z-index: 1 !important;
    }

    /* 3. Сплошное затемнение поверх картинки */
    .hero-besnik::before {
        content: '' !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: rgba(0, 0, 0, 0.668) !important;
        z-index: 2 !important;
        pointer-events: none !important;
    }

    /* 4. Текст поверх картинки и затемнения */
    .hero-content-overlay {
        position: relative !important;
        z-index: 3 !important;
        width: 100% !important;
        padding: 100px 20px !important;
        text-align: center !important;
        background: transparent !important;
        display: block !important; /* На случай, если там тоже остался flex */
    }


    

}
/* Системная настройка: отключаем декоративное движение по запросу пользователя. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid #315f91;
    outline-offset: 3px;
}

