/* ============================================================
   JCB Запчасти — единая дизайн-система
   ============================================================ */

:root {
    --jcb-yellow: #f5b81a;
    --jcb-yellow-dark: #e0a40d;
    --graphite: #1c1c1e;
    --graphite-light: #2c2c2e;
    --bg: #f2f2f0;
    --surface: #ffffff;
    --border: #e3e3e0;
    --text: #1c1c1e;
    --text-muted: #6e6e73;
    --text-light: #9a9a9f;
    --green: #1d9e75;
    --red: #d8483a;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-hover: 0 6px 20px rgba(0,0,0,.10);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.container { flex: 1 0 auto; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- Шапка ---------- */
.site-header {
    background: var(--graphite);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}
.header-center { justify-self: center; }
.callback-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(245,184,26,.12);
    border: 1px solid rgba(245,184,26,.35);
    color: var(--jcb-yellow);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
    white-space: nowrap;
}
.callback-nav-btn:hover { background: rgba(245,184,26,.22); }
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.logo-badge {
    background: var(--jcb-yellow);
    color: var(--graphite);
    font-weight: 800;
    font-size: 18px;
    letter-spacing: .5px;
    padding: 4px 10px;
    border-radius: 6px;
}
.logo-text { color: #f5f5f7; font-size: 16px; font-weight: 600; }

.header-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 14px;
    justify-self: end;
}
.header-nav a, .header-nav span { color: #d0d0d4; transition: color .15s; }
.header-nav a:hover { color: var(--jcb-yellow); }
.header-nav .cart-link { color: var(--jcb-yellow); font-weight: 600; }
.header-nav .user-name { color: #f5f5f7; }
.btn-link {
    background: none; border: none; color: #d0d0d4;
    cursor: pointer; font-size: 14px; padding: 0; font-family: inherit;
}
.btn-link:hover { color: var(--jcb-yellow); }

/* ---------- Контейнер ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 28px 24px; }

h1 { font-size: 26px; font-weight: 700; margin: 0 0 20px; }
h2 { font-size: 20px; font-weight: 700; margin: 0 0 16px; }
h3 { font-size: 16px; font-weight: 600; margin: 0 0 10px; }

/* ---------- Кнопки ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--jcb-yellow);
    color: var(--graphite);
    border: none;
    padding: 11px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s, transform .05s;
}
.btn:hover { background: var(--jcb-yellow-dark); }
.btn:active { transform: scale(.98); }
.btn-block { width: 100%; }
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: #fff; color: var(--text); }

/* ---------- Поиск сверху ---------- */
.search-bar { margin-bottom: 22px; }
.search-wrap { position: relative; }
.search-wrap .icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-light); pointer-events: none; font-size: 18px;
}
.search-wrap input { padding-left: 42px; height: 46px; font-size: 15px; }

/* ---------- Раскладка: панель слева + товары справа ---------- */
.catalog-layout {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 24px;
    align-items: start;
}

/* ---------- Боковая панель фильтров ---------- */
.filter-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: sticky;
    top: 80px;
}
.filter-group { margin-bottom: 20px; }
.filter-group:last-of-type { margin-bottom: 0; }
.filter-group-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 9px;
}
.filter-group select,
.filter-group input[type="number"] { font-size: 14px; }
.price-inputs { display: flex; gap: 8px; }
.price-inputs input { width: 50%; }
.filter-toggle { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; user-select: none; }
.filter-toggle input { width: auto; cursor: pointer; }
.filter-reset {
    border-top: 1px solid var(--border);
    margin-top: 18px;
    padding-top: 16px;
}
.filter-reset a {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-muted); font-size: 14px;
}
.filter-reset a:hover { color: var(--red); }

/* мобильный аккордеон фильтров */
.filter-mobile-toggle { display: none; }
/* на десктопе панель всегда видна, даже если стоит класс collapsed */
@media (min-width: 861px) {
    .filter-sidebar.collapsed { display: block; }
}

input[type="text"], input[type="number"], input[type="email"],
input[type="password"], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--jcb-yellow);
    box-shadow: 0 0 0 3px rgba(245,184,26,.18);
}
.filter-checkbox { display: flex; align-items: center; gap: 7px; font-size: 14px; padding-bottom: 10px; }
.filter-checkbox input { width: auto; }

.search-meta { color: var(--text-muted); margin-bottom: 16px; font-size: 14px; }

/* ---------- Сетка товаров ---------- */
.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow .18s, transform .18s;
    display: flex;
    flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.card-img {
    height: 180px;
    background: #f6f6f4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.card-img .placeholder { color: var(--text-light); font-size: 40px; }
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-art { font-size: 11px; color: var(--text-light); }
.card-title { font-size: 15px; font-weight: 600; line-height: 1.35; margin: 0; }
.card-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 6px; }
.price { font-size: 18px; font-weight: 700; }
.stock-in { font-size: 12px; color: var(--green); display: inline-flex; align-items: center; gap: 3px; }
.stock-out { font-size: 12px; color: var(--text-light); }

/* ---------- Карточка товара ---------- */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
}
.product-gallery .main-img {
    width: 100%;
    height: 380px;
    background: #f6f6f4;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-gallery .main-img img { width: 100%; height: 100%; object-fit: contain; padding: 16px; }
.product-gallery .main-img .placeholder { font-size: 64px; color: var(--text-light); }
.thumbs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.thumbs img { width: 72px; height: 72px; object-fit: cover; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }

.product-info .product-title { font-size: 24px; font-weight: 700; margin: 0 0 16px; }
.spec-row { display: flex; gap: 8px; padding: 7px 0; border-bottom: 1px solid #f0f0ee; font-size: 14px; }
.spec-row .spec-label { color: var(--text-muted); min-width: 150px; }
.spec-row .spec-value { font-weight: 500; }
.product-price { font-size: 32px; font-weight: 800; margin: 20px 0 8px; }
.product-stock { margin-bottom: 20px; font-size: 14px; }
.product-stock.in { color: var(--green); }
.product-stock.out { color: var(--text-light); }
.product-desc { margin-top: 26px; }
.product-desc h3 { border-top: 1px solid var(--border); padding-top: 18px; }

.breadcrumb { margin-bottom: 18px; font-size: 14px; color: var(--text-muted); }
.breadcrumb a:hover { color: var(--jcb-yellow-dark); }

/* ---------- Таблица корзины ---------- */
.cart-table {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    border-collapse: collapse;
    overflow: hidden;
}
.cart-table th {
    text-align: left;
    padding: 14px 16px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    background: #fafafa;
    border-bottom: 1px solid var(--border);
}
.cart-table td { padding: 14px 16px; border-bottom: 1px solid #f0f0ee; font-size: 14px; }
.cart-table tr:last-child td { border-bottom: none; }
.cart-remove { background: none; border: none; color: var(--red); cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.cart-remove:hover { text-decoration: underline; }
.cart-total { text-align: right; margin-top: 22px; font-size: 22px; }
.cart-total strong { font-weight: 800; }
.cart-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 12px; align-items: center; }

/* ---------- Формы (вход/регистрация/заказ) ---------- */
.auth-card {
    max-width: 420px;
    margin: 40px auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
}
.form-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 26px;
}
form p { margin: 0 0 14px; }
form label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 5px; }
.helptext, form ul { font-size: 12px; color: var(--text-light); }
.errorlist { color: var(--red); font-size: 13px; list-style: none; padding: 0; margin: 4px 0; }
.form-switch { margin-top: 16px; font-size: 14px; color: var(--text-muted); }
.form-switch a { color: var(--jcb-yellow-dark); font-weight: 600; }

/* ---------- Оформление заказа ---------- */
.checkout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.order-summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; height: fit-content; }
.order-line { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f0f0ee; font-size: 14px; }
.order-line:last-child { border-bottom: none; }
.order-summary-total { text-align: right; margin-top: 14px; font-size: 18px; }

/* ---------- Страница "заказ оформлен" ---------- */
.success-card {
    max-width: 600px; margin: 50px auto; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 44px; text-align: center;
}
.success-icon {
    width: 64px; height: 64px; border-radius: 50%;
    background: rgba(29,158,117,.12); color: var(--green);
    display: flex; align-items: center; justify-content: center;
    font-size: 34px; margin: 0 auto 18px;
}

/* ---------- Пустое состояние ---------- */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 48px; color: var(--text-light); margin-bottom: 12px; }

/* ---------- Подвал ---------- */
.site-footer {
    background: var(--graphite);
    color: #a0a0a5;
    padding: 30px 24px;
    font-size: 13px;
    flex-shrink: 0;
}
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.site-footer a { color: #d0d0d4; }
.site-footer a:hover { color: var(--jcb-yellow); }

/* ---------- Уведомления (messages) ---------- */
.messages { list-style: none; padding: 0; margin: 0 0 22px; }
.messages li {
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
}
.messages li.success { background: rgba(29,158,117,.10); color: #0f6e56; border-color: rgba(29,158,117,.25); }
.messages li.error { background: rgba(216,72,58,.10); color: #a32d2d; border-color: rgba(216,72,58,.25); }
.messages li.info { background: rgba(55,138,221,.10); color: #185fa5; border-color: rgba(55,138,221,.25); }

/* ---------- Бейдж типа запчасти ---------- */
.part-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}
.part-badge.original { background: rgba(245,184,26,.18); color: #8a6200; }
.part-badge.analog { background: rgba(55,138,221,.14); color: #185fa5; }
.spec-row .part-badge { font-size: 12px; }

/* ---------- Корзина: карточный список ---------- */
.cart-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.cart-items { display: flex; flex-direction: column; gap: 12px; }
.cart-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.cart-item-img {
    width: 76px; height: 76px; flex-shrink: 0;
    background: #f6f6f4; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.cart-item-img .placeholder { color: var(--text-light); font-size: 26px; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 600; font-size: 15px; margin-bottom: 3px; }
.cart-item-name a:hover { color: var(--jcb-yellow-dark); }
.cart-item-art { font-size: 12px; color: var(--text-light); }
.cart-item-qty { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.cart-item-price { text-align: right; flex-shrink: 0; }
.cart-item-sum { font-size: 17px; font-weight: 700; white-space: nowrap; }
.cart-item-unit { font-size: 12px; color: var(--text-light); white-space: nowrap; }
.cart-item-remove {
    background: none; border: none; color: var(--text-light); cursor: pointer;
    font-size: 18px; padding: 6px; flex-shrink: 0; border-radius: 6px; transition: color .15s, background .15s;
}
.cart-item-remove:hover { color: var(--red); background: rgba(216,72,58,.08); }

.cart-summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    position: sticky;
    top: 80px;
}
.cart-summary h3 { margin-bottom: 16px; }
.cart-summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; color: var(--text-muted); }
.cart-summary-total {
    display: flex; justify-content: space-between;
    border-top: 1px solid var(--border); margin-top: 10px; padding-top: 16px;
    font-size: 20px; font-weight: 800; color: var(--text);
}
.cart-summary .btn { margin-top: 18px; }

/* ---------- Адаптив ---------- */
@media (max-width: 860px) {
    .catalog-layout { grid-template-columns: 1fr; }
    .filter-sidebar { position: static; margin-bottom: 4px; }
    .filter-mobile-toggle {
        display: flex; align-items: center; justify-content: space-between;
        width: 100%; background: var(--surface); border: 1px solid var(--border);
        border-radius: var(--radius); padding: 12px 16px; font-size: 15px;
        font-weight: 600; cursor: pointer; font-family: inherit; color: var(--text);
        margin-bottom: 14px;
    }
    .filter-sidebar.collapsed { display: none; }
}

@media (max-width: 760px) {
    .container { padding: 20px 16px; }
    .header-inner { padding: 10px 16px; grid-template-columns: auto auto 1fr; gap: 8px; }
    .logo-text { display: none; }
    .header-nav { gap: 14px; }
    .callback-nav-btn span { display: none; }
    .callback-nav-btn { padding: 8px 10px; }
    .product-detail { grid-template-columns: 1fr; gap: 20px; padding: 18px; }
    .checkout-grid { grid-template-columns: 1fr; }
    .product-gallery .main-img { height: 280px; }
    h1 { font-size: 22px; }
    .cart-wrap { grid-template-columns: 1fr; }
    .cart-summary { position: static; }
    .cart-table thead { display: none; }
    .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; }
    .cart-table tr { border-bottom: 1px solid var(--border); padding: 8px 0; }
    .cart-table td { border: none; padding: 4px 16px; }
    .cart-table td::before { content: attr(data-label); color: var(--text-muted); font-size: 12px; display: block; }
}

/* ============================================================
   Многошаговое оформление заказа
   ============================================================ */
.checkout-wrap { max-width: 720px; margin: 0 auto; }

/* индикатор шагов */
.steps-bar { display: flex; align-items: center; margin-bottom: 28px; }
.step-node { display: flex; align-items: center; gap: 8px; }
.step-circle {
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; flex-shrink: 0;
    background: var(--surface); border: 2px solid var(--border); color: var(--text-light);
    transition: all .2s;
}
.step-label { font-size: 13px; color: var(--text-light); white-space: nowrap; }
.step-line { flex: 1; height: 2px; background: var(--border); margin: 0 10px; transition: background .2s; }
.step-node.active .step-circle { background: var(--jcb-yellow); border-color: var(--jcb-yellow); color: var(--graphite); }
.step-node.active .step-label { color: var(--text); font-weight: 600; }
.step-node.done .step-circle { background: var(--green); border-color: var(--green); color: #fff; }
.step-node.done .step-label { color: var(--text); }

/* карточки шагов */
.step-panel { display: none; }
.step-panel.active { display: block; }
.checkout-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 26px;
}
.checkout-card h3 { font-size: 17px; margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.form-row-single { margin-bottom: 14px; }
.field-label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 5px; }

/* радио-карточки выбора */
.option-cards { display: flex; flex-direction: column; gap: 10px; }
.option-card {
    display: flex; align-items: flex-start; gap: 12px;
    border: 1.5px solid var(--border); border-radius: var(--radius);
    padding: 14px 16px; cursor: pointer; transition: border-color .15s, background .15s;
}
.option-card:hover { border-color: var(--jcb-yellow); }
.option-card input { margin-top: 3px; width: auto; flex-shrink: 0; accent-color: var(--jcb-yellow); }
.option-card.selected { border-color: var(--jcb-yellow); background: rgba(245,184,26,.06); }
.option-card-title { font-weight: 600; font-size: 15px; }
.option-card-desc { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.option-card.disabled { opacity: .45; cursor: not-allowed; }
.option-card.disabled:hover { border-color: var(--border); }

.delivery-extra { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.delivery-note {
    background: rgba(55,138,221,.08); color: #185fa5;
    border-radius: var(--radius); padding: 11px 14px; font-size: 13px;
    margin-top: 12px; display: flex; gap: 8px; align-items: flex-start;
}

/* навигация по шагам */
.step-nav { display: flex; justify-content: space-between; margin-top: 20px; }
.step-nav .btn-ghost:disabled { opacity: .4; cursor: not-allowed; }

/* мини-сводка заказа на шаге оплаты */
.pay-summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; margin-bottom: 18px; }
.pay-summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.pay-total { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; font-size: 20px; font-weight: 800; display: flex; justify-content: space-between; }

@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
    .step-label { display: none; }
    .step-line { margin: 0 6px; }
}

/* ============================================================
   Страница контактов
   ============================================================ */
.contacts-grid {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 26px;
    margin-bottom: 24px;
}
.contact-block { display: flex; gap: 14px; align-items: flex-start; }
.contact-icon {
    width: 42px; height: 42px; flex-shrink: 0;
    border-radius: 50%;
    background: rgba(245,184,26,.16); color: var(--jcb-yellow-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.contact-label { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; font-weight: 600; }
.contact-value { font-size: 15px; line-height: 1.5; }
.contact-value a { color: var(--text); }
.contact-value a:hover { color: var(--jcb-yellow-dark); }

.map-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.map-wrap iframe { display: block; }

/* ============================================================
   Интерактивная галерея товара
   ============================================================ */
.product-gallery .main-img { position: relative; }
.gallery-main-img { display: none; }
.gallery-main-img.active { display: block; width: 100%; height: 100%; object-fit: contain; padding: 16px; }

.gallery-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(28,28,30,.55); color: #fff; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 22px; transition: background .15s;
    z-index: 2;
}
.gallery-arrow:hover { background: rgba(28,28,30,.8); }
.gallery-arrow.prev { left: 12px; }
.gallery-arrow.next { right: 12px; }

.gallery-counter {
    position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
    background: rgba(28,28,30,.6); color: #fff;
    font-size: 12px; padding: 3px 12px; border-radius: 20px; z-index: 2;
}

.gallery-thumb { transition: border-color .15s, opacity .15s; opacity: .65; }
.gallery-thumb:hover { opacity: 1; }
.gallery-thumb.active { border-color: var(--jcb-yellow); opacity: 1; border-width: 2px; }

/* ============================================================
   Выбор пункта выдачи (СДЭК / Яндекс / такси)
   ============================================================ */
.pvz-block { margin-top: 16px; }
.pvz-map {
    width: 100%; height: 340px;
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; background: #eef1ee;
}
.pvz-selected {
    margin-top: 10px; padding: 11px 14px;
    background: rgba(245,184,26,.08); border: 1px solid rgba(245,184,26,.3);
    border-radius: var(--radius); font-size: 14px; font-weight: 500;
}
.pvz-fallback {
    display: flex; align-items: center; justify-content: center;
    height: 100%; color: var(--text-muted); font-size: 14px; text-align: center; padding: 20px;
}
#service-options { margin-bottom: 6px; }

/* ============================================================
   Пункты выдачи: список + iframe-карта
   ============================================================ */
.pvz-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: 14px; }
.pvz-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.pvz-item {
    text-align: left; background: var(--surface);
    border: 1.5px solid var(--border); border-radius: var(--radius);
    padding: 11px 14px; font-size: 14px; cursor: pointer;
    font-family: inherit; color: var(--text); transition: border-color .15s, background .15s;
}
.pvz-item:hover { border-color: var(--jcb-yellow); }
.pvz-item.selected { border-color: var(--jcb-yellow); background: rgba(245,184,26,.08); font-weight: 600; }
.pvz-map-frame { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.pvz-map-frame iframe { display: block; }
.pvz-selected {
    padding: 11px 14px; background: rgba(245,184,26,.08);
    border: 1px solid rgba(245,184,26,.3); border-radius: var(--radius);
    font-size: 14px; font-weight: 500;
}
@media (max-width: 640px) {
    .pvz-layout { grid-template-columns: 1fr; }
    .pvz-list { max-height: 200px; }
}

/* ============================================================
   Автоподсказки адреса (DaData)
   ============================================================ */
.suggest-wrap { position: relative; }
.suggest-box {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    max-height: 240px; overflow-y: auto;
    margin-top: 4px;
}
.suggest-item {
    padding: 10px 14px; font-size: 14px; cursor: pointer;
    border-bottom: 1px solid #f2f2f0;
}
.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover { background: rgba(245,184,26,.1); }

/* ============================================================
   Личный кабинет
   ============================================================ */
.cabinet-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; }
.cabinet-nav {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 12px; position: sticky; top: 80px;
}
.cabinet-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; border-radius: var(--radius); font-size: 14px;
    color: var(--text); transition: background .15s;
}
.cabinet-nav a:hover { background: var(--bg); }
.cabinet-nav a.active { background: rgba(245,184,26,.14); color: var(--jcb-yellow-dark); font-weight: 600; }
.cabinet-nav a.logout { color: var(--red); }
.cabinet-nav a.logout:hover { background: rgba(216,72,58,.08); }
.cabinet-nav .divider { height: 1px; background: var(--border); margin: 8px 0; }

.cabinet-content { min-width: 0; }
.cab-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.cab-stat {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px;
}
.cab-stat .num { font-size: 30px; font-weight: 800; }
.cab-stat .lbl { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* карточки заказов */
.order-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 14px;
    transition: box-shadow .15s;
}
.order-card:hover { box-shadow: var(--shadow-hover); }
.order-card-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.order-num { font-size: 16px; font-weight: 700; }
.order-date { font-size: 13px; color: var(--text-muted); }
.order-status {
    font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 20px;
}
.status-new { background: rgba(55,138,221,.14); color: #185fa5; }
.status-processing { background: rgba(245,184,26,.18); color: #8a6200; }
.status-shipped { background: rgba(120,80,220,.14); color: #6b3fb0; }
.status-done { background: rgba(29,158,117,.14); color: #0f6e56; }
.status-canceled { background: rgba(216,72,58,.12); color: #a32d2d; }
.order-card-body { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.order-items-preview { font-size: 14px; color: var(--text-muted); }
.order-card-total { font-size: 18px; font-weight: 700; }
.paid-badge { font-size: 12px; color: var(--green); }
.unpaid-badge { font-size: 12px; color: var(--text-light); }

.order-detail-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.order-detail-table th { text-align: left; padding: 12px 16px; font-size: 13px; color: var(--text-muted); background: #fafafa; }
.order-detail-table td { padding: 12px 16px; border-top: 1px solid #f0f0ee; font-size: 14px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 20px; }
.info-item .info-label { font-size: 12px; color: var(--text-muted); margin-bottom: 3px; }
.info-item .info-val { font-size: 15px; }

@media (max-width: 760px) {
    .cabinet-layout { grid-template-columns: 1fr; }
    .cabinet-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
    .cabinet-nav a { flex: 1; justify-content: center; }
    .cabinet-nav .divider { display: none; }
}

/* ============================================================
   Модальное окно «Обратный звонок»
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(28,28,30,.55);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 30px;
    max-width: 380px;
    width: 100%;
    position: relative;
}
.modal-close {
    position: absolute; top: 14px; right: 14px;
    background: none; border: none; cursor: pointer;
    font-size: 22px; color: var(--text-light); line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-box h3 { margin-bottom: 6px; }
.modal-box .modal-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 18px; }
