/* ========================================
   AISHA — Design System
   Brand: #FF6E00 orange + #1C2047 navy
   ======================================== */

/* --- Design Tokens --- */
:root {
    /* Brand Colors */
    --color-primary:        #1C2047;   /* navy — text, headings, dark UI */
    --color-primary-light:  #2d3260;
    --color-accent:         #FF6E00;   /* orange — CTA, active, badges */
    --color-accent-hover:   #e66000;
    --color-accent-light:   #fff3eb;   /* orange tint for backgrounds */

    /* Surfaces */
    --color-bg:             #FFFFFF;
    --color-white:          #FFFFFF;
    --color-card:           #FFFFFF;
    --color-surface:        #F0F2F6;
    --color-overlay:        rgba(28, 32, 71, 0.06);

    /* Text */
    --color-text:           #1C2047;
    --color-text-secondary: #6B7280;
    --color-text-muted:     #A0A8B4;

    /* UI Elements */
    --color-border:         #E4E7EF;
    --color-search-bg:      #F0F1F5;
    --color-star:           #FFA500;
    --color-badge:          #FF6E00;
    --color-heart-active:   #EF0D10;
    --product-card-accent:  #E8F0FA;
    --product-card-border:  #E8F0FA;

    /* Tab states */
    --color-tab-active-bg:  #FF6E00;
    --color-tab-active-text:#FFFFFF;
    --color-tab-bg:         #F0F1F5;
    --color-tab-text:       #6B7280;

    /* Nav */
    --color-nav-active:     #FF6E00;
    --color-nav-inactive:   #484C78;

    /* Card / design palette (Figma) */
    --color-card-title:     #484C78;   /* product title, nav labels */
    --color-card-surface:   #FDFDFD;    /* card background */
    --color-card-line:      #FAFAFA;    /* card border */
    --color-muted-2:        #9699A2;    /* inactive chip text, rating */
    --color-placeholder:    #C5C8D0;    /* search placeholder */
    --color-soft:           #F0F1F5;    /* chips / search / icon buttons */

    /* Promo */
    --color-promo-bg:       #1C2047;

    /* Typography */
    --font-primary:  'Montserrat', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display:  'Montserrat', 'Inter', -apple-system, sans-serif;

    /* Spacing (4pt grid) */
    --space-xs:  4px;
    --space-sm:  8px;
    --space-md:  12px;
    --space-lg:  16px;
    --space-xl:  20px;
    --space-2xl: 24px;
    --space-3xl: 32px;

    /* Border Radius */
    --radius-sm:   8px;
    --radius-md:   12px;
    --radius-lg:   16px;
    --radius-xl:   20px;
    --radius-2xl:  24px;
    --radius-full: 50%;

    /* Shadows */
    --shadow-xs:     none;
    --shadow-card:   none;
    --shadow-nav:    none;
    --shadow-button: none;
    --shadow-search: 0 0 0 2px #FF6E00;

    /* Transitions */
    --transition-fast:   0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow:   0.4s ease;

    /* Layout */
    --app-max-width:  430px;
    --header-height:  66px;
    --nav-height:     64px;
}

/* --- Reset --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    /* Always reserve room for the vertical scrollbar so the page width never
       jumps when switching between categories that do / don't overflow
       (full grid → scrollbar appears, empty state → it disappears). */
    scrollbar-gutter: stable;
}

body {
    font-family: var(--font-primary);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a    { text-decoration: none; color: inherit; }
button { border: none; background: none; cursor: pointer; font-family: inherit; font-size: inherit; color: inherit; }
input { border: none; outline: none; font-family: inherit; font-size: inherit; }
img  { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }

/* ─── App Container ─── */
.app {
    width: 100%;
    max-width: var(--app-max-width);
    min-height: 100vh;
    background: var(--color-white);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ─── Header ─── */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    height: var(--header-height);
    background: var(--color-white);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--color-card-line);
}

.header__brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.header__logo-img {
    height: 54px;
    width: auto;
    object-fit: contain;
}

.header__tagline {
    font-size: 0.68rem;
    color: var(--color-text-muted);
    font-weight: 500;
    line-height: 1.2;
}

.header__icons {
    display: flex;
    align-items: center;
    gap: 13px;
}

.header__notify {
    position: relative;
    width: 33px;
    height: 33px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: var(--color-card-title);
    background: #F7F8FA;
    border-radius: 11px;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.header__notify:active {
    background: var(--color-soft);
    transform: scale(0.92);
}

.header__notify-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #FF3B30;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--color-white);
}

.header__cart {
    position: relative;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: var(--color-primary);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.header__cart:active {
    transform: scale(0.92);
}

.header__cart-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 17px;
    height: 17px;
    background: var(--color-accent);
    color: var(--color-white);
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── Search ─── */
.search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px 0;
    background: var(--color-white);
    position: sticky;
    top: var(--header-height);
    z-index: 99;
    border-bottom: none;
}

.search__input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--color-search-bg);
    border-radius: 13px;
    padding: 0 var(--space-lg);
    height: 48px;
    transition: box-shadow var(--transition-fast);
}

.search__input-wrapper:focus-within {
    box-shadow: var(--shadow-search);
}

.search__icon {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.search__input {
    flex: 1;
    background: transparent;
    height: 100%;
    font-size: 0.875rem;
    color: var(--color-text);
}

.search__input::placeholder {
    color: var(--color-placeholder);
}

.search__filter {
    width: 48px;
    height: 48px;
    background: var(--color-search-bg);
    color: var(--color-card-title);
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.search__filter:active {
    transform: scale(0.93);
    background: var(--color-border);
}

/* Clear-search button inside the input */
.search__clear {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-border, #e5e7eb);
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background var(--transition-fast);
}
.search__clear:active { transform: scale(0.9); }

/* Active filter chips under the search bar */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 var(--space-lg) 4px;
    margin-top: -2px;
}
.active-filters__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px 6px 12px;
    background: #fff3eb;
    border: 1px solid #ffd9bf;
    color: #FF6E00;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.active-filters__chip i {
    font-size: 0.72rem;
    width: 15px;
    height: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,110,0,0.14);
}
.active-filters__chip:active { transform: scale(0.96); }
.active-filters__clear-all {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: none;
    border: 1px solid var(--color-border, #e5e7eb);
    color: #6b7280;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

/* Empty state with reset button */
.products__empty .btn { margin-top: 14px; }

/* ─── Main ─── */
.main {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: calc(var(--nav-height) + var(--space-xl));
    -webkit-overflow-scrolling: touch;
    background: var(--color-bg);
}

.main::-webkit-scrollbar { display: none; }
.main { -ms-overflow-style: none; scrollbar-width: none; }

/* ─── Promo Slider ─── */
.promo-slider {
    position: relative;
    padding: 17px 12px 0;
    margin-bottom: 0;
}

.promo-slider__track {
    position: relative;
    overflow: hidden;
    border-radius: 13px;
}

/* Horizontal rail holding every slide side-by-side; it slides as one block so
   the current banner leaves left while the next enters from the right. */
.promo-slider__rail {
    display: flex;
    transition: transform 0.45s ease-in-out;
    will-change: transform;
}

.promo-slide {
    flex: 0 0 100%;
    width: 100%;
    display: flex;
    align-items: center;
    position: relative;
    background: var(--color-promo-bg);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    min-height: 160px;
    overflow: hidden;
}

/* Image-only banner */
.promo-slide--img {
    display: block;
    padding: 0;
    background: #111;
    min-height: unset;
    aspect-ratio: 16 / 7;
    border-radius: var(--radius-xl);
}

@media (prefers-reduced-motion: reduce) {
    .promo-slider__rail { transition: none; }
}

.promo-slide--img a {
    display: block;
    position: absolute;
    inset: 0;
}

.promo-slide--img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-xl);
}

.promo-slide__content {
    display: flex;
    flex-direction: column;
    z-index: 2;
    flex: 1;
}

.promo-slide__label {
    color: rgba(255,255,255,.7);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: var(--space-xs);
}

.promo-slide__percent {
    color: var(--color-white);
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: var(--space-xs);
}

.promo-slide__percent-sign {
    font-size: 1.6rem;
    vertical-align: super;
}

.promo-slide__upto {
    color: var(--color-accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: var(--space-md);
}

.promo-slide__link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--color-accent);
    color: var(--color-white);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: var(--radius-full);
    width: fit-content;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.promo-slide__link:active { opacity: .85; transform: scale(.97); }

.promo-slide__image {
    position: absolute;
    right: -10px;
    top: 0;
    bottom: 0;
    width: 52%;
    z-index: 1;
}

.promo-slide__image::before {
    content: '';
    position: absolute;
    left: -40px;
    top: 0;
    bottom: 0;
    width: 80px;
    background: linear-gradient(to right, var(--color-promo-bg), transparent);
    z-index: 2;
}

.promo-slide__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
}



/* Pagination dots — overlaid in a translucent pill at the banner bottom (Figma) */
.promo-slider__dots {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 3px 9px;
    background: rgba(250, 250, 250, 0.52);
    -webkit-backdrop-filter: blur(2px);
            backdrop-filter: blur(2px);
    border-radius: 10px;
    z-index: 2;
}

.promo-slider__dot {
    width: 5px;
    height: 5px;
    border-radius: var(--radius-full);
    background: #484C78;
    opacity: 0.44;
    cursor: pointer;
    transition: background var(--transition-normal), opacity var(--transition-normal);
}

/* Active dot — same small circle, just orange (NOT an elongated pill) */
.promo-slider__dot--active {
    width: 5px;
    height: 5px;
    border-radius: var(--radius-full);
    background: #FF6E00;
    opacity: 0.71;
}

/* ─── Section Header ─── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-lg) var(--space-sm);
}

.section-header__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
}

.section-header__link {
    font-size: 0.8rem;
    color: var(--color-accent);
    font-weight: 600;
}

/* ─── Categories ─── */
.categories {
    display: flex;
    gap: 9px;
    padding: 17px 12px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: var(--color-white);
    border-bottom: none;
}

.categories::-webkit-scrollbar { display: none; }

.categories__tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 14px;
    height: 36px;
    min-height: 36px;
    line-height: 1;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    background: var(--color-soft);
    color: var(--color-muted-2);
    border: none;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.categories__tab i {
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
}

.categories__tab:active {
    transform: scale(0.95);
    opacity: 0.85;
}

.categories__tab--active {
    background: var(--color-accent);
    color: #fff;
    font-weight: 600;
    border-color: transparent;
}

/* ─── Products Grid ─── */
.products {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 11px;
    padding: 17px 12px 8px;
}

/* ─── Product Card ─── */
.product-card {
    background: var(--color-card-surface);
    border-radius: 13px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    border: 1.5px solid var(--color-card-line);
    transition: transform var(--transition-fast);
}

.product-card:active { transform: scale(0.97); }

/* ── Image zone — inset 6px inside the card, matching Figma ── */
.product-card__image-wrapper {
    position: relative;
    height: 162px;
    margin: 6px 6px 0;
    background: #ffffff;
    overflow: hidden;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Actions group — lower-right of card image (column: fav → share → chat),
   anchored to the bottom like the Figma design */
.product-card__actions {
    position: absolute;
    bottom: 10px;
    right: 9px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    z-index: 3;
}

/* Shared style for all action buttons (chat, share, favourite) */
.product-card__action-btn,
.product-card__favorite {
    width: 23px;
    height: 23px;
    background: rgba(250,250,250,.56);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.66rem;
    color: #9699A2;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.product-card__action-btn:active,
.product-card__favorite:active { transform: scale(0.86); }

/* Chat icon — same speech-bubble glyph as the bottom-nav «Чат», inherits the
   muted action-button colour. */
.product-card__chat-icon {
    width: 11px;
    height: 11px;
    display: block;
    color: inherit;
}
.product-card__favorite--active { color: var(--color-heart-active); }
.product-card__favorite--active i { animation: heartPop 0.28s ease; will-change: transform; }

@keyframes heartPop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* Badge — top-left chip. Single shared shape (Figma «New»): 34×17, radius 5,
   9px SemiBold. New / Скидка / Хит differ only by colour. */
.product-card__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 17px;
    padding: 0 7px;
    border-radius: 5px;
    font-size: 9px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
    z-index: 3;
    white-space: nowrap;
    pointer-events: none;
}

.product-card__badge--new  { background: rgba(255, 0, 0, 0.6); color: #fff; }
.product-card__badge--sale { background: var(--color-accent);  color: #fff; }
.product-card__badge--hit  { background: var(--color-primary); color: #fff; }

/* ── Info section ── */
.product-card__info {
    padding: 10px 9px 11px;
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    background: var(--color-card-surface);
}

.product-card__name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-card-title);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Footer: price (left) · rating (center) · cart (right), vertically centered */
.product-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.product-card__prices {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.product-card__old-price {
    font-size: 0.63rem;
    color: rgba(28,32,71,0.55);
    text-decoration: line-through;
    line-height: 1;
}

.product-card__price {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--color-accent);
    letter-spacing: -0.2px;
    line-height: 1.2;
}

/* Rating — sits in the footer row, vertically centered. Display only. */
.product-card__rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
    line-height: 1;
    color: var(--color-muted-2);
    pointer-events: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.product-card__rating i {
    font-size: 0.62rem;
    color: #FEA500;
    display: block;
    line-height: 1;
    vertical-align: middle;
    margin: 0;
    transform: none;
}
.product-card__rating-num {
    display: block;
    line-height: 1;
    font-size: 0.62rem;
    margin: 0;
}
.product-card__rating--empty { color: #9aa0ad; }
.product-card__rating--empty i { color: #cfd3dd; }

/* Cart button — right side of the footer row, vertically centered */
.product-card__cart-btn {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    background: transparent;
    color: var(--color-primary);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    line-height: 1;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.product-card__cart-btn--in-cart {
    color: var(--color-accent);
}

.product-card__cart-btn:active {
    transform: scale(0.88);
    opacity: .85;
}

/* ─── Bottom Navigation ─── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--app-max-width);
    height: 72px;
    background: #FAFAFA;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    box-shadow: 0 -2px 16px rgba(72, 76, 120, .06);
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom, 0);
    border-top: 1px solid #FAFAFA;
    overflow: visible;
    will-change: transform;
}

.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--color-nav-inactive);
    transition: color var(--transition-fast);
    position: relative;
    height: 100%;
    padding: 12px 16px 0;
    -webkit-tap-highlight-color: transparent;
    min-width: 52px;
}

.nav-icon-zone {
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.bottom-nav__item i { font-size: 1.2rem; }
.bottom-nav__item svg.nav-icon-cat  { width: 1.1rem; height: 1.1rem; display: block; }
.bottom-nav__item svg.nav-icon-chat { width: 21px; height: 25px; display: block; }

.bottom-nav__item--active {
    color: var(--color-accent);
}

.bottom-nav__item--active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    background: var(--color-accent);
    border-radius: 0 0 4px 4px;
}

.bottom-nav__item:active { opacity: 0.6; }

/* Center floating chat button (FAB) — raised above the bar */
.bottom-nav__item--fab {
    justify-content: center;
    padding-top: 0;
    min-width: 60px;
}
.bottom-nav__item--fab .nav-icon-zone {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--color-accent);
    box-shadow: 0 0 0 6px #FAFAFA;   /* solid ring like the Figma stroke — no drop shadow */
    transform: translateY(-18px);
    transition: transform var(--transition-fast);
}
.bottom-nav__item--fab .nav-icon-chat { width: 24px; height: 24px; }
.bottom-nav__item--fab .nav-icon-chat path { fill: #fff; }
.bottom-nav__item--fab .nav-icon-chat rect { fill: var(--color-accent); }
.bottom-nav__item--fab:active { opacity: 1; }
.bottom-nav__item--fab:active .nav-icon-zone { transform: translateY(-18px) scale(0.94); }
.bottom-nav__item--fab.bottom-nav__item--active::before { display: none; }

.bottom-nav__icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bottom-nav__badge {
    position: absolute;
    top: -1px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--color-accent);
    border-radius: 50%;
    border: 2px solid #ffffff;
    animation: badgePulse 1.6s ease-in-out infinite;
    will-change: opacity, transform;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1;    transform: scale(1);    }
    50%       { opacity: 0.55; transform: scale(1.12); }
}

.bottom-nav__notify-badge {
    position: absolute;
    top: 4px;
    right: 12px;
    width: 8px;
    height: 8px;
    background: var(--color-accent);
    border-radius: var(--radius-full);
    border: 2px solid var(--color-white);
}

/* ─── Loading Skeleton ─── */
.skeleton {
    background: linear-gradient(90deg, #f0f1f5 25%, #e5e7ed 50%, #f0f1f5 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
    will-change: background-position;
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ─── Empty States ─── */
.products__empty,
.page-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.products__empty {
    grid-column: 1 / -1;
    /* Fill the free space between the search bar and the bottom nav so the
       empty state sits centered vertically. */
    min-height: calc(100dvh - var(--header-height) - var(--nav-height) - 80px);
    padding: 24px var(--space-xl);
}

.page-empty {
    grid-column: 1 / -1;
    min-height: calc(100dvh - var(--header-height) - var(--nav-height));
    padding: var(--space-xl);
}

.products__empty i,
.page-empty i {
    font-size: 2.5rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

.products__empty p,
.page-empty p {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn--primary {
    background: var(--color-accent);
    color: var(--color-white);
    box-shadow: var(--shadow-button);
}

.btn--primary:hover  { background: var(--color-accent-hover); }
.btn--primary:active { transform: scale(0.97); }

.btn--full {
    width: 100%;
    padding: var(--space-lg);
}


/* ─── Filter Modal ─── */
.filter-modal {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--app-max-width);
    height: 100%;
    background: rgba(28,32,71,.45);
    z-index: 300;
    display: none;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.filter-modal--open {
    display: block;
    opacity: 1;
}

.filter-modal__panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-white);
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    padding: var(--space-2xl);
    transform: translateY(100%);
    transition: transform var(--transition-normal);
    max-height: 75vh;
    overflow-y: auto;
}

.filter-modal--open .filter-modal__panel { transform: translateY(0); }

.filter-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
}

.filter-modal__title {
    font-size: 1.05rem;
    font-weight: 700;
}

.filter-modal__close {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border-radius: var(--radius-full);
}

.filter-group { margin-bottom: var(--space-xl); }

.filter-group__label {
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    display: block;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-group__options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.filter-chip {
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.82rem;
    background: var(--color-tab-bg);
    color: var(--color-tab-text);
    transition: all var(--transition-fast);
    font-weight: 500;
    white-space: nowrap;
    text-align: center;
    cursor: pointer;
    line-height: 1.3;
}

.filter-chip--active {
    background: var(--color-accent);
    color: var(--color-white);
}

.price-range {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.price-range__input {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    background: var(--color-search-bg);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    text-align: center;
}

.price-range__separator {
    color: var(--color-text-muted);
    font-weight: 500;
}

.filter-modal__actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.filter-modal__reset {
    flex: 1;
    padding: var(--space-lg);
    background: var(--color-search-bg);
    color: var(--color-text);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    transition: background var(--transition-fast);
}

.filter-modal__reset:hover { background: #e4e6eb; }

.filter-modal__apply {
    flex: 1;
    padding: var(--space-lg);
    background: var(--color-accent);
    color: var(--color-white);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0;
    transition: background var(--transition-fast);
    box-shadow: var(--shadow-button);
}

.filter-modal__apply:hover { background: var(--color-accent-hover); }

/* ─── Price Slider ─── */
.price-slider-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.price-slider__val { font-size: 0.88rem; font-weight: 600; color: var(--color-accent); }
.price-slider-wrap { padding: 8px 0; }
.price-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 5px; border-radius: 100px; outline: none; cursor: pointer; background: #E5E7EB; }
.price-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #FF6E00; cursor: pointer; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(255,110,0,0.35); }
.price-slider::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #FF6E00; cursor: pointer; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(255,110,0,0.35); border: none; }

/* ════════════════════════════════════════
   Sub-page shared styles
   ════════════════════════════════════════ */

/* Back / page header variants */
.header__back {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--color-primary);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

.header__back:active { background: var(--color-overlay); }

.header__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
}

.header--centered-title .header__title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.header__action {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

.header__action:active { color: var(--color-accent); }

/* ─── Product Detail ─── */
.detail__image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: var(--color-surface);
    overflow: hidden;
}

.detail__image { width: 100%; height: 100%; object-fit: cover; }

.detail__fav-btn {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    width: 42px;
    height: 42px;
    background: var(--color-white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--color-text-muted);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-fast);
}

.detail__fav-btn--active { color: var(--color-heart-active); }

.detail__content { padding: var(--space-xl); }

.detail__header { margin-bottom: var(--space-md); }

.detail__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.detail__rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    color: var(--color-text-secondary);
}

.detail__rating i { color: var(--color-star); }

.detail__reviews { color: var(--color-text-muted); }

.detail__price-row {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.detail__price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-accent);
}

.detail__old-price {
    font-size: 1rem;
    color: var(--color-text-muted);
    text-decoration: line-through;
}

.detail__description {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.65;
    margin-bottom: var(--space-xl);
}

.detail__option { margin-bottom: var(--space-lg); }

.detail__option-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--color-text-secondary);
}

.detail__chips { display: flex; flex-wrap: wrap; gap: var(--space-sm); }

.detail__chip {
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--color-tab-bg);
    color: var(--color-tab-text);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
}

.detail__chip--active {
    background: var(--color-accent);
    color: var(--color-white);
}

.detail__qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
}

.detail__qty {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--color-search-bg);
    border-radius: var(--radius-md);
    padding: var(--space-xs) var(--space-sm);
}

.detail__qty-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-accent);
    background: var(--color-white);
    transition: background var(--transition-fast);
    border: none;
    cursor: pointer;
}

.detail__qty-btn:active { background: var(--color-border); }

.detail__qty-value {
    font-size: 1rem;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}

.detail__related { padding: var(--space-xl); padding-top: 0; }

.detail__related-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
}

/* ─── Cart Page ─── */
.cart-list { padding: 0 var(--space-xl); }

.cart-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border);
    align-items: flex-start;
}

.cart-item:last-child { border-bottom: none; }

.cart-item__image {
    width: 84px;
    height: 106px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-surface);
    flex-shrink: 0;
    position: relative;
}

.cart-item__image img { width: 100%; height: 100%; object-fit: cover; }

.cart-item__image--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 1.5rem;
}

.cart-item__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 6px;
}

.cart-item__top {
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.cart-item__name {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    margin: 0;
}

.cart-item__remove {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    background: none;
    padding: 0;
    margin-top: -2px;
}

.cart-item__remove:active { color: #e74c3c; }

.cart-item__variants {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cart-item__color {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cart-item__color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid transparent;
}

.cart-item__color-dot--light { border-color: #ddd; }

.cart-item__color-name {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.cart-item__size {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-muted);
    background: var(--color-search-bg);
    border-radius: 5px;
    padding: 2px 7px;
}

.cart-item__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.cart-item__qty {
    display: flex;
    align-items: center;
    background: var(--color-search-bg);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.cart-item__qty-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    background: var(--color-white);
    color: var(--color-accent);
    border: none;
    cursor: pointer;
}

.cart-item__qty-value {
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 28px;
    text-align: center;
    color: var(--color-primary);
}

.cart-item__price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-accent);
}

.cart-summary {
    padding: var(--space-xl);
    margin-top: var(--space-sm);
    border-top: 1px solid var(--color-border);
}

.cart-summary__row {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
}

.cart-summary__free { color: #28a745; font-weight: 500; }

.cart-summary__total {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border);
    margin-bottom: var(--space-lg);
}

/* ─── Categories Page ─── */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    padding: var(--space-xl);
}

.cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-2xl) var(--space-lg);
    background: var(--color-white);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: transform var(--transition-fast);
    border: 1px solid var(--color-border);
}

.cat-card:hover  { transform: translateY(-2px); }
.cat-card:active { transform: translateY(0); }

.cat-card__icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: var(--space-xs);
    background: var(--color-accent-light);
    color: var(--color-accent);
}

.cat-card__name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
}

.cat-card__count {
    font-size: 0.72rem;
    color: var(--color-text-muted);
}

.cat-products__header {
    padding: var(--space-lg) var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.cat-products__back {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.82rem;
    color: var(--color-text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm) 0;
}

.cat-products__back:hover { color: var(--color-accent); }

.cat-products__title {
    font-size: 1rem;
    font-weight: 700;
    margin-left: auto;
}

/* ─── Profile Page ─── */
.profile { padding: var(--space-xl); }

.profile__header {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.profile__avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: var(--color-accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--color-accent);
    flex-shrink: 0;
}

.profile__name { font-size: 1.15rem; font-weight: 700; }

.profile__email { font-size: 0.78rem; color: var(--color-text-muted); }

.profile__stats {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

.profile__stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-lg);
    background: var(--color-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.profile__stat-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-accent);
}

.profile__stat-label {
    font-size: 0.68rem;
    color: var(--color-text-muted);
    margin-top: 2px;
    text-align: center;
}

.profile__menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile__menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--color-text);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
    text-decoration: none;
    font-family: inherit;
}

.profile__menu-item:hover { background: var(--color-surface); }

.profile__menu-item i:first-child {
    width: 20px;
    text-align: center;
    color: var(--color-accent);
}

.profile__menu-item span { flex: 1; text-align: left; }

.profile__menu-item i:last-child {
    color: var(--color-text-muted);
    font-size: 0.72rem;
}

.profile__menu-item--danger { color: #e74c3c; }
.profile__menu-item--danger i:first-child { color: #e74c3c; }

/* ─── Notifications Page ─── */
.notif-list { padding: 0 var(--space-xl); }

.notif-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.notif-item:last-child { border-bottom: none; }

.notif-item__dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: transparent;
    flex-shrink: 0;
    margin-top: 6px;
}

.notif-item--unread .notif-item__dot { background: var(--color-accent); }

.notif-item__content { flex: 1; min-width: 0; }

.notif-item__title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.notif-item--unread .notif-item__title { color: var(--color-primary); }

.notif-item__text {
    font-size: 0.78rem;
    color: var(--color-text-secondary);
    line-height: 1.45;
    margin-bottom: var(--space-xs);
}

.notif-item__time {
    font-size: 0.68rem;
    color: var(--color-text-muted);
}

/* ─── Utility ─── */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}


/* ── Per-item variant picker (shared: product page + QS modal) ── */
.pv__block {
    background: #fafafa; border-radius: 14px;
    padding: 12px; display: flex; flex-direction: column; gap: 0;
}
.pv__row { padding: 10px 0; }
.pv__divider { border: none; border-top: 1px solid #efefef; margin: 0; }
.pv__row-label { font-size: 12px; font-weight: 700; color: #111; display: block; margin-bottom: 8px; }
.pv__row-opts { display: flex; flex-direction: column; gap: 12px; }
.pv__swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.pv__swatch {
    width: 28px; height: 28px; border-radius: 50%;
    border: none; cursor: pointer; outline: none;
    box-shadow: 0 2px 5px rgba(0,0,0,.15);
    transition: transform .15s; flex-shrink: 0;
}
.pv__swatch:active { transform: scale(.85); }
.pv__swatch--on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #FF6E00 !important; transform: scale(1.1); }
.pv__swatch--light { box-shadow: inset 0 0 0 1.5px #ddd; }
.pv__swatch--light.pv__swatch--on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #FF6E00 !important; }
.pv__chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pv__chip {
    min-width: 36px; height: 30px; padding: 0 10px;
    border: 1.5px solid #e8e8e8; border-radius: 8px;
    background: #fff; font-size: 12px; font-weight: 600;
    color: #111; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .15s, background .15s, color .15s;
}
.pv__chip--on { border-color: #FF6E00; background: #FF6E00; color: #fff; }
.pv__warn { display: block; font-size: 11px; color: #e74c3c; margin-top: 6px; font-weight: 500; }

/* ─── Quick Order Bottom Sheet ─── */
.qs-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.52);
    z-index: 500;
    display: flex; align-items: flex-end; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease;
}
.qs-overlay.open { opacity: 1; pointer-events: all; }

.qs-sheet {
    background: #fff;
    border-radius: 24px 24px 0 0;
    width: 100%; max-width: var(--app-max-width);
    max-height: 90vh;
    display: flex; flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}
.qs-overlay.open .qs-sheet { transform: translateY(0); }

.qs-header {
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    padding: 14px 16px 10px; position: relative;
}
.qs-drag {
    width: 36px; height: 4px;
    background: #e0e0e0; border-radius: 2px; cursor: grab;
}
.qs-close {
    position: absolute; top: 12px; right: 12px;
    width: 36px; height: 36px;
    background: #f5f5f5; border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; cursor: pointer; color: #777; transition: background 0.15s;
}
.qs-close:active { background: #e8e8e8; }

.qs-body {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 8px 16px 16px;
    display: flex; flex-direction: column; gap: 14px;
}

/* Product row */
.qs-product {
    flex-shrink: 0;
    display: flex; gap: 14px; align-items: flex-start;
    padding-bottom: 14px; border-bottom: 1px solid #f0f0f0;
}
.qs-product__photo {
    flex-shrink: 0; width: 110px; height: 110px;
    border-radius: 14px; background: #f6f6f6;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.qs-product__photo img { width: 100%; height: 100%; object-fit: contain; }
.qs-product__info {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 6px; padding-top: 2px;
}
.qs-product__name {
    font-size: 15px; font-weight: 700; margin: 0;
    color: var(--color-primary, #1C2047); line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.qs-product__prices { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.qs-product__price {
    font-size: 22px; font-weight: 800;
    color: var(--color-primary, #1C2047); line-height: 1;
}
.qs-product__old-price {
    font-size: 13px; color: #bbb; text-decoration: line-through;
}
.qs-product__desc {
    font-size: 12px; color: var(--color-text-secondary, #6B7280);
    line-height: 1.45; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Gallery thumbnails */
.qs-thumbs {
    flex-shrink: 0;
    display: flex; justify-content: center; align-items: center;
    gap: 8px; overflow-x: auto; padding-bottom: 2px; width: 100%;
}
.qs-thumb {
    flex-shrink: 0; width: 48px; height: 48px;
    border-radius: 8px; overflow: hidden;
    border: 2px solid #f0f0f0; cursor: pointer;
    background: #f8f8f8; transition: border-color 0.15s;
}
.qs-thumb img { width: 100%; height: 100%; object-fit: contain; }
.qs-thumb--active { border-color: var(--color-accent, #FF6E00); }

/* ─── Photo Viewer Overlay ─── */
.photo-viewer-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 600;
    display: flex; align-items: center; justify-content: center;
    padding: 12px;
    box-sizing: border-box;
}
.photo-viewer {
    width: 100%; max-width: 420px;
    background: #fff;
    border-radius: 24px;
    padding: 16px;
    position: relative;
    box-sizing: border-box;
}
.photo-viewer-close {
    position: absolute; top: 12px; right: 12px;
    width: 32px; height: 32px;
    border-radius: 50%; border: none;
    background: #f0f0f0; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; color: #333;
    z-index: 1;
}
.photo-viewer-close:hover { background: #e0e0e0; }
.photo-viewer-main {
    width: 100%; max-height: 70vh;
    object-fit: contain; border-radius: 16px;
    display: block;
}
.photo-viewer-thumbs {
    margin-top: 14px;
    display: flex; justify-content: center; align-items: center;
    gap: 10px; overflow-x: auto;
    padding-bottom: 4px; width: 100%;
}
.photo-viewer-thumb {
    flex-shrink: 0; width: 48px; height: 48px;
    border-radius: 8px; overflow: hidden;
    border: 2px solid #f0f0f0; cursor: pointer;
    background: #f8f8f8; transition: border-color 0.15s;
}
.photo-viewer-thumb img { width: 100%; height: 100%; object-fit: contain; }
.photo-viewer-thumb--active { border-color: var(--color-accent, #FF6E00); }

/* Sizes */
.qs-block { flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; }
#qsVariantsArea { flex-shrink: 0; }
.qs-block__label {
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.07em; color: var(--color-primary, #1C2047);
}
.qs-block__label--color,
.qs-block__label--size {
    text-transform: none;
    letter-spacing: 0;
}
.qs-field-warn {
    display: none;
    font-size: 11px;
    color: #e74c3c;
    font-weight: 600;
    margin-top: -3px;
}
/* Color swatches */
.qs-colors { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.qs-color-swatch {
    width: 30px; height: 30px; border-radius: 50%;
    border: none; cursor: pointer; padding: 0; flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.10);
    transition: box-shadow 0.15s;
}
.qs-color-swatch--active {
    box-shadow: 0 0 0 2.5px #fff, 0 0 0 4.5px var(--color-accent, #FF6E00);
}

.qs-sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.qs-size-chip {
    height: 36px; min-width: 46px; padding: 0 16px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid #e8e8e8; border-radius: 9px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    background: #fff; color: var(--color-primary, #1C2047);
    font-family: inherit; transition: all 0.15s;
}
.qs-size-chip:hover:not(.qs-size-chip--active) {
    border-color: var(--color-accent, #FF6E00);
    color: var(--color-accent, #FF6E00);
}
.qs-size-chip--active {
    border-color: var(--color-accent, #FF6E00);
    background: var(--color-accent, #FF6E00); color: #fff;
}

/* Qty + total block */
.qs-qty-row {
    display: flex; align-items: center;
    justify-content: space-between; gap: 12px;
    background: var(--color-accent-light, #fff3eb);
    border-radius: 14px; padding: 12px 14px;
}
.qs-qty {
    display: flex; align-items: center;
    background: #fff; border-radius: 10px; overflow: hidden;
}
.qs-qty__btn {
    width: 36px; height: 36px;
    background: none; border: none; cursor: pointer;
    font-size: 14px; color: var(--color-accent, #FF6E00);
    display: flex; align-items: center; justify-content: center;
    font-family: inherit; transition: background 0.15s;
}
.qs-qty__btn:active { background: #fff4ee; }
.qs-qty__num {
    min-width: 36px; text-align: center; line-height: 36px;
    font-size: 18px; font-weight: 700; color: var(--color-primary, #1C2047);
}
.qs-total-group {
    display: flex; align-items: baseline; gap: 6px;
    justify-content: flex-end; flex-wrap: nowrap;
}
.qs-total-label {
    font-size: 14px; color: var(--color-text-secondary, #6B7280);
    font-weight: 500; white-space: nowrap;
}
.qs-total-val {
    font-size: 22px; font-weight: 800;
    color: var(--color-primary, #1C2047); line-height: 1.1; white-space: nowrap;
}

/* Footer + button */
.qs-footer {
    position: sticky; bottom: 0; z-index: 2;
    flex-shrink: 0;
    display: flex; flex-direction: column; gap: 10px;
    padding: 12px 16px 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid #f0f0f0;
}
.qs-btn {
    width: 100%; height: 52px;
    background: var(--color-primary, #1C2047); color: #fff;
    border: none; border-radius: 14px;
    font-size: 16px; font-weight: 700; cursor: pointer;
    font-family: inherit; letter-spacing: 0.01em;
    display: flex; align-items: center; justify-content: center;
    gap: 7px;
    transition: opacity 0.15s, background-color 0.25s ease;
}
.qs-btn--in-cart {
    background: #27ae60;
}
.qs-btn--out {
    background: #9ca3af;
    cursor: not-allowed;
}
.product-card__cart-btn--in-cart i {
    font-size: 13px;
    -webkit-text-stroke: 0.5px currentColor;
}
.qs-btn--in-cart i {
    font-size: 15px;
    -webkit-text-stroke: 0.5px currentColor;
}
.qs-btn:active { opacity: 0.82; }

/* ─── Responsive ─── */
@media (max-width: 380px) {
    .promo-slide__percent { font-size: 2.6rem; }
    .products { gap: 8px; padding: 10px 10px 8px; }
    .product-card__image-wrapper { height: 140px; }
    .product-card__name  { font-size: 0.71rem; }
    .product-card__price { font-size: 0.82rem; }
}

@media (min-width: 431px) {
    body {
        background: #EAECF3;
        align-items: flex-start;
        padding: 24px 0;
    }

    .app {
        border-radius: var(--radius-2xl);
        min-height: calc(100vh - 48px);
        box-shadow: 0 2px 16px rgba(28,32,71,.06);
        overflow: hidden;
    }

    .bottom-nav {
        border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
    }
}

@media (min-width: 768px) {
    :root { --app-max-width: 480px; }

    .products { grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* =====================
   Active orders — scooter icon + bottom sheet
   ===================== */
/* Delivery icon — image file used as-is (not recoloured). Sizes to 1em. */
.scooter-ic { width: 1em; height: 1em; object-fit: contain; display: inline-block; vertical-align: middle; flex-shrink: 0; background: none; }
.header__scooter { color: var(--color-primary); font-size: 1.45rem; }
/* "New order" dot — accent colour, same placement as the other header dots */
.header__scooter-dot { background: var(--color-accent); }

/* Light bottom sheet — matches the other client modals (profile / cart):
   white surfaces, soft grey borders, gentle shadows, orange only as an accent.
   Reuses the .qs-overlay / .qs-sheet animation shell. */
.ao-sheet {
    background: #fff;
    color: var(--color-primary);
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -8px 32px rgba(28,32,71,0.12);
}

/* Fixed header: scooter + title + close, with a divider */
.ao-head {
    flex-shrink: 0;
    display: flex; align-items: center; gap: 11px;
    padding: 16px 16px 14px;
    border-bottom: 1px solid #eef0f4;
}
.ao-head__icon {
    width: 38px; height: 38px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--color-accent-light); color: var(--color-accent);
    border-radius: 11px; font-size: 26px;
}
.ao-head__title { flex: 1; min-width: 0; margin: 0; font-size: 16.5px; font-weight: 700; color: var(--color-primary); }
.ao-head__close {
    width: 34px; height: 34px; flex-shrink: 0; border: none; cursor: pointer;
    background: #f5f5f7; color: #777;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 14px; transition: background 0.15s;
}
.ao-head__close:active { background: #e8e8ec; }

/* Scrollable body — extra bottom padding clears the Safari bottom bar */
.ao-body {
    flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 14px 16px calc(28px + env(safe-area-inset-bottom, 0px));
    display: flex; flex-direction: column; gap: 12px;
    background: #fff;
}

/* Order card */
.ao-order {
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 18px; padding: 14px;
    box-shadow: 0 4px 14px rgba(28,32,71,0.05);
}
.ao-order__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.ao-order__date {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; font-weight: 600; color: var(--color-text-secondary);
}
.ao-order__date i { font-size: 11px; opacity: 0.7; }

/* Right side of an order row: running-courier animation + cancel button */
.ao-order__act { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ── Running courier with a parcel (order in progress) ── */
.ao-runner { width: 38px; height: 32px; display: inline-block; flex-shrink: 0; }
.ao-runner__svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ao-runner__body { animation: aoBob .5s ease-in-out infinite; }
.ao-runner__box  { animation: aoBoxShake .5s ease-in-out infinite; transform-box: view-box; transform-origin: 34px 18px; }
.ao-runner__leg  { transform-box: view-box; transform-origin: 22px 25px; }
.ao-runner__leg--a { animation: aoLegA .5s linear infinite; }
.ao-runner__leg--b { animation: aoLegB .5s linear infinite; }
.ao-runner__lines { animation: aoLines .5s linear infinite; }
@keyframes aoBob      { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes aoBoxShake { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes aoLegA     { 0%,100% { transform: rotate(20deg); }  50% { transform: rotate(-22deg); } }
@keyframes aoLegB     { 0%,100% { transform: rotate(-22deg); } 50% { transform: rotate(20deg); } }
@keyframes aoLines    { 0% { opacity: .15; transform: translateX(4px); } 50% { opacity: .85; } 100% { opacity: .15; transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) {
    .ao-runner__body, .ao-runner__box, .ao-runner__leg, .ao-runner__lines { animation: none; }
}

/* ── Cancel button (visible only in the 15-min window) ── */
.ao-cancel {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px 16px;
    border-radius: 9px;
    background: #fff;
    border: 1.5px solid #EF0D10;
    color: #EF0D10;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}
.ao-cancel:active { transform: scale(0.95); background: #fff0ef; }
.ao-cancel:disabled { opacity: .6; cursor: default; }

/* ── Site-styled confirm dialog (replaces native window.confirm) ── */
.cf-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(28, 32, 71, 0.45);
    -webkit-backdrop-filter: blur(2px);
            backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity .18s ease;
}
.cf-overlay.open { opacity: 1; }
.cf-dialog {
    width: 100%;
    max-width: 320px;
    background: #fff;
    border-radius: 18px;
    padding: 22px 20px 18px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(28, 32, 71, .25);
    transform: translateY(10px) scale(.96);
    transition: transform .2s cubic-bezier(.2, .8, .25, 1);
}
.cf-overlay.open .cf-dialog { transform: translateY(0) scale(1); }
.cf-dialog__title {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-card-title);
    margin: 0 0 8px;
}
.cf-dialog__text {
    font-size: 13.5px;
    color: var(--color-text-secondary);
    line-height: 1.45;
    margin: 0 0 18px;
}
.cf-dialog__actions { display: flex; gap: 10px; }
.cf-btn {
    flex: 1;
    padding: 12px 10px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    border: none;
    transition: transform .12s ease, background .15s ease, opacity .15s ease;
}
.cf-btn:active { transform: scale(.96); }
.cf-btn--ghost   { background: var(--color-soft); color: var(--color-card-title); }
.cf-btn--primary { background: var(--color-accent); color: #fff; }
.cf-btn--danger  { background: #EF0D10; color: #fff; }

/* Status badges (soft, light) */
.ao-status { font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 20px; white-space: nowrap; flex-shrink: 0; }
.ao-status--new       { background: #e3f2fd; color: #1565c0; }
.ao-status--in_work   { background: #fff3e0; color: #e65100; }
.ao-status--delivered { background: #e8f5e9; color: #2e7d32; }
.ao-status--cancelled { background: #fbe9e7; color: #c0392b; }

/* Items list */
.ao-order__items { display: flex; flex-direction: column; gap: 8px; }
.ao-item {
    display: flex; gap: 10px; align-items: center;
    padding: 9px; border-radius: 12px;
    background: #f8f9fb; border: 1px solid #eef0f4;
}
.ao-item__photo, .ao-item__ph {
    width: 52px; height: 52px; flex-shrink: 0; border-radius: 9px; overflow: hidden;
    background: #eef0f4;
}
.ao-item__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ao-item__ph { display: flex; align-items: center; justify-content: center; color: #c4c4c4; font-size: 16px; }
.ao-item__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ao-item__name {
    font-size: 13.5px; font-weight: 600; color: var(--color-primary); line-height: 1.3; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ao-item__chips { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.ao-item__chip {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11.5px; color: #555;
    background: #fff; border: 1px solid #e8eaf0; border-radius: 6px; padding: 2px 8px;
}
.ao-item__chip--size { font-weight: 600; }
.ao-item__chip--qty { font-weight: 600; }
.ao-item__dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(0,0,0,0.12); }
.ao-item__money { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 1px; }
.ao-item__unit { font-size: 11.5px; color: var(--color-text-muted); }
.ao-item__sum { font-size: 13px; font-weight: 700; color: var(--color-primary); white-space: nowrap; }

/* Order total */
.ao-order__foot {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    margin-top: 11px; padding-top: 11px; border-top: 1px solid #f0f1f5;
    font-size: 12.5px; color: var(--color-text-secondary); flex-wrap: wrap;
}
.ao-foot__cell { color: var(--color-text-secondary); white-space: nowrap; }
.ao-foot__cell--mid { text-align: center; }
.ao-foot__cell--total { text-align: right; margin-left: auto; }
.ao-foot__label { color: var(--color-text-muted); }
.ao-foot__cell--total .ao-foot__label { color: var(--color-text-secondary); }
.ao-order__foot strong { font-size: 16px; font-weight: 800; color: var(--color-accent); }
.ao-order__none { color: var(--color-text-muted); font-size: 12.5px; padding: 4px 0; }

/* Empty state */
.ao-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 20px; }
.ao-empty__icon {
    width: 76px; height: 76px; border-radius: 50%; margin-bottom: 14px;
    display: flex; align-items: center; justify-content: center;
    background: var(--color-accent-light); color: var(--color-accent); font-size: 30px;
}
.ao-empty__text { font-size: 14px; color: var(--color-text-secondary); margin: 0; }
.ao-empty__link {
    margin-top: 16px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 11px 22px; border-radius: 12px;
    background: var(--color-accent); color: #fff;
    font-size: 14px; font-weight: 700; text-decoration: none;
    transition: transform var(--transition-fast);
}
.ao-empty__link:active { transform: scale(0.96); }

/* ============================================================
   Figma icon set — exact SVG glyphs exported from the design.
   Rendered as CSS masks so they inherit `color` (recolorable).
   ============================================================ */
.fig-ic {
    display: inline-block;
    width: 1em;
    height: 1em;
    background-color: currentColor;
    -webkit-mask: var(--ic) center / contain no-repeat;
            mask: var(--ic) center / contain no-repeat;
    flex-shrink: 0;
    vertical-align: middle;
}
.fig-ic--support { --ic: url(../img/icons/support.svg?v=2); }
.fig-ic--heart   { --ic: url(../img/icons/heart.svg?v=2); }
.fig-ic--bell    { --ic: url(../img/icons/bell.svg?v=2); }
.fig-ic--search  { --ic: url(../img/icons/search.svg?v=2); }
.fig-ic--filter  { --ic: url(../img/icons/filter.svg?v=2); }
.fig-ic--grid    { --ic: url(../img/icons/cat-grid.svg?v=2); }
.fig-ic--home    { --ic: url(../img/icons/nav-home.svg?v=2); }
.fig-ic--cat     { --ic: url(../img/icons/nav-cat.svg?v=2); }
.fig-ic--cart    { --ic: url(../img/icons/nav-cart.svg?v=2); }
.fig-ic--profile { --ic: url(../img/icons/nav-profile.svg?v=2); }
.fig-ic--chat    { --ic: url(../img/icons/nav-chat.svg?v=2); }
.fig-ic--card-chat { --ic: url(../img/icons/card-chat.svg?v=2); }

/* Header icon glyph size inside the 33px rounded buttons */
.header__notify .fig-ic { width: 18px; height: 18px; }
.header__notify-ic { width: 19px; height: 19px; object-fit: contain; display: block; }
/* Search field glyphs */
.search__icon.fig-ic { width: 18px; height: 18px; }
.search__filter .fig-ic { width: 20px; height: 20px; }
/* Category chip glyph */
.categories__tab .fig-ic { width: 15px; height: 15px; }
/* Bottom-nav glyphs */
.bottom-nav__item .fig-ic { width: 24px; height: 24px; }
.bottom-nav__item .fig-ic--home    { width: 26px; height: 26px; }
.bottom-nav__item .fig-ic--cat     { width: 22px; height: 22px; }
.bottom-nav__item .fig-ic--cart    { width: 23px; height: 26px; }
.bottom-nav__item .fig-ic--profile { width: 25px; height: 25px; }
.bottom-nav__item .fig-ic--chat    { width: 25px; height: 25px; }
.bottom-nav__item--fab .fig-ic { width: 32px; height: 32px; color: #fff; }
/* Card chat (comment-bubble) glyph */
.product-card__action-btn .fig-ic--card-chat { width: 12px; height: 12px; }
/* ============================================================
   DESKTOP STORE LAYOUT  (≥768px) — sidebar marketplace
   ------------------------------------------------------------
   Mobile (≤767px) is untouched: every rule is min-width gated and
   the desktop-only elements (.dnav / .catalog-sidebar / .catalog-toolbar)
   are display:none below 768px. On desktop the centred phone card
   becomes a real store: a two-row header, a left category sidebar,
   a wide hero, a filter/sort toolbar and a 3→4→5→6 column grid.
   ============================================================ */
.dnav, .catalog-sidebar, .catalog-toolbar { display: none; }

/* Mobile (<768px): the product page wraps #productDetail in .subpage-cat-wrap
   (added by navbar.js for the desktop sidebar). Because <body> is display:flex
   + justify-content:center, an unsized wrapper shrink-wraps to its content and
   gets centred, clipping the card's left/right edges. Restore the full-width
   behaviour #productDetail had on its own. Desktop (≥768px) overrides this with
   the grid layout below, so the PC version is unaffected. */
.subpage-cat-wrap { width: 100%; }

@media (min-width: 768px) {
    /* ---- Design tokens / page shell ---- */
    body {
        background: #F6F7FB;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: 0;
    }
    .app {
        width: 100%;
        max-width: 1440px;
        margin: 0 auto;
        background: transparent;
        border-radius: 0;
        box-shadow: none;
        min-height: auto;
        overflow: visible;
    }
    .main { overflow: visible; background: transparent; padding-bottom: 56px; }

    /* Hide mobile chrome, show desktop chrome */
    .bottom-nav { display: none !important; }
    .dnav { display: block; }
    body.is-home .header,
    body.is-home .search,
    body.is-home .categories { display: none !important; }

    /* Sub-page mobile header must not fight the sticky desktop header. */
    .app > .header { position: static; top: auto; }

    /* ================= Desktop top header (two rows) ================= */
    .dnav {
        position: sticky; top: 0; z-index: 300; width: 100%;
        background: #fff; border-bottom: 1px solid #ECEEF3;
    }
    .dnav__top {
        max-width: 1440px; margin: 0 auto;
        height: 70px; display: flex; align-items: center; gap: 22px;
        padding: 0 28px;
    }
    .dnav__logo { display: flex; align-items: center; flex-shrink: 0; }
    .dnav__logo-img { height: 44px; width: auto; object-fit: contain; }

    .dnav__search {
        flex: 1; min-width: 0;
        display: flex; align-items: center; gap: 10px;
        height: 44px; padding: 0 5px 0 16px;
        background: #F3F4F8; border: 1px solid #ECEEF3; border-radius: 12px;
        text-decoration: none;
    }
    .dnav__search--link { padding: 0 16px; }
    .dnav__search:focus-within { border-color: var(--color-accent); background: #fff; }
    .dnav__search-icon { width: 18px; height: 18px; color: #9CA0AD; flex-shrink: 0; }
    .dnav__search-input { flex: 1; min-width: 0; height: 100%; background: transparent; border: none; outline: none; font-size: 14px; color: var(--color-text); }
    .dnav__search-ph { flex: 1; min-width: 0; font-size: 14px; color: #9CA0AD; }
    /* Filter icon lives INSIDE the search bar (right side) */
    .dnav__search-filter {
        flex-shrink: 0;
        width: 36px; height: 36px;
        display: flex; align-items: center; justify-content: center;
        border: none; border-radius: 9px; cursor: pointer;
        background: var(--color-accent); color: #fff;
        transition: opacity var(--transition-fast), transform var(--transition-fast);
    }
    .dnav__search-filter:hover { opacity: .9; }
    .dnav__search-filter:active { transform: none; }
    .dnav__search-filter .fig-ic { width: 17px; height: 17px; }

    .dnav__actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
    .dnav__icon {
        position: relative;
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        min-width: 62px; height: 52px; border-radius: 12px;
        color: var(--color-card-title);
        transition: background var(--transition-fast);
    }
    .dnav__icon:hover { background: #F3F4F8; }
    .dnav__icon .fig-ic { width: 21px; height: 21px; }
    .dnav__icon-label { font-size: 10.5px; font-weight: 500; color: #8A8F9C; line-height: 1; }
    .dnav__icon--active { color: var(--color-accent); }
    .dnav__icon--active .dnav__icon-label { color: var(--color-accent); }
    .dnav__dot { position: absolute; top: 7px; right: 16px; width: 8px; height: 8px; background: #FF3B30; border-radius: 50%; border: 1.5px solid #fff; }
    .dnav__count { position: absolute; top: 4px; right: 12px; min-width: 17px; height: 17px; padding: 0 4px; background: var(--color-accent); color: #fff; font-size: 10px; font-weight: 700; border-radius: 9px; display: flex; align-items: center; justify-content: center; }

    /* ================= Home: sidebar + content ================= */
    body.is-home .main {
        display: grid;
        grid-template-columns: 240px minmax(0, 1fr);
        column-gap: 24px;
        align-items: start;
        max-width: 1440px; margin: 0 auto;
        padding: 24px 28px 56px;
    }
    body.is-home .main > * { grid-column: 2; min-width: 0; }
    body.is-home .main > .catalog-sidebar {
        grid-column: 1; grid-row: 1 / span 99;
        align-self: start;
        position: sticky; top: 86px;
    }

    /* Sidebar */
    .catalog-sidebar { display: block; background: #fff; border: 1px solid #ECEEF3; border-radius: 16px; padding: 14px 12px; }
    .catalog-sidebar__title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #9CA0AD; padding: 4px 10px 10px; }
    .catalog-sidebar__list { display: flex; flex-direction: column; gap: 2px; }
    .catalog-sidebar__item {
        width: 100%; display: flex; align-items: center; gap: 11px;
        padding: 11px 12px; border: none; background: transparent; cursor: pointer;
        border-radius: 11px; font-size: 14px; font-weight: 500; color: var(--color-card-title);
        text-align: left; font-family: inherit;
        transition: background var(--transition-fast), color var(--transition-fast);
    }
    .catalog-sidebar__item i { width: 18px; text-align: center; font-size: 15px; color: #9699A2; transition: color var(--transition-fast); }
    .catalog-sidebar__item span { flex: 1; }
    .catalog-sidebar__count { flex: 0 0 auto; font-size: 12px; color: #B4B8C2; font-weight: 600; }
    .catalog-sidebar__item:hover { background: #F3F4F8; }
    .catalog-sidebar__item.is-active { background: var(--color-accent); color: #fff; }
    .catalog-sidebar__item.is-active i,
    .catalog-sidebar__item.is-active .catalog-sidebar__count { color: #fff; }

    /* Toolbar */
    .catalog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 2px 0; }
    .catalog-toolbar__count { font-size: 13.5px; font-weight: 600; color: #8A8F9C; }
    .catalog-toolbar__controls { display: flex; align-items: center; gap: 12px; }
    .catalog-toolbar__filter {
        display: inline-flex; align-items: center; gap: 7px;
        height: 38px; padding: 0 16px; border-radius: 10px;
        background: #fff; border: 1px solid #E3E5EC; color: var(--color-card-title);
        font-size: 13.5px; font-weight: 600; cursor: pointer; font-family: inherit;
        transition: border-color var(--transition-fast), color var(--transition-fast);
    }
    .catalog-toolbar__filter:hover { border-color: var(--color-accent); color: var(--color-accent); }
    .catalog-toolbar__filter .fig-ic { width: 15px; height: 15px; }
    .catalog-toolbar__sort { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #8A8F9C; font-weight: 600; }
    .catalog-toolbar__sort select {
        height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid #E3E5EC; background: #fff;
        font-size: 13.5px; font-weight: 600; color: var(--color-card-title); cursor: pointer; font-family: inherit;
    }

    /* Hero banner inside the content column */
    body.is-home .promo-slider { padding: 0 0 18px; }
    .promo-slide { min-height: 0; }
    .promo-slide--img { aspect-ratio: auto; height: 260px; max-height: 260px; border-radius: var(--radius-xl); }
    .promo-slide--img img { object-fit: cover; }

    /* ================= Product grid + unified cards =================
       Wider, calmer cards: fewer columns per row (2→3→4→5), bigger gap,
       taller photos. object-fit:cover keeps images undistorted. */
    .products { grid-template-columns: repeat(2, 1fr); gap: 22px; padding: 20px 28px 8px; }
    body.is-home .products { padding: 16px 0 0; }

    .product-card { height: 100%; border-radius: 14px; border: 1px solid #ECEEF3; background: #fff; }
    .product-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(28, 32, 71, .09); }
    .product-card__image-wrapper { height: 248px; }

    /* Card actions: only the favourite stays over the photo (top-right);
       share + chat appear as a tidy row on hover — nothing hangs chaotically. */
    .product-card__actions { top: 8px; right: 8px; bottom: auto; left: auto; flex-direction: row-reverse; gap: 6px; }
    .product-card__share,
    .product-card__chat {
        opacity: 0; transform: translateY(-3px); pointer-events: none;
        transition: opacity var(--transition-fast), transform var(--transition-fast);
    }
    .product-card:hover .product-card__share,
    .product-card:hover .product-card__chat { opacity: 1; transform: none; pointer-events: auto; }

    /* Price is the hero of the card */
    .product-card__info { padding: 12px 12px 13px; }
    .product-card__name { font-size: 0.84rem; }
    .product-card__price { font-size: 1.05rem; font-weight: 800; }
    .product-card__old-price { font-size: 0.72rem; }
}

/* ---- Column counts per tier (wider cards: 3 / 4 / 5) ---- */
@media (min-width: 1024px) {
    .products { grid-template-columns: repeat(3, 1fr); gap: 22px; }
    .product-card__image-wrapper { height: 256px; }
    .promo-slide--img { height: 290px; max-height: 290px; }
}
@media (min-width: 1366px) {
    body.is-home .main { grid-template-columns: 248px minmax(0, 1fr); column-gap: 28px; padding-left: 32px; padding-right: 32px; }
    .products { grid-template-columns: repeat(4, 1fr); gap: 24px; }
    .product-card__image-wrapper { height: 268px; }
    .promo-slide--img { height: 310px; max-height: 310px; }
}
@media (min-width: 1920px) {
    .products { grid-template-columns: repeat(5, 1fr); gap: 24px; }
}

/* Desktop photo match: Shopping.tj reference, mobile rules above stay intact. */
@media (min-width: 768px) {
    body {
        background: #F6F7FB;
    }

    .app {
        max-width: 1360px;
    }

    .dnav {
        height: 80px;
        background: #fff;
        border-bottom: 0;
    }

    .dnav__top {
        width: min(1360px, calc(100% - 32px));
        max-width: none;
        height: 80px;
        padding: 0;
        gap: 20px;
    }

    .dnav__logo-img {
        width: 195px;
        height: 60px;
        max-width: none;
        object-fit: contain;
    }

    .dnav__search {
        height: 46px;
        min-width: 220px;
        gap: 14px;
        padding: 0 6px 0 18px;
        border: 1px solid #E4E6EE;
        border-radius: 24px;
        background: #F0F1F5;
    }

    .dnav__search--link {
        padding: 0 6px 0 18px;
    }

    .dnav__search:focus-within {
        border-color: #E4E6EE;
        background: #F0F1F5;
    }

    .dnav__search-icon {
        width: 25px;
        height: 25px;
        color: #A0A4AF;
    }

    .dnav__search-input,
    .dnav__search-ph {
        font-size: 16.5px;
        font-weight: 500;
        color: #9DA1AD;
        letter-spacing: 0;
    }

    .dnav__search-input::placeholder {
        color: #9DA1AD;
        opacity: 1;
    }

    .dnav__search-filter,
    .dnav__search-filter--ghost {
        width: 78px;
        height: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 18px;
        background: #484C78;
        color: #fff;
        font-size: 13px;
        font-weight: 600;
        line-height: 1;
        flex-shrink: 0;
    }

    .dnav__search-filter:active {
        transform: none;
    }

    .dnav__actions {
        height: 46px;
        gap: 18px;
    }

    .dnav__icon {
        width: 34px;
        min-width: 0;
        height: 46px;
        flex-direction: row;
        gap: 0;
        border-radius: 0;
        background: transparent;
        color: #484C78;
    }

    .dnav__icon:hover {
        background: transparent;
    }

    .dnav__icon .fig-ic {
        width: 23px;
        height: 23px;
    }

    .dnav__icon[aria-label="Уведомления"] .fig-ic {
        width: 21.5px;
        height: 21.5px;
    }

    .dnav__icon[aria-label="Чат"] .fig-ic {
        width: 22.5px;
        height: 22.5px;
    }

    .dnav__icon[aria-label="Профиль"] .fig-ic {
        width: 22px;
        height: 22px;
    }

    .dnav__icon-label {
        display: none;
    }

    .dnav__icon--cart {
        width: 120px;
        height: 46px;
        padding: 0 11px 0 6px;
        gap: 8px;
        align-items: center;
        justify-content: flex-start;
        border-radius: 24px;
        background: #FF6E00;
        color: #fff;
    }

    .dnav__icon--cart:hover {
        background: #FF6E00;
    }

    .dnav__icon--cart .dnav__icon-label {
        display: block;
        color: #fff;
        font-size: 12px;
        font-weight: 600;
        line-height: 1;
        padding-top: 1px;
    }

    .dnav__cart-mark {
        width: 33px;
        height: 33px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: #fff;
        color: #FF6E00;
        flex-shrink: 0;
    }

    .dnav__icon--cart .fig-ic {
        width: 17px;
        height: 17px;
        color: #FF6E00;
    }

    .dnav__dot {
        top: 8px;
        right: 0;
    }

    .dnav__count {
        top: -2px;
        right: 10px;
        background: #484C78;
        color: #fff;
    }

    body.is-home .main {
        width: min(1360px, calc(100% - 32px));
        max-width: none;
        grid-template-columns: 240px minmax(0, 1fr);
        column-gap: 22px;
        padding: 20px 0 48px;
    }

    body.is-home .main > .catalog-sidebar {
        top: 84px;
    }

    /* Sub-page catalogue sidebar (favourites / categories): same left rail,
       content opens to its right. Mirrors the home grid sizing. */
    body.has-cat-sidebar:not(.is-home) .main {
        width: min(1360px, calc(100% - 32px));
        max-width: none;
        margin: 0 auto;
        display: grid;
        grid-template-columns: 240px minmax(0, 1fr);
        column-gap: 22px;
        align-items: start;
    }
    body.has-cat-sidebar:not(.is-home) .main > *:not(.catalog-sidebar) {
        grid-column: 2;
        min-width: 0;
    }
    body.has-cat-sidebar:not(.is-home) .main > .catalog-sidebar {
        grid-column: 1;
        grid-row: 1 / span 99;
        align-self: start;
        position: sticky;
        top: 92px;
        /* Pull the rail up next to the title bar so its top lands at EXACTLY the
           same height as on the home page (no jump when navigating).
           Title-bar footprint = 14px margin + 66px height = 80px; home main has
           20px padding-top → pull up 80 − 20 = 60px. */
        margin-top: calc(20px - 14px - var(--header-height));
    }

    /* Sub-page title bar (e.g. «Избранное») — sit it ONLY above the content
       column (right of the category sidebar), so the sidebar keeps its place.
       --main-w mirrors the .main container; --side-col = sidebar (240) + gap (22). */
    body.has-cat-sidebar:not(.is-home) > .app > .header {
        --main-w: min(1360px, calc(100% - 32px));
        --side-col: 262px;
        width: calc(var(--main-w) - var(--side-col));
        margin: 14px 0 0 calc((100% - var(--main-w)) / 2 + var(--side-col));
        border: 1px solid #ECEEF3;
        border-radius: 14px;
    }

    /* product.html has no .main — the sidebar + detail are wrapped together. */
    .subpage-cat-wrap {
        width: min(1360px, calc(100% - 32px));
        margin: 0 auto;
        display: grid;
        grid-template-columns: 240px minmax(0, 1fr);
        column-gap: 22px;
        align-items: start;
    }
    .subpage-cat-wrap > #productDetail {
        grid-column: 2;
        min-width: 0;
    }
    .subpage-cat-wrap > .catalog-sidebar {
        grid-column: 1;
        grid-row: 1 / span 99;
        align-self: start;
        position: sticky;
        top: 92px;
    }

    .catalog-sidebar {
        min-height: 420px;
        padding: 26px 22px;
        /* Cosmetics matched to .profile__info-card (border / radius / shadow only;
           size + position untouched). */
        border: 1px solid #ececec;
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    }

    .catalog-sidebar__title {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 0 0 20px 4px;
        color: #A0A4AF;
        font-size: 15px;
        font-weight: 500;
        line-height: 1;
        letter-spacing: 0;
        text-transform: none;
    }

    .catalog-sidebar__title .fig-ic {
        width: 18px;
        height: 18px;
    }

    .catalog-sidebar__list {
        gap: 15px;
    }

    .catalog-sidebar__item {
        display: flex;
        align-items: center;
        gap: 11px;
        height: 34px;
        padding: 0 24px;
        border-radius: 8px;
        color: #3B4168;
        font-size: 15px;
        font-weight: 500;
        line-height: 0.95;
        letter-spacing: 0;
        text-align: left;
    }

    .catalog-sidebar__item i {
        width: 17px;
        height: 17px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        color: #3B4168;
        font-size: 16px;
        line-height: 1;
    }

    .catalog-sidebar__item span {
        line-height: 1;
    }

    .catalog-sidebar__count {
        display: none;
    }

    .catalog-sidebar__item:hover {
        background: transparent;
    }

    .catalog-sidebar__item.is-active {
        height: 42px;
        justify-content: center;
        margin: 0 0 3px;
        padding: 0 14px;
        background: #FF6E00;
        color: #fff;
        font-size: 15px;
        font-weight: 600;
        line-height: 0.95;
    }

    .catalog-sidebar__item.is-active i {
        color: #fff;
    }

    .catalog-toolbar {
        display: none !important;
    }

    body.is-home .promo-slider {
        display: block !important;
        padding: 0;
        margin: 0;
    }

    .promo-slider__track {
        height: 180px;
        border-radius: 8px;
        background: #B2B3B3;
    }

    .promo-slider__rail,
    .promo-slide,
    .promo-slide--img {
        height: 100%;
        min-height: 0;
    }

    .promo-slide--img {
        max-height: none;
        border-radius: 8px;
        background: #B2B3B3;
    }

    .promo-slide--img img {
        opacity: 1;
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 8px;
    }

    .promo-slider__dots {
        display: inline-flex;
        bottom: 14px;
        gap: 10px;
        padding: 4px 11px;
        border-radius: 12px;
    }

    .promo-slider__dot,
    .promo-slider__dot--active {
        width: 8px;
        height: 8px;
    }

    body.is-home .products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
        padding: 20px 0 0;
    }

    .product-card {
        border: 1px solid #E8EBF1;
        border-radius: 13px;
        background: #FDFDFD;
        box-shadow: none;
        transform: none;
    }

    .product-card:hover {
        transform: none;
        box-shadow: none;
    }

    .product-card:active {
        transform: none;
    }

    .product-card__image-wrapper {
        height: auto;
        margin: 5px 5px 0;
        aspect-ratio: 245 / 278;
        border-radius: 8px;
    }

    .product-card__actions {
        top: 8px;
        right: 8px;
        bottom: auto;
        left: auto;
        flex-direction: row;
        gap: 0;
    }

    .product-card__share,
    .product-card__chat {
        display: none !important;
    }

    .product-card__action-btn,
    .product-card__favorite {
        width: 25px;
        height: 25px;
        border-radius: 6px;
        background: rgba(238, 240, 241, 0.82);
        color: #9699A2;
        font-size: 12px;
    }

    .product-card__action-btn:active,
    .product-card__favorite:active {
        transform: none;
    }

    .product-card__favorite i {
        color: #9699A2;
    }

    .product-card__favorite--active i {
        animation: none;
        color: #EF0D10;
    }

    /* Empty state (e.g. empty favourites) — lift it up from dead-centre so the
       icon + text + button sit higher in the catalogue column on desktop. */
    .page-empty,
    .products__empty {
        min-height: calc(100dvh - var(--header-height) - 320px);
        justify-content: flex-start;
        padding-top: 7vh;
    }

    .product-card__info {
        min-height: 54px;
        padding: 8px 11px 10px;
    }

    .product-card__name {
        margin-bottom: 4px;
        color: #484C78;
        font-size: 13px;
        font-weight: 800;
        line-height: 1.2;
    }

    .product-card__footer {
        align-items: flex-end;
    }

    .product-card__price {
        color: #FF6E00;
        font-size: 18px;
        font-weight: 800;
        line-height: 1;
        letter-spacing: 0;
    }

    .product-card__rating {
        gap: 3px;
        padding-bottom: 1px;
    }

    .product-card__rating i {
        color: #FEA500;
        font-size: 10px;
    }

    .product-card__rating-num {
        color: #9699A2;
        font-size: 10px;
        font-weight: 700;
    }
}

@media (min-width: 1024px) {
    body.is-home .products {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (min-width: 1280px) {
    body.is-home .products {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (min-width: 1920px) {
    body.is-home .products {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (min-width: 768px) and (max-width: 1180px) {
    .dnav__top,
    body.is-home .main {
        width: calc(100% - 24px);
    }

    .dnav__top {
        gap: 12px;
    }

    .dnav__logo-img {
        width: 126px;
        height: 39px;
    }

    .dnav__search {
        min-width: 0;
        height: 40px;
        gap: 10px;
        padding-left: 14px;
    }

    .dnav__search-icon {
        width: 24px;
        height: 24px;
    }

    .dnav__search-input,
    .dnav__search-ph {
        font-size: 15px;
    }

    .dnav__search-filter,
    .dnav__search-filter--ghost {
        width: 68px;
        height: 28px;
        font-size: 12px;
    }

    .dnav__actions {
        gap: 10px;
    }

    .dnav__icon {
        width: 28px;
    }

    .dnav__icon .fig-ic,
    .dnav__icon[aria-label="Чат"] .fig-ic,
    .dnav__icon[aria-label="Профиль"] .fig-ic {
        width: 24px;
        height: 24px;
    }

    .dnav__icon[aria-label="Уведомления"] .fig-ic {
        width: 22px;
        height: 22px;
    }

    .dnav__icon--cart {
        width: 100px;
        height: 40px;
        gap: 6px;
        padding-right: 8px;
    }

    .dnav__cart-mark {
        width: 28px;
        height: 28px;
    }

    .dnav__icon--cart .fig-ic {
        width: 15px;
        height: 15px;
    }

    .dnav__icon--cart .dnav__icon-label {
        font-size: 11px;
        font-weight: 600;
        padding-top: 1px;
    }

    body.is-home .main {
        grid-template-columns: 200px minmax(0, 1fr);
        column-gap: 18px;
    }

    .catalog-sidebar {
        min-height: 360px;
        padding: 22px 18px;
    }

    .catalog-sidebar__item {
        height: 31px;
        padding: 0 20px;
        font-size: 13px;
        line-height: 0.95;
    }

    .catalog-sidebar__item.is-active {
        height: 28px;
        padding: 0 12px;
        font-size: 13px;
        line-height: 0.95;
    }
}

/* ---------- Secondary pages: category grid + list pages ---------- */
@media (min-width: 768px) {
    .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 24px 28px; }
    /* Left-align the list (don't centre it in the wide content column) and match
       the title bar's 12px inset, so the notification text lines up under the
       back arrow. */
    .notif-list { max-width: 720px; margin-left: 0; margin-right: 0; padding: 10px 12px 0; }

    /* ===== Filter — proper centred dialog with a full-screen dimmed backdrop
       (mobile keeps the bottom sheet). Makes it read clearly as a modal. ===== */
    .filter-modal {
        max-width: none;
        left: 0;
        transform: none;
        width: 100%;
    }
    .filter-modal__panel {
        position: absolute;
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        width: 460px;
        max-width: calc(100vw - 48px);
        max-height: 82vh;
        border-radius: 18px;
        transform: translate(-50%, -50%) scale(0.96);
    }
    .filter-modal--open .filter-modal__panel {
        transform: translate(-50%, -50%) scale(1);
    }
}
@media (min-width: 1024px) {
    .cat-grid { grid-template-columns: repeat(4, 1fr); padding-left: 32px; padding-right: 32px; }
}
@media (min-width: 1440px) {
    .cat-grid { grid-template-columns: repeat(5, 1fr); }
}
/* Progressive catalogue rendering keeps large catalogues responsive. */
.products__more {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 18px 0 8px;
}

.products__more-btn {
    min-width: 190px;
}
