/* App-like shell on top of store.css. From 769px the site layout stays; 768px and below get the app layout. */

:root {
    --radius: 12px;
    --radius-lg: 18px;
    /* --app-bg from store-theme.css */
    --app-card-shadow: 0 1px 2px color-mix(in srgb, var(--text) 4%, transparent), 0 4px 16px color-mix(in srgb, var(--text) 6%, transparent);
    --app-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --tabbar-h: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
    overscroll-behavior-y: contain;
}

.topbar {
    display: none;
}

html {
    -webkit-tap-highlight-color: transparent;
}

a,
button,
label,
summary,
[role="tab"] {
    touch-action: manipulation;
}

.btn {
    border-radius: 12px;
}

.btn:active,
.product-card__action:active,
.app-tabbar__item:active,
.cat-tile:active,
.category-tile:active {
    transform: scale(0.97);
}

/* ---------- Progress bar ---------- */
.app-progress {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 200;
    height: 3px;
    pointer-events: none;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    transform-origin: right center;
    transform: scaleX(0);
    opacity: 0;
}

.app-progress.is-loading {
    opacity: 1;
    animation: appProgress 8s cubic-bezier(0.1, 0.7, 0.2, 1) forwards;
}

.app-progress.is-done {
    transform: scaleX(1);
    opacity: 0;
    transition: opacity 0.3s 0.1s;
}

@keyframes appProgress {
    from { transform: scaleX(0); }
    to { transform: scaleX(0.92); }
}

/* ---------- Hidden by default (desktop) ---------- */
.app-tabbar,
.app-bar,
.app-actionbar,
.buy-panel__price,
.account-nav__photo,
.account-nav__chevron {
    display: none;
}

/* ---------- Categories page (all sizes) ---------- */
.cat-app {
    padding: 24px 0 56px;
}

.cat-app__layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.cat-app__empty {
    grid-column: 1 / -1;
}

.cat-app__rail {
    position: sticky;
    top: 70px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.cat-app__tab {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 6px 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text-soft);
    font-weight: 600;
    font-size: 14px;
    text-align: right;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.cat-app__tab:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.cat-app__tab.is-active {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.cat-app__tab--sale {
    color: var(--accent);
}

.cat-app__tab-img {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--surface-soft);
}

.cat-app__tab-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cat-app__tab-img .icon {
    width: 20px;
    height: 20px;
}

.cat-app__tab-img .cat-tile__letter {
    font-size: 16px;
}

.cat-app__tab-name {
    min-width: 0;
    line-height: 1.5;
}

.cat-app__panel {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.cat-app__all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-soft), #f2faf7);
    color: var(--primary-dark);
}

.cat-app__all strong {
    display: block;
    font-size: 14px;
}

.cat-app__all small {
    color: var(--text-soft);
    font-size: 12px;
}

.cat-app__group + .cat-app__group {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.cat-app__group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.cat-app__group-head h2 {
    font-size: 15px;
    font-weight: 800;
}

.cat-app__group-head a {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: var(--primary);
    font-size: 12.5px;
    font-weight: 700;
}

.cat-app__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 16px 12px;
}

.cat-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    transition: transform 0.15s;
}

.cat-tile__img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 88px;
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    background: var(--surface-soft);
}

.cat-tile__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cat-tile--brand .cat-tile__img {
    border-radius: 18px;
    padding: 10px;
    border: 1px solid var(--border);
    background: #fff;
}

.cat-tile--brand .cat-tile__img img {
    object-fit: contain;
}

.cat-tile__letter {
    color: var(--primary);
    font-size: 26px;
    font-weight: 800;
}

.cat-tile__name {
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.6;
    color: var(--text);
}

/* ================================================================
   Phones (768px and below): app layout
   ================================================================ */
@media (max-width: 768px) {
    body {
        background: var(--app-bg);
    }

    body.has-tabbar {
        padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom));
    }

    .container {
        padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right));
    }

    .store-main {
        min-height: 60vh;
    }

    /* ---------- Bottom tab bar ---------- */
    .app-tabbar {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 55;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        height: calc(var(--tabbar-h) + var(--safe-bottom));
        padding: 0 6px var(--safe-bottom);
        background: rgba(255, 255, 255, 0.94);
        -webkit-backdrop-filter: saturate(180%) blur(18px);
        backdrop-filter: saturate(180%) blur(18px);
        border-top: 1px solid rgba(15, 20, 25, 0.06);
        box-shadow: 0 -6px 24px rgba(16, 24, 40, 0.06);
    }

    .app-tabbar__item {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-width: 0;
        color: #7b818a;
        font-size: 11px;
        font-weight: 600;
        line-height: 1.3;
        transition: color 0.2s, transform 0.15s;
    }

    .app-tabbar__item:hover {
        color: var(--text);
    }

    .app-tabbar__item .icon {
        position: relative;
        z-index: 1;
        width: 23px;
        height: 23px;
        stroke-width: 1.8;
    }

    .app-tabbar__item.is-active {
        color: var(--primary-dark);
    }

    .app-tabbar__item.is-active .icon {
        stroke-width: 2.2;
    }

    .app-tabbar__item.is-active > .icon {
        background: var(--primary-soft);
        border-radius: 16px;
        padding: 5px 12px;
        box-sizing: content-box;
    }

    .app-tabbar__item.is-active::before {
        display: none;
    }

    .app-tabbar__icon {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 23px;
        height: 23px;
    }

    .app-tabbar__item.is-active .app-tabbar__icon::before {
        content: "";
        position: absolute;
        z-index: 0;
        inset: -5px -12px;
        border-radius: 16px;
        background: var(--primary-soft);
    }

    .app-tabbar__badge {
        position: absolute;
        z-index: 2;
        top: -12px;
        right: -30px;
        min-width: 18px;
        height: 18px;
        /*padding: 5px;*/
        border: 2px solid #fff;
        border-radius: 999px;
        background: #ef4056;
        color: #fff;
        font-size: 12px;
        font-weight: 600;
        line-height: 16px;
        text-align: center;
        box-sizing: content-box;
    }

    /* ---------- Header ---------- */
    .mainnav {
        display: none !important;
    }

    .header {
        position: sticky;
        top: 0;
        z-index: 45;
        padding: 0;
        background: rgba(255, 255, 255, 0.96);
        -webkit-backdrop-filter: saturate(180%) blur(14px);
        backdrop-filter: saturate(180%) blur(14px);
        transition: box-shadow 0.2s;
    }

    .is-scrolled .header {
        box-shadow: 0 6px 20px rgba(16, 24, 40, 0.07);
    }

    .header__burger {
        display: inline-flex !important;
        order: 3;
        width: 42px;
        height: 42px;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: #f0f1f3;
    }

    .header__inner {
        flex-wrap: nowrap;
        gap: 8px;
        min-height: 0;
        padding-top: 8px;
        padding-bottom: 10px;
    }

    .header__inner > .search {
        order: 2;
        flex: 1 1 auto;
        flex-basis: auto;
        max-width: none;
    }

    .logo {
        order: 1;
        flex-shrink: 0;
    }

    .logo__mark {
        width: 36px;
        height: 36px;
        border-radius: 12px;
        font-size: 17px;
    }

    .logo__text {
        display: none;
    }

    .has-tabbar .header__actions {
        display: none;
    }

    .search input {
        height: 44px;
        padding: 0 44px 0 16px;
        border: 0;
        border-radius: 999px;
        background: #f0f1f3;
        font-size: 14px;
    }

    .search input:focus {
        background: #fff;
        box-shadow: 0 0 0 2px var(--primary);
    }

    .search > button {
        right: 4px;
        left: auto;
        top: 4px;
        width: 36px;
        height: 36px;
        background: transparent;
        color: #8a9097;
    }

    .search__panel {
        border-radius: 18px;
    }

    /* App bar replaces the site header on inner pages */
    .has-appbar .header,
    .has-appbar .footer {
        display: none;
    }

    .app-bar {
        position: sticky;
        top: 0;
        z-index: 45;
        display: flex;
        align-items: center;
        gap: 6px;
        height: 56px;
        padding: 0 max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
        background: rgba(255, 255, 255, 0.96);
        -webkit-backdrop-filter: saturate(180%) blur(14px);
        backdrop-filter: saturate(180%) blur(14px);
        border-bottom: 1px solid transparent;
        transition: box-shadow 0.2s, border-color 0.2s;
    }

    .is-scrolled .app-bar {
        border-bottom-color: var(--border);
        box-shadow: 0 6px 20px rgba(16, 24, 40, 0.06);
    }

    .app-bar__btn {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 42px;
        height: 42px;
        border-radius: 12px;
        color: var(--text);
    }

    a.app-bar__btn:active {
        background: #f0f1f3;
    }

    .app-bar__btn .app-tabbar__badge {
        top: 2px;
        right: 0;
    }

    .app-bar__title {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        font-size: 15.5px;
        font-weight: 800;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* ---------- Drawer ---------- */
    .drawer {
        width: min(340px, 86vw);
        padding: 18px 18px calc(24px + var(--safe-bottom));
        border-radius: 22px 0 0 22px;
        transition: transform 0.32s var(--app-ease);
    }

    .drawer-backdrop {
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
    }

    /* ---------- Floating UI ---------- */
    .back-to-top {
        display: none;
    }

    .store-toast {
        bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px);
        border-radius: 14px;
    }

    .no-tabbar .store-toast {
        bottom: calc(96px + var(--safe-bottom));
    }

    /* ---------- Home ---------- */
    .hero {
        margin: 12px 14px 0;
        border-radius: 22px;
        box-shadow: var(--app-card-shadow);
    }

    .hero__track {
        aspect-ratio: 3 / 1;
    }

    .hero__dots {
        bottom: 10px;
        gap: 6px;
    }

    .hero__dots button {
        width: 7px;
        height: 7px;
        border: 0;
        background: rgba(255, 255, 255, 0.55);
        opacity: 1;
        transition: width 0.25s;
    }

    .hero__dots button.is-active {
        width: 20px;
        border-radius: 999px;
        background: #fff;
    }

    .features {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 10px;
        padding: 14px;
        border: 0;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .features::-webkit-scrollbar,
    .promos::-webkit-scrollbar,
    .categories::-webkit-scrollbar,
    .product-grid--rail::-webkit-scrollbar,
    .brands::-webkit-scrollbar,
    .gallery__thumbs::-webkit-scrollbar,
    .breadcrumb::-webkit-scrollbar,
    .cat-app__rail::-webkit-scrollbar {
        display: none;
    }

    .feature {
        flex: 0 0 auto;
        gap: 10px;
        padding: 10px 14px;
        border-radius: 16px;
        background: var(--surface);
        text-align: right;
        box-shadow: var(--app-card-shadow);
    }

    .feature .icon {
        width: 26px;
        height: 26px;
    }

    .feature h3 {
        font-size: 13px;
        line-height: 1.5;
    }

    .feature p {
        font-size: 11.5px;
        line-height: 1.5;
    }

    .promos {
        display: flex;
        gap: 12px;
        margin-top: 0;
        margin-inline: -14px;
        padding: 0 14px 4px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 14px;
        scrollbar-width: none;
    }

    .promo {
        flex: 0 0 min(80%, 360px);
        min-height: 124px;
        padding: 18px;
        border-radius: 20px;
        scroll-snap-align: start;
    }

    .promo__title {
        font-size: 19px;
    }

    .promo__img {
        width: 86px;
        height: 86px;
    }

    .section {
        margin-top: 24px;
    }

    .section--tight {
        margin-top: 20px;
    }

    .section__head,
    .section__head--center,
    .section--tight > .section__head {
        align-items: center;
        justify-content: space-between;
        margin-bottom: 12px;
        border-bottom: 0;
    }

    .section__title {
        padding: 0 12px 0 0;
        font-size: 16px;
    }

    .section__title::after {
        top: 18%;
        right: 0;
        bottom: auto;
        width: 4px;
        height: 64%;
        border-radius: 4px;
    }

    .section__more {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 0;
        font-size: 12.5px;
    }

    .section__more::after {
        content: "";
        width: 6px;
        height: 6px;
        border-bottom: 2px solid currentColor;
        border-left: 2px solid currentColor;
        transform: rotate(45deg);
    }

    .section--deals {
        margin-top: 12px;
        margin-inline: 0;
        padding: 16px 14px 6px;
        border-radius: 22px;
        width: auto;
        background: linear-gradient(135deg, #b8691a 0%, var(--accent) 45%, #e0a24a 100%);
    }

    .section--deals .section__title,
    .section--deals .section__more {
        color: #fff;
    }

    .section--deals .section__title::after {
        background: #fff;
    }

    .categories {
        display: flex;
        gap: 14px;
        margin-inline: -14px;
        padding: 2px 14px 6px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .category-tile {
        flex: 0 0 72px;
        gap: 2px;
        transition: transform 0.15s;
    }

    .category-tile__img {
        width: 66px;
        height: 66px;
        max-width: none;
        margin-bottom: 4px;
        border: 2px solid #fff;
        background: #fff;
        box-shadow: var(--app-card-shadow);
    }

    .category-tile:hover .category-tile__img {
        transform: none;
    }

    .category-tile__letter {
        font-size: 24px;
    }

    .category-tile__name {
        font-size: 11.5px;
        font-weight: 600;
        line-height: 1.5;
    }

    .category-tile__count {
        display: none;
    }

    .wide-banner {
        margin-top: 24px;
        padding: 22px 20px;
        border-radius: 22px;
        gap: 14px;
    }

    .wide-banner__title {
        font-size: 19px;
    }

    .wide-banner p {
        font-size: 13px;
    }

    .wide-banner .btn {
        min-height: 40px;
        border-radius: 999px;
    }

    .brands {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 10px;
        margin-inline: -14px;
        padding: 0 14px 6px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .brand-tile,
    .brands .brand-tile {
        flex: 0 0 112px;
        width: 112px;
        max-width: none;
        height: 64px;
        border: 0;
        border-radius: 16px;
        filter: none;
        opacity: 1;
        box-shadow: var(--app-card-shadow);
    }

    .brand-tile img {
        max-height: 40px;
    }

    .empty-state {
        background: var(--surface);
        border-radius: 20px;
    }

    /* ---------- Product cards ---------- */
    .product-grid,
    .product-grid--shop {
        gap: 10px;
    }

    .product-card {
        padding: 8px;
        border-radius: 18px;
        background: var(--surface);
        box-shadow: var(--app-card-shadow);
    }

    .product-card__media {
        border-radius: 13px;
    }

    .product-card:hover .product-card__img {
        transform: none;
    }

    .product-card__badges {
        top: 8px;
        right: 8px;
    }

    .product-card .badge {
        padding: 1px 8px;
        border-radius: 999px;
        font-size: 10.5px;
    }

    .product-card__body {
        padding: 8px 2px 0;
    }

    .product-card__category {
        font-size: 11px;
        line-height: 1.6;
    }

    .product-card__title {
        min-height: 3.4em;
        font-size: 12.5px;
        line-height: 1.7;
    }

    .product-card__colors {
        gap: 4px;
        margin-top: 4px;
    }

    .product-card .swatch-dot {
        width: 11px;
        height: 11px;
    }

    .product-card__footer {
        padding-top: 6px;
    }

    .product-card .price__old {
        font-size: 11.5px;
    }

    .product-card .price__current {
        font-size: 14px;
    }

    .product-card .price__current small {
        font-size: 10.5px;
    }

    .product-card__shot {
        position: relative;
    }

    .product-card__action {
        position: absolute;
        z-index: 2;
        left: 8px;
        bottom: 8px;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: #fff;
        color: var(--primary);
        box-shadow: 0 4px 14px rgba(16, 24, 40, 0.16);
    }

    .product-grid--rail {
        display: flex;
        gap: 10px;
        margin-inline: -14px;
        padding: 2px 14px 12px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 14px;
        scrollbar-width: none;
    }

    .product-grid--rail > .product-card,
    .product-grid--rail > .style-card {
        flex: 0 0 clamp(148px, 42vw, 210px);
        scroll-snap-align: start;
    }

    /* Quick-buy panel becomes a bottom sheet */
    .product-card.is-quick-open {
        z-index: 90;
    }

    .product-card.is-quick-open::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 1;
        background: rgba(15, 20, 25, 0.45);
        animation: appFade 0.2s ease both;
    }

    .product-card__quick {
        position: fixed;
        inset: auto 0 0 0;
        max-height: 82vh;
        gap: 14px;
        padding: 26px 16px calc(16px + var(--safe-bottom));
        border: 0;
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -10px 40px rgba(15, 20, 25, 0.16);
        animation: appSheetUp 0.3s var(--app-ease) both;
    }

    .product-card__quick::before {
        content: "";
        position: absolute;
        top: 8px;
        left: 50%;
        width: 40px;
        height: 4px;
        margin-left: -20px;
        border-radius: 4px;
        background: #d6d9de;
    }

    .product-card__quick-head {
        font-size: 15px;
    }

    .product-card__quick-close {
        width: 34px;
        height: 34px;
    }

    .product-card__quick .option-group__label {
        font-size: 13.5px;
    }

    .product-card__quick .swatch__dot {
        width: 32px;
        height: 32px;
    }

    .product-card__quick .chip span {
        min-width: 46px;
        height: 40px;
        font-size: 14px;
    }

    .product-card__quick .buy-panel {
        padding: 0;
        border: 0;
        background: transparent;
    }

    .product-card__quick .buy-panel__add {
        min-height: 50px;
        border-radius: 14px;
        font-size: 15px;
    }

    .product-card__quick .in-cart__btn {
        width: 42px;
        height: 42px;
    }

    /* ---------- Page heads ---------- */
    .page-head {
        margin-bottom: 4px;
        padding: 12px 0 8px;
        background: transparent;
    }

    .page-head--compact {
        margin-bottom: 0;
        padding: 10px 0 6px;
    }

    .page-head__title {
        margin-top: 2px;
        font-size: 19px;
    }

    .breadcrumb {
        flex-wrap: nowrap;
        overflow-x: auto;
        font-size: 11.5px;
        white-space: nowrap;
        scrollbar-width: none;
    }

    .has-appbar .page-head--compact {
        display: none;
    }

    /* ---------- Shop ---------- */
    .shop {
        gap: 0;
    }

    .shop-toolbar {
        position: sticky;
        top: var(--app-header-h, 0px);
        z-index: 30;
        flex-wrap: nowrap;
        gap: 8px;
        margin: 0 -14px 10px;
        padding: 8px 14px;
        border-radius: 0;
        background: var(--app-bg);
    }

    .shop-toolbar__filters {
        order: 0;
        flex-shrink: 0;
        min-height: 38px;
        padding: 0 14px;
        border: 0;
        border-radius: 999px;
        background: var(--surface);
        box-shadow: var(--app-card-shadow);
    }

    .shop-toolbar__controls {
        order: 1;
        flex: 1;
        width: auto;
        min-width: 0;
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .shop-toolbar__controls .select-label > span,
    .shop-toolbar__controls .select-label:last-child {
        display: none;
    }

    .shop-toolbar__controls .field--sm {
        min-height: 38px;
        max-width: 100%;
        border: 0;
        border-radius: 999px;
        background: var(--surface);
        box-shadow: var(--app-card-shadow);
    }

    .shop-toolbar__count {
        order: 2;
        flex-shrink: 0;
        font-size: 12px;
    }

    .active-filters {
        flex-wrap: nowrap;
        margin: 0 -14px 12px;
        padding: 0 14px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .active-filter {
        flex-shrink: 0;
        border: 0;
        background: var(--primary-soft);
        color: var(--primary-dark);
        white-space: nowrap;
    }

    .shop__sidebar {
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 75;
        width: auto;
        max-height: 88vh;
        padding: 0 18px;
        border-radius: 24px 24px 0 0;
        transform: translateY(105%);
        transition: transform 0.34s var(--app-ease);
        box-shadow: 0 -10px 40px rgba(15, 20, 25, 0.16);
    }

    .shop__sidebar::before {
        content: "";
        position: sticky;
        top: 0;
        z-index: 3;
        display: block;
        width: 40px;
        height: 4px;
        margin: 8px auto -12px;
        border-radius: 4px;
        background: #d6d9de;
    }

    .shop__sidebar-head {
        position: sticky;
        top: 0;
        z-index: 2;
        margin: 0 -18px;
        padding: 18px 18px 10px;
        background: #fff;
    }

    .filter-actions {
        position: sticky;
        bottom: 0;
        z-index: 2;
        display: flex;
        gap: 8px;
        margin: 0 -18px;
        padding: 12px 18px calc(12px + var(--safe-bottom));
        background: #fff;
        box-shadow: 0 -6px 16px rgba(16, 24, 40, 0.05);
    }

    .filter-actions .btn {
        flex: 1;
        margin: 0;
    }

    .pager {
        margin-top: 22px;
        gap: 6px;
    }

    .js [data-infinite] ~ .pager {
        display: none;
    }

    .pager__item {
        min-width: 38px;
        height: 38px;
        border: 0;
        border-radius: 12px;
        background: var(--surface);
        box-shadow: var(--app-card-shadow);
    }

    /* ---------- Product page ---------- */
    .no-tabbar .store-main {
        padding-bottom: calc(96px + var(--safe-bottom));
    }

    body.has-tabbar:has(.product:not(.product--style)) {
        padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 120px);
    }

    .product {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 0;
    }

    .gallery {
        position: relative;
        top: auto;
        align-self: stretch;
        width: 100%;
        max-width: 100%;
        margin-inline: 0;
    }

    .gallery__main {
        width: 100%;
        aspect-ratio: 1;
        border-radius: 0;
        background: #fff;
        box-shadow: none;
    }

    .gallery__img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .gallery__badge {
        top: 12px;
        right: 12px;
        border-radius: 999px;
    }

    .gallery__thumbs {
        position: absolute;
        right: 12px;
        bottom: 52px;
        left: 12px;
        z-index: 2;
        gap: 8px;
        margin: 0;
        scrollbar-width: none;
    }

    .gallery__thumb {
        width: 48px;
        height: 48px;
        aspect-ratio: 1;
        border-radius: 12px;
        border-color: #fff;
        box-shadow: 0 4px 12px rgba(16, 24, 40, 0.18);
    }

    .product-info {
        position: relative;
        z-index: 3;
        margin-top: -18px;
        padding: 20px 16px 8px;
        border-radius: 22px 22px 0 0;
        background: var(--surface);
        box-shadow: 0 -8px 24px rgba(16, 24, 40, 0.06);
    }

    .product-info__title {
        font-size: 18px;
        line-height: 1.7;
    }

    .product-info__code,
    .product-info__meta {
        display: none;
    }

    .product-info .product-info__price {
        display: none;
    }

    .option-group {
        margin-bottom: 16px;
    }

    .chips--lg .chip span,
    .product-info .chip span {
        min-width: 48px;
        min-height: 42px;
        border-radius: 12px;
    }

    .product-info__perks {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin-top: 8px;
        padding: 0;
        background: transparent;
    }

    .product-info__perks li {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-height: 76px;
        padding: 10px 8px;
        border: 0;
        border-radius: 16px;
        background: var(--app-bg);
        text-align: center;
        font-size: 11.5px;
        line-height: 1.5;
    }

    .product .buy-panel {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 56;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px 12px;
        padding: 10px 14px calc(10px + var(--safe-bottom));
        border: 0;
        border-top: 1px solid rgba(15, 20, 25, 0.06);
        border-radius: 22px 22px 0 0;
        background: rgba(255, 255, 255, 0.97);
        -webkit-backdrop-filter: saturate(180%) blur(16px);
        backdrop-filter: saturate(180%) blur(16px);
        box-shadow: 0 -8px 28px rgba(16, 24, 40, 0.1);
    }

    body.has-tabbar .product .buy-panel {
        bottom: calc(var(--tabbar-h) + var(--safe-bottom));
        z-index: 54;
        padding-bottom: 10px;
        border-radius: 0;
        box-shadow: 0 -6px 20px rgba(16, 24, 40, 0.06);
    }

    .product .buy-panel__price {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        justify-self: end;
        grid-column: 2;
        grid-row: 2;
        min-width: max-content;
        line-height: 1.45;
        white-space: nowrap;
    }

    .buy-panel__price-old {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        color: var(--muted);
        font-size: 12px;
    }

    .buy-panel__price-old .badge {
        padding: 0 7px;
        border-radius: 999px;
        font-size: 10.5px;
    }

    .buy-panel__price .price__current {
        font-size: 17px;
    }

    .product .buy-panel__stock {
        grid-column: 1 / -1;
        grid-row: 1;
        font-size: 12px;
    }

    .product .buy-box {
        grid-column: 1;
        grid-row: 2;
        min-width: 0;
    }

    .product .buy-panel__add {
        min-height: 50px;
        border-radius: 14px;
    }

    .product .buy-panel__assure {
        display: none;
    }

    .product .style-product .buy-panel {
        position: static;
        right: auto;
        bottom: auto;
        left: auto;
        z-index: auto;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        grid-template-columns: none;
        gap: 12px;
        margin-top: 4px;
        padding: 12px;
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        background: var(--surface-soft);
        box-shadow: none;
        backdrop-filter: none;
    }

    .product .style-product .buy-panel__price {
        align-items: flex-start;
        justify-self: stretch;
        order: -1;
        width: 100%;
        min-width: 0;
        white-space: normal;
    }

    body.has-tabbar .product .style-product .buy-panel {
        bottom: auto;
        padding-bottom: 12px;
        border-radius: var(--radius-lg);
        box-shadow: none;
    }

    .product .style-product .buy-box,
    .product .style-product .in-cart {
        grid-column: auto;
        grid-row: auto;
        order: 0;
        flex: none;
        width: 100%;
    }

    .product .in-cart {
        grid-column: 1;
        grid-row: 2;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        min-width: 0;
    }

    .product .in-cart__row {
        gap: 10px;
    }

    .product .in-cart__label {
        font-size: 13px;
    }

    .product .in-cart__link {
        align-self: center;
        font-size: 13px;
        white-space: nowrap;
    }

    .product-details {
        margin-top: 8px;
        padding-bottom: 8px;
    }

    .tabs__nav {
        gap: 4px;
        margin: 0 0 10px;
        padding: 4px;
        border: 0;
        border-radius: 14px;
        background: var(--surface);
        box-shadow: var(--app-card-shadow);
    }

    .tabs__btn {
        flex: 1;
        min-height: 40px;
        padding: 0 12px;
        border: 0;
        border-radius: 12px;
        margin: 0;
        font-size: 13.5px;
    }

    .tabs__btn.is-active {
        background: var(--primary-soft);
        color: var(--primary-dark);
    }

    .tabs__panel {
        padding: 16px;
        border-radius: 18px;
        background: var(--surface);
        box-shadow: var(--app-card-shadow);
    }

    .specs,
    .specs tbody,
    .specs tr,
    .specs th,
    .specs td {
        display: block;
        width: 100%;
    }

    .specs tr {
        padding: 10px 0;
        border-bottom: 1px solid var(--border);
    }

    .specs th {
        padding: 0;
        color: var(--muted);
        font-size: 12px;
        font-weight: 600;
        background: transparent;
        border: 0;
    }

    .specs td {
        padding: 2px 0 0;
        border: 0;
        font-weight: 700;
    }

    /* ---------- Cart & checkout ---------- */
    .cart-page {
        padding: 8px 0 24px;
        background: transparent;
    }

    .cart-loading,
    .cart-empty {
        border: 0;
        border-radius: 22px;
        box-shadow: var(--app-card-shadow);
        padding: 40px 20px;
    }

    .has-appbar #cartApp .cart-panel__head {
        display: none;
    }

    .cart-panel {
        background: transparent;
        box-shadow: none;
        border: 0;
    }

    #checkoutApp .cart-panel__head {
        gap: 10px;
        margin: 0 0 8px;
        padding: 2px 2px 10px;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    #checkoutApp .cart-panel__head h1,
    #checkoutApp .cart-panel__head h2 {
        font-size: 15px;
        font-weight: 800;
    }

    #checkoutApp .cart-panel__mark {
        width: 36px;
        height: 36px;
        border-radius: 12px;
    }

    .cart-ship__list,
    .cart-ship__address,
    .checkout-code,
    .js-checkout-pay-hint {
        padding-right: 0;
        padding-left: 0;
    }

    .app-tabbar__icon span.app-tabbar__badge.js-cart-count {
        right: -10px;
        top: -8px;
    }

    .cart-lines {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .cart-line {
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 8px 12px;
        margin: 0;
        padding: 12px;
        border: 0;
        border-radius: 18px;
        background: var(--surface);
        box-shadow: var(--app-card-shadow);
    }

    .cart-line + .cart-line {
        border: 0;
    }

    .cart-line__media {
        width: 76px;
        height: 96px;
        border-radius: 14px;
    }

    .cart-line__name {
        font-size: 13.5px;
        line-height: 1.6;
    }

    .cart-line__side {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding-top: 4px;
    }

    .qty--cart .qty__btn,
    .in-cart__btn {
        width: 40px;
        height: 40px;
    }

    .cart-ship__option {
        min-height: 56px;
        padding: 14px;
        border: 0;
        border-radius: 16px;
        background: var(--surface);
        box-shadow: var(--app-card-shadow);
    }

    .cart-ship__option.is-selected {
        box-shadow: 0 0 0 2px var(--primary);
    }

    .checkout-code {
        display: flex;
        gap: 8px;
        padding: 0 0 8px;
    }

    .checkout-code .field {
        flex: 1;
        min-height: 48px;
        border: 0;
        border-radius: 14px;
        background: var(--surface);
        box-shadow: var(--app-card-shadow);
        font-size: 16px;
    }

    .checkout-code .btn {
        min-height: 48px;
        border-radius: 14px;
        white-space: nowrap;
    }

    .cart-pay-hold,
    .checkout-hold {
        border: 0;
        border-radius: 18px;
        box-shadow: var(--app-card-shadow);
    }

    .cart-pay-hold__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .cart-pay-hold__actions .btn {
        min-height: 44px;
        width: 100%;
    }

    .cart-pay-hold__actions .btn--ghost {
        grid-column: 1 / -1;
    }

    .has-actionbar .cart-summary h2,
    .has-actionbar .cart-summary__note,
    .has-actionbar .cart-summary__continue,
    .has-actionbar .cart-summary__perk {
        display: none;
    }

    .cart-summary {
        margin-top: 8px;
        padding: 8px 16px 12px;
        border: 0;
        border-radius: 18px;
        background: var(--surface);
        box-shadow: var(--app-card-shadow);
    }

    body.has-actionbar .store-main {
        padding-bottom: 78px;
    }

    .app-actionbar {
        position: fixed;
        right: 0;
        bottom: calc(var(--tabbar-h) + var(--safe-bottom));
        left: 0;
        z-index: 54;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 10px 14px;
        background: rgba(255, 255, 255, 0.97);
        -webkit-backdrop-filter: saturate(180%) blur(16px);
        backdrop-filter: saturate(180%) blur(16px);
        border-top: 1px solid rgba(15, 20, 25, 0.06);
        box-shadow: 0 -6px 20px rgba(16, 24, 40, 0.06);
    }

    .app-actionbar[hidden] {
        display: none;
    }

    .no-tabbar .app-actionbar {
        bottom: 0;
        padding-bottom: calc(10px + var(--safe-bottom));
        border-radius: 22px 22px 0 0;
    }

    .app-actionbar__info {
        display: flex;
        flex-direction: column;
        min-width: 0;
        line-height: 1.5;
    }

    .app-actionbar__info span {
        color: var(--muted);
        font-size: 11.5px;
    }

    .app-actionbar__info strong {
        font-size: 16px;
        font-weight: 800;
        white-space: nowrap;
    }

    .app-actionbar__btn {
        flex: 0 0 auto;
        min-width: 48%;
        min-height: 48px;
        border-radius: 14px;
    }

    .has-actionbar .cart-summary__checkout,
    .has-actionbar .cart-summary__pay {
        display: none;
    }

    .cart-modal__dialog {
        border-radius: 24px 24px 0 0;
    }

    /* ---------- Customer panel ---------- */
    .account {
        padding: 12px 0 24px;
        background: transparent;
    }

    .account__layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .account--sub .account-nav {
        display: none;
    }

    .account--overview .account-nav {
        display: contents;
    }

    .account--overview .account-nav__profile {
        order: -1;
        gap: 14px;
        padding: 18px;
        border: 0;
        border-radius: 22px;
        background: var(--store-gradient);
        color: #fff;
        box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 30%, transparent);
    }

    .account--overview .account-nav__profile strong {
        font-size: 16px;
    }

    .account--overview .account-nav__profile span {
        color: rgba(255, 255, 255, 0.8);
    }

    .account-nav__photo {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        color: #fff;
    }

    .account--overview .account__main {
        order: 0;
    }

    .account--overview .account-nav__bar {
        order: 1;
        display: block;
        padding: 6px;
        border-radius: 22px;
        background: var(--surface);
        box-shadow: var(--app-card-shadow);
    }

    .account--overview .account-nav__menu {
        flex-direction: column;
        gap: 0;
        padding: 0;
        overflow: visible;
    }

    .account--overview .account-nav__link {
        min-height: 56px;
        padding: 8px 10px;
        white-space: normal;
    }

    .account--overview .account-nav__link + .account-nav__link {
        border-top: 1px solid #f0f1f3;
    }

    .account--overview .account-nav__link > .icon:first-child {
        width: 38px;
        height: 38px;
        padding: 9px;
        border-radius: 12px;
        background: var(--surface-soft);
        color: var(--primary);
    }

    .account--overview .account-nav__link.is-active {
        display: none;
    }

    .account--overview .account-nav__chevron {
        display: inline-block;
        width: 16px;
        height: 16px;
        margin-inline-start: auto;
        color: var(--muted);
    }

    .account--overview .account-nav__link em + .account-nav__chevron {
        margin-inline-start: 6px;
    }

    .account--overview .account-nav__logout {
        padding: 0;
        border-top: 1px solid #f0f1f3;
    }

    .account--overview .account-nav__logout button {
        min-height: 56px;
        padding: 8px 20px;
        border-radius: 12px;
        background: transparent;
    }

    .account-card,
    .address-card,
    .account-stat,
    .orders-panel,
    .order-card {
        border: 0;
        border-radius: 20px;
        box-shadow: var(--app-card-shadow);
    }

    .account-stat {
        border-radius: 18px;
    }

    /* ---------- Auth ---------- */
    .auth {
        padding: 28px 0 40px;
        background: transparent;
    }

    .auth__card {
        padding: 8px 4px 28px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        max-width: 420px;
        margin-inline: auto;
    }

    .auth__title {
        font-size: 28px;
        font-weight: 800;
        line-height: 1.4;
        margin-bottom: 8px;
    }

    .auth__lead {
        margin-bottom: 28px;
        color: var(--text-soft);
        font-size: 14.5px;
        line-height: 1.8;
    }

    .auth__card .field {
        min-height: 52px;
        border-radius: 16px;
        font-size: 16px;
        background: #fff;
        box-shadow: var(--app-card-shadow);
        border-color: transparent;
    }

    .auth__submit {
        min-height: 52px;
        border-radius: 16px;
        margin-top: 8px;
    }

    .auth__back {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        margin-top: 20px;
        border-radius: 50%;
        background: #f0f1f3;
        color: var(--text);
    }

    /* ---------- Footer: hidden on phones so the tab bar matches every page ---------- */
    .footer {
        display: none;
    }

    .footer__grid {
        display: none;
    }

    .footer__bottom {
        border: 0;
        background: transparent;
    }

    .footer__bottom-inner {
        flex-direction: column;
        justify-content: center;
        padding: 8px 0 4px;
        font-size: 11.5px;
        color: var(--muted);
        text-align: center;
    }

    .footer__pay {
        display: none;
    }

    /* ---------- Categories page ---------- */
    .cat-app {
        padding: 0;
    }

    .cat-app .cat-app__layout {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 0;
        padding: 0;
        min-height: calc(100vh - var(--app-header-h, 110px) - var(--tabbar-h) - var(--safe-bottom));
    }

    .cat-app__rail {
        top: var(--app-header-h, 0px);
        gap: 0;
        max-height: calc(100vh - var(--app-header-h, 110px) - var(--tabbar-h) - var(--safe-bottom));
        padding: 0 0 12px;
        overflow-y: auto;
        border: 0;
        border-radius: 0;
        background: #eef0f3;
        scrollbar-width: none;
    }

    .cat-app__tab {
        position: relative;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        min-height: 84px;
        padding: 8px 6px;
        border-radius: 0;
        font-size: 11.5px;
        text-align: center;
    }

    .cat-app__tab.is-active {
        background: var(--app-bg);
    }

    .cat-app__tab.is-active::before {
        content: "";
        position: absolute;
        top: 16px;
        right: 0;
        bottom: 16px;
        width: 4px;
        border-radius: 4px 0 0 4px;
        background: var(--primary);
    }

    .cat-app__tab-img {
        width: 44px;
        height: 44px;
        background: #fff;
    }

    .cat-app__panels {
        min-width: 0;
        padding: 12px;
    }

    .cat-app__panel {
        padding: 12px;
        border: 0;
        border-radius: 20px;
        box-shadow: var(--app-card-shadow);
        animation: appFade 0.2s ease both;
    }

    .cat-app__grid {
        grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
        gap: 14px 8px;
    }

    .cat-tile__name {
        font-size: 11.5px;
    }
}

/* Tablets: a bit more room */
@media (min-width: 600px) and (max-width: 768px) {
    .product-grid--rail > .product-card,
    .product-grid--rail > .style-card {
        flex-basis: clamp(170px, 28vw, 220px);
    }

    .category-tile {
        flex-basis: 88px;
    }

    .category-tile__img {
        width: 80px;
        height: 80px;
    }

    .app-tabbar {
        padding-inline: 12%;
    }

    .cat-app .cat-app__layout {
        grid-template-columns: 120px minmax(0, 1fr);
    }

    .cat-app__grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .product .buy-panel,
    .app-actionbar {
        padding-inline: max(14px, calc((100vw - 720px) / 2));
    }
}

@keyframes appSheetUp {
    from { transform: translateY(100%); }
    to { transform: none; }
}

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

@media (prefers-reduced-motion: reduce) {
    .app-progress.is-loading,
    .infinite-loader__spin,
    .product-card__quick,
    .product-card.is-quick-open::before,
    .cat-app__panel {
        animation: none;
    }
}

/* ---------- PWA install banner ---------- */
.pwa-banner {
    position: fixed;
    right: 12px;
    left: 12px;
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    z-index: 120;
    pointer-events: none;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.28s var(--app-ease, ease), transform 0.28s var(--app-ease, ease);
}

.pwa-banner.is-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

html.is-standalone .pwa-banner {
    display: none !important;
}

.pwa-banner__card {
    position: relative;
    padding: 16px 16px 14px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(16, 24, 40, 0.16);
    border: 1px solid rgba(15, 20, 25, 0.06);
}

.pwa-banner__close {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted, #8a9097);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.pwa-banner__row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-left: 24px;
}

.pwa-banner__icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    flex-shrink: 0;
    object-fit: cover;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 22%, transparent);
}

.pwa-banner__copy strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.pwa-banner__copy p {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-soft, #555b62);
}

.pwa-banner__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

.pwa-banner__later,
.pwa-banner__install {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 12px;
    border: 0;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.pwa-banner__later {
    background: var(--surface-soft);
    color: var(--text-soft);
}

.pwa-banner__install {
    background: var(--primary);
    color: #fff;
}

@media (max-width: 768px) {
    body.has-tabbar .pwa-banner {
        bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px);
    }
}
