:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-gradient: linear-gradient(135deg, #2563eb, #1e40af);
    --accent: #f59e0b;
    --accent-light: #fef3c7;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --dark: #0f172a;
    --dark-hover: #1e293b;
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-alt: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
    --shadow-xl: 0 25px 60px rgba(0,0,0,0.15);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --primary-color: #2563eb; /* Legacy compat */
}

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

body {
    font-family: 'Manrope', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    background: var(--bg-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
img { max-width: 100%; height: auto; }
button { font-family: inherit; }

/* === LAYOUT === */
.container { max-width: 1360px; margin: 0 auto; padding: 0 20px; }

/* === HOMEPAGE GRID === */
.home-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    margin-bottom: 50px;
}
@media (max-width: 1024px) {
    .home-grid { grid-template-columns: 1fr; }
    .home-sidebar { display: none !important; }
}

/* === SIDEBAR === */
.home-sidebar {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    overflow: hidden;
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
}
.sidebar-title {
    padding: 20px 24px 16px;
    font-weight: 800;
    font-size: 17px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}
.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 24px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    border-left: 3px solid transparent;
}
.sidebar-link:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
    padding-left: 28px;
}
.sidebar-link-icon { font-size: 18px; margin-right: 12px; filter: grayscale(0.4); }
.sidebar-link:hover .sidebar-link-icon { filter: grayscale(0); transform: scale(1.15); }
.sidebar-link-arrow { color: var(--text-muted); font-size: 12px; transition: var(--transition); }
.sidebar-link:hover .sidebar-link-arrow { transform: translateX(4px); color: var(--primary); }

/* === HERO BANNER === */
.hero-banner {
    min-height: 380px;
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 48px;
    color: white;
    box-shadow: var(--shadow-lg);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.hero-banner-dark { background: linear-gradient(135deg, #020617, #0f172a, #1e293b); }
.hero-banner-primary { background: linear-gradient(135deg, #1e3a8a, #2563eb); }
.hero-banner-light { background: var(--bg-alt); color: var(--text-primary); }
.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 8px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.2);
}
.hero-title {
    font-size: clamp(32px, 4vw, 52px);
    font-weight: 900;
    margin: 0 0 20px;
    line-height: 1.08;
    letter-spacing: -1.5px;
}
.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 36px;
    border-radius: var(--radius-lg);
    font-weight: 800;
    font-size: 16px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.2);
    transition: var(--transition);
}
.hero-cta:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(0,0,0,0.25); }
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    pointer-events: none;
}

/* === PRODUCT CARD === */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}
@media (max-width: 640px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    padding: 14px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: var(--transition);
}
.product-card:hover {
    border-color: var(--border);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.product-card-badges {
    position: absolute;
    top: 14px;
    left: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
}
.badge-discount {
    background: var(--danger);
    color: white;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
}
.badge-hit {
    background: var(--success);
    color: white;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
}
.product-card-actions {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
    opacity: 0;
    transform: translateX(8px);
    transition: var(--transition);
}
.product-card:hover .product-card-actions { opacity: 1; transform: translateX(0); }

.action-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.action-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }
.action-btn.active { color: var(--danger); border-color: var(--danger); }

.product-card-image {
    display: block;
    position: relative;
    padding-top: 100%;
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-alt);
}
.product-card-image img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: transform 0.4s;
}
.product-card:hover .product-card-image img { transform: scale(1.05); }

.product-card-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
}
.price-current {
    font-weight: 800;
    font-size: 18px;
    color: var(--text-primary);
    line-height: 1;
}
.price-current.has-discount { color: var(--danger); }
.price-old {
    color: var(--text-muted);
    text-decoration: line-through;
    font-size: 13px;
    font-weight: 500;
}
.price-card-label {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.product-card-title {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
    flex-grow: 1;
    transition: color 0.2s;
}
.product-card-title:hover { color: var(--primary); }

.product-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 10px;
}
.product-card-meta .rating-star { color: var(--accent); }

.btn-cart {
    width: 100%;
    height: 38px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-cart:hover { background: var(--primary-hover); transform: translateY(-1px); }

/* === SECTION HEADERS === */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.section-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}
.section-link {
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    padding: 8px 18px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    transition: var(--transition);
}
.section-link:hover { background: var(--primary); color: white; }

/* === FLASH SALE === */
.flash-sale {
    background: linear-gradient(135deg, #fef2f2, #fff1f2);
    border-radius: var(--radius-xl);
    padding: 36px;
    margin-bottom: 50px;
    border: 1px solid #fecaca;
}
.flash-timer {
    background: var(--danger);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}

/* === BRANDS CAROUSEL === */
.brands-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.brands-scroll::-webkit-scrollbar { display: none; }
.brand-card {
    flex-shrink: 0;
    width: 150px;
    height: 80px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    color: var(--text-secondary);
    transition: var(--transition);
    cursor: pointer;
}
.brand-card:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* === STORIES === */
.stories-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 15px;
    margin-bottom: 24px;
    scrollbar-width: none;
}
.stories-scroll::-webkit-scrollbar { display: none; }
.story-item {
    flex-shrink: 0;
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
}
.story-ring {
    width: 68px; height: 68px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, #f97316, #ef4444, #ec4899);
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.story-item:hover .story-ring { transform: scale(1.08); }
.story-inner {
    width: 100%; height: 100%;
    border-radius: 50%;
    background: white;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}
.story-label { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-align: center; line-height: 1.2; }

/* === SIDE BANNERS === */
.side-banners { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .side-banners { grid-template-columns: 1fr; } }
.side-banner {
    border-radius: var(--radius-xl);
    padding: 32px;
    position: relative;
    overflow: hidden;
    min-height: 140px;
    transition: var(--transition);
}
.side-banner:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

/* === TRUST BAR === */
.trust-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 50px;
}
@media (max-width: 768px) { .trust-bar { grid-template-columns: repeat(2, 1fr); } }
.trust-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: var(--transition);
}
.trust-item:hover { border-color: var(--primary); transform: translateY(-2px); }
.trust-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.trust-text-title { font-weight: 700; font-size: 14px; color: var(--text-primary); }
.trust-text-desc { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* === NEWSLETTER === */
.newsletter {
    background: var(--primary-gradient);
    border-radius: var(--radius-xl);
    padding: 48px;
    margin-bottom: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    color: white;
}
@media (max-width: 768px) { .newsletter { flex-direction: column; text-align: center; padding: 32px; } }
.newsletter-form {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}
.newsletter-input {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 15px;
    font-weight: 500;
    width: 300px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}
.newsletter-input::placeholder { color: rgba(255,255,255,0.6); }
.newsletter-input:focus { border-color: white; background: rgba(255,255,255,0.2); }
.newsletter-btn {
    padding: 14px 28px;
    border-radius: var(--radius-md);
    border: none;
    background: white;
    color: var(--primary);
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.newsletter-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.2); }

/* === MOBILE BOTTOM NAV === */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    z-index: 9999;
    padding: 8px 0 env(safe-area-inset-bottom, 8px);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}
@media (max-width: 768px) {
    .mobile-nav { display: flex; justify-content: space-around; align-items: center; }
    body { padding-bottom: 70px; }
}
.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.2s;
    padding: 4px 12px;
    position: relative;
}
.mobile-nav-item.active, .mobile-nav-item:hover { color: var(--primary); }
.mobile-nav-badge {
    position: absolute;
    top: -2px;
    right: 4px;
    background: var(--danger);
    color: white;
    width: 16px; height: 16px;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === ANIMATIONS === */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes pulse { 0% { opacity: 0.6; transform: scale(0.95); } 100% { opacity: 1; transform: scale(1.05); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideIn { to { transform: translateX(0); } }
@keyframes slideOut { to { transform: translateX(120%); opacity: 0; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.animate-in { animation: fadeInUp 0.5s ease-out both; }

/* === UTILITIES === */
.text-primary { color: var(--primary) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-muted { color: var(--text-muted) !important; }
.fw-800 { font-weight: 800; }
.fw-700 { font-weight: 700; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }

/* === SKELETON LOADING === */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* === ФОКУС С КЛАВИАТУРЫ ===
   Каждому полю на сайте проставлен inline-стилем outline: none, а подсветка
   возвращалась обработчиком onfocus. Человек, который ходит по сайту
   табуляцией, не видел, где он находится, — а без JavaScript не видел вовсе.
   Правило ниже перекрывает inline-стиль и работает всегда. */
:focus-visible {
    outline: 3px solid #2563eb !important;
    outline-offset: 2px !important;
    border-radius: 4px;
}
/* Мышью подсветка не нужна: :focus-visible её и не даёт, но старые
   браузеры без поддержки должны хотя бы не терять фокус совсем. */
@supports not selector(:focus-visible) {
    a:focus, button:focus, input:focus, select:focus, textarea:focus {
        outline: 3px solid #2563eb !important;
        outline-offset: 2px !important;
    }
}
