/* ===== MyPhone Bishkek — основной стиль ===== */
:root {
    /* Бренд — индиго + золото */
    --primary: #0a0a6e;          /* индиго (чуть мягче #000080) */
    --primary-deep: #050540;     /* глубокий индиго для градиентов */
    --primary-light: #2323a8;
    --primary-50: #eeeef8;       /* светлая индиго-подложка */
    --primary-100: #dcdcf1;
    --accent: #ffd700;           /* золотой */
    --accent-hover: #f0c800;
    --accent-soft: #fff7cc;      /* мягкий жёлтый фон */
    --accent-text: #0a0a6e;      /* тёмный текст на жёлтом */
    --green: #0a9d58;
    --danger: #e23744;
    --bg: #f6f7fb;
    --card: #ffffff;
    --text: #14142b;
    --muted: #6b7280;
    --border: #e7e8ef;
    /* Радиусы */
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    /* Тени (единая шкала) */
    --shadow-xs: 0 1px 2px rgba(16, 16, 64, .05);
    --shadow: 0 2px 10px rgba(16, 16, 64, .06);
    --shadow-md: 0 6px 20px rgba(16, 16, 64, .09);
    --shadow-hover: 0 14px 36px rgba(10, 10, 110, .16);
    /* Шрифты */
    --font-heading: "Space Grotesk", -apple-system, "Segoe UI", sans-serif;
    --font-body: "DM Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { overflow-x: hidden; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.55;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, .logo { font-family: var(--font-heading); letter-spacing: -.02em; }
h1 { font-size: 30px; font-weight: 700; line-height: 1.15; }
h2 { letter-spacing: -.025em; }

a { color: inherit; text-decoration: none; transition: color .18s ease; }
img { max-width: 100%; display: block; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* Доступность: видимый фокус для клавиатурной навигации */
:focus-visible { outline: 3px solid rgba(10,10,110,.35); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ===== Кнопки ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; border: none; border-radius: var(--radius-sm); cursor: pointer;
    font-family: var(--font-body); font-size: 15px; font-weight: 600; white-space: nowrap;
    transition: transform .12s ease, background .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--accent); color: var(--accent-text); box-shadow: 0 4px 14px rgba(255,215,0,.35); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 6px 20px rgba(255,215,0,.45); }
.btn-dark { background: var(--primary); color: #fff; }
.btn-dark:hover { background: var(--primary-light); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: 14px; }

/* ===== Верхняя полоса ===== */
.topbar { background: var(--primary-deep); color: #b9c0e8; font-size: 13px; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; height: 40px; }
.topbar a:hover { color: var(--accent); }
.topbar-links { display: flex; gap: 22px; }

/* ===== Шапка ===== */
.header { background: rgba(255,255,255,.9); backdrop-filter: saturate(180%) blur(12px); box-shadow: var(--shadow-xs); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header .container { display: flex; align-items: center; gap: 24px; height: 78px; }
.logo { display: flex; align-items: center; gap: 2px; font-size: 26px; font-weight: 700; color: var(--primary); letter-spacing: -.03em; }
.logo span { color: var(--accent); -webkit-text-stroke: .5px var(--primary); }

.search { flex: 1; position: relative; max-width: 620px; }
.search input {
    width: 100%; padding: 13px 50px 13px 18px; border: 2px solid var(--border);
    border-radius: 12px; font-size: 15px; font-family: var(--font-body); outline: none;
    background: var(--bg); transition: border-color .18s, background .18s, box-shadow .18s;
}
.search input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px var(--primary-50); }
.search button {
    position: absolute; right: 4px; top: 4px; bottom: 4px; width: 44px;
    border: none; background: var(--accent); color: var(--accent-text); border-radius: 8px; cursor: pointer;
}
.suggest {
    position: absolute; top: 110%; left: 0; right: 0; background: #fff;
    border-radius: 10px; box-shadow: var(--shadow-hover); overflow: hidden; z-index: 50; display: none;
}
.suggest a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.suggest a:hover { background: var(--bg); }
.suggest img { width: 40px; height: 40px; object-fit: contain; }
.suggest .s-price { margin-left: auto; font-weight: 700; color: var(--primary); }

.header-actions { display: flex; gap: 8px; align-items: center; position: relative; }
.actions-list { display: flex; gap: 8px; align-items: center; }
.menu-toggle {
    display: none; width: 44px; height: 44px; align-items: center; justify-content: center;
    background: none; border: 1px solid var(--border); border-radius: 8px;
    font-size: 22px; line-height: 1; color: var(--primary); cursor: pointer;
    transition: background .15s, border-color .15s;
}
.menu-toggle:hover { background: var(--bg); }
.icon-btn {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 12px; border-radius: 8px; color: var(--muted); font-size: 12px; position: relative;
}
.icon-btn:hover { background: var(--bg); color: var(--primary); }
.icon-btn .ic { font-size: 22px; }
.badge {
    position: absolute; top: 2px; right: 6px; background: var(--accent); color: var(--accent-text);
    font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center; padding: 0 5px;
}

/* ===== Навигация категорий ===== */
.nav { background: var(--primary); background-image: linear-gradient(180deg, var(--primary), var(--primary-deep)); }
.nav .container { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav .container::-webkit-scrollbar { display: none; }
.nav a {
    padding: 14px 16px; color: #cfd4f5; font-size: 14px; font-weight: 500;
    white-space: nowrap; border-bottom: 3px solid transparent;
    transition: color .15s, border-color .15s, background .15s;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.nav a.cat-icon { font-size: 15px; }

/* ===== Хлебные крошки ===== */
.breadcrumbs { padding: 14px 0; font-size: 13px; color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { margin: 0 6px; }

/* ===== Баннеры / hero ===== */
.hero { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin: 20px 0 36px; }
.banner {
    border-radius: var(--radius-lg); padding: 44px; color: #fff; min-height: 280px;
    display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden;
    box-shadow: var(--shadow-md);
}
.banner h2 { font-size: 38px; margin-bottom: 14px; line-height: 1.1; letter-spacing: -.03em; }
.banner p { font-size: 16px; opacity: .9; margin-bottom: 20px; max-width: 60%; }
.hero-main { flex-direction: row; align-items: center; justify-content: space-between; }
.hero-main .hero-text { flex: 1; }
.hero-main .hero-text p { max-width: 100%; }
.hero-phone { height: 300px; width: auto; flex-shrink: 0; margin-right: 10px; filter: drop-shadow(0 12px 30px rgba(0,0,0,.4)); }
.banner-side { display: flex; flex-direction: column; gap: 16px; }
.banner-small { min-height: 122px; padding: 24px; }
.banner-small h3 { font-size: 20px; }

/* ===== Секции ===== */
.section { margin: 48px 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.section-head h2 { font-size: 27px; font-weight: 700; position: relative; padding-left: 14px; }
.section-head h2::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 5px; border-radius: 3px; background: linear-gradient(var(--accent), var(--accent-hover)); }
.section-head a { color: var(--primary); font-weight: 600; font-size: 14px; }
.section-head a:hover { color: var(--accent-hover); }

/* ===== Сетка товаров ===== */
.products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.product-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
    box-shadow: var(--shadow-xs); position: relative; display: flex; flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.product-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-4px); border-color: transparent; }
.product-card:hover .p-img img { transform: scale(1.05); }
.p-card-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.p-badges { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.p-badge { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 6px; color: #fff; letter-spacing: .01em; box-shadow: var(--shadow-xs); }
.p-badge.new { background: var(--green); }
.p-badge.discount { background: var(--accent); color: var(--accent-text); }
.p-badge.used { background: #64748b; }
.p-fav {
    position: absolute; top: 12px; right: 12px; z-index: 2; width: 36px; height: 36px;
    border-radius: 50%; background: rgba(255,255,255,.9); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-xs);
    cursor: pointer; border: 1px solid var(--border); font-size: 17px; color: var(--muted);
    transition: color .15s, background .15s, transform .15s;
}
.p-fav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; transition: fill .15s, stroke .15s; }
.p-fav:hover { transform: scale(1.1); color: var(--danger); }
.p-fav.active { color: var(--danger); background: #ffe8ea; border-color: transparent; }
.p-fav.active svg { fill: var(--danger); stroke: var(--danger); }
.p-img { height: 200px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; border-radius: var(--radius-sm); background: linear-gradient(160deg, #fafbff, #f1f2fa); overflow: hidden; }
.p-img img { max-height: 88%; object-fit: contain; transition: transform .3s ease; }
.p-img .noimg { font-size: 64px; opacity: .25; }
.p-name { font-family: var(--font-heading); font-size: 15px; font-weight: 500; letter-spacing: -.01em; margin-bottom: 6px; min-height: 42px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-name:hover { color: var(--primary); }
.p-specs { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.p-price-row { display: flex; align-items: baseline; gap: 4px 8px; margin-bottom: 4px; flex-wrap: wrap; }
.p-price { font-family: var(--font-heading); font-size: 21px; font-weight: 700; color: var(--primary); font-feature-settings: "tnum"; white-space: nowrap; }
.p-oldprice { font-size: 14px; color: var(--muted); text-decoration: line-through; white-space: nowrap; }
.p-credit { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--green); font-weight: 600; margin-bottom: 12px; background: rgba(10,157,88,.08); padding: 3px 8px; border-radius: 6px; align-self: flex-start; }
.p-credit.used { color: #475569; background: rgba(100,116,139,.14); }
.p-actions { margin-top: auto; display: flex; gap: 8px; position: relative; z-index: 2; }
.p-compare { font-size: 12px; color: var(--muted); margin-top: 10px; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; position: relative; z-index: 2; align-self: flex-start; }
.p-compare:hover { color: var(--accent); }

/* ===== Бренды ===== */
.brands-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.brand-chip {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; text-align: center;
    box-shadow: var(--shadow-xs); font-family: var(--font-heading); font-weight: 600; font-size: 18px; color: var(--primary);
    transition: transform .18s, box-shadow .18s, border-color .18s;
}
.brand-chip:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--accent); }

/* ===== Каталог: layout с фильтрами ===== */
.catalog-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.filters { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); position: sticky; top: 90px; }
.filter-group { padding: 16px 0; border-bottom: 1px solid var(--border); }
.filter-group:last-child { border-bottom: none; }
.filter-group h4 { font-size: 14px; margin-bottom: 12px; }
.filter-option { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; cursor: pointer; }
.filter-option input { width: 16px; height: 16px; accent-color: var(--accent); }
.price-inputs { display: flex; gap: 8px; align-items: center; }
.price-inputs input { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }

/* Кнопка «Фильтр» и мобильный дровер — по умолчанию скрыты (десктоп) */
.filters-toggle { display: none; }
.filters-head { display: none; }
.filters-apply { display: none; }
.filters-count {
    display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px;
    padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-text);
    font-size: 12px; font-weight: 700;
}
.filters-overlay { display: none; }

.catalog-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.catalog-count { color: var(--muted); font-size: 14px; }
.sort-tabs { display: flex; gap: 4px; background: #fff; border-radius: 8px; padding: 4px; box-shadow: var(--shadow); }
.sort-tabs a { padding: 7px 14px; border-radius: 6px; font-size: 13px; color: var(--muted); }
.sort-tabs a.active { background: var(--primary); color: #fff; }
.products-catalog { grid-template-columns: repeat(3, 1fr); }

/* ===== Пагинация ===== */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 32px 0; }
.pagination a, .pagination span {
    padding: 9px 15px; border-radius: 8px; background: #fff; box-shadow: var(--shadow); font-size: 14px;
}
.pagination .current { background: var(--primary); color: #fff; }

/* ===== Страница товара ===== */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; background: #fff; border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.gallery-main { height: 400px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; }
.gallery-main img { max-height: 100%; object-fit: contain; }
.gallery-main .noimg { font-size: 120px; opacity: .25; }
.gallery-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.gallery-thumbs img { width: 68px; height: 68px; object-fit: contain; border: 2px solid var(--border); border-radius: 8px; padding: 4px; cursor: pointer; }
.gallery-thumbs img.active { border-color: var(--accent); }

.pd-title { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.pd-meta { display: flex; gap: 16px; color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.pd-stock { color: var(--green); font-weight: 600; }
.pd-price-box { background: var(--bg); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.pd-price { font-size: 34px; font-weight: 800; color: var(--primary); }
.pd-oldprice { font-size: 18px; color: var(--muted); text-decoration: line-through; margin-left: 10px; }
.pd-credit { color: var(--green); font-weight: 600; margin-top: 6px; }
.pd-credit.used { color: #475569; }
.pd-variants { margin-bottom: 20px; }
.pd-variants h4 { font-size: 14px; margin-bottom: 10px; }
.variant-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.variant-opt { padding: 8px 16px; border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 14px; }
.variant-opt.active, .variant-opt:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.color-dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; }
.color-dot.active { border-color: var(--accent); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.pd-actions { display: flex; gap: 12px; margin-bottom: 20px; }

.tabs { margin: 40px 0; }
.tab-heads { display: flex; gap: 8px; border-bottom: 2px solid var(--border); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tab-heads::-webkit-scrollbar { display: none; }
.tab-head { padding: 12px 20px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tab-head.active { color: var(--primary); border-bottom-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.specs-table { width: 100%; max-width: 700px; border-collapse: collapse; }
.specs-table tr { border-bottom: 1px solid var(--border); }
.specs-table td { padding: 12px 8px; font-size: 14px; }
.specs-table td:first-child { color: var(--muted); width: 45%; }
.specs-table td:last-child { font-weight: 500; }

.credit-calc { background: var(--bg); border-radius: var(--radius); padding: 20px; max-width: 460px; }
.credit-terms { display: flex; gap: 10px; margin: 14px 0; }
.credit-term { flex: 1; text-align: center; padding: 14px; border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer; }
.credit-term.active { border-color: var(--accent); background: #fff; }
.credit-term b { display: block; font-size: 18px; color: var(--primary); }
.credit-term small { color: var(--muted); }

.review { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.review-head { display: flex; justify-content: space-between; margin-bottom: 8px; }
.review-author { font-weight: 600; }
.stars { color: #f5a623; }

/* ===== Корзина ===== */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.cart-items { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cart-item { display: grid; grid-template-columns: 90px 1fr auto auto auto; gap: 16px; align-items: center; padding: 18px; border-bottom: 1px solid var(--border); }
.cart-item img { max-height: 80px; object-fit: contain; }
.cart-item .noimg { font-size: 40px; opacity: .3; text-align: center; }
.qty { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.qty button { width: 34px; height: 34px; border: none; background: var(--bg); cursor: pointer; font-size: 18px; }
.qty input { width: 44px; text-align: center; border: none; font-size: 15px; }
.cart-summary { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; position: sticky; top: 90px; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; }
.summary-total { font-size: 22px; font-weight: 800; border-top: 2px solid var(--border); padding-top: 14px; margin-top: 8px; }

/* ===== Формы ===== */
.form-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; max-width: 480px; margin: 0 auto; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 15px; outline: none; transition: .15s;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); }
.radio-list { display: flex; flex-direction: column; gap: 10px; }
.radio-opt { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer; }
.radio-opt input { width: auto; }

/* ===== Магазины ===== */
.stores-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.store-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.store-card h3 { font-size: 17px; margin-bottom: 10px; }
.store-card p { color: var(--muted); font-size: 14px; margin-bottom: 6px; }

/* ===== Trade-in / промо ===== */
.info-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; margin-bottom: 20px; }
.promo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.promo-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: .18s; }
.promo-card:hover { box-shadow: var(--shadow-hover); }
.promo-card .promo-body { padding: 20px; }
.promo-card h3 { font-size: 18px; margin-bottom: 8px; }
.promo-thumb { height: 160px; background: linear-gradient(135deg, var(--primary), var(--accent)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 44px; }

/* ===== Подписка ===== */
.subscribe { background: var(--primary); border-radius: var(--radius); padding: 40px; color: #fff; text-align: center; margin: 40px 0; }
.subscribe h2 { font-size: 26px; margin-bottom: 8px; }
.subscribe p { opacity: .85; margin-bottom: 20px; }
.subscribe form { display: flex; gap: 10px; max-width: 480px; margin: 0 auto; }
.subscribe input { flex: 1; padding: 13px 18px; border: none; border-radius: 8px; font-size: 15px; }
.contact-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.contact-btn { display: flex; align-items: center; gap: 12px; padding: 16px 26px; border-radius: 12px; background: #fff; color: var(--primary); text-align: left; transition: .18s; }
.contact-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.contact-btn .cb-ic { font-size: 30px; }
.contact-btn.insta { background: linear-gradient(135deg, #f9ce34, #ee2a7b, #6228d7); color: #fff; }
.contact-btn.whats { background: #25d366; color: #fff; }

/* ===== Футер ===== */
.footer { background: var(--primary); color: #b0c0d0; margin-top: 60px; padding: 48px 0 24px; }
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.footer ul { list-style: none; }
.footer li { margin-bottom: 8px; font-size: 14px; }
.footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 32px; padding-top: 20px; text-align: center; font-size: 13px; }

/* ===== Кнопки покупки на странице товара ===== */
.pd-buy-grid { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 10px; }
.pd-buy-grid .btn { padding: 14px 12px; }
@media (max-width: 520px) { .pd-buy-grid { grid-template-columns: 1fr; } }

/* ===== Модальное окно ===== */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000; display: none;
    align-items: center; justify-content: center; padding: 16px;
    background: rgba(5, 5, 40, .55); backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; animation: fadeIn .2s ease; }
.modal {
    background: #fff; border-radius: var(--radius-lg); padding: 28px; width: 100%; max-width: 440px;
    max-height: 92vh; overflow-y: auto; position: relative; box-shadow: var(--shadow-hover);
    animation: modalUp .25s cubic-bezier(.2, .8, .2, 1);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalUp { from { transform: translateY(24px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close {
    position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border: none;
    background: var(--bg); border-radius: 50%; font-size: 22px; line-height: 1; color: var(--muted);
    cursor: pointer; transition: background .15s, color .15s;
}
.modal-close:hover { background: #ffe8ea; color: var(--danger); }
.modal-title { font-size: 22px; margin-bottom: 4px; padding-right: 30px; }
.modal-sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.modal-note { font-size: 12px; color: var(--muted); text-align: center; margin-top: 10px; }

/* Сегмент-переключатель */
.seg { display: flex; gap: 6px; background: var(--bg); border-radius: 10px; padding: 5px; }
.seg button {
    flex: 1; padding: 10px; border: none; background: transparent; border-radius: 7px;
    font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
}
.seg button.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-xs); }

/* Чипы срока */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    padding: 9px 16px; border: 1.5px solid var(--border); border-radius: 9px; background: #fff;
    font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}
.chip:hover { border-color: var(--primary); }
.chip.active { border-color: var(--primary); background: var(--primary); color: #fff; }

/* Слайдер взноса */
.range { width: 100%; accent-color: var(--primary); margin: 6px 0 2px; height: 6px; cursor: pointer; }
.range-hint { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* Блок результата */
.credit-out {
    background: linear-gradient(135deg, var(--primary-50), #fff); border: 1px solid var(--primary-100);
    border-radius: var(--radius); padding: 18px; text-align: center; margin: 20px 0;
}
.credit-out-label { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.credit-out-value { font-family: var(--font-heading); font-size: 30px; font-weight: 700; color: var(--primary); }
.credit-out-detail { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ===== Утилиты / интерактивность ===== */
.tab-head, .variant-opt, .color-dot, .credit-term, .filter-option, .radio-opt, .sort-tabs a, .qty button, .gallery-thumbs img { cursor: pointer; }
.info-card { transition: box-shadow .2s, transform .2s; }
a.info-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* ===== Сообщения ===== */
.messages { position: fixed; top: 20px; right: 20px; z-index: 1000; }
.msg { background: #fff; box-shadow: var(--shadow-hover); border-radius: 8px; padding: 14px 20px; margin-bottom: 10px; border-left: 4px solid var(--green); animation: slidein .3s; }
.msg.error { border-left-color: #e23; }
@keyframes slidein { from { transform: translateX(120%); } to { transform: translateX(0); } }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .ic { font-size: 64px; margin-bottom: 16px; }

/* ===== Адаптивность ===== */
@media (max-width: 1024px) {
    .products, .products-catalog { grid-template-columns: repeat(3, 1fr); }
    .brands-row { grid-template-columns: repeat(4, 1fr); }
    .hero { grid-template-columns: 1fr; }
    .banner p { max-width: 100%; }
}
@media (max-width: 768px) {
    .products, .products-catalog { grid-template-columns: repeat(2, 1fr); }
    .catalog-layout { grid-template-columns: 1fr; }

    /* Кнопка, открывающая фильтр */
    .filters-toggle {
        display: inline-flex; align-items: center; gap: 8px; width: 100%; justify-content: center;
        padding: 12px 16px; margin-bottom: 16px; background: #fff; border: 1px solid var(--border);
        border-radius: 10px; font-family: var(--font-heading); font-weight: 600; font-size: 15px;
        color: var(--primary); box-shadow: var(--shadow-xs); cursor: pointer;
    }
    .filters-toggle .ic { font-size: 18px; }

    /* Панель фильтров как выезжающий слева дровер */
    .filters {
        position: fixed; top: 0; left: 0; bottom: 0; z-index: 300;
        width: 86%; max-width: 340px; border-radius: 0; margin: 0;
        overflow-y: auto; -webkit-overflow-scrolling: touch;
        transform: translateX(-100%); transition: transform .25s ease; box-shadow: none;
    }
    .filters.open { transform: translateX(0); box-shadow: var(--shadow-md); }

    .filters-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
    .filters-head h3 { font-size: 18px; }
    .filters-close {
        background: none; border: none; font-size: 22px; line-height: 1; color: var(--muted);
        cursor: pointer; padding: 4px 8px;
    }
    .filters-apply { display: block; margin-top: 16px; position: sticky; bottom: 0; }

    .filters-overlay {
        display: block; position: fixed; inset: 0; z-index: 290;
        background: rgba(10,10,40,.45); opacity: 0; visibility: hidden; transition: opacity .25s;
    }
    .filters-overlay.open { opacity: 1; visibility: visible; }
    body.filters-open { overflow: hidden; }
    .product-detail { grid-template-columns: 1fr; }
    .cart-layout { grid-template-columns: 1fr; }
    .footer-cols { grid-template-columns: 1fr 1fr; }
    .stores-grid, .promo-grid { grid-template-columns: 1fr; }
    .search { order: 3; flex-basis: 100%; max-width: 100%; }
    .header .container { flex-wrap: wrap; height: auto; padding: 12px 16px; }
    .menu-toggle { display: flex; }
    .actions-list {
        display: none; position: absolute; top: calc(100% + 10px); right: 0; z-index: 200;
        flex-direction: column; align-items: stretch; gap: 2px; min-width: 200px; padding: 8px;
        background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-md);
    }
    .header-actions.open .actions-list { display: flex; }
    .actions-list .icon-btn {
        flex-direction: row; align-items: center; justify-content: flex-start;
        gap: 12px; padding: 12px 14px; font-size: 15px;
    }
    .actions-list .badge { position: static; margin-left: auto; }
    .topbar-links { display: none; }
    .hero-phone { display: none; }
    .hero-main { flex-direction: column; align-items: flex-start; }

    /* --- Общая мобильная огранка --- */
    h1 { font-size: 24px; }

    /* Баннеры / hero */
    .hero { margin: 12px 0 24px; }
    .banner { padding: 26px 22px; min-height: 200px; }
    .banner h2 { font-size: 27px; }
    .banner p { font-size: 15px; max-width: 100%; }
    .banner-small { min-height: auto; padding: 20px; }

    /* Секции */
    .section { margin: 34px 0; }
    .section-head { margin-bottom: 16px; }
    .section-head h2 { font-size: 21px; }

    /* Страница товара */
    .product-detail { padding: 18px; gap: 22px; }
    .gallery-main { height: 280px; }
    .pd-title { font-size: 21px; }
    .pd-price { font-size: 28px; }
    .pd-meta { flex-wrap: wrap; gap: 8px 14px; }
    .tabs { margin: 28px 0; }
    .credit-calc { max-width: 100%; }
    .credit-term { padding: 12px 8px; }
    .credit-term b { font-size: 16px; }

    /* Модалка */
    .modal { padding: 22px 18px; }
    .modal-title { font-size: 20px; }

    /* Карточки-секции */
    .info-card { padding: 22px 18px; }
    .form-card { padding: 22px 18px; }
    .store-card { padding: 18px; }

    /* Подписка / контакты */
    .subscribe { padding: 28px 20px; margin: 28px 0; }
    .subscribe h2 { font-size: 22px; }
    .subscribe form { flex-direction: column; }
    .contact-btn { width: 100%; }

    /* Футер */
    .footer { padding: 36px 0 20px; margin-top: 40px; }
}
@media (max-width: 480px) {
    .products, .products-catalog, .brands-row { grid-template-columns: 1fr 1fr; }

    /* Товар в корзине: картинка слева, инфо сверху, кол-во+сумма+удалить снизу */
    .cart-item {
        grid-template-columns: 60px 1fr auto;
        column-gap: 12px; row-gap: 10px; padding: 14px; align-items: center;
    }
    .cart-item > :nth-child(1) { grid-column: 1; grid-row: 1 / span 2; align-self: start; }
    .cart-item > :nth-child(2) { grid-column: 2; grid-row: 1; }
    .cart-item > :nth-child(5) { grid-column: 3; grid-row: 1; justify-self: end; }
    .cart-item > :nth-child(3) { grid-column: 2; grid-row: 2; justify-self: start; }
    .cart-item > :nth-child(4) { grid-column: 3; grid-row: 2; justify-self: end; }

    /* Хлебные крошки не должны рвать сетку */
    .breadcrumbs { white-space: normal; word-break: break-word; }

    /* Крупные заголовки калькулятора */
    .credit-out-value { font-size: 26px; }
    .pd-price { font-size: 25px; }
}
