/* Базовые стили */
html, body {
    overflow-x: clip;
    max-width: 100%;
}
body {
    font-family: 'Manrope', sans-serif;
    color: var(--text-gray);
    background-color: var(--bg-milky-white);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
}

/* Адаптивная типографика (для больших декоративных заголовков) */
.clamp-h1 { font-size: clamp(1.75rem, 6vw, 4rem); line-height: 1.1; }
.clamp-h2 { font-size: clamp(1.5rem, 5vw, 3rem); line-height: 1.15; }
.clamp-hero { font-size: clamp(2rem, 10vw, 7rem); line-height: 1.05; }
.clamp-giga { font-size: clamp(2.5rem, 12vw, 10rem); line-height: 1; }
.clamp-price { font-size: clamp(2.5rem, 8vw, 6rem); line-height: 1; }

/* Гарантированная минимальная тач-цель */
.tap-target { min-width: 44px; min-height: 44px; }

/* CSS-переменные цветовой схемы */
:root {
    --bg-milky-white: #F9FAFB;
    --bg-sandy: #F5E6D3;
    --bg-deep-green: #2D5D4C;
    --text-deep-green: #2D5D4C;
    --bg-concrete-gray: #6B7280;
    --text-gray: #1F2937;
    --bg-white: #FFFFFF;
    --text-gray-600: #4B5563;
    --input-bg: #FFFFFF;
    --input-border: #D1D5DB;
    --input-focus: #2D5D4C;
    --button-hover: #4B6B5D;
    --error-color: #DC2626;
}

/* Применение переменных */
.bg-milky-white { background-color: var(--bg-milky-white); }
.bg-sandy { background-color: var(--bg-sandy); }
.bg-deep-green { background-color: var(--bg-deep-green); }
.text-deep-green { color: var(--text-deep-green); }
.bg-concrete-gray { background-color: var(--bg-concrete-gray); }
.bg-white { background-color: var(--bg-white); }
.text-gray-600 { color: var(--text-gray-600); }

/* Типографика */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-deep-green);
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
p, li, a, span { font-size: 1rem; font-weight: 400; }
h1 span, h2 span, h3 span, h4 span, h5 span, h6 span { font-size: inherit; font-weight: inherit; }
.text-lg { font-size: 1.125rem; }

/* Стили для форм и полей ввода */
input, textarea, select {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--text-gray);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(45, 93, 76, 0.2);
}
input::placeholder, textarea::placeholder {
    color: var(--text-gray-600);
    opacity: 0.7;
}
label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
    display: block;
}
.error-message {
    color: var(--error-color);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* === Кнопки (2026 Premium Standards) === */
button, a.button {
    padding: 0.75rem 1.5rem;
    border-radius: 12px; /* rounded-xl вместо устаревших пилюль */
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

button:hover, a.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* Premium Glow Shadow */
}

/* Специфичные кнопки, если где-то юзается .bg-deep-green */
.button.bg-deep-green:hover {
    background-color: #152c20;
    box-shadow: 0 10px 20px -5px rgba(26, 54, 40, 0.4);
}

/* === Ползунок Цены (noUiSlider Premium 2026) === */
/* === Ползунок Цены (noUiSlider Premium 2026) === */
.noUi-target {
    background: #F3F4F6;
    border: none;
    box-shadow: none;
    border-radius: 999px;
    margin: 2.5rem 0 1rem;
    height: 4px; 
}

.noUi-connect {
    background: var(--text-deep-green); 
}

.noUi-handle {
    background: #111827;
    border: 2px solid #FFFFFF;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 20px !important;
    height: 20px !important;
    top: -8px !important;
    right: -10px !important;
    cursor: grab;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.noUi-handle:active {
    cursor: grabbing;
    transform: scale(1.25); 
}
.noUi-handle::before, .noUi-handle::after {
    display: none; 
}

/* Tooltip (Стильные всплывающие окна) */
.noUi-tooltip {
    background: #111827;
    color: #FFFFFF;
    border: none;
    border-radius: 0.5rem;
    padding: 0.35rem 0.7rem;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: 'Inter', sans-serif;
    transform: translate(-50%, 0);
    bottom: 140%;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.noUi-tooltip::after { 
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px 4px 0;
    border-style: solid;
    border-color: #111827 transparent transparent transparent;
}

/* Эффекты наведения и переходы */
.hover-scale {
    transition: transform 0.3s ease;
}
.hover-scale:hover {
    transform: scale(1.05);
}
.shadow-hover {
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}
.shadow-hover:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Текстурный фон */
.texture-overlay {
    background-image: url('/static/images/concrete_texture-small.webp'); /* Укажи путь к локальному изображению */
    /* Если изображения нет, можно закомментировать строку выше и убрать текстуру: */
    /* background-image: none; */
    opacity: 0.05;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    mix-blend-mode: multiply;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Основная шапка: общий язык с карточками, типографикой и цветами сайта. */
.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    height: 78px;
    background: rgba(252, 251, 247, .97);
    border-bottom: 1px solid #e5e7df;
    box-shadow: 0 8px 26px rgba(20, 38, 29, .055);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    color: #193c2c;
}
.site-header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: clamp(12px, 2vw, 32px);
}
.site-brand {
    display: inline-flex;
    align-items: center;
    flex: none;
    gap: 11px;
    color: #193c2c;
    text-decoration: none;
}
.site-brand-mark {
    display: block;
    width: 36px;
    height: 51px;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(19%) sepia(30%) saturate(780%) hue-rotate(91deg) brightness(87%);
}
.about-brand-mark {
    filter: brightness(0) saturate(100%) invert(19%) sepia(30%) saturate(780%) hue-rotate(91deg) brightness(87%);
}
.site-brand-name {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: .055em;
}
.site-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    gap: 7px;
    min-width: 0;
}
.site-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 clamp(9px, 1vw, 15px);
    border-radius: 11px;
    color: #59665e;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: color .2s ease, background-color .2s ease;
}
.site-nav-link:hover, .site-nav-link.is-active {
    color: #193c2c;
    background: #e9efe9;
}
.site-nav-link.is-active { font-weight: 700; }
.site-header-actions { display: flex; align-items: center; flex: none; gap: 13px; }
.site-cart, .site-account, .site-logout, .site-menu-toggle, .site-menu-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    text-decoration: none;
    white-space: nowrap;
}
.site-cart {
    position: relative;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid #dfe6de;
    border-radius: 12px;
    color: #193c2c;
    background: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    transition: border-color .2s ease, background-color .2s ease;
}
.site-cart:hover, .site-cart.is-active { border-color: #a8bdaa; background: #f4f8f3; }
.site-cart svg, .site-account svg, .site-logout svg, .site-menu-toggle svg, .site-menu-close svg { width: 19px; height: 19px; flex: none; }
.site-cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    color: #fff;
    background: #193c2c;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}
.site-cart-count.is-empty { display: none; }
.site-account {
    gap: 8px;
    padding: 0 16px;
    border-radius: 12px;
    color: #fff;
    background: #193c2c;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    transition: background-color .2s ease, box-shadow .2s ease;
}
.site-account:hover { color: #fff; background: #2d5d4c; box-shadow: 0 5px 14px rgba(25,60,44,.18); }
.site-logout-form { margin: 0; }
.site-logout, .site-menu-toggle, .site-menu-close {
    width: 44px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    color: #607268;
    background: transparent;
    box-shadow: none;
}
.site-logout:hover, .site-menu-toggle:hover, .site-menu-close:hover {
    color: #193c2c;
    background: #e9efe9;
    transform: none;
    box-shadow: none;
}
.site-menu-toggle { display: none; }
.site-menu-overlay { display: none; }
.site-mobile-menu { display: none; }

@media (max-width: 1199px) {
    .site-header { height: 72px; }
    .site-nav, .site-account, .site-logout-form { display: none; }
    .site-header-inner { justify-content: space-between; }
    .site-menu-toggle { display: inline-flex; }
    .site-menu-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 51;
        background: rgba(11, 25, 17, .48);
        opacity: 0;
        visibility: hidden;
        transition: opacity .25s ease, visibility .25s ease;
    }
    .site-menu-overlay.is-open { opacity: 1; visibility: visible; }
    .site-mobile-menu {
        display: flex;
        flex-direction: column;
        position: fixed;
        inset: 0 0 0 auto;
        z-index: 52;
        width: min(440px, 100vw) !important;
        max-width: none !important;
        height: 100dvh;
        color: #193c2c;
        background: #fcfbf7;
        box-shadow: -20px 0 50px rgba(11, 25, 17, .16);
        transform: translateX(100%);
        visibility: hidden;
        transition: transform .28s ease, visibility .28s ease;
    }
    .site-mobile-menu.is-open { transform: translateX(0); visibility: visible; }
    .site-mobile-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 78px;
        padding: 10px 22px;
        border-bottom: 1px solid #e5e7df;
    }
    .site-mobile-body { flex: 1 1 auto; overflow-y: auto; padding: 23px 20px; }
    .site-mobile-kicker {
        margin: 0 12px 10px;
        color: #829086;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: .17em;
        text-transform: uppercase;
    }
    .site-mobile-kicker-secondary { margin-top: 23px; }
    .site-mobile-nav { display: grid; gap: 4px; }
    .site-mobile-link {
        display: flex;
        align-items: center;
        gap: 14px;
        min-height: 52px;
        padding: 9px 13px;
        border-radius: 13px;
        color: #344a3d;
        font-size: 15px;
        font-weight: 600;
        text-decoration: none;
        transition: background-color .2s ease, color .2s ease;
    }
    .site-mobile-link i { width: 21px; color: #688674; font-size: 16px; text-align: center; }
    .site-mobile-link:hover, .site-mobile-link.is-active { color: #193c2c; background: #e9efe9; }
    .site-mobile-link.is-active { font-weight: 800; }
    .site-mobile-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 24px;
        height: 24px;
        margin-left: auto;
        padding: 0 6px;
        border-radius: 999px;
        color: #fff;
        background: #193c2c;
        font-size: 11px;
        font-weight: 700;
    }
    .site-mobile-footer { display: flex; gap: 10px; padding: 16px 20px max(18px, env(safe-area-inset-bottom)); border-top: 1px solid #e5e7df; }
    .site-mobile-primary, .site-mobile-secondary {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 1 1 0;
        min-height: 48px;
        padding: 8px 12px;
        border-radius: 12px;
        font-size: 13px;
        font-weight: 750;
        text-decoration: none;
    }
    .site-mobile-primary { color: #fff; background: #193c2c; }
    .site-mobile-primary:hover { color: #fff; background: #2d5d4c; }
    .site-mobile-secondary { color: #193c2c; background: #fff; border: 1px solid #dfe6de; }
    .site-mobile-secondary:hover { background: #e9efe9; transform: none; box-shadow: none; }
    #mobile-menu a:after, #mobile-menu button:after { content: none; }
}
@media (max-width: 620px) {
    .site-brand-name { font-size: 19px; }
    .site-cart { width: 44px; padding: 0; }
    .site-cart-label { display: none; }
    .site-cart-count { position: absolute; top: -6px; right: -6px; border: 2px solid #fcfbf7; min-width: 21px; height: 21px; }
    .site-mobile-menu { width: 100vw !important; }
}
@media (prefers-reduced-motion: reduce) {
    .site-menu-overlay, .site-mobile-menu { transition: none; }
}

/* Плавающая анимация для hero-логотипа */
@keyframes heroLogoFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-10px) rotate(-1deg); }
}
.animate-hero-float {
    animation: heroLogoFloat 6s ease-in-out infinite;
    will-change: transform;
}

/* Пульсирующее свечение за логотипом */
@keyframes heroGlowPulse {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50%      { opacity: 0.9;  transform: scale(1.08); }
}
.animate-hero-glow {
    animation: heroGlowPulse 5s ease-in-out infinite;
    will-change: opacity, transform;
}

/* Отключаем на reduced-motion для доступности */
@media (prefers-reduced-motion: reduce) {
    .animate-hero-float,
    .animate-hero-glow { animation: none; }
}

/* Модальное окно */
#quick-view-modal {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
#quick-view-modal.show {
    opacity: 1;
    pointer-events: auto;
}
#modal-content {
    transform: scale(0.95);
    transition: transform 0.3s ease;
    background-color: var(--bg-white);
    border-radius: 1rem;
}
#quick-view-modal.show #modal-content {
    transform: scale(1);
}

/* Доступность */
button:focus, a:focus {
    outline: 2px solid var(--input-focus);
    outline-offset: 2px;
}
[aria-label] {
    cursor: pointer;
}

/* Медиа-запросы для адаптивности */
@media (max-width: 1024px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.4rem; }
    
    /* Изменения размеров кнопок */
    button, a.button {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
    
    /* Отступы в формах */
    input, textarea, select {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Увеличиваем размер элементов управления */
    .noUi-handle {
        width: 24px;
        height: 24px;
        top: -9px;
    }
    
    /* Минимальная высота тап-областей для мобильного меню */
    #mobile-menu a, 
    #mobile-menu button {
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    /* Улучшенный скроллинг */
    ::-webkit-scrollbar {
        width: 6px;
    }
    
    ::-webkit-scrollbar-track {
        background: var(--bg-milky-white);
    }
    
    ::-webkit-scrollbar-thumb {
        background: var(--bg-deep-green);
        border-radius: 4px;
    }

    /* Адаптивные отступы для контейнера */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

}

/* Планшеты и маленькие ноутбуки */
@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    /* Изменения размеров кнопок */
    button, a.button {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    /* Отступы в формах */
    input, textarea, select {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }
    
    /* Увеличиваем размер элементов управления */
    .noUi-handle {
        width: 26px;
        height: 26px;
        top: -10px;
    }
}

/* Мобильные устройства */
@media (max-width: 480px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }
    
    /* Изменения размеров кнопок (без принудительного width:100% — конфликтует с flex) */
    button, a.button {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Отступы в формах */
    input, textarea, select {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Увеличиваем размер элементов управления */
    .noUi-handle {
        width: 28px !important;
        height: 28px !important;
        top: -12px !important;
    }

    /* Адаптивные отступы для контейнера */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Мобильное меню (fullscreen наследуется) */
}

/* Тач-устройства без hover: увеличиваем ручки слайдера для удобства пальцем */
@media (hover: none) and (pointer: coarse) {
    .noUi-handle {
        width: 36px !important;
        height: 36px !important;
        top: -16px !important;
    }
    .noUi-target {
        height: 6px;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}
.phone-mask-error {
    color: #b91c1c !important;
}

input[type="tel"][aria-invalid="true"] {
    border-color: #b91c1c !important;
}
input[type="number"][name="quantity"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"][name="quantity"]::-webkit-inner-spin-button,
input[type="number"][name="quantity"]::-webkit-outer-spin-button { appearance: none; display: none; margin: 0; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (pointer: coarse) {
    .animate-fade-in, .animate-fade-in-up, .animate-hero-float, .animate-hero-glow,
    .about-hero__copy, .about-hero__visual, .about-hero__ring--outer {
        animation: none !important;
        opacity: 1 !important;
    }
}
