/* ══════ ПлёнкаОпт — Design System v2 ══════ */
:root {
    --primary: #0369A1;
    --primary-dark: #075985;
    --primary-light: #38BDF8;
    --primary-bg: #F0F9FF;
    --primary-glow: rgba(3,105,161,0.18);
    --text: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --surface: #FFFFFF;
    --surface-glass: rgba(255,255,255,0.7);
    --bg: #F8FAFC;
    --border: #E2E8F0;
    --border-light: rgba(226,232,240,0.6);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.08);
    --shadow-xl: 0 20px 48px rgba(0,0,0,0.10);
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --ease: cubic-bezier(0.16,1,0.3,1);
    --ease-spring: cubic-bezier(0.34,1.56,0.64,1);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(3,105,161,0.04) 0%, transparent 100%),
        var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    min-height: 100vh;
}

::selection { background: var(--primary); color: #fff; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* ── Navbar (Glassmorphism) ── */
.navbar {
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    border-bottom: 1px solid var(--border-light);
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow 0.25s var(--ease),
                background 0.25s var(--ease),
                border-color 0.25s var(--ease);
}
.navbar.scrolled {
    background: rgba(255,255,255,0.94);
    box-shadow: 0 1px 4px rgba(0,0,0,0.05),
                0 8px 24px rgba(0,0,0,0.05);
    border-bottom-color: var(--border);
}
.navbar .container {
    display: flex;
    align-items: center;
}
.navbar-brand {
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--primary-dark) !important;
    letter-spacing: -0.03em;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}
.navbar-brand span { font-weight: 300; }
.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}
.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.35rem 0.6rem !important;
    border-radius: 6px;
    white-space: nowrap;
    line-height: 1;
}
.nav-link:hover, .nav-link.active {
    color: var(--primary-dark) !important;
    background: var(--primary-bg);
}
.navbar-phone {
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 0.85rem;
    text-decoration: none !important;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    background: var(--primary-bg);
    margin-right: 0.4rem;
    white-space: nowrap;
    line-height: 1;
    flex-shrink: 0;
}

/* ── Buttons ── */
.btn {
    font-weight: 600;
    border-radius: 8px;
    padding: 0.5rem 1.2rem;
    transition: all 0.15s var(--ease);
    cursor: pointer;
    border: 1px solid transparent;
    font-size: 0.88rem;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
    background: transparent;
}
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-lg { padding: 0.65rem 1.5rem; font-size: 0.95rem; }

/* ── Cards ── */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
    overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-body { padding: 1.1rem; }
.card-title { font-weight: 600; font-size: 0.95rem; }

/* ── Product gallery ── */
.product-gallery { display: flex; gap: 12px; align-items: flex-start; }
.product-gallery .main-image { flex: 1; text-align: center; }
.product-gallery .main-image img {
    max-height: 400px; object-fit: contain;
    border-radius: var(--radius); cursor: zoom-in;
    border: 1px solid var(--border);
}
.product-gallery .thumbnails { display: flex; flex-direction: column; gap: 6px; max-height: 400px; overflow-y: auto; }
.product-gallery .thumbnails img {
    width: 60px; height: 60px; object-fit: cover;
    border-radius: 6px; cursor: pointer;
    border: 2px solid var(--border); opacity: 0.6;
    transition: opacity 0.15s, border-color 0.15s;
}
.product-gallery .thumbnails img:hover { opacity: 0.85; }
.product-gallery .thumbnails img.active-thumb { border-color: var(--primary); opacity: 1; }

/* ── Price ── */
.price-block {
    background: var(--primary-bg);
    border: 1px solid #CCFBF1;
    border-radius: var(--radius-lg);
    padding: 1.1rem;
}
.price-block .main-price { font-size: 1.6rem; font-weight: 800; color: var(--primary-dark); margin-bottom: 8px; }
.price-item { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed var(--border); font-size: 0.88rem; }
.price-item:last-child { border-bottom: none; }

/* ── Table ── */
.table-sm { width: 100%; border-collapse: collapse; }
.table-sm th { width: 30%; background: var(--bg); padding: 0.6rem 0.85rem; font-weight: 600; font-size: 0.85rem; text-align: left; border-bottom: 1px solid var(--border); }
.table-sm td { padding: 0.6rem 0.85rem; font-size: 0.88rem; border-bottom: 1px solid var(--border); }

/* ── Order button ── */
.btn-order {
    display: inline-flex; align-items: center; gap: 0.35rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; font-weight: 700; font-size: 0.95rem;
    padding: 0.6rem 1.5rem; border-radius: 8px; border: none;
    cursor: pointer; box-shadow: 0 2px 10px var(--primary-glow);
}
.btn-order:hover { box-shadow: 0 6px 20px rgba(13,148,136,0.3); color: #fff; }

/* ── Breadcrumbs ── */
.breadcrumb { display: flex; flex-wrap: wrap; padding: 0.4rem 0; list-style: none; font-size: 0.82rem; }
.breadcrumb-item + .breadcrumb-item::before { content: "›"; padding: 0 0.4rem; color: var(--text-muted); }
.breadcrumb-item a { color: var(--text-muted); }
.breadcrumb-item.active { color: var(--primary); font-weight: 600; }

/* ── Subcategories ── */
.subcategories-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; margin-bottom: 1.5rem; }
.subcategories-section h3 { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.85rem; }
.subcat-card { border: 1px solid var(--border-light) !important; }
.subcat-card:hover { border-color: var(--primary) !important; }
.subcat-card-img { height: 120px; object-fit: contain; padding: 10px; }
.subcat-card-title { color: var(--text); font-size: 0.9rem; }

/* ── Placeholder for missing images ── */
.no-image-placeholder {
    height: 300px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 4rem;
    opacity: 0.15;
}
.no-image-placeholder-sm {
    height: 150px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 2.5rem;
    opacity: 0.12;
}

/* ── Filters ── */
.filter-group { margin-bottom: 1rem; }
.filter-group label { font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-secondary); display: block; margin-bottom: 0.3rem; }
.filter-checkbox { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; margin-bottom: 0.15rem; }
.filter-checkbox input { accent-color: var(--primary); }

/* ── Fullscreen ── */
.fullscreen-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,0.94); z-index: 9999; align-items: center; justify-content: center; }
.fullscreen-overlay img { max-width: 92vw; max-height: 92vh; object-fit: contain; border-radius: 6px; }
.fullscreen-overlay .close-btn { position: absolute; top: 14px; right: 22px; color: #fff; font-size: 2rem; cursor: pointer; background: none; border: none; opacity: 0.7; }
.fullscreen-overlay .close-btn:hover { opacity: 1; }

/* ── Legal pages ── */
.legal-content { max-width: 700px; margin: 0 auto; line-height: 1.7; }
.legal-content h1 { font-weight: 800; }
.legal-content h2 { font-size: 1.1rem; font-weight: 700; color: var(--primary-dark); margin: 1.5rem 0 0.4rem; }
.legal-content p, .legal-content li { font-size: 0.88rem; margin-bottom: 0.4rem; color: var(--text-secondary); }

/* ── Footer ── */
.footer {
    background: var(--text);
    color: #94A3B8;
    padding: 3rem 0 5rem;
    margin-top: 3rem;
    font-size: 0.88rem;
}
.footer h5, .footer h6 { color: #fff; font-weight: 700; }
.footer a { color: #94A3B8; }
.footer a:hover { color: var(--primary-light); }
.footer .footer-phone { color: var(--primary-light); font-size: 1.1rem; font-weight: 700; }
.footer .border-top { border-color: #1E293B !important; }

/* ── Search ── */
#search-suggestions { position: absolute; z-index: 1030; width: 100%; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-md); overflow: hidden; border: 1px solid var(--border); }
#search-suggestions .list-group-item { border: none; border-bottom: 1px solid var(--border); font-size: 0.85rem; padding: 0.55rem 0.85rem; }
#search-suggestions .list-group-item:last-child { border-bottom: none; }
#search-suggestions .list-group-item:hover { background: var(--primary-bg); }

/* ── Cookie banner ── */
.cookie-banner {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    z-index: 9999; padding: 0.85rem 0; display: none;
    animation: cookieUp 0.3s var(--ease);
}
@keyframes cookieUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.cookie-banner .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; }
.cookie-banner .cookie-text { flex: 1; min-width: 200px; font-size: 0.82rem; color: var(--text-secondary); }
.cookie-banner .cookie-text a { color: var(--primary); text-decoration: underline; }
.cookie-banner .cookie-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }
.btn-cookie-accept { background: var(--primary); color: #fff; border: none; padding: 0.45rem 1.25rem; border-radius: 7px; font-weight: 700; font-size: 0.85rem; cursor: pointer; }
.btn-cookie-accept:hover { background: var(--primary-dark); }
.btn-cookie-settings { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); padding: 0.4rem 0.9rem; border-radius: 7px; font-weight: 600; font-size: 0.82rem; cursor: pointer; }
.cookie-details { display: none; width: 100%; padding-top: 0.6rem; margin-top: 0.4rem; border-top: 1px solid var(--border); }
.cookie-details.open { display: block; }
.cookie-option { display: flex; align-items: flex-start; gap: 0.4rem; margin-bottom: 0.3rem; font-size: 0.8rem; color: var(--text-secondary); }
.cookie-option strong { color: var(--text); min-width: 70px; font-size: 0.8rem; }
.cookie-option input[type="checkbox"] { accent-color: var(--primary); margin-top: 2px; }

/* ── Category product grid ── */
.product-cat-image { height: 150px; object-fit: contain; width: 100%; }
.product-description { line-height: 1.7; }

/* ── Search form in navbar ── */
.navbar .search-container { position: relative; flex-shrink: 0; }
.navbar .search-container .form-control { font-size: 0.85rem; }
.navbar .search-container .btn { font-size: 0.82rem; padding: 0.4rem 0.8rem; }

/* ── Accessibility ── */

:focus-visible {
    outline: 2px solid var(--primary-dark);
    outline-offset: 2px;
    border-radius: 4px;
}

@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;
    }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .navbar-brand { font-size: 1.15rem; }
    .navbar-phone { font-size: 0.78rem; }
    .product-gallery { flex-direction: column-reverse; }
    .product-gallery .thumbnails { flex-direction: row; overflow-x: auto; max-height: none; }
    .product-gallery .thumbnails img { width: 48px; height: 48px; flex-shrink: 0; }
    .cookie-banner .container { flex-direction: column; align-items: stretch; text-align: center; }
    .cookie-banner .cookie-actions { justify-content: center; }
}

/* ── Product cards & horizontal scroll ── */
.subcat-chip {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}
.subcat-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.featured-section {
    max-width: 100%;
    overflow: hidden;
    background: rgba(255,255,255,0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 1.25rem 1.25rem;
    margin-bottom: 2rem;
    transition: background 0.25s var(--ease),
                box-shadow 0.25s var(--ease);
}
.featured-section:hover {
    background: rgba(255,255,255,0.75);
    box-shadow: var(--shadow-md);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}
.section-header h2 {
    font-weight: 700;
    font-size: 1.2rem;
    margin: 0;
}
.section-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.scroll-wrapper {
    position: relative;
}

.scroll-row {
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 4px 0 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}
.scroll-row::-webkit-scrollbar { display: none; }

.scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    box-shadow: var(--shadow);
    font-size: 1.1rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.15s;
}
.scroll-arrow:hover { box-shadow: var(--shadow-md); }
.scroll-arrow-left  { left: -10px; }
.scroll-arrow-right { right: -10px; }

/* ── Hero section classes ── */
.hero-section {
    text-align: center;
    padding: 2rem 0 1rem;
}
.hero-title {
    font-size: clamp(1.6rem, 2.8vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}
.hero-subtitle {
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto 0.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
}
.hero-meta {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
    color: var(--text-secondary);
    font-size: 0.83rem;
}
.chip-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin: 1.25rem 0 2rem;
}
/* Stagger children must not break centering */
.chip-container.stagger-children {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

/* ── Product tabs (clean, no emoji) ── */
.product-tabs {
    border-bottom: 2px solid var(--border);
    gap: 0;
}
.product-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.55rem 1.1rem;
    transition: color 0.15s, border-color 0.15s;
    background: transparent;
    border-radius: 0;
    cursor: pointer;
}
.product-tabs .nav-link:hover {
    color: var(--text);
    border-bottom-color: var(--border);
}
.product-tabs .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

/* ── Scroll animations (animate-on-scroll + stagger-children) ── */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s var(--ease),
                transform 0.5s var(--ease);
}
.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-children > * {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s var(--ease),
                transform 0.4s var(--ease);
}
.stagger-children.visible > *:nth-child(1) { transition-delay: 0.03s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.06s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.09s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.12s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.15s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.18s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(7) { transition-delay: 0.21s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(8) { transition-delay: 0.24s; opacity: 1; transform: translateY(0); }

.product-card {
    flex: 0 0 auto;
    width: 220px;
    text-decoration: none;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow 0.25s var(--ease),
                transform 0.25s var(--ease);
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    transform: translateY(-4px);
}
.product-card img {
    width: 100%;
    height: 160px;
    object-fit: contain;
    padding: 0.75rem 0.75rem 0.2rem;
    background: var(--bg);
    transition: transform 0.3s var(--ease-spring);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.product-card .no-image {
    height: 160px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    opacity: 0.08;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.product-card-body {
    padding: 0.4rem 0.85rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    background: linear-gradient(to bottom, var(--surface) 0%, rgba(255,255,255,0.6) 100%);
}
/* Image dots indicator */
.product-card-dots {
    display: flex;
    gap: 4px;
    justify-content: center;
    padding: 2px 0 4px;
    background: var(--surface);
}
.product-card-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border);
    transition: background 0.2s, width 0.25s var(--ease);
    flex-shrink: 0;
}
.product-card-dots .dot.active {
    background: var(--primary);
    width: 18px;
    border-radius: 3px;
}
.product-card-title {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
}
.product-card-price {
    font-weight: 800;
    color: var(--primary-dark);
    font-size: 0.95rem;
    margin-top: auto;
}

@media (max-width: 768px) {
    .product-card { width: 160px; }
    .product-card img { height: 130px; }
    .scroll-arrow { display: none; }
}

/* ── Mobile: 2-column grid instead of horizontal scroll ── */
@media (max-width: 576px) {
    .scroll-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem;
        overflow-x: visible;
        padding: 0;
    }
    .scroll-row .product-card {
        width: 100% !important;
    }
    .scroll-row .product-card img {
        height: 130px;
    }
    .scroll-arrow {
        display: none !important;
    }
    .section-header h2 {
        font-size: 1rem;
    }
}
