/* Firkan theme — токены и компоненты сверены с фактическими вычисленными стилями arba-food.kz */

@import url('https://fonts.googleapis.com/css2?family=Onest:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg: #fbfaf8;
    --surface: #ffffff;
    --surface-2: #f1efec;
    --border: #ece9e4;
    --foreground: #151414;
    --muted: #6b655d;
    --muted-2: #a49c92;
    --icon-muted: #bbb4ab;

    --accent-1: #ff9a2e;
    --accent-2: #f5820c;
    --accent-3: #ff7a3c;
    --accent-deep: #f5561f;
    --accent-gold: #fbbf24;
    --gradient-primary: linear-gradient(180deg, var(--accent-1), var(--accent-2));

    --shadow-card: 0 6px 16px rgba(70, 50, 15, .05);
    --shadow-card-sm: 0 2px 8px rgba(60, 40, 10, .05);
    --shadow-pop: 0 3px 10px rgba(60, 40, 10, .1);
    --shadow-cta: 0 4px 10px -3px rgba(245, 160, 12, .6);
    --shadow-cta-lg: 0 8px 20px -6px rgba(245, 130, 12, .6);
    --shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, .25);

    --radius-pill: 9999px;
    --radius-lg: 22px;
    --radius-md: 20px;
    --radius-sm: 12px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--foreground);
    font-family: 'Onest', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}
/* Футер всегда внизу: если контента мало, он не подтягивается наверх. */
#firkan-main { flex: 1 0 auto; width: 100%; }
.firkan-footer { flex-shrink: 0; }

/* Блокируем скролл фона под открытым попапом/панелью. */
body.firkan-overlay-open { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.firkan-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--foreground);
    color: #fff;
    padding: 10px 16px;
    border-radius: 0 0 10px 0;
    z-index: 10000;
}
.firkan-skip-link:focus { left: 0; }

:focus-visible {
    outline: 0px solid var(--accent-2);
    outline-offset: 0px;
}

.firkan-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.firkan-icon { width: 20px; height: 20px; display: block; flex-shrink: 0; }

/* ---------- Header (тёмный, закреплена только верхняя строка — категории ниже, в потоке страницы) ---------- */
.firkan-fixed-top {
    position: sticky;
    top: 0;
    z-index: 100;
}

.firkan-header {
    /* Фон — буквальный тёмный цвет, а не var(--foreground): эта же переменная
       переопределяется ниже до белого для дочерних элементов, и если бы фон
       тоже читал var(--foreground), он стал бы белым вместо тёмного. */
    background: #151414;
    /* Локальные переопределения токенов — все дочерние компоненты (кнопки, поиск)
       используют var(--surface-2)/var(--foreground)/var(--muted)/var(--border) как обычно,
       но здесь эти переменные подменены на светлые тона для тёмного фона. */
    --surface-2: rgba(255, 255, 255, .1);
    --foreground: #fff;
    --muted: #cfc7bd;
    --muted-2: #a89b8c;
    --border: rgba(255, 255, 255, .14);
}

.firkan-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 76px;
}

.firkan-header .firkan-catalog-btn:hover,
.firkan-header .firkan-icon-text-btn:hover,
.firkan-header .firkan-icon-btn:hover { background: rgba(255, 255, 255, .18); }

.firkan-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.firkan-logo-img { height: 32px; max-height: 32px; width: auto; max-width: none; display: block; }

.firkan-catalog-btn,
.firkan-icon-text-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 16px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--foreground);
    cursor: pointer;
    transition: background .15s ease, transform .1s ease;
    white-space: nowrap;
}
.firkan-catalog-btn:hover, .firkan-icon-text-btn:hover { background: #e9e5df; }
.firkan-catalog-btn:active, .firkan-icon-text-btn:active { transform: scale(.97); }

.firkan-search { position: relative; flex: 1; min-width: 120px; }
.firkan-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-2);
    pointer-events: none;
}
.firkan-search input {
    width: 100%;
    height: 45px;
    padding: 0 16px 0 49px;
    border: 1.5px solid transparent;
    border-radius: var(--radius-pill);
    font-size: 16px;
    font-weight: 500;
    font-family: inherit;
    background: var(--surface-2);
    color: var(--foreground);
    outline: none;
    transition: border-color .15s ease;
}
.firkan-search input::placeholder { color: var(--muted-2); font-weight: 500; }
.firkan-search input:focus { border-color: var(--accent-2); }

.firkan-city {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--foreground);
    white-space: nowrap;
}
.firkan-city .firkan-icon { color: var(--muted); width: 18px; height: 18px; }
button.firkan-city { border: none; background: none; cursor: pointer; font-family: inherit; padding: 6px 0; }
button.firkan-city .firkan-icon:last-child { width: 14px; height: 14px; }
#firkan-store-toggle .firkan-icon:first-child { color: var(--accent-2); }
button.firkan-city svg.firkan-icon:first-child { margin-top: -6px; }
button.firkan-city svg.firkan-icon { margin-bottom: -3px; }
button.firkan-city { gap: 3px; }

/* ---------- Попапы "Поддержка" и "Что улучшить в приложении?" ---------- */
.firkan-support-hero { text-align: center; padding: 26px 0 22px; }
.firkan-support-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    border-radius: 22px;
    background: #fff3e4;
    color: var(--accent-2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.firkan-support-icon .firkan-icon { width: 32px; height: 32px; }
.firkan-support-title { font-size: 17px; font-weight: 800; color: var(--foreground); }
.firkan-support-phone { margin-top: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.firkan-support-row {
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
    box-shadow: 0px 0px 10px #00000014;
}
.firkan-support-row .firkan-icon:first-child { color: var(--accent-2); }
.firkan-feedback-hint { margin: 18px 0 14px; font-size: 13px; color: var(--muted); line-height: 1.5; }
#firkan-feedback-form textarea { min-height: 150px; }
#firkan-feedback-form button[type="submit"] { margin-top: 16px; }
.firkan-city-wrap { position: relative; flex-shrink: 0; }
.firkan-store-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 200;
    min-width: 220px;
    padding: 8px;
    background: #fff;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-modal);
}
.firkan-store-menu[hidden] { display: none; }
.firkan-store-menu-title { padding: 8px 12px 6px; font-size: 12px; font-weight: 700; color: #8a7f76; }
.firkan-store-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: none;
    color: #151414;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}
.firkan-store-option:hover { background: #f1efec; }
.firkan-store-option.is-active { color: var(--accent-2); }
.firkan-store-option .firkan-icon { width: 16px; height: 16px; color: var(--accent-2); }

.firkan-header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.firkan-icon-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--foreground);
    transition: background .15s ease, transform .1s ease;
}
.firkan-icon-btn:hover { background: #e9e5df; }
.firkan-icon-btn:active { transform: scale(.94); }
.firkan-icon-btn .firkan-icon { width: 20px; height: 20px; }

.firkan-icon-text-icon-wrap { position: relative; display: inline-flex; }

.firkan-fav-count {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--accent-2);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.firkan-fav-count[hidden] { display: none; }

.firkan-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 16px 0 14px;
    border-radius: var(--radius-pill);
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .1s ease;
}
.firkan-cart-btn:active { transform: scale(.97); }
.firkan-cart-count {
    background: rgba(255,255,255,.28);
    border-radius: 999px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.firkan-categories-section { padding: 24px 16px 6px; }
.firkan-categories-title { font-size: 20px; font-weight: 800; margin: 0 0 14px; letter-spacing: -.01em; }

/* ---------- Category chips ---------- */
.firkan-chips-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px;
    scrollbar-width: none;
}
.firkan-chips-row::-webkit-scrollbar { display: none; }

.firkan-chip {
    position: relative;
    flex-shrink: 0;
    width: 104px;
    height: 104px;
    border-radius: var(--radius-lg);
    background: var(--surface-2);
    border: none;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    transition: transform .15s ease;
}
.firkan-chip:active { transform: scale(.95); }
.firkan-chip.is-active { box-shadow: 0 0 0 2px var(--accent-2); }

.firkan-chip-photo { position: absolute; inset: 0; display: block; }
.firkan-chip-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.firkan-chip-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent 58%);
}
.firkan-chip .firkan-chip-label {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,.4);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.firkan-chip-all {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.firkan-chip-all .firkan-chip-label {
    position: static;
    color: var(--foreground);
    text-shadow: none;
    text-align: center;
    -webkit-line-clamp: 1;
}
.firkan-chip-dots {
    display: grid;
    grid-template-columns: repeat(2, 11px);
    grid-template-rows: repeat(2, 11px);
    gap: 4px;
}
.firkan-chip-dots span { width: 11px; height: 11px; border-radius: 3px; background: var(--accent-2); }

/* ---------- Home ---------- */
.firkan-home { padding: 20px 16px 60px; }

.firkan-hero {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 30px;
}
.firkan-hero-steps {
    background: var(--gradient-primary);
    color: #fff;
    border-radius: 26px;
    padding: 28px;
    box-shadow: var(--shadow-cta-lg);
}
.firkan-hero-steps h1 { margin: 0 0 16px; font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.firkan-hero-steps ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 24px; flex-wrap: wrap; }
.firkan-hero-steps li { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; max-width: 120px; }
.firkan-step-num {
    width: 26px; height: 26px; border-radius: 50%;
    background: rgba(255,255,255,.25);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
}

.firkan-hero-promo {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 26px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    box-shadow: var(--shadow-card);
}
.firkan-hero-promo-icon { width: 26px; height: 26px; color: var(--accent-2); }
.firkan-hero-promo-title { font-weight: 700; font-size: 16px; }
.firkan-hero-promo-sub { color: var(--muted); font-size: 13px; }

.firkan-section { margin-bottom: 34px; }
.firkan-section h2 { font-size: 20px; margin: 0 0 14px; font-weight: 800; letter-spacing: -.01em; }

.firkan-deals-banner {
    background: var(--gradient-primary);
    color: #fff;
    border-radius: 20px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    margin-bottom: 14px;
    box-shadow: var(--shadow-cta-lg);
}
.firkan-deals-badge {
    background: rgba(255,255,255,.25);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
}

/* "Товары со скидками" — горизонтальная прокрутка вместо грида, на любом
   экране (пк/планшет/моб.), как баннерные ряды. ID выше по специфичности
   любых .firkan-product-grid-правил ниже (в т.ч. мобильных !important). */
#firkan-deals .products.firkan-product-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 2px 6px !important;
    gap: 12px !important;
    cursor: grab;
    user-select: none;
}
#firkan-deals .products.firkan-product-grid.is-dragging { cursor: grabbing; scroll-snap-type: none; }
#firkan-deals .products.firkan-product-grid::-webkit-scrollbar { display: none; }
#firkan-deals .firkan-product-card {
    flex: 0 0 auto;
    scroll-snap-align: start;
}
/* !important обязателен: ul.products li.product { width: auto !important; } ниже
   по файлу иначе перебивает ширину карточки (та же specificity, но !important). */
@media (min-width: 640px) {
    #firkan-deals .firkan-product-card { width: 200px !important; }
}
/* Мобильный — видно 2 карточки + ~30% третьей (подсказка, что список длиннее). */
@media (max-width: 640px) {
    #firkan-deals .firkan-product-card { width: 43% !important; }
}

.firkan-app-banner {
    background: var(--foreground);
    color: #fff;
    border-radius: 26px;
    padding: 34px;
    text-align: center;
}
.firkan-app-banner h2 { color: #fff; }
.firkan-app-banner p { color: #cfc7bd; margin: 0; }

/* ---------- Product grid & card ---------- */
ul.products, .firkan-product-grid {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)) !important;
    gap: 20px 12px !important;
}

ul.products li.product,
ul.products li.firkan-product-card,
.firkan-product-grid li.product {
    width: auto !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

li.firkan-product-card {
    display: flex;
    flex-direction: column;
    position: relative;
    animation: firkanFadeInUp .35s ease both;
}
@keyframes firkanFadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.firkan-product-media-wrap { position: relative; }

.firkan-product-media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.firkan-product-media img {
    max-width: 86%;
    max-height: 86%;
    width: auto;
    height: auto;
    object-fit: contain;
    padding: 8px;
}

.firkan-badge-discount {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--gradient-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 9px;
    border-radius: 8px;
    z-index: 2;
}

.firkan-fav-icon-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.95);
    box-shadow: var(--shadow-pop);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--icon-muted);
    transition: transform .12s ease, color .15s ease;
}
.firkan-fav-icon-btn:hover { background: #fff; }
.firkan-fav-icon-btn:active { transform: scale(.9); }
.firkan-fav-icon-btn .firkan-icon { width: 18px; height: 18px; }
.firkan-fav-icon-btn.is-active { color: var(--accent-2); }
.firkan-fav-icon-btn.is-active .firkan-icon { fill: var(--accent-2); }

/* WooCommerce на стандартный .ajax_add_to_cart добавляет ссылку "Просмотр корзины" —
   мы больше не используем стандартный флоу (свой firkan_card_qty AJAX), но на всякий
   случай (другие шаблоны/шорткоды) прячем её глобально, чтобы не дублировала CTA. */
a.added_to_cart.wc-forward { display: none; }

.firkan-product-cta {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 2;
    background: transparent;
    border-radius: 50%;
    padding: 0;
}
.firkan-product-cta:has(.firkan-card-stepper) {
    background: #fff;
    padding: 3px;
    border-radius: 999px;
    box-shadow: var(--shadow-pop);
}

button.firkan-add-to-cart {
    width: 38px;
    height: 38px;
    box-shadow: var(--shadow-cta);
}
/* Кнопка "+" после первого клика: заблокирована, вместо плюса — крутящийся круг. */
button.firkan-add-to-cart { position: relative; }
button.firkan-add-to-cart:disabled { cursor: wait; }
button.firkan-add-to-cart.is-loading .firkan-icon { visibility: hidden; }
button.firkan-add-to-cart.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: firkanSpin .6s linear infinite;
}
button.firkan-add-to-cart:hover {
    filter: brightness(1.06);
    cursor: pointer;
}
.firkan-add-to-cart .firkan-icon { width: 18px; height: 18px; }

.firkan-add-to-cart,
.firkan-card-qty-minus,
.firkan-card-qty-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: none;
    transition: transform .12s ease;
}
.firkan-add-to-cart:active,
.firkan-card-qty-minus:active,
.firkan-card-qty-plus:active { transform: scale(.9); }
.firkan-card-qty-minus .firkan-icon,
.firkan-card-qty-plus .firkan-icon { width: 16px; height: 16px; }

.firkan-card-stepper { display: flex; align-items: center; gap: 4px; }
.firkan-card-stepper button { cursor: pointer; }
.firkan-card-qty-value {
    min-width: 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--foreground);
    font-variant-numeric: tabular-nums;
}

.firkan-product-info { display: block; margin-top: 10px; }
.firkan-product-card-price {
    font-size: 18px;
    font-weight: 900;
    color: var(--foreground);
    font-variant-numeric: tabular-nums;
}
.firkan-product-card-price del { color: var(--muted-2); font-weight: 500; font-size: 13px; margin-right: 6px; text-decoration: line-through; }
.firkan-product-card-price ins { text-decoration: none; }
.firkan-product-card-title {
    margin: 3px 0 0;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 500;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Скелетон загрузки каталога ---------- */
.firkan-skeleton-title {
    width: 220px;
    height: 26px;
    margin: 16px 0 20px;
    border-radius: 8px;
    background: var(--surface-2);
    animation: firkanPulse 1.2s ease-in-out infinite;
}
.firkan-skeleton-card { pointer-events: none; }
.firkan-product-media.firkan-skeleton {
    background: var(--surface-2);
    box-shadow: none;
    animation: firkanPulse 1.2s ease-in-out infinite;
}
@keyframes firkanPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .55; }
}

/* ---------- Archive header ---------- */
.firkan-archive-title { font-size: 22px; margin: 16px 0; font-weight: 800; }

/* ---------- "Избранное" (и другие view с кнопкой "назад" в слоте #firkan-catalog-view) ---------- */
.firkan-view-header { display: flex; align-items: center; gap: 14px; margin-top: 0px; margin-bottom: 16px; }
.firkan-view-header .firkan-archive-title { margin: 0; }
.firkan-view-back {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--foreground);
    cursor: pointer;
    transition: background .15s ease;
}
.firkan-view-back:hover { background: #e9e5df; }
.firkan-view-back:active { transform: scale(.92); }
.firkan-icon-flip { transform: scaleX(-1); }

.firkan-favorites-view[hidden] { display: none; }
/* Категории — только для каталога, в "Избранном" им не место (как на референсе). */
body.firkan-favorites-active #firkan-category-row { display: none; }

.firkan-favorites-guest {
    max-width: 380px;
    margin: 0 auto;
    padding: 64px 20px 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.firkan-favorites-guest-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-2);
}
.firkan-favorites-guest-icon .firkan-icon { width: 36px; height: 36px; }
.firkan-favorites-guest h2 { font-size: 20px; font-weight: 800; margin: 0 0 8px; }
.firkan-favorites-guest p { font-size: 14px; color: var(--muted); margin: 0 0 32px; line-height: 1.5; }
.firkan-favorites-guest-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 32px;
    height: 54px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--gradient-primary);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    box-shadow: var(--shadow-cta-lg);
}

/* ---------- Обычная текстовая страница (оферта, политика конфиденциальности и т.п.) ---------- */
.firkan-page { padding: 30px 16px 60px; }
.firkan-page article h1 { font-size: 28px; margin: 0 0 24px; font-weight: 800; }
.firkan-page-content { max-width: 760px; }
.firkan-page-content h2 { font-size: 19px; font-weight: 700; margin: 28px 0 10px; }
.firkan-page-content p { line-height: 1.65; margin: 0 0 14px; color: var(--foreground); }
.firkan-page-content strong { font-weight: 700; }
.firkan-wc-wrap { padding-bottom: 60px; }
.woocommerce-products-header { margin-top: 4px; }

/* ---------- Off-canvas overlays ---------- */
.mfp-hide { display: none !important; }

.firkan-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
}
.firkan-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(30,20,10,.45);
    backdrop-filter: blur(2px);
}
.firkan-overlay-panel, .nm-login-popup-wrap {
    position: relative;
    background: var(--bg);
    width: 100%;
    max-width: 430px;
    height: 100%;
    overflow-y: auto;
    padding: 26px;
    margin-left: auto;
    animation: firkanSlideIn .25s ease both;
}
@keyframes firkanSlideIn {
    from { transform: translateX(24px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.firkan-account-overlay:not(.is-open) { display: none; }
.firkan-account-overlay.is-open { display: flex; }

.firkan-overlay-close, .mfp-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    /* Выше кнопки избранного на карточке товара (z-index:2) — иначе на быстром
       просмотре избранное перекрывает крестик закрытия и по нему нельзя кликнуть. */
    z-index: 6;
    color: var(--foreground);
    transition: background .15s ease;
}
.firkan-overlay-close:hover, .mfp-close:hover { background: #e9e5df; }
.firkan-overlay-close .firkan-icon, .mfp-close .firkan-icon { width: 16px; height: 16px; }

.firkan-overlay-panel h2, .firkan-quickview-panel h2 { font-size: 20px; font-weight: 800; margin: 0 0 0px; }

/* ---------- Cart panel ---------- */
.firkan-cart-item {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #fff;
    border-radius: 10px;
    padding: 5px;
    margin-bottom: 10px;
    box-shadow: 0px 0px 10px #00000014;
}
.firkan-cart-item:last-child { margin-bottom: 0; }
.firkan-cart-item { transition: transform .3s ease, opacity .3s ease; }
.firkan-cart-item.is-removing {
    opacity: 0.6;
    transform: translateX(-120%);
    pointer-events: none;
}
.firkan-cart-item-thumb img { width: 60px; height: 60px; object-fit: contain; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 4px; }
.firkan-cart-item-info { flex: 1; }
.firkan-cart-item-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.firkan-cart-item-price { font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 700; }
.firkan-cart-item-qty { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: -15px; }
.firkan-cart-item .firkan-cart-item-qty {
    background: #efefef;
    width: fit-content;
    float: right;
    border-radius: 300px;
    padding: 2px;
}
.firkan-cart-item-qty button {
    width: 26px; height: 26px; border-radius: 50%;
    border: none;
    background: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--foreground);
}
.firkan-cart-item-qty button:hover { background: #e9e5df; }
.firkan-cart-item-qty button .firkan-icon { width: 13px; height: 13px; }
.firkan-qv-qty button .firkan-icon { width: 14px; height: 14px; }
.firkan-cart-empty { color: var(--muted); text-align: center; padding: 40px 0; font-weight: 500; }
.firkan-loading { color: var(--muted); text-align: center; padding: 30px 0; }

.firkan-cart-footer {
    position: sticky;
    bottom: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 16px 0 4px;
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.firkan-cart-footer-total { font-weight: 800; font-size: 16px; }
.firkan-cart-footer .button.checkout {
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    padding: 13px 24px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    box-shadow: var(--shadow-cta-lg);
    transition: transform .1s ease;
}
.firkan-cart-footer .button.checkout:active { transform: scale(.97); }

/* "Возможно, вы забыли заказать?" — сетка в 2 колонки (без скролла) рекомендуемых
   товаров под футером корзины. Скрыта сама по себе, когда рекомендовать нечего (:empty). */
.firkan-cart-forgotten { margin-top: 24px; margin-bottom: 280px; }
#firkan-cart-items { margin-top: 18px; }
.firkan-cart-forgotten:empty { display: none; margin: 0; }
.firkan-cart-forgotten h3 {
    position: relative;
    padding-left: 12px;
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 12px;
}
.firkan-cart-forgotten h3:before {
    content: "";
    background-color: #f5820c;
    width: 4px;
    height: 100%;
    position: absolute;
    left: 0px;
    border-radius: 10px;
}
#firkan-cart-forgotten .products.firkan-product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px 10px !important;
}

#customer_mini_checkout { margin-top: 0px; }
div#mini-checkout-section { padding-bottom: 260px; padding-top: 20px; }

/* Адрес доставки в форме заказа — тот же блок, что в шапке (.firkan-header-address) */
.firkan-checkout-address { display: flex !important; margin: 4px 0 14px; }
.firkan-checkout-address #yd-address-summary { margin-left: 0; border-bottom: 0; color: inherit; cursor: pointer; }
.firkan-checkout-address #yd-address-summary.mini-checkout-field-invalid { color: #e51937; }
.firkan-checkout-address .firkan-header-address-value { max-width: none; white-space: normal; }

/* Имя и телефон в форме заказа — из профиля (поля скрыты) */
.firkan-checkout-profile { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 14px; }
.firkan-checkout-profile-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0px;
    background: transparent;
    justify-content: left;
    border-radius: var(--radius-pill);
    font-size: 15px;
    font-weight: 600;
    color: var(--foreground);
}
.firkan-checkout-profile-row .firkan-icon { width: 18px; height: 18px; color: var(--accent-2); flex-shrink: 0; }
.firkan-checkout-profile-row span { flex: 0 1 auto; min-width: 0; }
/* Общее правило "#customer_mini_checkout button" красит все кнопки формы в градиент — здесь нужна маленькая круглая. */
#customer_mini_checkout button.firkan-account-edit-btn {
    width: 26px;
    height: 26px;
    padding: 0;
    gap: 0;
    background: #fff;
    color: var(--muted);
    box-shadow: none;
}
#customer_mini_checkout button.firkan-account-edit-btn .firkan-icon { width: 13px; height: 13px; color: var(--muted); }

/*
 * Попап выбора адреса на Яндекс.Картах (#yd-map-popup-*) и попап выбора оплаты
 * (#oplata-popup-*) — отдельные виджеты плагина со своим встроенным <style>
 * (плоские цвета, углы 12px). Переопределяем под общую дизайн-систему; порядок
 * вставки в DOM у плагина более поздний, поэтому там, где это важно, используем
 * !important, чтобы наши правила не проиграли каскад.
 */
#yd-map-popup-container {
    border-radius: 24px !important;
    box-shadow: var(--shadow-modal) !important;
    font-family: 'Onest', system-ui, sans-serif;
}

#yd-popup-form input,
.checkout_coupon_code_wrap input {
    height: 48px !important;
    border-radius: var(--radius-pill) !important;
    border: 1.5px solid var(--border) !important;
    background: var(--surface-2) !important;
    font-family: inherit !important;
    font-size: 15px !important;
    padding: 0 16px !important;
}
#yd-popup-form input:focus { border-color: var(--accent-2) !important; }
#yd-popup-form label { font-size: 12px !important; color: var(--muted) !important; font-weight: 600 !important; }

#yd_popup_search_results {
    border-radius: 14px !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-modal) !important;
    overflow: hidden;
}
.yd-search-item { font-family: inherit; padding: 12px 14px !important; }
.yd-search-item:hover { background: var(--surface-2) !important; color: var(--foreground) !important; }

.yd-btn {
    flex: 1;
    border: none;
    border-radius: var(--radius-pill) !important;
    font-family: inherit !important;
    font-weight: 700 !important;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    height: 50px;
}
#yd-btn-confirm {
    background: var(--gradient-primary) !important;
    box-shadow: var(--shadow-cta-lg);
}
#yd-btn-cancel { background: var(--surface-2) !important; color: var(--foreground) !important; }

.oplata-method-label {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm) !important;
    border-color: var(--border) !important;
}
.oplata-method-label:hover { border-color: var(--accent-2) !important; }
.oplata-method-label:has(input:checked) { border-color: var(--accent-2) !important; background: #fff3e4 !important; }
.oplata-method-label input[type="radio"] { display: none; }

/* ---------- Модалки по центру (вход, быстрый просмотр) ---------- */
.firkan-modal-overlay { align-items: center; justify-content: center; }

.firkan-modal-panel {
    position: relative;
    background: var(--bg);
    width: 100%;
    height: auto;
    max-width: 420px;
    max-height: 90vh;
    margin: 0;
    overflow-y: auto;
    border-radius: 28px;
    padding: 34px 30px 30px;
    box-shadow: var(--shadow-modal);
    animation: firkanPopIn .2s ease both;
    text-align: center;
}

.firkan-login-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #fff3e4;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-2);
}
.firkan-login-icon .firkan-icon { width: 26px; height: 26px; }

.firkan-login-modal h2 { margin: 0 0 8px; }
.firkan-login-subtitle { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.firkan-login-modal #otp-form { text-align: left; }

/* ---------- Quick view modal ---------- */
.firkan-quickview-overlay { align-items: center; justify-content: center; }
.firkan-quickview-panel {
    position: relative;
    background: var(--bg);
    width: 100%;
    max-width: 720px;
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 28px;
    padding: 30px;
    box-shadow: var(--shadow-modal);
    animation: firkanPopIn .2s ease both;
}
@keyframes firkanPopIn {
    from { transform: scale(.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.firkan-quickview-body { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.firkan-quickview-media {
    position: relative;
    aspect-ratio: 1/1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
/* В модалке быстрого просмотра сдвигаем "избранное" ниже, чтобы визуально не
   налезало на крестик закрытия модалки (который стоит над самой медиа-плашкой). */
.firkan-quickview-media .firkan-product-fav { top: 44px; }
.firkan-quickview-media img { max-width: 82%; max-height: 82%; object-fit: contain; }
.firkan-quickview-info h2 { margin: 0 0 10px; font-size: 22px; padding-right: 25px; }
.firkan-quickview-price { font-size: 26px; font-weight: 900; margin-bottom: 14px; }
.firkan-quickview-price del { font-weight: 300; font-size: 20px; opacity: .8; }
.firkan-quickview-desc { color: var(--muted); font-size: 14px; line-height: 1.5; margin-bottom: 20px; }
.firkan-quickview-actions { display: flex; align-items: center; gap: 12px; }
.firkan-qv-qty { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border-radius: var(--radius-pill); padding: 6px; }
.firkan-qv-qty button { width: 32px; height: 32px; border-radius: 50%; border: none; background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.firkan-qv-add-btn {
    flex: 1;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    height: 50px;
    border-radius: var(--radius-pill);
    background: var(--gradient-primary);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-cta-lg);
}
@media (max-width: 640px) {
    .firkan-quickview-body { grid-template-columns: 1fr; }
    .firkan-quickview-panel { padding: 20px; border-radius: 20px; max-height: 92vh; }
}

/* ---------- Формы внутри попапов (вход по СМС, аккаунт, чекаут) ----------
   custom-sms-otp / mini-cart-checkout используют стандартные классы WooCommerce
   (.woocommerce-Input, .input-text, .regular-text, .button) без своих стилей —
   подхватываем их одним общим набором правил вместо переписывания плагинов. */

.firkan-overlay-panel input[type="text"],
.firkan-overlay-panel input[type="tel"],
.firkan-overlay-panel input[type="number"],
.firkan-overlay-panel input[type="password"],
.firkan-overlay-panel input[type="email"],
.firkan-overlay-panel input.regular-text,
.firkan-overlay-panel select,
.firkan-overlay-panel textarea,
#customer_mini_checkout input[type="text"],
#customer_mini_checkout input[type="tel"],
#customer_mini_checkout select,
#customer_mini_checkout textarea {
    display: block;
    width: 100%;
    height: 50px;
    padding: 0 18px;
    margin: 0 0 12px;
    border: 1.5px solid transparent;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--foreground);
    outline: none;
    transition: border-color .15s ease;
    box-sizing: border-box;
}
.firkan-overlay-panel textarea,
#customer_mini_checkout textarea {
    height: auto;
    min-height: 90px;
    border-radius: var(--radius-sm);
    padding: 10px;
    font-size: 14px;
    resize: vertical;
}
div#kaspi_number_container input#kaspi_number { border-radius: var(--radius-sm); }
.firkan-overlay-panel input:focus,
#customer_mini_checkout input:focus,
#customer_mini_checkout select:focus,
#customer_mini_checkout textarea:focus {
    border-color: var(--accent-2);
}
.firkan-overlay-panel input::placeholder,
#customer_mini_checkout input::placeholder {
    color: var(--muted-2);
}
.firkan-overlay-panel .form-row,
.firkan-overlay-panel p.form-row-wide { margin: 0; }

/*
 * Только конкретные кнопки форм плагинов (по их собственным классам/ID) —
 * НЕ общий .firkan-overlay-panel button, иначе перекрасит маленькие круглые
 * кнопки (закрыть, +/-, избранное), которые тоже лежат внутри .firkan-overlay-panel.
 */
.firkan-overlay-panel .woocommerce-Button,
.firkan-overlay-panel #popup_save_fields,
.firkan-overlay-panel #firkan-address-form button[type="submit"],
.firkan-overlay-panel #firkan-profile-edit-form button[type="submit"],
.firkan-overlay-panel #firkan-feedback-form button[type="submit"],
#customer_mini_checkout button,
#customer_mini_checkout .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 50px;
    padding: 0 20px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--gradient-primary);
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    box-shadow: var(--shadow-cta-lg);
    transition: transform .1s ease, opacity .15s ease;
    box-sizing: border-box;
}
.firkan-overlay-panel .woocommerce-Button:hover,
#customer_mini_checkout button:hover { opacity: .94; }
.firkan-overlay-panel .woocommerce-Button:active,
#customer_mini_checkout button:active { transform: scale(.98); }
.firkan-overlay-panel .woocommerce-Button:disabled,
.firkan-overlay-panel #firkan-address-form button[type="submit"]:disabled,
.firkan-overlay-panel #firkan-profile-edit-form button[type="submit"]:disabled,
.firkan-overlay-panel #firkan-feedback-form button[type="submit"]:disabled,
#customer_mini_checkout button:disabled {
    background: var(--surface-2);
    color: var(--muted-2);
    box-shadow: none;
    cursor: not-allowed;
}

/* Второстепенные/текстовые действия — без градиента. */
.firkan-overlay-panel #change-phone {
    background: none;
    color: var(--muted);
    text-decoration: underline;
    font-weight: 500;
}
.firkan-overlay-panel #change-phone {
    display: block;
    width: auto;
    height: auto;
    text-align: center;
    margin-top: 4px;
}
.firkan-overlay-panel a.button {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--foreground);
    font-weight: 600;
    box-shadow: var(--shadow-card-sm);
}
#nm-login-wrap .button {
    margin: 0px;
    width: 100%;
    margin-top: 10px;
    font-size: 15px;
    padding: 8px;
    border-radius: var(--radius-pill);
}
.firkan-overlay-panel .delete_account,
button#delete_account {
    display: block !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    border-radius: 0 !important;
    color: #fb1800 !important;
    cursor: pointer;
    box-shadow: none !important;
    font-size: 14px !important;
    height: auto !important;
    padding: 0 !important;
    width: fit-content !important;
    margin: 20px auto 0 !important;
}

/*
 * Чекбокс + текст + ссылка лежат в разметке плагина как ПРЯМЫЕ соседи внутри
 * одного <label> (без общей обёртки вокруг текста). На display:flex это разваливается
 * на 3 независимых flex-элемента (чекбокс / текстовый узел / ссылка), каждый со своим
 * переносом строк — из-за этого текст выглядел разорванным и "не влезающим".
 * float — классический приём: текст и ссылка обтекают чекбокс единым абзацем.
 */
.firkan-overlay-panel #inform-message label {
    display: block;
    overflow: hidden;
    font-size: 13px;
    color: var(--muted);
    margin: 4px 0 16px;
    line-height: 1.4;
}
.firkan-overlay-panel #inform-message input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    float: left;
    width: 20px !important;
    height: 20px !important;
    margin: 1px 10px 0 0 !important;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
    cursor: pointer;
    position: relative;
    transition: background .15s ease, border-color .15s ease;
}
.firkan-overlay-panel #inform-message input[type="checkbox"]:checked {
    background: var(--gradient-primary);
    border-color: transparent;
}
.firkan-overlay-panel #inform-message input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.firkan-overlay-panel #inform-message a { color: var(--accent-2); }

/* Шаг "Заполните данные профиля" — плагин сам вызывает .show() на нём после
   успешной SMS-верификации нового пользователя (custom-sms-otp.php:1001),
   но забыл скрыть его по умолчанию во вёрстке — скрываем это здесь. */
#extra-user-fields-popup { display: none; }

.firkan-overlay-panel #error-message,
.firkan-overlay-panel #verify-error-message {
    color: #c0392b;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}
.firkan-overlay-panel #timer-message { color: var(--muted); font-weight: 500 !important; }
.firkan-overlay-panel #success-message { font-weight: 600; }

#extra-user-fields-popup { margin-top: 10px; }

/*
 * mini-cart-checkout.php рассчитывает, что .delivery-type/.label-minicart и т.п.
 * стилизует тема (сам плагин стилизует только свои модальные попапы). Без этого
 * иконки способов доставки (freedelivery.avif/car.avif/vel.avif) рендерились в
 * исходном огромном размере (1000+ px), ломая вёрстку — это и была "картинка с деньгами".
 * Плагин больше не выводит собственный <style> и inline style="" — все стили чекаута
 * (включая попапы адреса/оплаты) сведены сюда, в единую дизайн-систему темы.
 */
.label-minicart {
    font-size: 13px;
    font-weight: 600;
    color: var(--foreground);
    margin: 14px 0 6px;
}
.label-minicart:first-child { margin-top: 0; }

#customer_mini_checkout { display: none; }
.firkan-checkout-title { font-weight: 600; margin-bottom: 10px; }
.firkan-checkout-subtitle { font-size: 18px; margin: 25px 0 10px; }
.firkan-checkout-field { width: 100%; position: relative; margin-top: 10px; }
.firkan-hidden-field { display: none; }
#free_delivery_hint.firkan-hidden-field { display: none !important; }
#firkan-delivery-type.is-free label:not(#free_delivery_label) { display: none; }
.mini-checkout-address-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-top: 0;
}
.mini-checkout-address-details input { min-width: 100%; margin-bottom: 0; }

/* Подпись поля справа внутри инпута (Кв/офис, Подъезд…) — видна и после заполнения */
.firkan-field-hint { position: relative; display: block; margin: 0; }
.firkan-field-hint::after {
    content: attr(data-hint);
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-80%);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted-2);
    pointer-events: none;
}

/* Карта в форме адреса: маркер по центру (как в попапе карты заказа), подсказки и линия */
.firkan-address-map-wrap { position: relative; height: 240px; margin: 14px 0 6px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.firkan-address-map-wrap[hidden] { display: none; }
.firkan-address-map { width: 100%; height: 100%; }
.firkan-address-map-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    transform: translate(-50%, -100%);
    z-index: 5;
    pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23F5820C'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z'/%3E%3C/svg%3E") center bottom / contain no-repeat;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3));
}
/* Копирайт/промо Яндекс.Карт скрыты (как на старом сайте). Первые два — точные имена текущей версии API,
   остальные без номера версии, чтобы не сломалось при её обновлении. */
ymaps.ymaps-2-1-79-map-copyrights-promo { display: none; }
ymaps.ymaps-2-1-79-copyright { display: none; }
#firkan-address-map ymaps[class*="-map-copyrights-promo"],
#firkan-address-map ymaps[class*="-copyright"],
#yd-map-container-box ymaps[class*="-map-copyrights-promo"],
#yd-map-container-box ymaps[class*="-copyright"] { display: none; }
.firkan-address-map-status { min-height: 18px; margin: 0 0 6px; font-size: 13px; font-weight: 700; }
.firkan-address-map-status.is-error { color: #e51937; }
#firkan-address-text.is-invalid { border-color: #e51937; }
.firkan-address-suggest-wrap { position: relative; }
.firkan-address-suggest {
    position: absolute;
    top: calc(100% - 8px);
    left: 0;
    right: 0;
    z-index: 30;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow-modal);
    overflow: hidden;
}
.firkan-address-suggest:empty { display: none; }
.firkan-address-suggest-item {
    display: block;
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: none;
    font-family: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}
.firkan-address-suggest-item:hover { background: var(--surface-2); }
.firkan-address-hr { border: none; border-top: 1px solid var(--border); margin: 16px 0 4px; }
.firkan-overlay-panel .firkan-field-hint input[type="text"] { padding-right: 78px; }

/* Карусель способов доставки: показываем ~1.5 карточки, остальное открывается
   свайпом (тач — нативно через overflow-x) или перетаскиванием мышью (theme.js). */
.delivery-type {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    user-select: none;
    padding-bottom: 2px;
    scrollbar-width: none;
}
.delivery-type::-webkit-scrollbar { display: none; }
.delivery-type.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.delivery-type label {
    flex: 0 0 auto;
    width: 55%;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 12px 8px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.delivery-type label:has(input:checked) { border-color: var(--accent-2); background: #fff3e4; }
.delivery-type label:has(input:disabled),
.delivery-type label.is-disabled { opacity: .5; cursor: not-allowed; }
.delivery-type label input[type="radio"] { display: none; }
.delivery-type label img { width: 28px; height: 28px; object-fit: contain; }
.delivery-type label span { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 2px; width: 100%; }
div#firkan-delivery-type img { display: none; }
span#free_delivery_diff { width: auto; }
.namedelivery { font-size: 13px; font-weight: 600; color: var(--foreground); }
.namedeliverytime { font-size: 11px; color: var(--muted); }
.yd-price { font-size: 12px; font-weight: 700; color: var(--accent-2); }
.yd-spin { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: yd-spin .7s linear infinite; vertical-align: -2px; }
@keyframes yd-spin { to { transform: rotate(360deg); } }
#free_delivery_hint { font-size: 11px; line-height: 1.5; color: var(--muted); }
span#free_delivery_hint { flex-flow: row; flex-direction: row; justify-content: left; }
/* JS (mini-cart-checkout.php) ставит opacity инлайн-стилем после AJAX-пересчёта суммы корзины. */
label#free_delivery_label[style="opacity: 1;"] ~ label { opacity: .5; pointer-events: none; }

#free_shipping_message:empty { display: none; }

.yd-branch-selector select,
#customer_mini_checkout select {
    width: 100%;
    height: 50px;
    padding: 0 18px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    border: 1.5px solid transparent;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: 12px;
}

/* Единый чекбокс для всего попапа чекаута ("До двери", "Использовать бонусы") —
   тот же визуал, что и у чекбокса согласия в попапе входа (#inform-message). */
#customer_mini_checkout input[type="checkbox"],
.firkan-cart-coupon input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin: 0;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
    cursor: pointer;
    position: relative;
    transition: background .15s ease, border-color .15s ease;
}
#customer_mini_checkout input[type="checkbox"]:checked,
.firkan-cart-coupon input[type="checkbox"]:checked {
    background: var(--gradient-primary);
    border-color: transparent;
}
#customer_mini_checkout input[type="checkbox"]:checked::after,
.firkan-cart-coupon input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 4px;
    width: 2px;
    height: 5px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.yd-door-to-door { width: 100%; margin: 12px 0 5px; }
.yd-door-option {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    cursor: pointer;
    transition: border-color .15s ease;
}
.yd-door-option:has(input:checked) { border-color: var(--accent-2); }
.yd-door-option input[type="checkbox"] { margin-top: 2px; }
.yd-door-option-content { display: flex; flex-direction: column; }
.yd-door-option-title { font-size: 14px; font-weight: 600; color: var(--foreground); line-height: 1.2; }
.yd-door-option-desc { margin-top: 3px; font-size: 12px; color: var(--muted); line-height: 1.35; }

.delivery-timing-wrapper { width: 100%; position: relative; margin-top: 10px; }
.delivery-time-options { display: flex; gap: 10px; margin-top: 8px; }
.delivery-time-label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    transition: .2s;
    background: var(--surface-2);
    color: var(--foreground);
}
.delivery-time-label input[type="radio"] { display: none; }
.delivery-time-label:has(input[type="radio"]:checked) { border-color: var(--accent-2); color: var(--accent-2); }
.delivery-time-select { margin-top: 10px; }

/* Выбор времени доставки — мини-кнопки с горизонтальной прокруткой вместо select
   (select остаётся в форме скрытым: его заполняет и читает плагин, кнопки лишь выбирают в нём значение). */
#customer_mini_checkout #scheduled_time { display: none; }
.firkan-time-chips {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
    padding-bottom: 2px;
}
.firkan-time-chips::-webkit-scrollbar { display: none; }
.firkan-time-chips.is-dragging { cursor: grabbing; scroll-snap-type: none; }
#customer_mini_checkout button.firkan-time-chip {
    flex: 0 0 auto;
    width: 20%;
    height: 38px;
    padding: 0 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--foreground);
    font-size: 13px;
    font-weight: 600;
    box-shadow: none;
    scroll-snap-align: start;
}
#customer_mini_checkout button.firkan-time-chip.is-active {
    background: var(--gradient-primary);
    color: #fff;
    border: none;
}

/* Купон и бонусы — в корзине (.firkan-overlay-panel уже красит поля ввода) */
.firkan-cart-coupon { margin: 18px 0 6px; }
.firkan-cart-coupon input[type="text"] { margin-bottom: 0; }
#apply_checkout_coupon {
    flex-shrink: 0;
    height: 50px;
    padding: 0 18px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--gradient-primary);
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: var(--shadow-cta);
}
#apply_checkout_coupon:disabled { opacity: .6; cursor: not-allowed; }
.firkan-coupon-row { display: flex; gap: 10px; margin-bottom: 5px; width: 100%; }
#checkout_coupon_message { font-size: 13px; margin-bottom: 10px; font-weight: 500; }
#checkout_coupon_message:empty { display: none; margin: 0; }
.firkan-checkout-checkbox-row { display: flex; align-items: center; gap: 10px; }
.firkan-checkout-checkbox-row span { font-weight: 600; font-size: 14px; color: var(--foreground); }

.mini-checkout-form-error {
    background: #fdeceb;
    border: 1px solid #f5b5ae;
    color: #b30000;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    padding: 10px 12px;
    border-radius: 8px;
    margin: 10px 0;
}
.mini-checkout-form-error ul { margin: 0; padding-left: 18px; }
.mini-cart-checkout-form input.mini-checkout-field-invalid,
.mini-cart-checkout-form select.mini-checkout-field-invalid { border-color: #e51937 !important; box-shadow: 0 0 0 1px #e51937; }
#yd-address-summary.mini-checkout-field-invalid,
#oplata-summary.mini-checkout-field-invalid { color: #e51937; border-bottom-color: #e51937; font-weight: 700; }

/* Триггеры-ссылки "адрес доставки" / "метод оплаты" внутри формы. */
.yd-address-trigger,
.oplata-trigger { font-size: 15px; font-weight: 500; margin: 5px 0 0; display: block; width: 100%; }
.oplata-trigger { font-weight: 600; margin-top: 0; }
#yd-address-summary,
#oplata-summary { color: var(--accent-2); border-bottom: 1px dashed var(--accent-2); cursor: pointer; margin-left: 5px; }
#yd-address-summary:hover,
#oplata-summary:hover { border-bottom-style: solid; }
.addresdostavkifull { display: none !important; }

/* ---------- Попап оплаты (#oplata-popup-*) ---------- */
.oplata-methods-list { display: flex; flex-direction: column; gap: 10px; margin-top: 15px; }
.oplata-method-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    transition: .2s;
}
.oplata-method-label:hover { background: var(--surface-2); }
.oplata-method-name { font-weight: 600; color: var(--foreground); display: block; line-height: 1.2; }
.oplata-method-description { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.oplata-method-description img { max-width: 100px; max-height: 24px; height: auto; display: block; margin-top: 5px; }
/* Новый попап оплаты (#firkan-payment-overlay в header.php) */
.firkan-payment-modal { text-align: left; }
.firkan-payment-buttons { display: flex; gap: 10px; margin-top: 18px; }
.firkan-payment-buttons button {
    flex: 1;
    height: 50px;
    border: none;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.firkan-payment-cancel { background: var(--surface-2); color: var(--foreground); }
.firkan-payment-confirm { background: var(--gradient-primary); color: #fff; box-shadow: var(--shadow-cta-lg); }

/* ---------- Попап адреса на Яндекс.Картах (#yd-map-popup-*) ---------- */
#yd-map-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 9999999;
    display: none;
    justify-content: center;
    align-items: center;
}
#yd-map-wrapper { position: relative; width: 100%; height: 350px; flex-shrink: 0; }
#yd-map-container-box { width: 100%; height: 100%; background: var(--surface-2); }
#yd-map-center-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    transform: translate(-50%, -100%);
    z-index: 1000;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23F5820C'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: contain;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3));
}
#yd-popup-form { padding: 20px; background: var(--bg); overflow-y: auto; flex-grow: 1; }
.yd-popup-row { margin-bottom: 12px; position: relative; }
/* Дублирует свойства из #yd-popup-form input выше (строка ~691) — те задают вид,
   эти чинят функциональность (плагин когда-то терял клики/выделение внутри попапа карты). */
#yd-popup-form input {
    pointer-events: auto !important;
    user-select: text !important;
    -webkit-user-select: text !important;
    z-index: 10;
    position: relative;
}
.yd-grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 10px; }
.yd-popup-buttons { display: flex; gap: 10px; margin-top: 10px; }
#yd-btn-confirm:disabled { background: #ccc !important; cursor: not-allowed; box-shadow: none; }
#yd-status-msg { font-size: 13px; margin-bottom: 10px; font-weight: 700; min-height: 18px; color: var(--foreground); }
.yd-error-text { color: #e51937; }

@media (max-width: 600px) {
    #yd-map-popup-container { width: 100%; height: 100%; max-height: 100%; border-radius: 0 !important; }
    #yd-map-wrapper { height: 40vh; }
    .yd-grid-4 { grid-template-columns: 1fr 1fr; row-gap: 0; }
    .yd-popup-row label { line-height: 1; }
    #yd-popup-form { padding: 10px; }
    #yd-status-msg { margin-bottom: 0; }
}

/* ---------- Попап "Профиль" (custom-sms-otp: user_account_popup) ---------- */
.firkan-account { text-align: center; padding-top: 20px; padding-bottom: 160px; }
.firkan-account-avatar {
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-cta-lg);
}
.firkan-account-avatar .firkan-icon { width: 32px; height: 32px; }

.firkan-account-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 700;
    color: var(--foreground);
}
#user-age { color: var(--muted); font-weight: 600; }
.firkan-account-edit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--muted);
    cursor: pointer;
    flex-shrink: 0;
}
.firkan-account-edit-btn .firkan-icon { width: 13px; height: 13px; }

.firkan-account-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}
.firkan-account-meta-item { display: inline-flex; align-items: center; gap: 5px; }
.firkan-account-meta-item .firkan-icon { width: 14px; height: 14px; color: var(--accent-2); }

.firkan-account-orders-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 50px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--gradient-primary);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    box-shadow: var(--shadow-cta-lg);
    margin-bottom: 8px;
}
.firkan-account-orders {
    text-align: left;
    padding: 12px 4px 4px;
}
.firkan-account-orders-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.firkan-order-card {
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 14px;
    box-shadow: 0px 0px 10px #00000014;
}
.firkan-order-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.firkan-order-num { font-size: 15px; font-weight: 800; color: var(--foreground); }
.firkan-order-status {
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.firkan-order-status.is-pending { background: #fff8db; color: #a67c00; }
.firkan-order-status.is-processing { background: #e3f0ff; color: #1a6fd1; }
.firkan-order-status.is-on-hold { background: #fff3e4; color: var(--accent-2); }
.firkan-order-status.is-completed { background: #e6f6ec; color: #1f8a4c; }
.firkan-order-status.is-cancelled,
.firkan-order-status.is-failed { background: #fdeceb; color: #c0392b; }
.firkan-order-status.is-refunded { background: #f0eaf8; color: #7a4fb5; }
.firkan-order-date { margin-top: 4px; font-size: 12px; color: var(--muted); }
.firkan-order-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.firkan-order-total { font-size: 16px; font-weight: 800; color: var(--accent-2); }
.firkan-order-card .orderMoreButton {
    padding: 5px 10px;
    border-radius: var(--radius-pill);
    background: #ffe9d2;
    color: var(--accent-2);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}
.order-details-ajax {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--surface-2);
    font-size: 12px;
    color: var(--foreground);
    line-height: 1.5;
}
.order-details-ajax[hidden] { display: none; }
.order-details-ajax .ajax_goods { font-weight: 700; margin: 0 0 4px; }
.firkan-repeat-order {
    display: block;
    width: 100%;
    margin-top: 12px;
    height: 40px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--gradient-primary);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-cta);
}
.firkan-repeat-order:disabled { opacity: .6; cursor: not-allowed; }
.order-details-ajax ul { margin: 0; padding-left: 16px; }

.firkan-account-link-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 0;
    border: none;
    background: none;
    color: var(--accent-2);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}
.firkan-account-link-row .firkan-icon { width: 16px; height: 16px; }
.firkan-account-panel {
    text-align: left;
    padding: 4px 4px 14px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}
.firkan-account-panel .fio_info { display: flex; gap: 6px; margin: 0 0 6px; flex-wrap: wrap; }
.firkan-account-panel .fio_info span:first-child { color: var(--foreground); font-weight: 600; flex-shrink: 0; }

.firkan-account-list { text-align: left; margin-top: 8px; border-top: 1px solid var(--border); }
.firkan-account-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 10px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: none;
    color: var(--foreground);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.firkan-account-list-item .firkan-icon { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.firkan-account-list-item span { text-align: justify; }
.firkan-account-list-item span:first-of-type { flex: 1; }
.firkan-account-list-item .firkan-icon:last-child { width: 16px; height: 16px; color: var(--muted-2); }
.firkan-account-list-value { color: var(--muted); font-weight: 500; }
button#firkan-account-about-btn span { text-align: left; }
.firkan-account-logout { margin-top: 24px; }

/* Реферальная ссылка с кнопкой копирования */
.firkan-referral-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #fff3e4;
    border-radius: var(--radius-sm);
}
.firkan-referral-link-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.firkan-referral-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.firkan-referral-value { font-size: 13px; color: var(--foreground); font-weight: 700; word-break: break-all; }
.firkan-referral-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: var(--accent-2);
    cursor: pointer;
    box-shadow: var(--shadow-card-sm);
}
.firkan-referral-copy .firkan-icon { width: 18px; height: 18px; }
.firkan-referral-copy.is-copied { background: var(--gradient-primary); color: #fff; }

/* Попап редактирования имени */
#firkan-profile-edit-form button[type="submit"] { margin-top: 16px; }

/* ---------- "Мои адреса" (книга сохранённых адресов, попап профиля) ---------- */
.firkan-addresses-panel { display: flex; flex-direction: column; }
.firkan-addresses-panel .firkan-view-header h2 { margin-bottom: 0px; }
#firkan-addresses-list { flex: 1; position: relative; }
div#firkan-addresses-list.is-switching .firkan-address-card { opacity: 0.5; pointer-events: none; }
#firkan-addresses-list.is-switching:before {
    content: "Меняем адрес";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-weight: 600;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
    pointer-events: none;
}
.firkan-address-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.firkan-address-card.is-deleting { opacity: .4; pointer-events: none; }
.firkan-address-card.is-deleting::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 8px;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    border: 2px solid var(--border);
    border-top-color: var(--accent-2);
    border-radius: 50%;
    animation: firkanSpin .6s linear infinite;
}
@keyframes firkanSpin { to { transform: rotate(360deg); } }
.firkan-address-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
    border: 1.5px solid var(--border);
    border-radius: 50%;
    background: none;
    color: transparent;
    cursor: pointer;
}
.firkan-address-check .firkan-icon { width: 13px; height: 13px; }
.firkan-address-check.is-active { border-color: var(--accent-2); background: var(--gradient-primary); color: #fff; }
.firkan-address-card-body { flex: 1; min-width: 0; }
.firkan-address-card-label { font-size: 14px; font-weight: 700; color: var(--foreground); margin-bottom: 2px; }
.firkan-address-card-text { font-size: 13px; color: var(--muted); line-height: 1.4; }
.firkan-address-edit,
.firkan-address-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--muted);
    cursor: pointer;
}
.firkan-address-edit .firkan-icon,
.firkan-address-delete .firkan-icon { width: 14px; height: 14px; }
.firkan-addresses-footer {
    position: sticky;
    bottom: 0;
    background: var(--bg);
    padding-top: 16px;
    margin-top: 10px;
}
.firkan-addresses-add-btn {
    color: var(--accent-2);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    background: #ffe9d2;
    border: 1px solid #ffe9d2;
    border-radius: 600px;
    padding: 10px;
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    width: 100%;
}

/* ---------- Форма добавления/редактирования адреса ---------- */
#firkan-address-form button[type="submit"] { margin-top: 16px; }
h2#firkan-address-form-title { margin-bottom: 0px; }
form#firkan-address-form { padding-bottom: 160px; }

/* Блок "Доставка в …" в мобильной шапке (на десктопе скрыт) */
.firkan-header-address {
    display: none;
    flex: 1;
    min-width: 0;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: none;
    background: none;
    color: var(--foreground);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}
.firkan-header-address .firkan-icon:first-child { width: 20px; height: 20px; color: var(--accent-2); flex-shrink: 0; }
.firkan-header-address .firkan-icon:last-child { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; }
.firkan-header-address-text { flex: 0 1 auto; min-width: 0; display: flex; flex-direction: column; }
.firkan-header-address-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.firkan-header-address-value {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- PWA-плашка "Установить приложение" (только мобильная версия, стили сверены с tatori.pro) ---------- */
.pwa-notification, .pwa-modals { display: none; }

@media (max-width: 640px) {
    .pwa-notification {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        background: #f4f4f4;
        border-radius: 0px;
        padding: 10px 0px;
        margin: 0px 10px 0;
    }
    .pwa-container { display: flex; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; overflow: visible; }
    .pwa-icon { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
    .pwa-titleContainer { display: flex; flex-direction: column; min-width: 0; }
    .pwa-titleContainer .title { font-size: 14px; font-weight: 500; color: #353535; line-height: 18px; }
    .pwa-titleContainer .subtitle {
        font-size: 13px; font-weight: 400; color: #8a8a8a; line-height: 15px;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .pwa-button {
        flex-shrink: 0;
        white-space: nowrap;
        background: #353535;
        color: #fff;
        border: none;
        border-radius: 15px;
        padding: 8px;
        font-size: 12px;
        font-weight: 500;
        font-family: inherit;
        cursor: pointer;
    }

    .pwa-modals {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 100000;
        align-items: flex-end;
        justify-content: center;
    }
    .pwa-modals:not(.is-active) { display: none; }
    .pwa-modals-backdrop { position: absolute; inset: 0; background: rgba(30, 20, 10, .45); }

    .ModalPWA-container {
        position: relative;
        width: 100%;
        max-width: 480px;
        max-height: 88vh;
        overflow-y: auto;
        background: #fff;
        border-radius: 28px 28px 0 0;
        box-shadow: 0 30px 60px rgba(0, 0, 0, .2);
        animation: firkanSlideUp .25s ease both;
    }
    @keyframes firkanSlideUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

    .ModalProfile-HeaderNav-container {
        display: flex; align-items: center; justify-content: space-between;
        padding: 18px 18px 6px;
    }
    .ModalProfile-HeaderNav-title { font-size: 17px; font-weight: 600; color: #353535; }
    .modal-close-button {
        width: 32px; height: 32px; border-radius: 22px; border: none;
        background: rgba(0, 0, 0, .05);
        display: flex; align-items: center; justify-content: center;
        cursor: pointer; color: #353535;
    }
    .modal-close-button .firkan-icon { width: 13px; height: 13px; }

    .ModalPWA-content { padding: 10px 18px 24px; padding-bottom: 160px; }

    .ModalPWA-Switcher { display: flex; gap: 15px; padding: 10px 0; }
    .pwa-tab {
        padding: 6px 14px; border-radius: 15px; font-size: 15px;
        color: #8a8a8a; cursor: pointer;
    }
    .pwa-tab.active { background: #f4f4f4; color: #353535; font-weight: 600; }

    .ModalPWA-Instruction { display: flex; gap: 14px; margin-bottom: 18px; }
    .ModalPWA-Instruction-Number {
        flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px;
        background: #f4f4f4; display: flex; align-items: center; justify-content: center;
        font-weight: 600; color: #353535;
    }
    .ModalPWA-Instruction-Info { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
    .ModalPWA-Instruction-Info .text { font-size: 14px; color: #353535; line-height: 1.35; }
    .ModalPWA-Instruction-Info .icon { color: #353535; }

    .ModalPWA-AdvantagesContainer { margin-top: 10px; padding-top: 20px; border-top: 1px solid #eee; }
    .ModalPWA-AdvantagesContainer h3 { font-size: 18px; font-weight: 700; margin: 0 0 16px; color: #353535; }
    .ModalPWA-Advantage { display: flex; gap: 14px; margin-bottom: 18px; color: #353535; }
    .ModalPWA-Advantage svg { min-width: 23px; }
    .ModalPWA-AdvantageInfo { display: flex; flex-direction: column; gap: 4px; }
    .ModalPWA-AdvantageInfo span:first-child { font-size: 17px; font-weight: 600; }
    .ModalPWA-AdvantageInfo span:last-child { font-size: 14px; color: #8a8a8a; line-height: 1.35; }

    .ModalPWA-HideButton {
        display: block; width: 100%; margin-top: 8px;
        background: #f4f4f4; color: #353535; border: none;
        border-radius: 24px; padding: 15px; text-align: center;
        font-size: 15px; font-weight: 500; font-family: inherit; cursor: pointer;
    }
}

/* ---------- Маркетинговые баннеры из ACF (реальные поля с firkaan.kz) ---------- */
.firkan-banner-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.firkan-banner-row::-webkit-scrollbar { display: none; }

.firkan-banner-slide,
.firkan-small-banner-card,
.firkan-catalog-card {
    display: block;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    flex-shrink: 0;
}

/* Большой слайдер — во всю ширину, по одному экрану на карточку. */
.firkan-banner-row-big { scroll-snap-type: x mandatory; }
.firkan-big-banner-card {
    scroll-snap-align: start;
    width: 100%;
    flex-shrink: 0;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    aspect-ratio: 16/6;
}
.firkan-big-banner-card img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Мини-слайдер — компактные плашки чуть у́же экрана. */
.firkan-mini-banner-card {
    width: 260px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-card-sm);
    aspect-ratio: 2/1;
}
.firkan-mini-banner-card img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Маленький баннер с текстом (карточка "акции/новинки" и т.п.). */
.firkan-small-banner-card {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface-2);
    box-shadow: var(--shadow-card-sm);
}
.firkan-small-banner-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.firkan-small-banner-text {
    position: absolute;
    z-index: 2;
    top: 10px;
    left: 10px;
    right: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,.45);
}

/* Баннеры категории вместо общей секции скидок. */
.firkan-category-banners { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }

/* Каталоги дня/месяца. */
.firkan-daily-catalogs-banner {
    width: 100%;
    border-radius: 24px;
    display: block;
    margin-bottom: 14px;
    box-shadow: var(--shadow-card);
}
.firkan-catalog-card { width: 130px; }
.firkan-catalog-card img {
    width: 130px;
    height: 130px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card-sm);
    display: block;
}
.firkan-catalog-card span {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--foreground);
}

/* ---------- Лайтбокс (открытие картинки/галереи баннера без ссылки) ---------- */
.firkan-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 100010;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(20, 14, 8, .85);
}
.firkan-lightbox-overlay.is-open { display: flex; }
.firkan-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.firkan-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.firkan-lightbox-nav[hidden] { display: none; }
.firkan-lightbox-prev { left: 16px; }
.firkan-lightbox-prev .firkan-icon { transform: rotate(180deg); }
.firkan-lightbox-next { right: 16px; }
.firkan-lightbox-img {
    max-width: 90vw;
    max-height: 86vh;
    border-radius: 16px;
    box-shadow: var(--shadow-modal);
}

@media (max-width: 640px) {
    .firkan-big-banner-card { border-radius: 18px; }
}

/* ---------- Footer ---------- */
.firkan-footer { background: var(--foreground); color: #cfc7bd; padding: 44px 0; margin-top: 40px; }
.firkan-footer-row { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; }
.firkan-footer-logo { font-size: 20px; font-weight: 800; color: #fff; }
.firkan-footer-cols { display: flex; gap: 40px; flex-wrap: wrap; }
.firkan-footer-col { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.firkan-footer-col a:hover { color: #fff; }
.firkan-footer-city { font-size: 13px; color: #a99; opacity: .7; }
.firkan-footer-legal {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, .12);
    font-size: 12px;
    color: #a99;
    opacity: .7;
    line-height: 1.7;
}
.firkan-footer-legal p { margin: 0; }
.firkan-footer-legal a { color: inherit; text-decoration: none; }
.firkan-footer-legal a:hover { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) and (min-width: 641px) {
    .firkan-search { order: 5; flex-basis: 100%; }
    .firkan-header-row { flex-wrap: wrap; height: auto; padding: 12px 0; }
    .firkan-city { display: none; }
    .firkan-icon-text-label { display: none; }
    .firkan-logo-img { height: 28px; max-height: 28px; }
}
@media (max-width: 900px) { .firkan-hero { grid-template-columns: 1fr; } }

/* ---------- Мобильная версия (<=640px): в шапке только поиск, действия — в нижнем плавающем меню ---------- */
.firkan-mobile-bottom { display: none; }

@media (max-width: 640px) {
    body { padding-bottom: 128px; }

    .firkan-container { padding: 10px 0px; }

    ul.products.firkan-product-grid,
    .firkan-product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px 10px !important;
        padding: 0 0px !important;
    }

    .firkan-header { padding: 0px 10px; }
    .firkan-footer { padding: 40px 10px 170px; }

    .firkan-overlay-panel, .nm-login-popup-wrap { padding: 30px 15px 15px 15px; }
    .firkan-quickview-panel { padding-bottom: 160px; }
    .firkan-addresses-footer { margin-bottom: 150px; }
    .firkan-quickview-media .firkan-product-fav {
        right: auto;
        left: 10px;
        top: 10px;
    }
    .firkan-quickview-overlay .firkan-overlay-close {
        right: 8px;
        top: 8px;
    }
    .firkan-home { padding: 20px 10px 60px; }
    body.firkan-checkout-open .firkan-mobile-checkout-trigger { display: none; }

    /* Оформление заказа: вместо статус-бара и "Оформить заказ" — закреплённые "Итого" + "Отправить заказ".
       Только пока открыта корзина, иначе флаг checkout-open прятал бы статус-бар и на главной. */
    .firkan-mobile-order-bar { display: none; margin-bottom: 8px; }
    body.firkan-checkout-open:has(#firkan-cart-overlay.is-open) .firkan-mobile-status-bar,
    body.firkan-checkout-open:has(#firkan-cart-overlay.is-open) .firkan-mobile-checkout-bar { display: none; }
    body.firkan-checkout-open:has(#firkan-cart-overlay.is-open) .firkan-mobile-order-bar.is-ready { display: block; }
    /* Кнопка формы перенесена в закреплённую панель (клик по ней нажимает эту же кнопку программно). */
    #customer_mini_checkout #mini_checkout_submit_btn { display: none; }
    .firkan-mobile-order-bar .firkan-order-bar-total { color: var(--foreground); font-weight: 800; }
    .firkan-mobile-order-submit {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: 100%;
        border: none;
        border-radius: var(--radius-pill);
        background: var(--gradient-primary);
        color: #fff;
        font-family: inherit;
        font-weight: 700;
        font-size: 15px;
        padding: 14px 20px;
        cursor: pointer;
        box-shadow: var(--shadow-cta-lg);
    }
    .firkan-mobile-order-submit .firkan-order-bar-total { color: #fff; }
    .firkan-mobile-order-submit:disabled { opacity: .6; cursor: not-allowed; }

    .firkan-product-card-price del {
        font-size: 11px;
        margin-right: 2px;
    }
    .firkan-product-card-price {
        font-size: 17px;
    }

    .firkan-header-row { height: 64px; padding: 0; gap: 0; }
    /* В мобильной шапке вместо поиска — выбор магазина. */
    .firkan-header-row > *:not(.firkan-city-wrap):not(.firkan-header-address):not(.firkan-header-actions) { display: none !important; }
    /* Гость видит только кнопку входа, авторизованный — блок выбранного адреса доставки. */
    .firkan-header-actions > *:not(.showlogin) { display: none !important; }
    .firkan-city-wrap { flex-shrink: 0; margin-right: 12px; }
    .firkan-header-address {
        display: flex;
        width: auto;
        flex: auto;
        gap: 5px;
        min-width: fit-content;
    }
    .firkan-header-address-value { max-width: 55vw; }
    .firkan-header-actions { margin-left: auto; }
    .firkan-store-menu { min-width: 240px; }
    #firkan-category-row.firkan-categories-section { padding-top: 16px; }

    .firkan-mobile-bottom {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        /* Выше попапов (корзина/избранное/аккаунт), чтобы нижнее меню оставалось
           доступным поверх них — кроме модалки входа, см. правило ниже. */
        z-index: 1001;
        padding: 0 10px calc(10px + env(safe-area-inset-bottom, 0px));
    }
    /* Во время входа/регистрации нижнее меню не нужно — прячем именно для этой модалки. */
    body:has(#firkan-login-overlay.is-open) .firkan-mobile-bottom { display: none; }
    /* Белая плашка со скруглением сверху — только пока открыта корзина. */
    body:has(#firkan-cart-overlay.is-open) .firkan-mobile-bottom {
        background: #fff;
        padding-top: 20px;
        border-radius: 20px 20px 0px 0px;
        box-shadow: 0px 0px 15px #00000033;
    }

    .firkan-mobile-status-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        background: #fff;
        color: var(--foreground);
        border-radius: var(--radius-pill);
        padding: 10px 10px 10px 16px;
        margin-bottom: 8px;
        box-shadow: 0px 1px 10px #0000002e;
    }
    .firkan-mobile-status-delivery {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 12px;
        color: var(--muted);
        min-width: 0;
        flex: 1;
    }
    .firkan-mobile-status-delivery .firkan-icon { width: 16px; height: 16px; color: var(--accent-2); flex-shrink: 0; }
    .firkan-mobile-status-delivery strong {
        color: var(--foreground);
        font-weight: 700;
        white-space: nowrap;
    }
    .firkan-mobile-status-delivery-text {
        display: flex;
        flex-direction: column;
        gap: 5px;
        min-width: 0;
        flex: 1;
    }
    .firkan-mobile-delivery-track {
        display: block;
        width: 100%;
        height: 3px;
        border-radius: 999px;
        background: var(--surface-2);
        overflow: hidden;
    }
    .firkan-mobile-delivery-fill {
        display: block;
        width: 100%;
        height: 100%;
        border-radius: 999px;
        background: var(--gradient-primary);
        transform-origin: left center;
        transition: transform .3s ease;
    }
    .firkan-mobile-status-cart {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
        background: var(--gradient-primary);
        color: #fff;
        border: none;
        border-radius: var(--radius-pill);
        padding: 8px 14px;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
    }
    .firkan-mobile-status-cart .firkan-icon { width: 16px; height: 16px; }

    /* Итого + "Оформить заказ" прямо в нижнем баре — дублирует .firkan-cart-footer
       из панели корзины, поэтому там она больше не нужна (прячем ниже). */
    /* Только пока открыта корзина — не на каждой странице. */
    .firkan-mobile-checkout-bar { display: none; margin-bottom: 8px; }
    body:has(#firkan-cart-overlay.is-open) .firkan-mobile-checkout-bar { display: block; }
    .firkan-mobile-checkout-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 4px;
        margin-bottom: 8px;
        font-size: 13px;
        font-weight: 600;
        color: var(--muted);
    }
    .firkan-mobile-checkout-row .firkan-cart-total { color: var(--foreground); font-weight: 800; }
    .firkan-mobile-checkout-trigger {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        border: none;
        border-radius: var(--radius-pill);
        background: var(--gradient-primary);
        color: #fff;
        font-weight: 700;
        font-size: 15px;
        padding: 14px 20px;
        cursor: pointer;
        box-shadow: var(--shadow-cta-lg);
    }
    .firkan-cart-footer { display: none; }

    .firkan-mobile-nav {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-around;
        background: #fff;
        border-radius: 999px;
        box-shadow: 0px 1px 10px #0000002e;
        padding: 10px;
        overflow: hidden;
    }
    .firkan-mobile-nav-indicator {
        position: absolute;
        top: 0;
        left: 0;
        border-radius: 300px;
        background: var(--gradient-primary);
        box-shadow: var(--shadow-cta);
        z-index: 0;
        opacity: 1;
        transition: transform .28s cubic-bezier(.22, 1, .36, 1), opacity .15s ease;
    }
    .firkan-mobile-nav-item {
        position: relative;
        z-index: 1;
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        border: none;
        background: none;
        padding: 8px 2px;
        color: var(--muted);
        font-family: inherit;
        cursor: pointer;
        transition: color .2s ease;
    }
    .firkan-mobile-nav-item .firkan-icon { width: 20px; height: 20px; }
    .firkan-mobile-nav-item span { font-size: 9px; font-weight: 600; }
    .firkan-mobile-nav-item.is-active { color: #fff; }
}

/* ---------- Меню каталога (мобильное): категории по 3 в ряд ---------- */
.firkan-catalog-menu-view[hidden] { display: none; }
body.firkan-catalog-menu-active #firkan-category-row { display: none; }
.firkan-catalog-level[hidden] { display: none; }
.firkan-catalog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.firkan-catalog-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    background: none;
    color: var(--foreground);
    font: inherit;
    cursor: pointer;
    text-align: center;
}
.firkan-catalog-tile-img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    overflow: hidden;
}
.firkan-catalog-tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.firkan-catalog-tile-name { font-size: 12px; font-weight: 600; line-height: 1.25; }
.firkan-catalog-tile:active .firkan-catalog-tile-img { transform: scale(.96); }
