/* ═══════════════════════════════════════════════════════════════
   КВАРТАЛ ДОСТАВКА — Design System v2
   Стиль: современный, чистый, мобильный фаст-фуд / продуктовый
═══════════════════════════════════════════════════════════════ */

/* ── Токены ──────────────────────────────────────────────── */
:root {
    --green:      #25C35A;
    --green-dark: #1aa348;
    --green-soft: #e8f8ee;
    --dark:       #111111;
    --dark2:      #1f1f1f;
    --mid:        #6b7280;
    --line:       #f0f0f0;
    --bg:         #f7f8fa;
    --white:      #ffffff;
    --red:        #ef4444;
    --gold:       #f59e0b;

    --r-xs: 8px;
    --r-sm: 14px;
    --r-md: 20px;
    --r-lg: 28px;
    --r-xl: 40px;

    --shadow-xs: 0 1px 4px rgba(0,0,0,0.06);
    --shadow-sm: 0 2px 12px rgba(0,0,0,0.07);
    --shadow-md: 0 8px 32px rgba(0,0,0,0.10);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.14);

    --ease: cubic-bezier(.4,0,.2,1);
}

/* ── Сброс ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--dark);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Скроллбар ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ddd; border-radius: 10px; }


/* ═══════════════════════════════════════════════════════════
   ТОП-БАР
═══════════════════════════════════════════════════════════ */
.top-bar {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    z-index: 1000;
    position: sticky;
    top: 0;
}
.top-bar-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    max-width: 1280px;
    margin: 0 auto;
}

.top-bar-logo {
    font-size: 17px;
    font-weight: 800;
    color: var(--dark);
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: -0.5px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}
.top-bar-logo span {
    color: var(--green);
}

/* Поиск */
.top-bar-search {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}
.top-bar-search-icon {
    position: absolute;
    left: 13px;
    color: var(--mid);
    font-size: 14px;
    pointer-events: none;
}
.top-bar-search-input {
    width: 100%;
    border: 1.5px solid var(--line);
    border-radius: var(--r-xl);
    padding: 9px 36px 9px 36px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg);
    color: var(--dark);
    outline: none;
    transition: border-color .15s, background .15s;
}
.top-bar-search-input::placeholder { color: #b0b7c3; }
.top-bar-search-input:focus {
    border-color: var(--dark);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(17,17,17,0.06);
}
.top-bar-search-clear {
    position: absolute;
    right: 8px;
    background: #e5e7eb;
    border: none;
    border-radius: 50%;
    color: var(--mid);
    font-size: 13px;
    cursor: pointer;
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    transition: background .12s;
}
.top-bar-search-clear:hover { background: #d1d5db; }

/* Кнопки десктоп */
.top-bar-profile-btn,
.top-bar-bell-btn,
.top-bar-cart-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    border: 1.5px solid var(--line);
    background: var(--white);
    border-radius: var(--r-xl);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all .15s;
    color: var(--dark);
}
.top-bar-profile-btn:hover { border-color: var(--dark); }
.top-bar-cart-btn {
    background: var(--dark);
    color: var(--white);
    border-color: var(--dark);
}
.top-bar-cart-btn:hover { background: var(--dark2); }
.top-bar-cart-badge {
    background: var(--red);
    color: #fff;
    border-radius: 20px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    min-width: 18px;
    text-align: center;
}


/* ═══════════════════════════════════════════════════════════
   НИЖНЕЕ МЕНЮ
═══════════════════════════════════════════════════════════ */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 64px;
    background: var(--white);
    border-top: 1px solid var(--line);
    display: flex;
    z-index: 1100;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    color: #b0b7c3;
    font-size: 10px;
    font-weight: 600;
    font-family: inherit;
    padding: 6px 4px;
    border-radius: var(--r-sm);
    transition: color .15s;
    letter-spacing: 0.1px;
    position: relative;
}
.bottom-nav-btn i {
    font-size: 20px;
    line-height: 1;
    transition: transform .15s var(--ease);
}
.bottom-nav-btn.active {
    color: var(--dark);
}
.bottom-nav-btn.active i {
    transform: scale(1.1);
}

/* Индикатор активного таба — зелёная точка */
.bottom-nav-btn.active::before {
    content: '';
    position: absolute;
    top: 4px;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--green);
}

/* Корзина в нижнем меню */
.cart-nav-icon-wrap { position: relative; display: inline-block; }
.cart-nav-badge {
    position: absolute;
    top: -6px; right: -10px;
    background: var(--red);
    color: #fff;
    border-radius: 20px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 1.5px solid var(--white);
}

/* Мобильный отступ снизу */
@media (max-width: 767px) {
    body { padding-bottom: 64px; }
}


/* ═══════════════════════════════════════════════════════════
   ГЕРОЙ
═══════════════════════════════════════════════════════════ */
.hero-banner {
    background: linear-gradient(135deg, var(--dark) 0%, #1a2a1a 100%);
    padding: 32px 0 28px;
    position: relative;
    overflow: hidden;
}
.hero-banner::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 260px; height: 260px;
    background: radial-gradient(circle, rgba(37,195,90,.18) 0%, transparent 70%);
    pointer-events: none;
}
.hero-banner::after {
    content: '';
    position: absolute;
    bottom: -40px; left: -40px;
    width: 180px; height: 180px;
    background: radial-gradient(circle, rgba(37,195,90,.1) 0%, transparent 70%);
    pointer-events: none;
}

.hero-title {
    font-size: 30px;
    font-weight: 800;
    color: var(--white);
    line-height: 1.18;
    letter-spacing: -0.8px;
    margin-bottom: 8px;
}
.hero-title span { color: var(--green); }

.hero-subtitle {
    font-size: 14px;
    color: rgba(255,255,255,.55);
    margin-bottom: 16px;
    font-weight: 400;
}

.hero-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.hero-badge {
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.85);
    border-radius: var(--r-xl);
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.12);
}

@media (max-width: 576px) {
    .hero-title { font-size: 24px; }
    .hero-banner { padding: 24px 0 20px; }
}


/* ═══════════════════════════════════════════════════════════
   КАТЕГОРИИ — сетка карточек
═══════════════════════════════════════════════════════════ */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 576px)  { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 992px)  { .cat-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .cat-grid { grid-template-columns: repeat(5, 1fr); } }

.cat-card {
    position: relative;
    border-radius: var(--r-md);
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
    animation: catFadeIn .18s ease forwards;
    box-shadow: var(--shadow-sm);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.cat-card:active { transform: scale(.97); }

.cat-card-bg {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.cat-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(0,0,0,.62) 100%);
}
.cat-card-emoji {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    font-size: 44px;
    line-height: 1;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,.25));
}
.cat-card-info {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 10px 13px;
}
.cat-card-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
    letter-spacing: -0.2px;
}
.cat-card-count {
    font-size: 11px;
    color: rgba(255,255,255,.65);
    margin-top: 2px;
    font-weight: 500;
}

@keyframes catFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}


/* ═══════════════════════════════════════════════════════════
   ШАПКА СТРАНИЦЫ КАТЕГОРИИ
═══════════════════════════════════════════════════════════ */
.cat-page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 0 8px;
}
.cat-page-back {
    width: 40px; height: 40px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
    text-decoration: none;
    box-shadow: var(--shadow-xs);
    flex-shrink: 0;
    font-size: 17px;
    transition: background .12s;
}
.cat-page-back:hover { background: var(--line); color: var(--dark); }
.cat-page-title { font-size: 20px; font-weight: 800; letter-spacing: -0.4px; }
.cat-page-count { font-size: 13px; color: var(--mid); margin-top: 1px; }

/* Поиск в категории */
.cat-search-bar {
    margin-bottom: 16px;
}
.cat-search-bar .input-group { border-radius: var(--r-xl); overflow: hidden; }
.cat-search-bar .input-group-text {
    background: var(--white);
    border: 1.5px solid var(--line);
    border-right: none;
    border-radius: var(--r-xl) 0 0 var(--r-xl) !important;
    padding: 0 14px;
    color: var(--mid);
}
.cat-search-bar .form-control {
    border: 1.5px solid var(--line);
    border-left: none;
    border-radius: 0 var(--r-xl) var(--r-xl) 0 !important;
    font-size: 14px;
    padding: 10px 12px;
    background: var(--white);
    box-shadow: none;
    font-family: inherit;
}
.cat-search-bar .form-control:focus {
    box-shadow: none;
    border-color: var(--dark);
}
.cat-search-bar .btn {
    border: 1.5px solid var(--line);
    border-left: none;
    border-radius: 0 var(--r-xl) var(--r-xl) 0 !important;
    background: var(--white);
    color: var(--mid);
    padding: 0 14px;
}


/* ═══════════════════════════════════════════════════════════
   КАРТОЧКИ ТОВАРОВ
═══════════════════════════════════════════════════════════ */
.product-card {
    background: var(--white);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    cursor: pointer;
    transition: box-shadow .2s var(--ease), transform .2s var(--ease);
    animation: fadeIn .2s ease forwards;
    border: 1px solid var(--line);
}
.product-card:active { transform: scale(.98); }

.product-image-wrapper {
    position: relative;
    background: #f8f9fa;
    aspect-ratio: 1;
    overflow: hidden;
}
.product-image {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
    padding: 8px;
    transition: transform .3s var(--ease);
}
.product-card:hover .product-image { transform: scale(1.04); }

.product-badge {
    position: absolute;
    top: 8px; left: 8px;
    background: var(--red);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: var(--r-xl);
    letter-spacing: 0.2px;
}

.product-info {
    padding: 10px 10px 12px;
}
.product-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--dark);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-price {
    font-size: 16px;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.3px;
}
.product-unit {
    font-size: 11px;
    color: var(--mid);
    font-weight: 400;
    letter-spacing: 0;
}

/* Кнопки на карточке */
.card-fav-btn {
    flex-shrink: 0;
    width: 36px; height: 36px;
    border: 1.5px solid var(--line);
    background: var(--white);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #d1d5db;
    font-size: 14px;
    transition: all .15s;
}
.card-fav-btn.active { color: var(--red); border-color: #fecaca; background: #fff5f5; }
.card-fav-btn:active { transform: scale(.88); }

.card-add-btn {
    flex: 1;
    background: var(--dark);
    color: var(--white);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    min-height: 36px;
    transition: background .15s;
    user-select: none;
    border: none;
}
.card-add-btn:active { background: var(--dark2); transform: scale(.96); }

.card-qty-ctrl {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--green-soft);
    border-radius: var(--r-sm);
    overflow: hidden;
    min-height: 36px;
    border: 1.5px solid var(--green);
}
.card-qty-btn {
    background: none;
    border: none;
    width: 34px;
    height: 36px;
    font-size: 17px;
    color: var(--green-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
    transition: background .12s;
}
.card-qty-btn:active { background: rgba(37,195,90,.15); }
.card-qty-num {
    font-weight: 800;
    font-size: 14px;
    color: var(--green-dark);
    min-width: 20px;
    text-align: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}


/* ═══════════════════════════════════════════════════════════
   КОРЗИНА (боковая панель)
═══════════════════════════════════════════════════════════ */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 2000;
    backdrop-filter: blur(2px);
}
.cart-panel {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 100%;
    max-width: 420px;
    background: var(--white);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    z-index: 2001;
    transform: translateX(110%);
    transition: transform .3s var(--ease);
}
.cart-panel.open {
    transform: translateX(0);
}
.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 16px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}
.cart-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
}
.cart-close-btn {
    background: var(--bg);
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: var(--mid);
    transition: background .12s;
}
.cart-close-btn:hover { background: var(--line); }

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}
.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    transition: background .1s;
}
.cart-item:hover { background: var(--bg); }
.cart-item-img {
    width: 56px; height: 56px;
    border-radius: var(--r-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg);
}
.cart-item-body { flex: 1; min-width: 0; }
.cart-item-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cart-item-price { font-size: 13px; color: var(--mid); margin-top: 2px; }
.cart-item-total { font-size: 15px; font-weight: 800; flex-shrink: 0; }

/* Управление количеством в корзине */
.cart-qty {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    flex-shrink: 0;
}
.cart-qty-btn {
    background: none;
    border: none;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: var(--dark);
    font-weight: 700;
    transition: background .1s;
}
.cart-qty-btn:active { background: var(--line); }
.cart-qty-num {
    font-size: 13px;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
    color: var(--dark);
}

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 12px;
    color: var(--mid);
    padding: 40px 24px;
    text-align: center;
}
.cart-empty i { font-size: 52px; color: #e5e7eb; }
.cart-empty h5 { font-size: 17px; font-weight: 700; color: var(--dark); }
.cart-empty p { font-size: 14px; }

.cart-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--line);
    flex-shrink: 0;
    background: var(--white);
}
.cart-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--mid);
    margin-bottom: 6px;
}
.cart-footer-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 14px;
    letter-spacing: -0.3px;
}
.cart-delivery-free {
    font-size: 12px;
    color: var(--green-dark);
    font-weight: 600;
    background: var(--green-soft);
    border-radius: var(--r-xl);
    padding: 4px 12px;
    display: inline-block;
    margin-bottom: 12px;
}
.cart-delivery-bar {
    height: 4px;
    background: var(--line);
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
}
.cart-delivery-bar-fill {
    height: 100%;
    background: var(--green);
    border-radius: 10px;
    transition: width .4s var(--ease);
}

/* Кнопки корзины */
.btn-checkout {
    width: 100%;
    background: var(--dark);
    color: var(--white);
    border: none;
    border-radius: var(--r-md);
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: -0.2px;
    transition: background .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-checkout:hover { background: var(--dark2); }
.btn-checkout:disabled { opacity: .5; cursor: not-allowed; }

.btn-clear-cart {
    width: 100%;
    background: none;
    border: none;
    color: var(--mid);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    margin-top: 10px;
    padding: 6px;
    transition: color .12s;
}
.btn-clear-cart:hover { color: var(--red); }


/* ═══════════════════════════════════════════════════════════
   BOOTSTRAP КНОПКИ (сохраняем совместимость)
═══════════════════════════════════════════════════════════ */
.btn {
    border-radius: var(--r-xl);
    padding: 10px 22px;
    font-weight: 600;
    font-family: inherit;
    transition: all .15s var(--ease);
    border: none;
    font-size: 14px;
}
.btn-success {
    background: var(--green);
    color: var(--white);
}
.btn-success:hover { background: var(--green-dark); color: var(--white); }
.btn-outline-success {
    border: 1.5px solid var(--green) !important;
    color: var(--green);
    background: transparent;
}
.btn-outline-success:hover { background: var(--green); color: var(--white); }
.btn-outline-secondary {
    border: 1.5px solid var(--line) !important;
    color: var(--mid);
    background: var(--white);
}
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-sm { padding: 6px 14px; font-size: 12px; }


/* ═══════════════════════════════════════════════════════════
   МОДАЛЬНОЕ ОКНО ТОВАРА
═══════════════════════════════════════════════════════════ */
.modal-content {
    border: none;
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--white);
}
.modal-body { padding: 20px; }

.product-gallery {
    background: var(--bg);
    border-radius: var(--r-md);
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 340px;
}

@media (max-width: 767px) {
    .product-gallery { height: 260px; }
}

/* ── Свайп-слайдер ─────────────────────────── */
.swipe-slider {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    cursor: grab;
    user-select: none;
}
.swipe-slider:active { cursor: grabbing; }

.swipe-track {
    display: flex;
    height: 100%;
    transition: transform .28s var(--ease);
    will-change: transform;
}

.swipe-slide {
    min-width: 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    flex-shrink: 0;
    overflow: hidden;
}
.swipe-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    pointer-events: none;
    padding: 16px;
}

/* Точки-индикаторы слайдера */
.swipe-dots {
    position: absolute;
    bottom: 10px;
    left: 0; right: 0;
    display: flex;
    justify-content: center;
    gap: 5px;
    pointer-events: none;
}
.swipe-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(0,0,0,.2);
    transition: all .2s;
}
.swipe-dot.active {
    background: var(--dark);
    width: 18px;
    border-radius: 3px;
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.gallery-thumb {
    width: 56px; height: 56px;
    object-fit: cover;
    border-radius: var(--r-sm);
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
    opacity: .7;
    transition: all .12s;
}
.gallery-thumb:hover,
.gallery-thumb.active { border-color: var(--dark); opacity: 1; }

.product-detail-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 20px;
}
.price-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -1.5px;
}
.price-unit { font-size: 15px; color: var(--mid); }

.product-category-badge {
    display: inline-block;
    background: var(--green-soft);
    color: var(--green-dark);
    padding: 5px 14px;
    border-radius: var(--r-xl);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 14px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--line);
    border-radius: var(--r-xl);
    overflow: hidden;
    width: 130px;
    background: var(--white);
}
.quantity-btn {
    width: 40px; height: 40px;
    border: none;
    background: transparent;
    font-size: 20px;
    font-weight: 400;
    cursor: pointer;
    transition: background .12s;
    color: var(--dark);
    display: flex; align-items: center; justify-content: center;
}
.quantity-btn:hover { background: var(--bg); }
.quantity-input {
    width: 50px; height: 40px;
    border: none;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    font-family: inherit;
    background: transparent;
}
.quantity-input:focus { outline: none; }
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Индикатор наличия */
.stock-indicator {
    padding: 10px 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: var(--r-sm);
}
.stock-high  { color: var(--green-dark); }
.stock-medium { color: #d97706; }
.stock-low   { color: var(--red); }
.stock-out   { color: var(--mid); }

.delivery-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    margin-top: 16px;
}
.delivery-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--mid);
    font-weight: 500;
}
.delivery-item i { color: var(--green); font-size: 15px; flex-shrink: 0; }

@media (max-width: 768px) {
    .modal-dialog { margin: 8px; }
    .modal-content { border-radius: var(--r-md); }
    .modal-body .row { display: flex; flex-direction: column; margin: 0; }
    .modal-body .col-md-6 { width: 100%; padding: 0; }
    .product-gallery { margin-bottom: 16px; max-height: 260px; }
    .gallery-main { max-height: 240px; }
    .price-value { font-size: 28px; }
    .quantity-selector { width: 120px; }
}


/* ═══════════════════════════════════════════════════════════
   ЧЕКАУТ
═══════════════════════════════════════════════════════════ */
.form-control, .form-select {
    border: 1.5px solid var(--line);
    border-radius: var(--r-sm);
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--dark);
    background: var(--white);
    transition: border-color .15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--dark);
    box-shadow: 0 0 0 3px rgba(17,17,17,.06);
    outline: none;
}
.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 5px;
    display: block;
}


/* ═══════════════════════════════════════════════════════════
   ПОИСК (input-group совместимость)
═══════════════════════════════════════════════════════════ */
.input-group {
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}
.input-group-text {
    background: var(--white);
    border: 1.5px solid var(--line);
    border-right: none;
    border-radius: var(--r-xl) 0 0 var(--r-xl) !important;
    padding: 0 16px;
    color: var(--mid);
}
.input-group .form-control {
    border-left: none;
    border-radius: 0 var(--r-xl) var(--r-xl) 0 !important;
    box-shadow: none;
}


/* ═══════════════════════════════════════════════════════════
   ИСТОРИЯ ЗАКАЗОВ (блок в профиле)
═══════════════════════════════════════════════════════════ */
.order-history-card {
    background: var(--bg);
    border-radius: var(--r-sm);
    padding: 14px;
    border: 1px solid var(--line);
}


/* ═══════════════════════════════════════════════════════════
   СТАТУСЫ ЗАКАЗОВ
═══════════════════════════════════════════════════════════ */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--r-xl);
    font-size: 12px;
    font-weight: 600;
}
.status-new         { background: #fff7ed; color: #c2410c; }
.status-confirmed   { background: #eff6ff; color: #1d4ed8; }
.status-assembling  { background: #faf5ff; color: #7c3aed; }
.status-delivering  { background: var(--green-soft); color: var(--green-dark); }
.status-completed   { background: #f0fdf4; color: #15803d; }
.status-cancelled   { background: #fef2f2; color: #b91c1c; }



/* ═══════════════════════════════════════════════════════════
   АДАПТИВ — общее
═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .container { padding-left: 16px; padding-right: 16px; }
}

.navbar { display: none; } /* Bootstrap navbar скрыт — используем top-bar */
.cart-badge { display: none; } /* старый badge не нужен */


/* ═══════════════════════════════════════════════════════════
   ЛИЧНЫЙ КАБИНЕТ
═══════════════════════════════════════════════════════════ */

/* Кнопка профиль в шапке */
.profile-nav-btn { font-size: 14px; }

/* Overlay + Panel */
.profile-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 2500;
    display: flex;
    justify-content: flex-end;
    backdrop-filter: blur(3px);
}
.profile-panel {
    width: 100%;
    max-width: 420px;
    height: 100%;
    background: var(--white);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

/* Vue transitions */
.profile-slide-enter-active { transition: transform .28s cubic-bezier(.4,0,.2,1); }
.profile-slide-leave-active { transition: transform .22s cubic-bezier(.4,0,.2,1); }
.profile-slide-enter-from,
.profile-slide-leave-to { transform: translateX(100%); }

/* Шапка панели */
.profile-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--dark);
    color: var(--white);
    flex-shrink: 0;
}
.profile-panel-title { font-weight: 800; font-size: 16px; letter-spacing: -0.2px; }
.profile-close-btn {
    background: rgba(255,255,255,.12);
    border: none;
    border-radius: 50%;
    color: var(--white);
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    cursor: pointer;
    transition: background .15s;
}
.profile-close-btn:hover { background: rgba(255,255,255,.2); }

/* Авторизация */
.profile-auth { padding: 24px; overflow-y: auto; flex: 1; }
.auth-tabs {
    display: flex;
    gap: 0;
    border: 1.5px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    margin-bottom: 24px;
}
.auth-tab {
    flex: 1; padding: 11px 0;
    background: none; border: none;
    font-weight: 700; font-size: 14px;
    color: var(--mid);
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
}
.auth-tab.active { background: var(--dark); color: var(--white); }
.auth-error {
    color: #b91c1c;
    font-size: 13px;
    background: #fef2f2;
    border-radius: var(--r-sm);
    padding: 10px 14px;
    margin-bottom: 16px;
    border: 1px solid #fecaca;
}
.auth-form { display: flex; flex-direction: column; gap: 6px; }
.auth-label { font-size: 13px; font-weight: 600; color: var(--dark); margin-bottom: 2px; }
.auth-input {
    border: 1.5px solid var(--line);
    border-radius: var(--r-sm);
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
    margin-bottom: 6px;
    color: var(--dark);
    background: var(--white);
}
.auth-input:focus { border-color: var(--dark); box-shadow: 0 0 0 3px rgba(17,17,17,.06); }
.auth-submit {
    background: var(--dark); color: var(--white);
    border: none; border-radius: var(--r-md);
    padding: 14px; font-size: 15px;
    font-weight: 700; font-family: inherit;
    cursor: pointer; margin-top: 8px;
    transition: background .15s;
    display: flex; align-items: center; justify-content: center;
    flex: 2;
}
.auth-submit:hover:not(:disabled) { background: var(--dark2); }
.auth-submit:disabled { opacity: .55; cursor: not-allowed; }
.auth-switch { text-align: center; font-size: 13px; color: var(--mid); margin-top: 14px; }
.auth-switch a { color: var(--dark); font-weight: 700; cursor: pointer; text-decoration: underline; }

/* Кабинет */
.profile-cabinet { display: flex; flex-direction: column; flex: 1; overflow: hidden; }

.profile-user-block {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}
.profile-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--dark);
    color: var(--white);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 800;
    flex-shrink: 0;
}
.profile-user-info { flex: 1; min-width: 0; }
.profile-user-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.profile-user-phone { font-size: 13px; color: var(--mid); margin-top: 2px; }
.profile-edit-btn { background: none; border: none; color: var(--mid); font-size: 12px; cursor: pointer; padding: 2px 4px; }
.profile-edit-btn:hover { color: var(--dark); }
.profile-name-edit { display: flex; align-items: center; gap: 6px; }
.profile-name-input { border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 5px 10px; font-size: 14px; flex: 1; outline: none; font-family: inherit; }
.profile-name-input:focus { border-color: var(--dark); }
.profile-save-btn { background: var(--dark); color: var(--white); border: none; border-radius: var(--r-sm); padding: 5px 12px; cursor: pointer; font-size: 14px; font-family: inherit; }
.profile-cancel-btn { background: none; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 5px 10px; cursor: pointer; font-size: 14px; color: var(--mid); font-family: inherit; }
.profile-logout-btn {
    background: none; border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 8px 12px; cursor: pointer;
    color: var(--mid); font-size: 16px; flex-shrink: 0;
    transition: all .15s;
}
.profile-logout-btn:hover { border-color: var(--red); color: var(--red); }

/* Табы кабинета */
.profile-tabs { display: flex; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.profile-tab {
    flex: 1; padding: 12px 4px;
    background: none; border: none;
    font-size: 12px; font-weight: 700;
    color: var(--mid); cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all .15s;
    display: flex; align-items: center; justify-content: center; gap: 5px;
    font-family: inherit;
    letter-spacing: 0.1px;
}
.profile-tab.active { color: var(--dark); border-bottom-color: var(--dark); }
.profile-tab i { font-size: 16px; }

/* Контент */
.profile-content { flex: 1; overflow-y: auto; padding: 14px 14px 24px; }
.profile-loading { display: flex; justify-content: center; padding: 40px 0; }
.profile-empty {
    text-align: center; padding: 40px 20px;
    color: var(--mid);
    display: flex; flex-direction: column;
    align-items: center; gap: 10px;
}
.profile-empty i { font-size: 2.5rem; color: #e5e7eb; }

/* Карточка заказа */
.order-card {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 14px;
    margin-bottom: 10px;
}
.order-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.order-num { font-weight: 800; font-size: 14px; margin-right: 8px; }
.order-status { font-size: 11px; font-weight: 700; border-radius: var(--r-xl); padding: 3px 10px; }
.os-new         { background: #fff7ed; color: #c2410c; }
.os-confirmed   { background: #eff6ff; color: #1d4ed8; }
.os-assembling  { background: #faf5ff; color: #7c3aed; }
.os-delivering  { background: var(--green-soft); color: var(--green-dark); }
.os-completed   { background: #f0fdf4; color: #15803d; }
.os-cancelled   { background: #fef2f2; color: #b91c1c; }
.order-date { font-size: 12px; color: var(--mid); }
.order-items-preview { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.order-item-chip {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    padding: 3px 10px;
    font-size: 12px;
    color: var(--dark);
}
.order-item-chip.more { color: var(--mid); }
.order-card-foot { display: flex; justify-content: space-between; align-items: center; }
.order-total { font-weight: 800; font-size: 16px; letter-spacing: -0.3px; }
.order-repeat-btn {
    background: var(--dark); color: var(--white);
    border: none; border-radius: var(--r-xl);
    padding: 7px 16px; font-size: 13px;
    font-weight: 700; font-family: inherit;
    cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    transition: background .15s;
}
.order-repeat-btn:hover { background: var(--dark2); }

/* ── Прогресс статуса в карточке заказа ── */
.order-progress {
    display: flex; align-items: center;
    margin: 10px 0 4px; gap: 0;
}
.op-step {
    display: flex; flex-direction: column; align-items: center;
    flex: 1; position: relative; font-size: 10px; color: #bbb;
    font-weight: 600; gap: 4px; transition: color .3s;
}
.op-step.done   { color: var(--green-dark); }
.op-step.active { color: var(--primary); }
.op-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #ddd; transition: background .3s; z-index: 1; flex-shrink: 0;
}
.op-step.done   .op-dot { background: var(--green-dark); }
.op-step.active .op-dot { background: var(--primary); box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.op-step::before {
    content: '';
    position: absolute; top: 5px; right: calc(50% + 5px);
    left: calc(-50% + 5px);
    height: 2px; background: #ddd; transition: background .3s;
}
.op-step:first-child::before { display: none; }
.op-step.done::before  { background: var(--green-dark); }
.op-step.active::before { background: var(--primary); }

/* ── Баннер активного заказа (фиксированный снизу) ── */
.active-order-banner {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; border-top: 2px solid var(--primary);
    padding: 12px 16px 16px;
    box-shadow: 0 -4px 24px rgba(0,0,0,.1);
    z-index: 50; cursor: pointer;
    transition: transform .3s cubic-bezier(.4,0,.2,1);
}
@media (min-width: 640px) {
    .active-order-banner { max-width: 480px; left: 50%; transform: translateX(-50%) translateY(0) !important; border-radius: 16px 16px 0 0; }
}
.aob-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px;
}
.aob-title { font-size: 14px; font-weight: 800; color: var(--dark); display: flex; align-items: center; gap: 6px; }
.aob-hint  { font-size: 11px; color: var(--mid); }
.aob-steps {
    display: flex; align-items: flex-start; gap: 0;
}
.aob-step {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; gap: 5px; position: relative;
    font-size: 10px; font-weight: 700; color: #ccc;
    text-align: center; transition: color .3s;
}
.aob-step.done    { color: var(--green-dark); }
.aob-step.active  { color: var(--primary); }
.aob-icon {
    font-size: 18px; line-height: 1;
    filter: grayscale(1) opacity(.35);
    transition: filter .3s;
}
.aob-step.done   .aob-icon { filter: none; }
.aob-step.active .aob-icon { filter: none; }
.aob-line {
    position: absolute; top: 9px;
    left: calc(50% + 14px); right: calc(-50% + 14px);
    height: 2px; background: #e5e7eb; transition: background .3s;
}
.aob-step.done .aob-line { background: var(--green-dark); }
.aob-step:last-child .aob-line { display: none; }

/* slide-up transition для баннера */
.aob-enter-active { transition: transform .3s cubic-bezier(.4,0,.2,1); }
.aob-leave-active { transition: transform .25s cubic-bezier(.4,0,.2,1); }
.aob-enter-from, .aob-leave-to { transform: translateY(100%); }

/* Избранное */
.fav-add-all-btn {
    width: 100%; background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 12px; font-size: 14px; font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-bottom: 14px; color: var(--dark);
    font-family: inherit;
    transition: all .15s;
}
.fav-add-all-btn:hover { background: var(--dark); color: var(--white); border-color: var(--dark); }
.fav-grid { display: flex; flex-direction: column; gap: 8px; }
.fav-card {
    display: flex; align-items: center; gap: 12px;
    background: var(--bg); border: 1px solid var(--line);
    border-radius: var(--r-md); padding: 10px;
}
.fav-card-img { width: 52px; height: 52px; object-fit: cover; border-radius: var(--r-sm); flex-shrink: 0; }
.fav-card-body { flex: 1; min-width: 0; }
.fav-card-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-card-price { font-size: 13px; color: var(--mid); margin-top: 2px; }
.fav-card-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.fav-add-btn {
    background: var(--dark); color: var(--white);
    border: none; border-radius: var(--r-sm);
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 14px;
}
.fav-qty { display: flex; align-items: center; background: var(--green-soft); border-radius: var(--r-sm); border: 1.5px solid var(--green); overflow: hidden; }
.fav-qty button { background: none; border: none; width: 28px; height: 28px; cursor: pointer; font-size: 14px; font-weight: 700; color: var(--green-dark); }
.fav-qty button:active { background: rgba(37,195,90,.15); }
.fav-qty span { font-weight: 800; font-size: 13px; min-width: 18px; text-align: center; color: var(--green-dark); }
.fav-del-btn {
    background: none; border: 1px solid #fecaca;
    border-radius: var(--r-sm);
    width: 32px; height: 32px;
    color: var(--red); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
}
.fav-del-btn:hover { background: #fef2f2; }

/* Адреса */
.addr-tile {
    display: flex; align-items: flex-start; gap: 12px;
    border: 1px solid var(--line); border-radius: var(--r-md);
    padding: 12px; margin-bottom: 8px;
    background: var(--bg);
}
.addr-tile-icon { font-size: 20px; flex-shrink: 0; line-height: 1.3; }
.addr-tile-body { flex: 1; cursor: pointer; }
.addr-tile-label { font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.addr-default-badge {
    font-size: 10px; background: var(--dark);
    color: var(--white); border-radius: var(--r-xl);
    padding: 2px 8px; font-weight: 700;
}
.addr-tile-text { font-size: 13px; color: var(--mid); margin-top: 2px; }
.addr-tile-extra { font-size: 12px; color: #b0b7c3; margin-top: 2px; }
.addr-tile-btns { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.addr-tile-btns button { background: none; border: none; color: var(--mid); cursor: pointer; font-size: 14px; padding: 4px; border-radius: var(--r-xs); }
.addr-tile-btns button:hover { color: var(--dark); background: var(--line); }
.addr-add-btn {
    width: 100%; background: none; border: 2px dashed var(--line);
    border-radius: var(--r-md); padding: 13px;
    font-size: 14px; color: var(--mid);
    cursor: pointer; font-weight: 600; font-family: inherit;
    transition: all .15s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.addr-add-btn:hover { border-color: var(--dark); color: var(--dark); }
.addr-form { padding: 2px 0; }
.addr-form-title { font-weight: 800; font-size: 15px; margin-bottom: 14px; }
.addr-label-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.addr-label-btn {
    border: 1.5px solid var(--line); background: none;
    border-radius: var(--r-xl); padding: 6px 14px;
    font-size: 13px; font-weight: 600;
    cursor: pointer; color: var(--mid); font-family: inherit;
    transition: all .15s;
}
.addr-label-btn.active { background: var(--dark); color: var(--white); border-color: var(--dark); }
.addr-extra-row { display: flex; gap: 8px; }
.addr-default-check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; cursor: pointer; margin: 10px 0; }
.addr-form-btns { display: flex; gap: 8px; margin-top: 8px; }
.addr-cancel-btn {
    flex: 1; background: none; border: 1.5px solid var(--line);
    border-radius: var(--r-md); padding: 13px;
    font-size: 14px; font-weight: 600;
    cursor: pointer; color: var(--mid); font-family: inherit;
}

@media (max-width: 480px) {
    .profile-panel { max-width: 100%; }
    .addr-extra-row { flex-direction: column; gap: 0; }
}

/* ═══════════════════════════════════════════════════════════
   ФУТЕР
═══════════════════════════════════════════════════════════ */
footer {
    background: var(--dark) !important;
    color: rgba(255,255,255,.6);
    font-size: 14px;
}
footer h5 { color: var(--white); font-weight: 700; margin-bottom: 12px; }
footer p { margin-bottom: 6px; }
footer i { margin-right: 6px; color: var(--green); }

/* ── iOS Install Hint ─────────────────────────────────────── */
.ios-install-hint {
    position: fixed;
    bottom: 80px;
    left: 12px;
    right: 12px;
    z-index: 2000;
}
.ios-hint-body {
    background: #1c1c1e;
    color: #fff;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.ios-hint-icon { font-size: 2rem; flex-shrink: 0; }
.ios-hint-text strong { display: block; margin-bottom: 4px; }
.ios-hint-text p { margin: 0; font-size: .85rem; opacity: .85; line-height: 1.4; }
.ios-hint-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
    padding: 0 4px;
}

/* ── Сортировка — сегментированный контрол ──────────────────────── */
.sort-toolbar {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px;
    background: var(--white);
    border-radius: var(--r-xl);
    border: 1.5px solid var(--line);
    margin-bottom: 16px;
    box-shadow: var(--shadow-xs);
}
.sort-toolbar::-webkit-scrollbar { display: none; }

.sort-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 13px;
    border-radius: 18px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--mid);
    cursor: pointer;
    transition: background .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
    white-space: nowrap;
    line-height: 1.2;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.sort-btn i { font-size: 12px; }
.sort-btn:hover:not(.active) {
    background: var(--bg);
    color: var(--dark);
}
.sort-btn.active {
    background: var(--green);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37,195,90,.30);
}

/* ── Бейдж скидки на карточке ───────────────────────────────────── */
.product-sale-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--r-xl);
    letter-spacing: 0.2px;
    z-index: 2;
    line-height: 1.3;
}

/* ── Зачёркнутая старая цена ────────────────────────────────────── */
.product-old-price {
    display: inline-block;
    margin-left: 5px;
    font-size: 12px;
    color: var(--mid);
    text-decoration: line-through;
    font-weight: 400;
    opacity: .75;
}


@media (max-width: 576px) {
    #checkoutModal .modal-dialog {
        margin: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
    }
    #checkoutModal .modal-content {
        border-radius: 0 !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        display: flex !important;
        flex-direction: column !important;
    }
    #checkoutModal .modal-body {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        min-height: 0 !important;
    }
    #checkoutModal .modal-footer {
        flex-shrink: 0 !important;
        padding-bottom: max(12px, calc(12px + env(safe-area-inset-bottom, 0px))) !important;
    }
}

/* ══ ФИНАЛЬНЫЙ ФИК: checkout modal — кнопки не уходят за nav bar ══ */

/* Bootstrap по умолчанию ставит overflow-y:auto на .modal —
   из-за этого весь диалог может скроллиться и footer уходит вниз.
   Фиксируем: modal не скроллится сам, скроллится только modal-body */
#checkoutModal {
    overflow: hidden !important;
}

@media (max-width: 576px) {
    /* Полный экран на телефоне */
    #checkoutModal .modal-dialog {
        margin: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        /* svh = small viewport height — учитывает браузерный UI и nav bar */
        height: 100svh !important;
        max-height: 100svh !important;
    }

    /* Flex-колонка: header фиксирован, body скроллится, footer всегда виден */
    #checkoutModal .modal-content {
        border-radius: 0 !important;
        height: 100svh !important;
        max-height: 100svh !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    #checkoutModal .modal-header {
        flex-shrink: 0 !important;
    }

    #checkoutModal .modal-body {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        min-height: 0 !important;
    }

    /* Footer всегда внизу + отступ под системную навигацию Android.
       viewport-fit=cover в meta заставляет env() вернуть реальное значение */
    #checkoutModal .modal-footer {
        flex-shrink: 0 !important;
        padding: 12px 16px !important;
        padding-bottom: max(12px, calc(12px + env(safe-area-inset-bottom, 0px))) !important;
    }
}


/* ══ z-index: modal выше bottom-nav (1100) ══
   Bootstrap по умолчанию: backdrop=1050, modal=1055
   Наш bottom-nav: 1100  →  modal был ПОД навигацией
   Решение: поднимаем backdrop и modal выше 1100             */
.modal-backdrop {
    z-index: 1101 !important;
}
.modal {
    z-index: 1102 !important;
}

/* Доп. отступ в modal footer под системную nav bar Android */
@media (max-width: 576px) {
    #checkoutModal .modal-footer {
        padding-bottom: max(16px, calc(16px + env(safe-area-inset-bottom, 0px))) !important;
    }
}
