/* ═══════════════════════════════════════════════════════════
   Matrix Shop — основные стили
   ═══════════════════════════════════════════════════════════ */

/* ── Переменные ── */
:root {
    --primary: #1a1a2e;
    --accent:  #e94560;
}

body {
    background: #f8f9fa;
    font-family: 'Segoe UI', sans-serif;
}

/* ── Шапка ── */
.site-header {
    background: var(--primary);
    padding: .9rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,.4);
}
.site-header .logo {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 1px;
}
.site-header .logo span { color: var(--accent); }
.site-header nav a {
    color: #ccc;
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: .9rem;
    transition: color .2s;
}
.site-header nav a:hover { color: #fff; }

.cart-link { position: relative; }
.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--accent);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ── Переключатели языка / валюты ── */
.lang-switcher,
.currency-switcher {
    display: flex;
    align-items: center;
    gap: .25rem;
    margin-left: 1.25rem;
}
.lang-switcher a,
.currency-switcher a {
    color: #999;
    text-decoration: none;
    font-size: .8rem;
    font-weight: 600;
    padding: .2rem .5rem;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: all .2s;
    text-transform: uppercase;
}
.lang-switcher a:hover,
.currency-switcher a:hover { color: #fff; border-color: #555; }
.lang-switcher a.active { color: #fff; border-color: var(--accent); background: rgba(233,69,96,.15); }
.currency-switcher a.active { color: #fff; border-color: #f0c040; background: rgba(240,192,64,.12); }
.header-divider {
    width: 1px;
    height: 16px;
    background: #444;
    margin-left: 1.25rem;
}

/* ── Хлебные крошки ── */
.breadcrumb-bar {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: .6rem 0;
}
.breadcrumb {
    background: none;
    margin: 0;
    padding: 0;
    font-size: .875rem;
}
.breadcrumb-item a { color: var(--accent); text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active { color: #6c757d; }

/* ── Заголовки секций ── */
.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.5rem;
}
.section-title span { color: var(--accent); }

/* ── Карточка товара ── */
.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    transition: box-shadow .2s, transform .2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.13);
    transform: translateY(-3px);
}
.product-img {
    height: 200px;
    background: linear-gradient(135deg, #e8edf2, #d1dbe5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: #b0bec5;
    position: relative;
}
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.badge-featured {
    position: absolute;
    top: .75rem;
    left: .75rem;
    background: var(--accent);
    color: #fff;
    font-size: .72rem;
    padding: .25rem .55rem;
    border-radius: 4px;
    font-weight: 600;
}
.badge-sale {
    position: absolute;
    top: .75rem;
    right: .75rem;
    background: #28a745;
    color: #fff;
    font-size: .72rem;
    padding: .25rem .55rem;
    border-radius: 4px;
    font-weight: 600;
}
.product-body {
    padding: 1.1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.product-brand {
    font-size: .78rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: .2rem;
}
.product-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: .4rem;
    line-height: 1.3;
}
.product-desc {
    font-size: .83rem;
    color: #6c757d;
    margin-bottom: auto;
    line-height: 1.4;
}
.product-footer {
    padding: 0 1.1rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.price-current { font-size: 1.2rem; font-weight: 700; color: var(--primary); }
.price-old { font-size: .85rem; color: #adb5bd; text-decoration: line-through; }
.price-sale { color: var(--accent); }
.stock-badge { font-size: .75rem; padding: .3rem .6rem; border-radius: 20px; font-weight: 600; }
.stock-in  { background: #d4edda; color: #155724; }
.stock-out { background: #f8d7da; color: #721c24; }
.stock-order { background: #fff3cd; color: #856404; }

/* ── Карточка категории ── */
.cat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    transition: box-shadow .2s, transform .2s;
    height: 100%;
    text-decoration: none;
    color: inherit;
    display: block;
}
.cat-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.13);
    transform: translateY(-3px);
    text-decoration: none;
    color: inherit;
}
.cat-card .cat-img {
    height: 120px;
    background: linear-gradient(135deg, #e8edf2, #d1dbe5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
    overflow: hidden;
}
.cat-card .cat-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-card .cat-name { font-weight: 700; font-size: 1.05rem; color: var(--primary); margin-bottom: .25rem; }
.cat-card .cat-count { font-size: .82rem; color: #6c757d; }
.cat-card .cat-desc  { font-size: .83rem; color: #6c757d; margin-top: .4rem; line-height: 1.4; }

/* ── Подвал ── */
footer {
    background: var(--primary);
    color: #888;
    text-align: center;
    padding: 1.5rem;
    font-size: .85rem;
    margin-top: 4rem;
}
footer a { color: #ccc; text-decoration: none; margin: 0 .75rem; }
footer a:hover { color: #fff; }

/* ═══════════════════════════════════════════════════════════
   Каталог
   ═══════════════════════════════════════════════════════════ */
.cat-sidebar .cat-group { margin-bottom: 1rem; }
.cat-sidebar .cat-parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .55rem .75rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: .95rem;
    color: var(--primary);
    transition: background .15s;
}
.cat-sidebar .cat-parent:hover { background: #f0f4f8; text-decoration: none; color: var(--primary); }
.cat-sidebar .cat-parent.active { background: var(--accent); color: #fff; }
.cat-sidebar .cat-parent.active .badge { background: rgba(255,255,255,.25); color: #fff; }
.cat-sidebar .cat-children { margin-top: .2rem; padding-left: .75rem; }
.cat-sidebar .cat-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .4rem .75rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: .88rem;
    color: #495057;
    transition: background .15s;
}
.cat-sidebar .cat-child:hover { background: #f0f4f8; text-decoration: none; color: var(--primary); }
.cat-sidebar .cat-child.active { background: rgba(233,69,96,.1); color: var(--accent); font-weight: 600; }
.cat-sidebar .cat-child.active::before { content: '›'; margin-right: .35rem; }
.sort-bar {
    background: #fff;
    border-radius: 8px;
    padding: .6rem 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    margin-bottom: 1.25rem;
}

/* ═══════════════════════════════════════════════════════════
   Корзина
   ═══════════════════════════════════════════════════════════ */
.cart-table th {
    font-weight: 600;
    color: #495057;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.cart-product-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    background: #e8edf2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b0bec5;
    font-size: 1.5rem;
}
.cart-product-name { font-weight: 600; color: var(--primary); font-size: .95rem; }
.cart-product-brand { font-size: .78rem; color: var(--accent); font-weight: 600; text-transform: uppercase; }
.qty-input { width: 70px; text-align: center; }
.summary-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    padding: 1.5rem;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .75rem;
    font-size: .95rem;
}
.summary-total {
    font-size: 1.2rem;
    font-weight: 700;
    border-top: 2px solid #e9ecef;
    padding-top: .75rem;
    margin-top: .75rem;
}
.coupon-applied {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: .6rem 1rem;
    font-size: .88rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.empty-cart { text-align: center; padding: 4rem 0; }
.empty-cart i { font-size: 5rem; color: #dee2e6; margin-bottom: 1.5rem; }

/* ═══════════════════════════════════════════════════════════
   Оформление заказа
   ═══════════════════════════════════════════════════════════ */
.checkout-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    padding: 1.75rem;
}
.checkout-card h5 { font-weight: 700; color: var(--primary); margin-bottom: 1.25rem; }
.order-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem 0;
    border-bottom: 1px solid #f1f3f5;
    font-size: .9rem;
}
.order-item-row:last-child { border-bottom: none; }
.order-item-name { font-weight: 600; color: var(--primary); }
.order-item-qty  { color: #6c757d; font-size: .82rem; }

/* ═══════════════════════════════════════════════════════════
   Страница успеха заказа
   ═══════════════════════════════════════════════════════════ */
.success-banner { text-align: center; padding: 3rem 0 2rem; }
.success-icon {
    width: 80px;
    height: 80px;
    background: #d4edda;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #28a745;
    margin-bottom: 1.25rem;
}
.order-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    padding: 1.5rem;
}
.order-meta span { font-size: .85rem; color: #6c757d; }
.order-meta strong { font-size: .95rem; color: var(--primary); }
.total-row {
    font-size: 1.1rem;
    font-weight: 700;
    border-top: 2px solid #e9ecef;
    margin-top: .75rem;
    padding-top: .75rem;
    display: flex;
    justify-content: space-between;
}

/* ═══════════════════════════════════════════════════════════
   Личный кабинет
   ═══════════════════════════════════════════════════════════ */
.account-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    padding: 1.5rem;
    height: 100%;
}
.account-card h5 { font-weight: 700; color: var(--primary); margin-bottom: 1rem; }
.account-nav a {
    display: flex;
    align-items: center;
    padding: .65rem .85rem;
    border-radius: 8px;
    color: #495057;
    text-decoration: none;
    font-size: .93rem;
    transition: background .15s, color .15s;
    margin-bottom: .25rem;
}
.account-nav a:hover { background: #f1f3f5; color: var(--primary); }
.account-nav a i { width: 22px; color: var(--accent); }
.account-nav a.active { background: rgba(233,69,96,.08); color: var(--accent); font-weight: 600; }

.order-badge { font-size: .75rem; padding: .25rem .55rem; border-radius: 12px; font-weight: 600; }
.status-pending    { background: #fff3cd; color: #856404; }
.status-processing { background: #cce5ff; color: #004085; }
.status-completed  { background: #d4edda; color: #155724; }
.status-cancelled  { background: #f8d7da; color: #721c24; }

.info-label { font-size: .8rem; color: #6c757d; margin-bottom: .2rem; }
.info-value { font-size: .95rem; font-weight: 600; color: var(--primary); }
.total-line { display: flex; justify-content: space-between; padding: .4rem 0; font-size: .93rem; }
.total-final {
    font-size: 1.1rem;
    font-weight: 700;
    border-top: 2px solid #e9ecef;
    margin-top: .5rem;
    padding-top: .75rem;
}

/* ═══════════════════════════════════════════════════════════
   Главная — Hero
   ═══════════════════════════════════════════════════════════ */
.hero-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
    color: #fff;
    padding: 5rem 0 4rem;
    text-align: center;
}
.hero-title {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: .75rem;
}
.hero-title .hero-accent { color: var(--accent); }
.hero-desc {
    font-size: 1.15rem;
    color: #a0aec0;
    max-width: 560px;
    margin: 0 auto 2rem;
}
.hero-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: .7rem 2.2rem;
    border-radius: 2rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: opacity .2s;
}
.hero-btn:hover { opacity: .88; color: #fff; text-decoration: none; }

/* ═══════════════════════════════════════════════════════════
   Утилиты (перенесены из app.css — shop layout не использует Vite)
   ═══════════════════════════════════════════════════════════ */
.brand-icon { font-size: 2rem; color: var(--primary); margin-bottom: .75rem; }
.brand-name  { font-weight: 600; font-size: 1rem; color: var(--primary); }
.brand-desc  { font-size: .82rem; color: #6c757d; margin-top: .25rem; line-height: 1.4; }

.cat-tag { display: inline-block; font-size: .8rem; color: #6c757d; margin-right: .4rem; }
.btn-nowrap { white-space: nowrap; }

.cat-sidebar-header { border-bottom: 2px solid var(--accent); }
.cat-sidebar-icon   { color: var(--accent); }
.cat-count-sm       { font-size: .78rem; }
.sort-count         { font-size: .88rem; }
.cat-desc           { font-size: .9rem; }
.cat-subcard-accent { border-left: 3px solid var(--accent); }
.cat-subcard-name   { font-size: .9rem; }

.cart-img-col { width: 80px; }
.cart-sku     { font-size: .82rem; color: #6c757d; }

.user-avatar {
    width: 64px;
    height: 64px;
    background: var(--accent);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    font-weight: 700;
}
.user-email       { font-size: .82rem; color: #6c757d; }
.accent-link      { color: var(--accent); }
.order-sku        { font-size: .8rem;  color: #6c757d; }
.order-meta       { font-size: .85rem; color: #6c757d; }
.status-badge-md  { font-size: .85rem; }
.footer-rates     { font-size: .78rem; color: #666; }

/* ═══════════════════════════════════════════════════════════
   Поиск
   ═══════════════════════════════════════════════════════════ */
.search-form {
    position: relative;
    margin-left: 1.5rem;
}
.search-input {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 20px;
    color: #fff;
    padding: .35rem 1rem .35rem 2rem;
    font-size: .85rem;
    width: 200px;
    transition: width .3s, background .2s;
    outline: none;
}
.search-input::placeholder { color: #aaa; }
.search-input:focus {
    width: 260px;
    background: rgba(255,255,255,.15);
    border-color: rgba(255,255,255,.4);
}
.search-icon {
    position: absolute;
    left: .65rem;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: .8rem;
    pointer-events: none;
}
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: 320px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,.18);
    z-index: 999;
    overflow: hidden;
    display: none;
}
.autocomplete-dropdown.open { display: block; }
.autocomplete-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem 1rem;
    text-decoration: none;
    color: var(--primary);
    border-bottom: 1px solid #f1f3f5;
    transition: background .15s;
    font-size: .88rem;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: #f8f9fa; text-decoration: none; color: var(--primary); }
.autocomplete-img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
    background: #e8edf2;
    flex-shrink: 0;
}
.autocomplete-img-placeholder {
    width: 42px;
    height: 42px;
    border-radius: 6px;
    background: #e8edf2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b0bec5;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.autocomplete-name { font-weight: 600; line-height: 1.2; }
.autocomplete-price { font-size: .82rem; color: var(--accent); font-weight: 700; margin-top: .1rem; }
.autocomplete-footer {
    padding: .55rem 1rem;
    font-size: .82rem;
    text-align: center;
    background: #f8f9fa;
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: block;
}
.autocomplete-footer:hover { text-decoration: none; background: #f1f3f5; color: var(--accent); }

/* Search results page */
.search-results-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}
.search-query-highlight { color: var(--accent); font-weight: 700; }

/* ═══════════════════════════════════════════════════════════
   Страница товара
   ═══════════════════════════════════════════════════════════ */
.product-gallery {
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.product-main-img {
    width: 100%;
    height: 420px;
    object-fit: cover;
}
.product-main-placeholder {
    width: 100%;
    height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8edf2, #d1dbe5);
    font-size: 6rem;
    color: #b0bec5;
}
.product-thumbs {
    display: flex;
    gap: .5rem;
    padding: .75rem;
    flex-wrap: wrap;
}
.product-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color .2s;
}
.product-thumb:hover,
.product-thumb.active { border-color: var(--accent); }

.product-info-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    padding: 2rem;
}
.product-brand-link {
    font-size: .82rem;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: .5px;
}
.product-brand-link:hover { text-decoration: underline; color: var(--accent); }
.product-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.25;
    margin-bottom: .75rem;
}
.product-price-block { margin: 1.25rem 0; }
.product-price-main { font-size: 2rem; font-weight: 700; color: var(--primary); }
.product-price-old { font-size: 1.1rem; color: #adb5bd; text-decoration: line-through; margin-left: .5rem; }
.product-price-save {
    display: inline-block;
    background: #d4edda;
    color: #155724;
    font-size: .8rem;
    font-weight: 700;
    padding: .2rem .55rem;
    border-radius: 12px;
    margin-left: .5rem;
}

.product-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1.5rem 0; }
.btn-add-cart {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}
.btn-add-cart:hover { opacity: .88; color: #fff; text-decoration: none; }
.btn-wishlist {
    background: #fff;
    border: 2px solid #dee2e6;
    color: #6c757d;
    border-radius: 8px;
    padding: .75rem 1.25rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.btn-wishlist:hover { border-color: var(--accent); color: var(--accent); }
.btn-wishlist.in-wishlist { border-color: var(--accent); color: var(--accent); background: rgba(233,69,96,.06); }
.btn-wishlist.in-wishlist i { font-weight: 900; }

.product-meta { font-size: .85rem; color: #6c757d; margin-bottom: 1rem; }
.product-meta span { margin-right: 1.5rem; }

.specs-table { width: 100%; }
.specs-table tr:nth-child(even) td { background: #f8f9fa; }
.specs-table td { padding: .55rem .75rem; font-size: .9rem; border-bottom: 1px solid #f1f3f5; }
.specs-table td:first-child { color: #6c757d; width: 40%; font-weight: 500; }
.specs-table td:last-child   { font-weight: 600; color: var(--primary); }

.product-desc-text { font-size: .95rem; line-height: 1.7; color: #495057; }

/* ═══════════════════════════════════════════════════════════
   Избранное (Wishlist)
   ═══════════════════════════════════════════════════════════ */
.wish-btn {
    position: absolute;
    top: .6rem;
    right: .6rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: .95rem;
    color: #adb5bd;
    transition: all .2s;
    padding: 0;
    line-height: 1;
}
.wish-btn:hover { color: var(--accent); background: #fff; }
.wish-btn.active { color: var(--accent); }
.wish-btn.active i { font-weight: 900; }

.wishlist-count-badge {
    position: absolute;
    top: -7px;
    right: -9px;
    background: var(--accent);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.wishlist-link { position: relative; }

.wishlist-empty { text-align: center; padding: 4rem 0; }
.wishlist-empty i { font-size: 5rem; color: #dee2e6; margin-bottom: 1.5rem; }
