/* ==========================================================================
   Reohimik Template — Modern Lab Style
   Магазин хімічних реактивів
   ========================================================================== */

/* ---------- Custom Properties ---------- */
:root {
    /* Palette */
    --c-primary:        #0066CC;
    --c-primary-dark:   #0052A3;
    --c-primary-light:  #E6F0FF;
    --c-accent:         #00B894;
    --c-accent-dark:    #009B7D;
    --c-accent-light:   #E6F9F4;

    --c-text:           #0F172A;
    --c-text-muted:     #475569;
    --c-text-soft:      #94A3B8;
    --c-border:         #E2E8F0;
    --c-border-strong:  #CBD5E1;
    --c-bg:             #F8F9FB;
    --c-bg-alt:         #F1F5F9;
    --c-white:          #FFFFFF;
    --c-danger:         #DC2626;
    --c-danger-light:   #FEE2E2;
    --c-warning:        #F59E0B;
    --c-warning-light:  #FEF3C7;
    --c-success:        #10B981;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

    /* Spacing scale */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 24px;
    --s-6: 32px;
    --s-7: 48px;
    --s-8: 64px;
    --s-9: 96px;

    /* Radii */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 16px;
    --r-xl: 24px;
    --r-full: 9999px;

    /* Shadows */
    --sh-sm: 0 1px 2px rgba(15,23,42,0.04), 0 1px 3px rgba(15,23,42,0.06);
    --sh-md: 0 4px 6px -1px rgba(15,23,42,0.07), 0 2px 4px -1px rgba(15,23,42,0.04);
    --sh-lg: 0 10px 15px -3px rgba(15,23,42,0.08), 0 4px 6px -2px rgba(15,23,42,0.04);
    --sh-xl: 0 20px 25px -5px rgba(15,23,42,0.10), 0 10px 10px -5px rgba(15,23,42,0.03);

    /* Transitions */
    --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --container-w: 1280px;
    --header-h: 72px;

    /* Z-index */
    --z-header: 100;
    --z-drawer: 200;
    --z-modal:  300;
    --z-toast:  400;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img, svg { max-width: 100%; height: auto; display: block; }

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

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

input, textarea, select { font: inherit; color: inherit; }

ul, ol { list-style: none; }

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 var(--s-4);
}

main { flex: 1 0 auto; }

.section { padding: var(--s-8) 0; }
.section--sm { padding: var(--s-6) 0; }
.section--alt { background: var(--c-white); }

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--s-4);
    margin-bottom: var(--s-6);
    flex-wrap: wrap;
}

.section-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--c-text);
}

.section-subtitle {
    color: var(--c-text-muted);
    font-size: 15px;
    margin-top: var(--s-2);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.02em; font-weight: 800; color: var(--c-text); }
h1 { font-size: clamp(28px, 4vw, 44px); }
h2 { font-size: clamp(24px, 3vw, 32px); }
h3 { font-size: 20px; }
h4 { font-size: 16px; }

.mono { font-family: var(--font-mono); letter-spacing: -0.02em; }

.text-muted { color: var(--c-text-muted); }
.text-soft  { color: var(--c-text-soft); }
.text-sm    { font-size: 13px; }
.text-xs    { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- Header ---------- */
.header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--c-border);
}

.header-top {
    background: var(--c-text);
    color: var(--c-text-soft);
    font-size: 12px;
    padding: var(--s-2) 0;
}
.header-top .container { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.header-top a { color: var(--c-white); }
.header-top a:hover { color: var(--c-accent); }
.header-top ul { display: flex; gap: var(--s-5); flex-wrap: wrap; }

.header-main {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: var(--s-5);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    font-weight: 900;
    font-size: 20px;
    letter-spacing: -0.03em;
    color: var(--c-text);
    flex-shrink: 0;
}
.logo:hover { color: var(--c-text); }
.logo-mark {
    width: 36px;
    height: 36px;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
    display: grid;
    place-items: center;
    color: white;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 18px;
}
.logo-text { display: flex; flex-direction: column; line-height: 1; gap: 2px; }
.logo-text small { font-size: 10px; color: var(--c-text-soft); font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; }

.search-form {
    flex: 1;
    max-width: 600px;
    display: flex;
    align-items: center;
    background: var(--c-bg-alt);
    border: 1px solid transparent;
    border-radius: var(--r-md);
    padding: var(--s-2) var(--s-3);
    gap: var(--s-2);
    transition: all var(--t-fast);
}
.search-form:focus-within { background: var(--c-white); border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-light); }
.search-form input { flex: 1; border: none; background: transparent; outline: none; font-size: 14px; padding: var(--s-2) 0; }
.search-form input::placeholder { color: var(--c-text-soft); }
.search-form button { color: var(--c-text-soft); padding: var(--s-1); display: grid; place-items: center; }
.search-form button:hover { color: var(--c-primary); }

.header-actions { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }

.header-action {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-2) var(--s-3);
    border-radius: var(--r-md);
    color: var(--c-text);
    transition: background var(--t-fast);
    position: relative;
}
.header-action:hover { background: var(--c-bg-alt); color: var(--c-text); }
.header-action-text { display: none; flex-direction: column; line-height: 1.2; }
.header-action-text small { font-size: 11px; color: var(--c-text-soft); }
.header-action-text strong { font-size: 13px; font-weight: 700; }
.cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--c-primary);
    color: white;
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 700;
    display: grid;
    place-items: center;
    border: 2px solid var(--c-white);
}

/* Main nav */
.nav { border-top: 1px solid var(--c-border); background: var(--c-white); }
.nav-list { display: flex; gap: var(--s-1); align-items: center; padding: var(--s-2) 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.nav-list::-webkit-scrollbar { display: none; }
.nav-list a {
    padding: var(--s-2) var(--s-3);
    color: var(--c-text);
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--r-sm);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: var(--s-2);
    transition: all var(--t-fast);
}
.nav-list a:hover { background: var(--c-primary-light); color: var(--c-primary); }
.nav-list a.active { background: var(--c-primary); color: var(--c-white); }
.nav-list a.active:hover { background: var(--c-primary-dark); color: var(--c-white); }

.nav-catalog-btn {
    background: var(--c-text) !important;
    color: var(--c-white) !important;
    padding: var(--s-3) var(--s-4) !important;
    font-weight: 700 !important;
}
.nav-catalog-btn:hover { background: var(--c-primary) !important; }

/* Mobile menu toggle */
.menu-toggle { display: none; padding: var(--s-2); border-radius: var(--r-sm); }
.menu-toggle:hover { background: var(--c-bg-alt); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { padding: var(--s-4) 0; color: var(--c-text-soft); font-size: 13px; }
.breadcrumbs ol { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.breadcrumbs li { display: flex; align-items: center; gap: var(--s-2); }
.breadcrumbs li::after { content: '/'; color: var(--c-border-strong); }
.breadcrumbs li:last-child::after { display: none; }
.breadcrumbs a { color: var(--c-text-muted); }
.breadcrumbs a:hover { color: var(--c-primary); }
.breadcrumbs li:last-child { color: var(--c-text); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    padding: var(--s-3) var(--s-5);
    font-weight: 700;
    font-size: 14px;
    border-radius: var(--r-md);
    transition: all var(--t-fast);
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid transparent;
    line-height: 1;
}
.btn:active { transform: translateY(1px); }

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

.btn-accent { background: var(--c-accent); color: white; }
.btn-accent:hover { background: var(--c-accent-dark); color: white; }

.btn-dark { background: var(--c-text); color: white; }
.btn-dark:hover { background: #1E293B; color: white; }

.btn-outline { border-color: var(--c-border-strong); background: white; color: var(--c-text); }
.btn-outline:hover { border-color: var(--c-primary); color: var(--c-primary); }

.btn-ghost { background: transparent; color: var(--c-text-muted); }
.btn-ghost:hover { background: var(--c-bg-alt); color: var(--c-text); }

.btn-lg { padding: var(--s-4) var(--s-6); font-size: 16px; }
.btn-sm { padding: var(--s-2) var(--s-3); font-size: 13px; }
.btn-block { width: 100%; }

.btn-icon { padding: var(--s-2); width: 38px; height: 38px; }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: var(--r-full);
    background: var(--c-bg-alt);
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.badge-primary  { background: var(--c-primary-light); color: var(--c-primary); }
.badge-accent   { background: var(--c-accent-light); color: var(--c-accent-dark); }
.badge-danger   { background: var(--c-danger-light); color: var(--c-danger); }
.badge-warning  { background: var(--c-warning-light); color: #92400E; }
.badge-success  { background: #D1FAE5; color: #065F46; }
.badge-dark     { background: var(--c-text); color: white; }

/* ---------- Cards ---------- */
.card {
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: all var(--t-base);
}
.card:hover { box-shadow: var(--sh-lg); border-color: var(--c-border-strong); transform: translateY(-2px); }
.card-body { padding: var(--s-5); }
.card-body--sm { padding: var(--s-4); }

/* Product card */
.product-card {
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: all var(--t-base);
    display: flex;
    flex-direction: column;
    position: relative;
}
.product-card:hover {
    box-shadow: var(--sh-lg);
    transform: translateY(-4px);
    border-color: var(--c-primary);
}
.product-card-img {
    aspect-ratio: 1;
    background: var(--c-bg-alt);
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    min-height: 200px; /* fallback если aspect-ratio не работает */
}
.product-card-img img { width: 100%; height: 100%; object-fit: contain; padding: var(--s-4); transition: transform var(--t-base); max-height: 320px; }
.product-card:hover .product-card-img img { transform: scale(1.05); }
.product-card-badges {
    position: absolute;
    top: var(--s-3);
    left: var(--s-3);
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
    z-index: 2;
}
.product-card-actions {
    position: absolute;
    top: var(--s-3);
    right: var(--s-3);
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
    opacity: 0;
    transform: translateX(10px);
    transition: all var(--t-base);
    z-index: 2;
}
.product-card:hover .product-card-actions { opacity: 1; transform: translateX(0); }
.product-card-action-btn {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: var(--r-full);
    display: grid;
    place-items: center;
    box-shadow: var(--sh-md);
    color: var(--c-text-muted);
    transition: all var(--t-fast);
}
.product-card-action-btn:hover { color: var(--c-primary); transform: scale(1.1); }

.product-card-body { padding: var(--s-4); display: flex; flex-direction: column; flex: 1; gap: var(--s-2); }
.product-card-sku { font-family: var(--font-mono); font-size: 11px; color: var(--c-text-soft); }
.product-card-title { font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--c-text); }
.product-card-title a { color: inherit; }
.product-card-title a:hover { color: var(--c-primary); }
.product-card-meta { display: flex; align-items: center; gap: var(--s-2); margin-top: auto; padding-top: var(--s-2); }
.product-card-price { font-family: var(--font-mono); font-size: 20px; font-weight: 800; color: var(--c-text); }
.product-card-price-old { font-family: var(--font-mono); font-size: 13px; color: var(--c-text-soft); text-decoration: line-through; }
.product-card-btn { margin-top: var(--s-2); }

/* ---------- Hero ---------- */
.hero {
    background:
        radial-gradient(circle at 20% 50%, rgba(0,102,204,0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0,184,148,0.06) 0%, transparent 50%),
        linear-gradient(180deg, var(--c-white) 0%, var(--c-bg) 100%);
    padding: var(--s-8) 0;
    position: relative;
    overflow: hidden;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: var(--s-8);
    align-items: center;
}
.hero-content { display: flex; flex-direction: column; gap: var(--s-5); }
.hero-title { font-size: clamp(32px, 5vw, 56px); line-height: 1.05; font-weight: 900; letter-spacing: -0.03em; }
.hero-title-gradient {
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.hero-subtitle { font-size: 17px; color: var(--c-text-muted); max-width: 540px; line-height: 1.6; }
.hero-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.hero-stats { display: flex; gap: var(--s-6); margin-top: var(--s-4); padding-top: var(--s-5); border-top: 1px solid var(--c-border); }
.hero-stat { display: flex; flex-direction: column; }
.hero-stat-value { font-family: var(--font-mono); font-size: 26px; font-weight: 800; color: var(--c-text); }
.hero-stat-label { font-size: 12px; color: var(--c-text-soft); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }

.hero-visual {
    position: relative;
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--c-primary-light), var(--c-accent-light));
    border-radius: var(--r-xl);
    display: grid;
    place-items: center;
    overflow: visible; /* чтобы hero-tag выглядывали наружу */
}
.hero-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,102,204,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,102,204,0.04) 1px, transparent 1px);
    background-size: 32px 32px;
}
.hero-molecule {
    position: relative;
    width: 70%;
    height: 70%;
}
.hero-tag {
    position: absolute;
    background: white;
    padding: var(--s-2) var(--s-3);
    border-radius: var(--r-md);
    box-shadow: var(--sh-lg);
    display: flex;
    align-items: center;
    gap: var(--s-2);
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text);
}
.hero-tag strong { font-family: var(--font-mono); color: var(--c-primary); }
.hero-tag-1 { top: 12%; right: -10%; animation: float 4s ease-in-out infinite; }
.hero-tag-2 { bottom: 18%; left: -8%; animation: float 5s ease-in-out infinite 1s; }
.hero-tag-3 { top: 50%; right: -5%; animation: float 6s ease-in-out infinite 0.5s; }

@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- Categories grid ---------- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--s-4);
}
.category-card {
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-5);
    text-align: left;
    transition: all var(--t-base);
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    color: var(--c-text);
    position: relative;
    overflow: hidden;
}
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sh-lg);
    color: var(--c-text);
    border-color: var(--c-primary);
}
.category-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--c-primary-light) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--t-base);
}
.category-card:hover::after { opacity: 1; }
.category-card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, var(--c-primary-light), var(--c-accent-light));
    display: grid;
    place-items: center;
    color: var(--c-primary);
    position: relative;
    z-index: 1;
}
.category-card-title { font-size: 16px; font-weight: 700; position: relative; z-index: 1; }
.category-card-count { font-size: 12px; color: var(--c-text-soft); position: relative; z-index: 1; }

/* ---------- Advantages ---------- */
.advantages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--s-5);
}
.advantage {
    text-align: left;
    padding: var(--s-5);
    background: var(--c-white);
    border-radius: var(--r-lg);
    border: 1px solid var(--c-border);
}
.advantage-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--r-md);
    background: var(--c-primary-light);
    color: var(--c-primary);
    display: grid;
    place-items: center;
    margin-bottom: var(--s-4);
}
.advantage-title { font-size: 16px; font-weight: 700; margin-bottom: var(--s-2); }
.advantage-text { font-size: 14px; color: var(--c-text-muted); line-height: 1.6; }

/* ---------- Newsletter ---------- */
.newsletter {
    background: linear-gradient(135deg, var(--c-text) 0%, #1E293B 100%);
    color: white;
    border-radius: var(--r-xl);
    padding: var(--s-8) var(--s-7);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.newsletter::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(0,184,148,0.2) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(0,102,204,0.2) 0%, transparent 40%);
}
.newsletter-content { position: relative; z-index: 1; max-width: 600px; margin: 0 auto; }
.newsletter h2 { color: white; margin-bottom: var(--s-3); }
.newsletter p { color: rgba(255,255,255,0.8); margin-bottom: var(--s-5); }
.newsletter-form { display: flex; gap: var(--s-2); max-width: 480px; margin: 0 auto; flex-wrap: wrap; }
.newsletter-form input {
    flex: 1;
    min-width: 240px;
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md);
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: white;
    outline: none;
}
.newsletter-form input::placeholder { color: rgba(255,255,255,0.6); }
.newsletter-form input:focus { border-color: var(--c-accent); background: rgba(255,255,255,0.15); }
.newsletter-form button { background: var(--c-accent); color: white; }
.newsletter-form button:hover { background: var(--c-accent-dark); }
.newsletter-form .privacy { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: var(--s-3); width: 100%; }

/* ---------- Footer ---------- */
.footer {
    background: var(--c-text);
    color: rgba(255,255,255,0.7);
    padding: var(--s-8) 0 var(--s-5);
    margin-top: var(--s-9);
    flex-shrink: 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1.5fr;
    gap: var(--s-6);
    margin-bottom: var(--s-7);
}
.footer-col h4 { color: white; font-size: 14px; font-weight: 700; margin-bottom: var(--s-4); text-transform: uppercase; letter-spacing: 0.06em; }
.footer-col ul { display: flex; flex-direction: column; gap: var(--s-2); }
.footer-col a { color: rgba(255,255,255,0.7); font-size: 14px; }
.footer-col a:hover { color: var(--c-accent); }
.footer-brand .logo { color: white; margin-bottom: var(--s-4); }
.footer-brand .logo-text small { color: rgba(255,255,255,0.5); }
.footer-about { font-size: 14px; line-height: 1.6; margin-bottom: var(--s-4); }
.footer-contacts { display: flex; flex-direction: column; gap: var(--s-2); font-size: 14px; }
.footer-contacts strong { color: white; font-family: var(--font-mono); font-size: 16px; }
.footer-social { display: flex; gap: var(--s-2); margin-top: var(--s-4); }
.footer-social a {
    width: 36px;
    height: 36px;
    border-radius: var(--r-md);
    background: rgba(255,255,255,0.08);
    display: grid;
    place-items: center;
    color: rgba(255,255,255,0.8);
    transition: all var(--t-fast);
}
.footer-social a:hover { background: var(--c-accent); color: white; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: var(--s-5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--s-4);
    flex-wrap: wrap;
    font-size: 13px;
}
.footer-payments { display: flex; gap: var(--s-2); align-items: center; }
.footer-payments span {
    padding: 4px 8px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--r-sm);
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
}

/* ---------- Forms ---------- */
.form-group { margin-bottom: var(--s-4); }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--c-text); margin-bottom: var(--s-2); }
.form-label .req { color: var(--c-danger); }
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: var(--s-3) var(--s-4);
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r-md);
    background: var(--c-white);
    font-size: 14px;
    transition: all var(--t-fast);
    outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px var(--c-primary-light);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--c-text-soft); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 12px; color: var(--c-text-soft); margin-top: var(--s-2); }
.form-error { font-size: 12px; color: var(--c-danger); margin-top: var(--s-2); }
.form-input.is-invalid { border-color: var(--c-danger); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }

.form-check { display: flex; align-items: flex-start; gap: var(--s-2); }
.form-check input[type="checkbox"], .form-check input[type="radio"] { margin-top: 3px; accent-color: var(--c-primary); width: 16px; height: 16px; }
.form-check label { font-size: 14px; cursor: pointer; color: var(--c-text-muted); }

/* ---------- Tabs ---------- */
.tabs { border-bottom: 1px solid var(--c-border); margin-bottom: var(--s-5); }
.tabs-list { display: flex; gap: var(--s-1); overflow-x: auto; scrollbar-width: none; }
.tabs-list::-webkit-scrollbar { display: none; }
.tabs-list button {
    padding: var(--s-3) var(--s-4);
    font-weight: 600;
    font-size: 14px;
    color: var(--c-text-muted);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all var(--t-fast);
    margin-bottom: -1px;
}
.tabs-list button:hover { color: var(--c-text); }
.tabs-list button.active { color: var(--c-primary); border-bottom-color: var(--c-primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn var(--t-base); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Catalog page ---------- */
.catalog-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--s-6);
    align-items: start;
}

.filter-sidebar {
    position: sticky;
    top: calc(var(--header-h) + var(--s-4));
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-5);
}
.filter-group { padding-bottom: var(--s-4); margin-bottom: var(--s-4); border-bottom: 1px solid var(--c-border); }
.filter-group:last-child { border-bottom: none; margin-bottom: 0; }
.filter-group-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--s-3); color: var(--c-text); display: flex; justify-content: space-between; align-items: center; }
.filter-option { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) 0; font-size: 14px; color: var(--c-text-muted); cursor: pointer; }
.filter-option:hover { color: var(--c-text); }
.filter-option input { accent-color: var(--c-primary); width: 16px; height: 16px; }
.filter-option-count { margin-left: auto; font-size: 12px; color: var(--c-text-soft); }

.price-range { display: flex; gap: var(--s-2); align-items: center; }
.price-range input { width: 100%; padding: var(--s-2) var(--s-3); font-size: 13px; }
.price-range span { color: var(--c-text-soft); }

.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--s-4);
    margin-bottom: var(--s-5);
    flex-wrap: wrap;
}
.catalog-count { font-size: 14px; color: var(--c-text-muted); }
.catalog-count strong { color: var(--c-text); }
.catalog-toolbar { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.catalog-sort {
    padding: var(--s-2) var(--s-3);
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r-md);
    background: white;
    font-size: 14px;
    cursor: pointer;
}
.catalog-view-toggle { display: flex; gap: 2px; background: var(--c-bg-alt); padding: 2px; border-radius: var(--r-md); }
.catalog-view-toggle button { padding: var(--s-2); border-radius: var(--r-sm); color: var(--c-text-soft); }
.catalog-view-toggle button.active { background: white; color: var(--c-primary); box-shadow: var(--sh-sm); }

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--s-4);
}

/* Mobile filter button */
.filter-toggle-btn { display: none; }

/* Pagination */
.pagination { display: flex; gap: var(--s-1); justify-content: center; padding: var(--s-6) 0; align-items: center; }
.pagination a, .pagination span {
    min-width: 40px;
    height: 40px;
    padding: 0 var(--s-3);
    display: grid;
    place-items: center;
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    background: white;
    color: var(--c-text);
    font-weight: 600;
    font-size: 14px;
    transition: all var(--t-fast);
}
.pagination a:hover { border-color: var(--c-primary); color: var(--c-primary); }
.pagination .active { background: var(--c-primary); color: white; border-color: var(--c-primary); }
.pagination .disabled { color: var(--c-text-soft); cursor: not-allowed; opacity: 0.5; }

/* ---------- Product detail ---------- */
.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-7);
    align-items: start;
}
.product-gallery { display: flex; flex-direction: column; gap: var(--s-3); position: sticky; top: calc(var(--header-h) + var(--s-4)); }
.product-gallery-main {
    aspect-ratio: 1;
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    overflow: hidden;
    display: grid;
    place-items: center;
}
.product-gallery-main img { width: 100%; height: 100%; object-fit: contain; padding: var(--s-6); }
.product-gallery-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-2); }
.product-gallery-thumb {
    aspect-ratio: 1;
    background: var(--c-white);
    border: 2px solid var(--c-border);
    border-radius: var(--r-md);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--t-fast);
}
.product-gallery-thumb.active, .product-gallery-thumb:hover { border-color: var(--c-primary); }
.product-gallery-thumb img { width: 100%; height: 100%; object-fit: contain; padding: var(--s-2); }

.product-info { display: flex; flex-direction: column; gap: var(--s-4); }
.product-info-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); }
.product-info-title { font-size: 28px; font-weight: 800; line-height: 1.2; }
.product-info-meta { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; font-size: 14px; color: var(--c-text-muted); }
.product-info-rating { display: flex; align-items: center; gap: var(--s-1); }
.product-info-rating .stars { color: var(--c-warning); display: flex; gap: 1px; }

.product-price-block {
    background: var(--c-bg-alt);
    border-radius: var(--r-lg);
    padding: var(--s-5);
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}
.product-price-row { display: flex; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; }
.product-price-current { font-family: var(--font-mono); font-size: 32px; font-weight: 800; color: var(--c-text); }
.product-price-old { font-family: var(--font-mono); font-size: 18px; color: var(--c-text-soft); text-decoration: line-through; }
.product-price-unit { font-size: 14px; color: var(--c-text-muted); }
.product-price-wholesale {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--s-3);
    border-top: 1px dashed var(--c-border-strong);
    font-size: 13px;
}
.product-price-wholesale strong { font-family: var(--font-mono); font-size: 16px; color: var(--c-accent-dark); }

.product-actions { display: flex; gap: var(--s-3); align-items: stretch; }
.qty-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r-md);
    overflow: hidden;
}
.qty-control button { padding: var(--s-3); width: 44px; height: 100%; color: var(--c-text-muted); font-size: 18px; }
.qty-control button:hover { background: var(--c-bg-alt); color: var(--c-primary); }
.qty-control input { width: 60px; text-align: center; border: none; outline: none; font-family: var(--font-mono); font-weight: 600; padding: var(--s-3) 0; }

.product-features { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); padding: var(--s-4) 0; border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); }
.product-feature { display: flex; align-items: center; gap: var(--s-2); font-size: 13px; color: var(--c-text-muted); }
.product-feature svg { color: var(--c-accent); flex-shrink: 0; }

.specs-table { width: 100%; border-collapse: collapse; }
.specs-table th, .specs-table td { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--c-border); text-align: left; font-size: 14px; }
.specs-table th { color: var(--c-text-muted); font-weight: 600; width: 40%; }
.specs-table td { color: var(--c-text); font-weight: 500; }
.specs-table tr:last-child th, .specs-table tr:last-child td { border-bottom: none; }

/* Reviews */
.review { padding: var(--s-4) 0; border-bottom: 1px solid var(--c-border); }
.review-header { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-2); }
.review-avatar { width: 40px; height: 40px; border-radius: var(--r-full); background: var(--c-primary-light); color: var(--c-primary); display: grid; place-items: center; font-weight: 700; }
.review-author { font-weight: 600; font-size: 14px; }
.review-date { font-size: 12px; color: var(--c-text-soft); }
.review-text { color: var(--c-text-muted); line-height: 1.6; font-size: 14px; }

/* ---------- Cart ---------- */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: var(--s-6);
    align-items: start;
}
.cart-items { display: flex; flex-direction: column; gap: var(--s-3); }
.cart-item {
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-4);
    display: grid;
    grid-template-columns: 80px 1fr auto auto auto;
    gap: var(--s-4);
    align-items: center;
}
.cart-item-img { width: 80px; height: 80px; background: var(--c-bg-alt); border-radius: var(--r-md); display: grid; place-items: center; overflow: hidden; }
.cart-item-img img { width: 100%; height: 100%; object-fit: contain; padding: var(--s-2); }
.cart-item-info { display: flex; flex-direction: column; gap: 4px; }
.cart-item-title { font-weight: 600; font-size: 15px; }
.cart-item-title a { color: var(--c-text); }
.cart-item-title a:hover { color: var(--c-primary); }
.cart-item-sku { font-family: var(--font-mono); font-size: 12px; color: var(--c-text-soft); }
.cart-item-price-each { font-size: 13px; color: var(--c-text-muted); }
.cart-item-total { font-family: var(--font-mono); font-weight: 700; font-size: 16px; text-align: right; }
.cart-item-remove { color: var(--c-text-soft); padding: var(--s-2); border-radius: var(--r-sm); transition: all var(--t-fast); }
.cart-item-remove:hover { color: var(--c-danger); background: var(--c-danger-light); }

.cart-summary {
    position: sticky;
    top: calc(var(--header-h) + var(--s-4));
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-5);
}
.cart-summary h3 { margin-bottom: var(--s-4); }
.cart-summary-row { display: flex; justify-content: space-between; padding: var(--s-2) 0; font-size: 14px; color: var(--c-text-muted); }
.cart-summary-row strong { color: var(--c-text); font-family: var(--font-mono); }
.cart-summary-total {
    border-top: 1px solid var(--c-border);
    margin-top: var(--s-3);
    padding-top: var(--s-3);
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    font-weight: 800;
    color: var(--c-text);
}
.cart-summary-total strong { font-family: var(--font-mono); }
.cart-summary .btn { margin-top: var(--s-4); }

.promo-input { display: flex; gap: var(--s-2); margin: var(--s-3) 0; }
.promo-input input { flex: 1; }
.promo-input button { padding: var(--s-3) var(--s-4); }

/* ---------- Checkout ---------- */
.checkout-steps { display: flex; gap: var(--s-2); margin-bottom: var(--s-6); }
.checkout-step {
    flex: 1;
    padding: var(--s-3) var(--s-4);
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    gap: var(--s-3);
    font-size: 14px;
}
.checkout-step.active { border-color: var(--c-primary); background: var(--c-primary-light); color: var(--c-primary); }
.checkout-step.done { background: var(--c-accent-light); border-color: var(--c-accent); color: var(--c-accent-dark); }
.checkout-step-num { width: 28px; height: 28px; border-radius: var(--r-full); background: var(--c-bg-alt); display: grid; place-items: center; font-weight: 700; font-family: var(--font-mono); font-size: 13px; }
.checkout-step.active .checkout-step-num { background: var(--c-primary); color: white; }
.checkout-step.done .checkout-step-num { background: var(--c-accent); color: white; }

.delivery-option {
    padding: var(--s-4);
    border: 2px solid var(--c-border);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: all var(--t-fast);
    display: flex;
    gap: var(--s-3);
    align-items: center;
    margin-bottom: var(--s-3);
}
.delivery-option:hover { border-color: var(--c-border-strong); }
.delivery-option.active { border-color: var(--c-primary); background: var(--c-primary-light); }
.delivery-option-icon { width: 48px; height: 48px; display: grid; place-items: center; color: var(--c-primary); flex-shrink: 0; }
.delivery-option-info { flex: 1; }
.delivery-option-name { font-weight: 700; font-size: 15px; }
.delivery-option-desc { font-size: 13px; color: var(--c-text-muted); }
.delivery-option-price { font-family: var(--font-mono); font-weight: 700; font-size: 16px; }

/* ---------- Auth pages ---------- */
.auth-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: calc(100vh - var(--header-h));
}
.auth-visual {
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
    color: white;
    padding: var(--s-9) var(--s-8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.auth-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 40px 40px;
}
.auth-visual-content { position: relative; z-index: 1; max-width: 480px; }
.auth-visual h1 { color: white; font-size: 40px; margin-bottom: var(--s-4); }
.auth-visual p { color: rgba(255,255,255,0.85); font-size: 17px; line-height: 1.6; margin-bottom: var(--s-5); }
.auth-visual-features { display: flex; flex-direction: column; gap: var(--s-3); }
.auth-visual-feature { display: flex; gap: var(--s-3); align-items: center; font-size: 15px; }
.auth-visual-feature svg { flex-shrink: 0; }

.auth-content {
    padding: var(--s-8) var(--s-6);
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { margin-bottom: var(--s-2); }
.auth-card-subtitle { color: var(--c-text-muted); margin-bottom: var(--s-6); font-size: 15px; }

.auth-tabs { display: flex; gap: var(--s-1); padding: 4px; background: var(--c-bg-alt); border-radius: var(--r-md); margin-bottom: var(--s-5); }
.auth-tabs button { flex: 1; padding: var(--s-3); border-radius: var(--r-sm); font-weight: 600; font-size: 14px; color: var(--c-text-muted); transition: all var(--t-fast); }
.auth-tabs button.active { background: white; color: var(--c-primary); box-shadow: var(--sh-sm); }

.auth-divider { display: flex; align-items: center; gap: var(--s-3); margin: var(--s-5) 0; color: var(--c-text-soft); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--c-border); }

.auth-social { display: flex; gap: var(--s-2); }
.auth-social button {
    flex: 1;
    padding: var(--s-3);
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r-md);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    font-size: 14px;
    font-weight: 600;
    color: var(--c-text);
    transition: all var(--t-fast);
}
.auth-social button:hover { border-color: var(--c-text); }

/* ---------- Profile dashboard ---------- */
.dashboard-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: var(--s-6);
    align-items: start;
}
.dashboard-sidebar {
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-4);
    position: sticky;
    top: calc(var(--header-h) + var(--s-4));
}
.dashboard-user {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding-bottom: var(--s-4);
    border-bottom: 1px solid var(--c-border);
    margin-bottom: var(--s-4);
}
.dashboard-avatar { width: 48px; height: 48px; border-radius: var(--r-full); background: linear-gradient(135deg, var(--c-primary), var(--c-accent)); color: white; display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.dashboard-user-name { font-weight: 700; font-size: 15px; }
.dashboard-user-email { font-size: 13px; color: var(--c-text-soft); }

.dashboard-nav { display: flex; flex-direction: column; gap: 2px; }
.dashboard-nav a {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3);
    border-radius: var(--r-md);
    color: var(--c-text-muted);
    font-weight: 500;
    font-size: 14px;
    transition: all var(--t-fast);
}
.dashboard-nav a:hover { background: var(--c-bg-alt); color: var(--c-text); }
.dashboard-nav a.active { background: var(--c-primary-light); color: var(--c-primary); font-weight: 600; }
.dashboard-nav a.danger { color: var(--c-danger); }
.dashboard-nav a.danger:hover { background: var(--c-danger-light); }

.dashboard-content { background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: var(--s-6); }
.dashboard-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s-5); }
.dashboard-section-header h2 { font-size: 22px; }

.orders-list { display: flex; flex-direction: column; gap: var(--s-3); }
.order-card { border: 1px solid var(--c-border); border-radius: var(--r-md); padding: var(--s-4); }
.order-card-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: var(--s-3); border-bottom: 1px solid var(--c-border); margin-bottom: var(--s-3); }
.order-number { font-family: var(--font-mono); font-weight: 700; }
.order-date { font-size: 13px; color: var(--c-text-soft); }
.order-card-body { display: flex; justify-content: space-between; align-items: center; }
.order-items-count { font-size: 14px; color: var(--c-text-muted); }
.order-total { font-family: var(--font-mono); font-weight: 700; font-size: 18px; }

/* ---------- Info page ---------- */
.info-page { padding: var(--s-7) 0; }
.info-layout { display: grid; grid-template-columns: 1fr 320px; gap: var(--s-7); align-items: start; }
.info-content { font-size: 16px; line-height: 1.7; color: var(--c-text); }
.info-content h2 { margin-top: var(--s-6); margin-bottom: var(--s-4); }
.info-content h2:first-child { margin-top: 0; }
.info-content p { margin-bottom: var(--s-4); color: var(--c-text-muted); }
.info-content ul { margin-bottom: var(--s-4); padding-left: var(--s-4); }
.info-content ul li { list-style: disc; margin-bottom: var(--s-2); color: var(--c-text-muted); }
.info-sidebar {
    position: sticky;
    top: calc(var(--header-h) + var(--s-4));
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-5);
}
.info-sidebar h4 { margin-bottom: var(--s-3); }
.info-sidebar ul { display: flex; flex-direction: column; gap: var(--s-1); margin-bottom: var(--s-4); }
.info-sidebar a { color: var(--c-text-muted); padding: var(--s-2) 0; font-size: 14px; display: block; }
.info-sidebar a:hover, .info-sidebar a.active { color: var(--c-primary); }

.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s-4); margin: var(--s-5) 0; }
.contact-card { padding: var(--s-5); border: 1px solid var(--c-border); border-radius: var(--r-lg); text-align: center; background: var(--c-white); }
.contact-card-icon { width: 48px; height: 48px; margin: 0 auto var(--s-3); background: var(--c-primary-light); color: var(--c-primary); border-radius: var(--r-md); display: grid; place-items: center; }
.contact-card-title { font-size: 13px; color: var(--c-text-soft); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--s-2); }
.contact-card-value { font-family: var(--font-mono); font-size: 18px; font-weight: 700; }

/* ---------- 404 page ---------- */
.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: var(--s-7) 0; }
.error-code { font-family: var(--font-mono); font-size: clamp(80px, 15vw, 160px); font-weight: 900; line-height: 1; background: linear-gradient(135deg, var(--c-primary), var(--c-accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: var(--s-4); }
.error-icon { width: 80px; height: 80px; margin: 0 auto var(--s-5); color: var(--c-text-soft); }
.error-title { font-size: 24px; font-weight: 800; margin-bottom: var(--s-3); }
.error-text { color: var(--c-text-muted); margin-bottom: var(--s-5); max-width: 480px; }
.error-actions { display: flex; gap: var(--s-3); justify-content: center; flex-wrap: wrap; }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: var(--s-5);
    right: var(--s-5);
    top: auto;
    z-index: var(--z-toast);
    background: var(--c-text);
    color: white;
    padding: var(--s-3) var(--s-5);
    border-radius: var(--r-md);
    box-shadow: var(--sh-xl);
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font-size: 14px;
    font-weight: 500;
    max-width: 360px;
    width: max-content;
    height: auto;
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--t-base);
    pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: var(--c-success); }
.toast-error { background: var(--c-danger); }
.toast > span { white-space: nowrap; }

/* ---------- Drawer (mobile menu / filters) ---------- */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.5);
    z-index: var(--z-drawer);
    opacity: 0;
    visibility: hidden;
    transition: all var(--t-base);
}
.drawer-backdrop.open { opacity: 1; visibility: visible; }

.drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 90%;
    max-width: 360px;
    height: 100%;
    background: white;
    z-index: calc(var(--z-drawer) + 1);
    transition: right var(--t-base);
    overflow-y: auto;
    padding: var(--s-5);
}
.drawer.open { right: 0; }
.drawer-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: var(--s-4); border-bottom: 1px solid var(--c-border); margin-bottom: var(--s-4); }
.drawer-header h3 { font-size: 20px; }
.drawer-close { padding: var(--s-2); border-radius: var(--r-sm); }
.drawer-close:hover { background: var(--c-bg-alt); }

/* ---------- Utilities ---------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--s-2); } .gap-3 { gap: var(--s-3); } .gap-4 { gap: var(--s-4); }
.mt-2 { margin-top: var(--s-2); } .mt-3 { margin-top: var(--s-3); } .mt-4 { margin-top: var(--s-4); } .mt-5 { margin-top: var(--s-5); }
.mb-2 { margin-bottom: var(--s-2); } .mb-3 { margin-bottom: var(--s-3); } .mb-4 { margin-bottom: var(--s-4); } .mb-5 { margin-bottom: var(--s-5); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.hidden { display: none !important; }
.grid { display: grid; }
.w-full { width: 100%; }

/* ============================================================
   RESPONSIVE — Mobile-first adjustments
   ============================================================ */

@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
    .info-layout { grid-template-columns: 1fr; }
    .info-sidebar { position: static; }
}

@media (max-width: 768px) {
    :root { --header-h: 60px; }

    .header-top { display: none; }

    .header-main { gap: var(--s-3); }
    .menu-toggle { display: grid; }
    .search-form { display: none; }
    .header-action-text { display: none; }
    .header-actions { gap: var(--s-1); }
    .header-action { padding: var(--s-2); }

    .nav-list { display: none; }

    .hero { padding: var(--s-6) 0; }
    .hero-grid { grid-template-columns: 1fr; gap: var(--s-6); }
    .hero-visual { display: none; }
    .hero-stats { gap: var(--s-4); }
    .hero-stat-value { font-size: 20px; }

    .section { padding: var(--s-6) 0; }
    .section-header { flex-direction: column; align-items: flex-start; }

    .catalog-layout { grid-template-columns: 1fr; }
    .filter-sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        left: auto;
        max-width: 360px;
        width: 90%;
        height: 100%;
        z-index: var(--z-drawer);
        border-radius: 0;
        transition: right var(--t-base);
        overflow-y: auto;
        max-height: 100vh;
    }
    .filter-sidebar.open { right: 0; }
    .filter-toggle-btn { display: inline-flex; }

    .products-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }
    .product-card-actions { opacity: 1; transform: translateX(0); }
    .product-card-btn { font-size: 12px; padding: var(--s-2); }

    .product-detail-grid { grid-template-columns: 1fr; gap: var(--s-5); }
    .product-gallery { position: static; }
    .product-info-title { font-size: 22px; }
    .product-price-current { font-size: 26px; }
    .product-features { grid-template-columns: 1fr; }

    .cart-layout { grid-template-columns: 1fr; }
    .cart-summary { position: static; }
    .cart-item { grid-template-columns: 60px 1fr; gap: var(--s-3); }
    .cart-item-img { width: 60px; height: 60px; }
    .cart-item-qty, .cart-item-total, .cart-item-remove { grid-column: 2; }
    .cart-item-total { text-align: left; }

    .auth-layout { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
    .auth-content { padding: var(--s-6) var(--s-4); }

    .dashboard-layout { grid-template-columns: 1fr; }
    .dashboard-sidebar { position: static; }
    .dashboard-nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
    .dashboard-nav::-webkit-scrollbar { display: none; }
    .dashboard-nav a { white-space: nowrap; }

    .checkout-steps { flex-direction: column; }
    .form-row { grid-template-columns: 1fr; }

    .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s-5); }
    .footer-brand { grid-column: 1 / -1; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }

    .toast { left: var(--s-4); right: var(--s-4); bottom: var(--s-4); }
}

@media (max-width: 480px) {
    .container { padding: 0 var(--s-3); }
    .products-grid { grid-template-columns: 1fr; }
    .category-grid { grid-template-columns: 1fr 1fr; }
    .advantages-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .hero-stats { flex-direction: column; gap: var(--s-3); }
    .product-gallery-thumbs { grid-template-columns: repeat(4, 1fr); }
}

/* ===== Стили для контента страниц (page-content) ===== */
/* Применяются к HTML, созданному через TinyMCE в админке */
.page-content {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--c-text);
    word-wrap: break-word;
}
.page-content > *:first-child { margin-top: 0; }
.page-content > *:last-child { margin-bottom: 0; }

.page-content h1 {
    font-size: 32px; color: var(--c-text); margin: 32px 0 16px;
    font-weight: 800;
}
.page-content h2 {
    font-size: 26px; color: var(--c-text); margin: 28px 0 14px;
    border-bottom: 2px solid var(--c-primary); padding-bottom: 8px;
    font-weight: 700;
}
.page-content h3 {
    font-size: 22px; color: var(--c-text); margin: 24px 0 12px;
    font-weight: 700;
}
.page-content h4 { font-size: 18px; color: var(--c-text); margin: 20px 0 10px; font-weight: 600; }
.page-content h5 { font-size: 16px; color: var(--c-text); margin: 16px 0 8px; font-weight: 600; }
.page-content h6 { font-size: 14px; color: var(--c-text-muted); margin: 14px 0 8px; font-weight: 600; text-transform: uppercase; }

.page-content p { margin: 0 0 16px; }

.page-content a { color: var(--c-primary); text-decoration: underline; }
.page-content a:hover { text-decoration: none; opacity: 0.8; }

.page-content img {
    max-width: 100%; height: auto; border-radius: 10px; margin: 16px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.page-content ul, .page-content ol { margin: 0 0 16px; padding-left: 24px; }
.page-content li { margin-bottom: 6px; }

.page-content blockquote {
    border-left: 4px solid var(--c-primary);
    padding: 12px 20px; margin: 16px 0;
    background: var(--c-bg-alt); border-radius: 0 8px 8px 0;
    color: var(--c-text-muted); font-style: italic;
}

.page-content pre {
    background: #1a1a1a; color: #f0f0f0; padding: 16px 20px;
    border-radius: 8px; overflow-x: auto; margin: 16px 0;
    font-size: 14px; line-height: 1.5;
}
.page-content code {
    background: var(--c-bg-alt); padding: 2px 6px; border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace; font-size: 14px;
}
.page-content pre code { background: none; padding: 0; }

.page-content table {
    border-collapse: collapse; width: 100%; margin: 16px 0;
    border-radius: 8px; overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.page-content th, .page-content td {
    border: 1px solid var(--c-border); padding: 10px 14px; text-align: left;
}
.page-content th { background: var(--c-bg-alt); font-weight: 600; color: var(--c-text); }
.page-content tr:nth-child(even) td { background: rgba(0,0,0,0.02); }

.page-content hr { border: none; border-top: 1px solid var(--c-border); margin: 24px 0; }

.page-content figure { margin: 16px 0; text-align: center; }
.page-content figcaption { font-size: 13px; color: var(--c-text-muted); margin-top: 8px; }

.page-content video { max-width: 100%; border-radius: 10px; margin: 16px 0; }

/* Адаптивность */
@media (max-width: 768px) {
    .page-content h1 { font-size: 24px; }
    .page-content h2 { font-size: 20px; }
    .page-content h3 { font-size: 18px; }
    .page-content table { font-size: 14px; }
    .page-content th, .page-content td { padding: 6px 10px; }
}

/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ ОСНОВНОГО САЙТА — детальная
   ============================================================ */

/* Планшеты (до 1024px) */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr !important;
    }
    .hero-visual {
        display: none !important;
    }
    .hero-title {
        font-size: 32px !important;
    }
    .section-title {
        font-size: 26px !important;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    .info-layout {
        grid-template-columns: 1fr !important;
    }
    .info-sidebar {
        order: -1;
    }
    .dashboard-layout {
        grid-template-columns: 1fr !important;
    }
    .dashboard-sidebar {
        position: static !important;
    }
    .dashboard-nav {
        flex-direction: row !important;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
    }
    .dashboard-nav a {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* Телефоны (до 768px) */
@media (max-width: 768px) {
    /* Шапка */
    .header-top {
        padding: 4px 0;
    }
    .header-top .container {
        flex-direction: column;
        gap: 2px;
    }
    .header-top ul {
        font-size: 11px !important;
        gap: 8px;
        justify-content: center;
        flex-wrap: wrap;
    }
    .header-main {
        flex-wrap: wrap;
        gap: 8px;
    }
    .search-form {
        order: 3;
        width: 100% !important;
    }
    .search-form input {
        width: 100%;
    }
    .header-actions {
        gap: 4px;
    }
    .header-action-text small {
        font-size: 10px;
    }
    .header-action-text strong {
        font-size: 12px;
    }
    /* Меню навигации — скролл */
    .nav-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
        gap: 4px;
        padding: 0 8px;
    }
    .nav-list li {
        flex-shrink: 0;
    }
    .nav-list a {
        white-space: nowrap;
        font-size: 13px;
        padding: 8px 10px;
    }
    .nav-catalog-btn {
        font-size: 13px !important;
        padding: 8px 12px !important;
    }
    /* Hero */
    .hero {
        padding: 32px 16px !important;
    }
    .hero-title {
        font-size: 24px !important;
    }
    .hero-subtitle {
        font-size: 14px !important;
    }
    .hero-stats {
        gap: 12px !important;
    }
    .hero-stat-value {
        font-size: 20px !important;
    }
    .hero-stat-label {
        font-size: 11px !important;
    }
    /* Сетки */
    .category-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    .products-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    .advantages-grid {
        grid-template-columns: 1fr !important;
    }
    /* Карточки товаров — компактнее */
    .product-card-title {
        font-size: 13px !important;
    }
    .product-card-price {
        font-size: 16px !important;
    }
    .product-card-img img {
        height: 140px !important;
    }
    .product-card-actions {
        top: 4px;
        right: 4px;
        gap: 2px;
    }
    .product-card-action-btn {
        width: 28px;
        height: 28px;
    }
    /* Секции */
    .section {
        padding: 24px 0 !important;
    }
    .section-title {
        font-size: 20px !important;
    }
    .container {
        padding: 0 12px;
    }
    /* Корзина */
    .cart-layout {
        grid-template-columns: 1fr !important;
    }
    .cart-summary {
        position: static !important;
        order: -1;
    }
    .checkout-steps {
        gap: 4px !important;
    }
    .checkout-step {
        font-size: 12px;
    }
    /* Карточка товара */
    .product-detail-grid {
        grid-template-columns: 1fr !important;
    }
    .product-gallery-main img {
        height: 300px !important;
    }
    .product-info h1 {
        font-size: 22px !important;
    }
    /* Личный кабинет */
    .dashboard-content {
        padding: 12px;
    }
    .orders-list {
        gap: 8px;
    }
    .order-card {
        padding: 12px;
    }
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    /* Инпуты — 16px чтобы iOS не зумила */
    .form-input, .form-select, .form-textarea {
        font-size: 16px !important;
    }
    /* Кнопки — крупнее для пальцев */
    .btn {
        min-height: 44px;
        font-size: 14px;
    }
    .btn-sm {
        min-height: 36px;
    }
    .btn-lg {
        min-height: 50px;
        font-size: 16px;
    }
    /* Избранное */
    .favorites-grid {
        grid-template-columns: 1fr !important;
    }
    /* Страница 404 */
    .error-code {
        font-size: 60px !important;
    }
    .error-title {
        font-size: 20px !important;
    }
}

/* Маленькие телефоны (до 480px) */
@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr !important;
    }
    .category-grid {
        grid-template-columns: 1fr !important;
    }
    .hero-title {
        font-size: 20px !important;
    }
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    .hero-actions .btn {
        width: 100%;
    }
    .product-card-img img {
        height: 180px !important;
    }
    .product-card-title {
        font-size: 14px !important;
        -webkit-line-clamp: 2;
    }
    .product-card-body {
        padding: 8px;
    }
    .product-card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    /* Кнопки действий в карточке — всегда видны */
    .product-card-actions {
        opacity: 1 !important;
    }
    /* Хедер — скрываем текст, оставляем иконки */
    .header-action-text {
        display: none !important;
    }
    .header-action {
        padding: 6px;
    }
    /* Поиск — полный width */
    .search-form {
        width: 100% !important;
    }
    /* Footer */
    .footer-payments {
        gap: 4px;
        font-size: 10px;
    }
    /* Контент страниц */
    .page-content h1 { font-size: 22px; }
    .page-content h2 { font-size: 18px; }
    .page-content h3 { font-size: 16px; }
    .page-content table { font-size: 12px; }
}
