/* --- Local Fonts --- */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('assets/fonts/inter-cyrillic.woff2') format('woff2');
    unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('assets/fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Cormorant Garamond';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('assets/fonts/garamond-cyrillic.woff2') format('woff2');
    unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Cormorant Garamond';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('assets/fonts/garamond-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('assets/fonts/outfit-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Caveat';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('assets/fonts/caveat-cyrillic.woff2') format('woff2');
    unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Caveat';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('assets/fonts/caveat-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Content Protection --- */
body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Global Image Protection */
img {
    -webkit-touch-callout: none !important;
    -webkit-user-drag: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* Hard Overlay Protection for Catalog & Modal Images */
.product-card__visual, 
.product-detail__main-img-box {
    position: relative;
    overflow: hidden;
}

.product-card__visual::after, 
.product-detail__main-img-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    background: rgba(255, 255, 255, 0); /* Invisible shield */
}

/* Ensure whitelisted areas don't re-enable image saving accidentally */
.allow-select, 
.allow-select *:not(img) {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
}

/* Explicit Whitelist for saveable/selectable content */
.allow-copy, 
.allow-copy img,
.allow-select .allow-copy,
.allow-select .allow-copy img {
    -webkit-touch-callout: default !important;
    -webkit-user-drag: auto !important;
    user-select: auto !important;
    -webkit-user-select: auto !important;
    pointer-events: auto !important;
    z-index: 10 !important; /* Above the shields */
}

:root {
    /* --- Design Tokens --- */
    --bg-color: #FBFBFB;
    --text-main: #111111;
    --text-muted: #555555;
    --primary-color: #111111;
    --accent-color: #C08261;
    /* Rose Gold / Copper to match AiLei logo */
    --white: #FFFFFF;

    /* --- Typography --- */
    --font-heading: 'Cormorant Garamond', serif;
    --font-main: 'Inter', sans-serif;
    --font-logo: 'Outfit', sans-serif;

    /* --- Layout & Spacing --- */
    --container-width: 1440px;
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-8: 64px;
    --space-12: 96px;

    /* --- Motion --- */
    --transition-speed: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 600ms cubic-bezier(0.4, 0, 0.2, 1);
    --lens-focus: 800ms cubic-bezier(0.16, 1, 0.3, 1);

    /* --- WP Architecture Tokens --- */
    --z-header: 10000;
    --z-isolation: 1000;
    --header-height: 80px;
    --isolation-padding: 150px;
}

/* --- Base Styles --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    /* Убираем лишние подергивания */
    width: 100%;
    overflow-x: hidden;
}

body {
    position: relative; /* База для корректных расчетов координат */
    width: 100%;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* Плавный инерционный скролл для старых iOS */
    
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.5;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

/* --- Typography Utility --- */
h1 {
    font-family: var(--font-heading);
    font-weight: 500;
}

/* --- Header Section --- */
.header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    
    /* Safe Areas for iPhone (Notch support) */
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(var(--header-height) + env(safe-area-inset-top, 0px));
    box-sizing: border-box;

    display: flex;
    align-items: center;
    z-index: var(--z-header);
    background: var(--bg-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    
    /* Безопасное ускорение без создания нового контекста координат */
    will-change: top;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    
    transition: background-color 0.3s var(--transition-speed);
}

.header__container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    /* Lang switcher will take the 1fr space */
    align-items: center;
    width: 100%;
}

.logo {
    justify-self: start;
}

.nav {
    justify-self: center;
}

.header__meta {
    justify-self: end;
}

.logo__brand {
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
    /* Ensure container has height */
    transition: var(--transition-speed);
}

.logo__brand:hover {
    opacity: 0.8;
}

.logo__icon {
    height: 32px;
    /* Slightly smaller for better balance with text */
    width: auto;
    border-radius: 4px;
    display: block;
}

.logo__text {
    font-family: var(--font-heading);
    font-size: 28px;
    /* Slightly refined size */
    font-weight: 400;
    letter-spacing: 0.05em;
    color: var(--accent-color);
    line-height: 1.1;
    /* Improved stability across different scripts */
    display: inline-flex;
    align-items: center;
}

/* Footer Logo Text - Moved from inline and made responsive */
.footer-logo-text {
    font-size: 36px !important;
    line-height: 1 !important;
}

/* Premium Chinese Brand Name Styling */
html[lang="zh"] .logo__text {
    font-family: var(--font-heading), "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", serif;
    font-weight: 400;
    letter-spacing: 0.1em;
    font-size: 19px; /* Refined size for the 8-character string */
}

html[lang="zh"] .footer-logo-text {
    font-size: 24px !important;
    letter-spacing: 0.12em;
}

/* Mobile Adaptation for Long Brand Names */
@media (max-width: 768px) {
    .logo__text {
        font-size: 20px;
    }

    html[lang="zh"] .logo__text {
        font-size: 16px; /* Optimized for the 9-character Chinese name */
    }

    .footer-logo-text {
        font-size: 28px !important;
    }

    html[lang="zh"] .footer-logo-text {
        font-size: 22px !important;
    }
}

@media (max-width: 380px) {
    html[lang="zh"] .logo__text {
        font-size: 14px; /* Extreme compact mode for small devices */
    }
}


.header__meta {
    display: flex;
    justify-self: center;
    gap: var(--space-4);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.lang-switcher {
    display: flex;
    gap: var(--space-1);
}

.lang-btn {
    background: none;
    border: none;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-speed);
    padding: 4px;
}

.lang-btn:hover,
.lang-btn.active {
    color: var(--text-main);
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    text-align: center;
    background-color: #FFFFFF;
    /* Pure white to match video background */
}

.hero__container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
}

.hero__visual {
    margin-bottom: var(--space-4);
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

.window-frame {
    background: #FFFFFF !important;
    /* Pure white integration */
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    position: relative;
    width: 100%;
    max-width: 900px;
    /* Reduced scale for increased sharpness and elegance */
    margin: -60px auto 0;
    /* Significant upward shift to remove dead space */
    animation: heroVideoEntry 1200ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes heroVideoEntry {
    from {
        opacity: 0;
        transform: scale(0.98) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.hero__video {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    border-radius: 0;
    object-fit: cover;
    background: white;
}

@media (max-width: 768px) {
    .window-frame {
        max-width: 100%;
        /* Full bleed on small screens */
        margin-top: 0;
        /* Reset shift on mobile to avoid overlap */
    }
}

.hero__title {
    font-size: clamp(40px, 8vw, 90px);
    line-height: 1;
    margin-bottom: var(--space-3);
    letter-spacing: -0.02em;
}

.hero__description {
    font-size: clamp(16px, 1.2vw, 18px);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto var(--space-4);
    font-weight: 400;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    text-decoration: none;
    padding: 14px 40px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition-speed);
}

.btn--primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn--primary:hover {
    transform: scale(1.05);
    background: var(--accent-color);
}

/* --- Footer Section --- */
.footer {
    background-color: #F8F6F4;
    /* Premium beige background */
    padding: 64px 0 32px 0;
    border-top: none;
    color: var(--text-main);
}

.footer__top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    /* Matching proportions from reference */
    gap: 40px;
    margin-bottom: 48px;
    /* Fixed overlap issue */
}

.footer__col-title {
    font-family: var(--font-main);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
}

.footer__address,
.footer__address a {
    font-size: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition-speed);
    text-decoration: none !important;
    border-bottom: none !important;
    -webkit-tap-highlight-color: transparent;
    width: fit-content;
    color: inherit; /* Prevent blue color on mobile system links */
}

.footer__address:hover,
.footer__address:active {
    color: var(--accent-color);
}

.footer__address svg {
    transition: var(--transition-speed);
}

.footer__address:hover svg,
.footer__address:active svg {
    color: var(--accent-color);
    transform: translateY(-2px);
}

.footer__link-text {
    color: var(--text-main);
    text-decoration: none;
    transition: color var(--transition-speed);
}

.footer__link-text:hover {
    color: var(--accent-color);
}

.footer__phone {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-main);
}

.footer__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer__link {
    color: var(--text-main);
    /* Darker text like reference */
    text-decoration: none;
    font-size: 14px;
    transition: color var(--transition-speed);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.footer__link:hover {
    color: var(--accent-color);
}

.footer__social-link svg {
    color: var(--text-main);
    transition: color var(--transition-speed);
}

.footer__social-link:hover svg {
    color: var(--accent-color);
}

.footer__partners {
    margin-bottom: 32px;
}

.partners-logos {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    align-items: center;
}

.partners-logos img {
    height: 32px;
    object-fit: contain;
    opacity: 0.4;
    /* Dual-animation ensures it works on all image types */
    filter: grayscale(100%) contrast(120%);
    mix-blend-mode: multiply;
    /* Helps hide white backgrounds on logos */
    transition: all 0.3s ease;
}

.partners-logos img:hover {
    opacity: 1;
    filter: grayscale(0%) contrast(100%);
    mix-blend-mode: normal;
}

.footer__bottom {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .footer__top {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer__bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

/* --- Folders Section --- */
.folders {
    padding-bottom: var(--space-12);
}

.folders__item {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    transition: var(--transition-speed);
}

.folders__item:last-child {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.folders__summary {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: var(--space-4) 0;
    cursor: pointer;
    list-style: none;
    /* Hide default arrow */
    gap: var(--space-4);
    transition: var(--transition-speed);
}

.folders__summary::-webkit-details-marker {
    display: none;
    /* Hide default arrow Chrome */
}

.folders__summary:hover {
    background: rgba(0, 0, 0, 0.01);
}

.folders__toggle {
    width: 20px;
    height: 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.folders__toggle::before,
.folders__toggle::after {
    content: '';
    position: absolute;
    background: var(--accent-color);
    transition: var(--transition-speed);
}

/* Horizontal line */
.folders__toggle::before {
    width: 12px;
    height: 1px;
}

/* Vertical line */
.folders__toggle::after {
    width: 1px;
    height: 12px;
}

/* Rotate exactly 45 degrees to "x" when open */
.folders__item[open] .folders__toggle {
    transform: rotate(45deg);
}

.folders__title {
    font-size: clamp(24px, 4vw, 42px);
    font-family: var(--font-heading);
    font-weight: 400;
    margin: 0;
}

.folders__preview {
    display: flex;
    /* Preview is a simple row */
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.folders__preview .folder-thumb {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 4px;
    cursor: zoom-in;
    transition: var(--transition-speed);
}

.folders__preview .folder-thumb:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.folders__inner {
    min-height: 0;
    padding-top: 48px;
    /* Added breathing room from top border */
    padding-bottom: 48px;
    /* Symmetrical bottom padding */
    padding-left: 36px;
    /* Align with title */
}

/* --- Two-Column Text Grid --- */
.folders__text-grid {
    display: grid;
    grid-template-columns: 3fr 7fr;
    /* Explicit 30/70 balance */
    gap: var(--space-4);
    /* Tightened to 32px for better cohesion */
    margin-bottom: 64px;
    /* Significant spacing before gallery */
    align-items: start;
}

.folders__subtitle {
    font-family: var(--font-heading);
    /* Cormorant Garamond */
    font-size: 26px;
    /* Calibrated size between 26 and 27 */
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: normal;
    text-transform: none;
    color: var(--accent-color);
    /* Matches the AiLei logo color */
    margin: 0;
}

.folders__text-right p {
    font-size: 18px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

/* --- Intelligent Carousel Wrapper --- */
.folders__carousel-wrapper {
    position: relative;
    width: 100%;
}

.folders__full-gallery {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
}

.folders__full-gallery::-webkit-scrollbar {
    display: none;
}

.folders__full-gallery:active {
    cursor: grabbing;
}

.folders__full-gallery .folder-thumb {
    flex: 0 0 auto;
    height: 400px;
    /* High-end fixed height */
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 4px;
    scroll-snap-align: start;
    cursor: zoom-in;
    transition: var(--transition-speed);
}

.folders__full-gallery .folder-thumb:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* --- Carousel Arrows --- */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    /* Hidden by default */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.folders__carousel-wrapper:hover .carousel-arrow {
    opacity: 1;
}

.carousel-arrow:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.carousel-arrow.prev {
    left: -24px;
}

.carousel-arrow.next {
    right: -24px;
}

/* Responsive Adjustments */
@media (max-width: 991px) {
    .folders__text-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .carousel-arrow {
        display: none;
        /* Swipe only on mobile */
    }
}

/* --- Minimalist Lightbox --- */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6000;
    /* Above Modal (5000) */
    opacity: 0;
    transition: opacity 300ms ease;
    cursor: zoom-out;
}

.lightbox.visible {
    opacity: 1;
}

.lightbox__content {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    transform: scale(0.9);
    transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Bouncy zoom */
    border-radius: 4px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.lightbox.visible .lightbox__content {
    transform: scale(1);
}

.lightbox__text {
    display: none !important;
}

/* Responsive Folders */
@media (max-width: 991px) {
    .folders__preview {
        width: 180px;
    }
}

@media (max-width: 768px) {
    .folders__summary {
        grid-template-columns: auto 1fr;
        row-gap: var(--space-2);
    }

    .folders__preview {
        grid-column: 1 / -1;
        justify-content: start;
    }

    .folders__full-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .folders__inner {
        padding-left: 0;
    }

    .folders__full-gallery .folder-thumb {
        height: 180px;
        /* Reduced for mobile */
    }

    .folders__full-gallery {
        gap: 12px;
        margin-top: 32px;
    }
}

.fade-in {
    opacity: 0;
    animation: fadeIn var(--transition-slow) forwards;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp var(--transition-slow) forwards;
}

.hero__title {
    animation-delay: 200ms;
}

.hero__description {
    animation-delay: 400ms;
}

.hero__actions {
    animation-delay: 600ms;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Responsive --- */

/* --- Catalog Section --- */
.catalog {
    padding: var(--space-8) 0;
    background-color: var(--bg-color);
}


.catalog__title {
    font-family: var(--font-heading);
    font-size: 42px;
    font-weight: 500;
    margin-bottom: var(--space-3);
    color: var(--text-main);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-align: center;
}

.catalog__search-input {
    width: 100%;
    padding: 16px 24px;
    font-family: var(--font-main);
    font-size: 16px;
    color: var(--text-main);
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 100px;
    outline: none;
    transition: var(--transition-speed);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    text-align: center;
}

.catalog__search-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.filter-tag {
    background: none;
    border: none;
    font-family: var(--font-main);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 100px;
    transition: var(--transition-speed);
}

.filter-tag:hover,
.filter-tag.active {
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.05);
}

/* --- Catalog Grid --- */
.catalog__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 48px var(--space-4);
    /* Increased gap for more white space */
}

.product-card {
    cursor: pointer;
    position: relative;
    text-decoration: none;
    color: inherit;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms ease, transform 800ms ease;
}

.product-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.product-card__visual {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    margin-bottom: var(--space-3);
    /* Increased spacing below image */
    background: #fbfbfb;
    /* Lighter background matching design */
    padding: 10px;
    /* Slight inset for image to give it more "breathing room" */
}

.product-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.product-card:hover .product-card__img {
    transform: scale(1.08);
}

.product-card__badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(251, 251, 251, 0.9);
    padding: 4px 10px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    z-index: 5;
    color: var(--text-muted);
}

.product-card__info {
    text-align: center;
    padding-top: 4px;
}

.product-card__title {
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-main);
    margin-bottom: 2px;
    /* Close to Article */
}

.product-card__tag {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

/* No Findings State */
.catalog__no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-12) 0;
    opacity: 0.6;
    font-family: var(--font-heading);
    font-size: 24px;
}

/* --- Search Focus Mode (Clean Native Layout Shift) --- */
/* When searching: hide non-catalog sections so the browser naturally reflows */

body.is-searching .hero,
body.is-searching .folders,
body.is-searching .footer {
    display: none;
}

body.is-searching .catalog__grid {
    padding-bottom: 120px;
}

.catalog__header {
    position: -webkit-sticky; /* Обязательный префикс для Safari/iOS */
    position: sticky;
    top: var(--header-height);
    z-index: 500;
    background-color: var(--bg-color);
    
    /* Безопасное ускорение без создания нового контекста координат */
    will-change: top;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;

    padding: var(--space-4) 0;
    margin-bottom: var(--space-4);
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}



/* Ensure header stays behind when isolation starts */
body.search-intent .header {
    z-index: 10;
}

.catalog__search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto var(--space-8);
}

.catalog__search-clear {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalog__search-clear.visible {
    opacity: 1;
    visibility: visible;
}

.catalog__search-clear:hover {
    color: var(--text-main);
}

/* --- Product Modal / Detail --- */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color) !important;
    /* Force solid opaque background */
    z-index: 5000 !important;
    /* Ensure it stays above Hero/Folders */
    opacity: 0;
    visibility: hidden;
    overflow-y: auto;
    transition: opacity 500ms ease, visibility 500ms;
}

.product-modal.open {
    opacity: 1 !important;
    visibility: visible;
}

.product-modal__close {
    display: none !important;
    /* Replaced by inline button */
}

.product-modal__close-text {
    display: none;
    /* Removed for circular design */
}

.product-detail {
    max-width: 1200px;
    margin: 140px auto 100px;
    padding: 0 var(--space-4);
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 80px;
    align-items: start;
}

.product-detail__visual {
    display: flex;
    align-items: stretch;
    gap: var(--space-4);
}

.product-detail__thumbs-container {
    width: 80px;
    flex-shrink: 0;
    position: relative;
}

.product-detail__thumbs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-detail__thumbs::-webkit-scrollbar {
    display: none;
}

.product-detail__thumb-item {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 2px;
    opacity: 0.6;
    transition: var(--transition-speed);
}

.product-detail__thumb-item.active,
.product-detail__thumb-item:hover {
    opacity: 1;
}

.product-detail__main-img-box {
    flex-grow: 1;
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #f0f0f0;
}

.product-detail__main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-detail__disclaimer {
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    font-size: 8px;
    line-height: 1.2;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    background: transparent;
    pointer-events: none;
    z-index: 10;
}

.product-detail__info {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.product-detail__art {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.product-detail__title {
    font-size: 32px;
    font-family: var(--font-heading);
    line-height: 1.2;
}

.product-detail__header {
    position: relative;
    padding-right: 52px;
    /* Space for inline close button */
    margin-bottom: var(--space-4);
}

.product-detail__close-inline {
    position: absolute;
    right: 0;
    top: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    /* Premium Dark */
    color: var(--white);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease;
}

.product-detail__close-inline:hover {
    transform: scale(1.05);
    background: var(--accent-color);
    /* Elegant Gold/Beige */
}

.product-detail__price {
    font-size: 24px;
    font-weight: 500;
    margin-top: 8px;
}

.product-detail__section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    color: var(--text-muted);
}

/* Selectors */
.selector-group {
    margin-bottom: var(--space-4);
}

.color-list {
    display: flex;
    gap: 12px;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: var(--transition-speed);
    position: relative;
    cursor: pointer;
}

.color-swatch.static {
    cursor: default;
}

.color-swatch.active::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 1px solid var(--text-main);
    border-radius: 50%;
}

.size-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.size-btn {
    min-width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: none;
    font-family: var(--font-main);
    font-size: 13px;
    transition: var(--transition-speed);
    cursor: pointer;
}

.size-btn.static {
    cursor: default;
}

.size-btn:not(.static):hover,
.size-btn.active {
    border-color: var(--text-main);
    background: var(--text-main);
    color: var(--white);
}

.size-chart-link {
    display: inline-block;
    font-size: 12px;
    color: var(--text-main);
    text-decoration: underline;
    margin-top: 12px;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition-speed);
}

.size-chart-link:hover {
    opacity: 1;
}

/* Accordions in Modal */
.detail-accordion {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.detail-accordion__item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.detail-accordion__summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    cursor: pointer;
    list-style: none;
}

.detail-accordion__summary::-webkit-details-marker {
    display: none;
}

.detail-accordion__title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.detail-accordion__icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.detail-accordion__item[open] .detail-accordion__icon {
    transform: rotate(180deg);
}

.detail-accordion__content {
    padding-bottom: 20px;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Mobile Responsive Adjustments */
@media (max-width: 991px) {
    .catalog__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px var(--space-2);
    }

    .product-detail {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .product-detail__visual {
        flex-direction: column-reverse;
    }

    .product-detail__thumbs {
        flex-direction: row;
        width: 100%;
        overflow-x: auto;
    }

    .product-detail__thumb-item {
        width: 60px;
    }
}

@media (max-width: 768px) {
    .header__meta {
        display: none;
    }
}

/* Table Styles */
.size-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 12px;
}

.size-table th,
.size-table td {
    padding: 10px 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    text-align: center;
}

.size-table th {
    background: rgba(0, 0, 0, 0.02);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
}

.info-modal-text b {
    display: block;
    margin-top: 24px;
    font-family: var(--font-heading);
    font-size: 18px;
    text-align: left;
}

/* --- Cookie Banner --- */
.cookie-banner {
    position: fixed;
    bottom: var(--space-3);
    left: var(--space-3);
    z-index: 10001;
    background: var(--white);
    padding: var(--space-3);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    width: calc(100% - 48px);
    max-width: 320px;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.cookie-banner.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.cookie-banner__text {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: var(--space-2);
}

.cookie-banner__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cookie-banner__link {
    font-size: 13px;
    color: var(--text-main);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-banner__btn {
    padding: 6px 16px;
    font-size: 13px;
    border-radius: 6px;
}

@media (max-width: 500px) {
    .cookie-banner {
        bottom: var(--space-2);
        left: var(--space-2);
        width: calc(100% - 32px);
        max-width: 100%;
    }
}

/* --- Address Modal Layout (moved from inline JS) --- */
.address-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}

.address-section b {
    display: block;
    font-family: var(--font-heading);
    font-size: 22px;
    color: var(--text-main);
    margin-bottom: 16px;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
    padding-bottom: 4px;
}

.address-section p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.address-section span {
    color: var(--text-main);
    font-weight: 500;
}

.phone-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.phone-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

.phone-item .flag {
    font-size: 24px;
    margin-top: 2px;
}

.phone-info {
    display: flex;
    flex-direction: column;
}

.phone-name {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.phone-num {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    font-family: var(--font-main);
}

/* --- Accessibility (A11y) --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* --- Info Modal Layout --- */
.info-modal-content {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 24px;
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    max-width: 800px;
    margin: 100px auto;
}
.info-modal-content h2 {
    font-family: var(--font-heading);
    color: var(--accent-color);
    margin-bottom: 24px;
}
.info-modal-content p, .info-modal-content ul {
    margin-bottom: 16px;
    color: var(--text-muted);
}

/* --- Floating Action Button --- */
.floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 15000;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.floating-btn:hover {
    transform: scale(1.1);
    background-color: var(--primary-color);
}

.floating-btn svg {
    transition: transform 0.3s ease;
}

.floating-btn:hover svg {
    transform: rotate(5deg);
}

@media (max-width: 768px) {
    .floating-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
}

/* --- Глобальный мобильный фикс (max-width: 768px) --- */
@media (max-width: 768px) {
    /* Фикс хедера */
    .header { z-index: 2000 !important; }

    /* Фикс модального окна */
    .product-modal {
        z-index: 1500 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        left: 0 !important;
        overflow-x: hidden !important;
    }

    /* Главный контейнер карточки */
    .product-detail {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100vw !important;
        margin-top: 70px !important;
        padding: 0 15px !important;
        box-sizing: border-box !important;
        position: static !important; /* Убираем относительность для fixed-крестика */
    }

    /* КРЕСТИК: Теперь он зафиксирован в углу экрана */
    .product-detail__close-inline {
        position: fixed !important;
        top: 85px !important; /* С учетом высоты шапки */
        right: 20px !important;
        z-index: 3000 !important;
        background: rgba(255, 255, 255, 0.9) !important;
        color: #000 !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2) !important;
        width: 36px !important;
        height: 36px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        border-radius: 50% !important;
        border: none !important;
    }

    /* Блок с фото и миниатюрами */
    .product-detail__visual {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px !important;
    }

    /* Главная картинка */
    .product-detail__main-img-box {
        order: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        aspect-ratio: auto !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        background: #f9f9f9 !important;
    }

    .product-detail__main-img, 
    .product-detail__main-img-box img {
        width: auto !important;
        max-width: 100% !important;
        max-height: 55vh !important;
        height: auto !important;
        object-fit: contain !important;
        display: block !important;
        margin: 0 auto !important;
    }

    /* Миниатюры */
    .product-detail__thumbs-container {
        order: 2 !important;
        width: 100% !important;
        overflow-x: auto !important;
        padding: 5px 0 !important;
        position: static !important;
    }

    .product-detail__thumbs {
        position: static !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        width: max-content !important;
    }

    .product-detail__thumb-item {
        width: 60px !important;
        height: 80px !important;
        flex-shrink: 0 !important;
    }

    /* Инфо-блок */
    .product-detail__info {
        width: 100% !important;
        padding-top: 20px !important;
        box-sizing: border-box !important;
    }
    
    .product-detail__header { position: static !important; padding-right: 0 !important; }
    .product-detail__title { font-size: 24px !important; line-height: 1.2 !important; }

    /* Ссылка в футере */
    #footer-address-link {
        text-decoration: underline !important;
        text-decoration-color: var(--accent-color) !important;
        text-underline-offset: 4px !important;
        display: inline-block !important;
    }

    /* --- Catalog Mobile UX Optimization --- */
    .catalog__search-box {
        margin-bottom: 20px !important; /* Reduced from 64px */
    }

    .catalog__filters {
        display: flex !important;
        flex-wrap: nowrap !important; /* Force single row */
        overflow-x: auto !important; /* Enable horizontal scroll */
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 8px !important;
        padding: 4px 20px 12px !important; /* Side padding for better swipe start */
        margin: 0 -20px !important; /* Bleed to edges */
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }

    .catalog__filters::-webkit-scrollbar {
        display: none !important; /* Hide scrollbar */
    }

    .filter-tag {
        flex: 0 0 auto !important;
        scroll-snap-align: start !important;
        white-space: nowrap !important;
        font-size: 11px !important;
        padding: 8px 16px !important;
        background: rgba(0, 0, 0, 0.03) !important; /* Subtle base for mobile */
    }

    .floating-btn {
        z-index: 15000 !important;
    }
}