/* rx-tabbar.css — the shop's bottom tab bar on phones (owner 2026-11-16).
   Built by js/rx-tabbar.js. Everything here is scoped to what the script puts
   on the page (.rx-tb, html.rx-tb-on), so nothing else moves:

     .rx-tb            the bar itself, fixed to the bottom of the screen
     .rx-tb-i          one tab: icon over its label
     .rx-tb-badge      the live cart count on the Cart tab
     .rx-tb-dot        the red mark on Trends: something new has arrived
     .rx-tb-sheet      the panel a tab opens (categories, newest items)

   Hidden from 900px up (the width where js/rx-nav.js also folds the header
   into its ⋮ menu). The app's own .sf-sheet (cart drawer, z 900) and its
   sign-in dialog stay above the bar: the bar sits at 850. */

html.rx-tb-on {
    --rx-tb-h: 62px;
}

.rx-tb {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 850;
    display: none;
    align-items: stretch;
    justify-content: space-between;
    gap: 2px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid rgba(17, 17, 17, .07);
    font-family: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 900px) {
    .rx-tb {
        display: flex;
    }
}

.rx-tb-i {
    flex: 1 1 0;
    min-width: 0;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 0;
    margin: 0;
    border: 0;
    background: none;
    color: #8c8c94;
    font: inherit;
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: .01em;
    text-align: center;
    cursor: pointer;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
}

.rx-tb-i .rx-tb-ic {
    position: relative;
    display: block;
    width: 23px;
    height: 23px;
}

.rx-tb-i svg {
    display: block;
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rx-tb-i .rx-tb-l {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rx-tb-i.is-on {
    color: #111;
}

.rx-tb-i.is-on[data-tab="shop"] svg path {
    fill: currentColor;
}

.rx-tb-i:active {
    opacity: .66;
}

.rx-tb-i:focus-visible {
    outline: 2px solid #111;
    outline-offset: -2px;
    border-radius: 10px;
}

/* the red mark: new items in the store */
.rx-tb-dot {
    position: absolute;
    top: -1px;
    inset-inline-end: -2px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e8352a;
    box-shadow: 0 0 0 2px #fff;
    display: none;
}

.rx-tb-i[data-tab="trends"].has-dot .rx-tb-dot {
    display: block;
}

/* the live item count, mirroring the app's own cart button */
.rx-tb-badge {
    position: absolute;
    top: -4px;
    inset-inline-end: -7px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #f04438;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    letter-spacing: 0;
    box-shadow: 0 0 0 2px #fff;
    display: none;
}

.rx-tb-i.has-count .rx-tb-badge {
    display: block;
}

/* ---- the tab bar owns the bottom of the page while it is there ---- */

@media (max-width: 900px) {
    html.rx-tb-on body {
        padding-bottom: calc(var(--rx-tb-h, 62px) + env(safe-area-inset-bottom, 0px));
    }

    /* the app's floating checkout bar (js/rx-store.js slides it in once the
       cart has something in it) now rides above the tabs instead of under
       them: one tap to checkout, and the tabs stay reachable */
    html.rx-tb-on button.sf-fab,
    html.rx-tb-on button.sf-fab.rx-fab {
        bottom: calc(var(--rx-tb-h, 62px) + 12px + env(safe-area-inset-bottom, 0px));
    }

    /* the shop's WhatsApp button is placed 78px from the bottom, which is fine
       until the phone has a home indicator: the bar then grows upwards and the
       button's lower part slid behind it. It now measures from the bar's real
       height, and steps above the checkout bar while that one is up (the
       rx-tb-fab class js/rx-tabbar.js sets). */
    html.rx-tb-on .rx-wa {
        bottom: calc(var(--rx-tb-h, 62px) + 14px + env(safe-area-inset-bottom, 0px));
    }

    html.rx-tb-on.rx-tb-fab .rx-wa {
        bottom: calc(var(--rx-tb-h, 62px) + 12px + 56px + 10px + env(safe-area-inset-bottom, 0px));
    }
}

/* The app's own dialogs (the sign-in / account one, opened by the Me tab) are
   drawn at z 70, which would put their lower edge behind the bar. Under the
   bar's spell they are lifted above it: their dim backdrop then covers the
   tabs, exactly as a dialog should. Nothing else about them changes. */
html.rx-tb-on .sf-modal {
    z-index: 860;
}

/* ---- the panel a tab opens ---- */

.rx-tb-sheet {
    position: fixed;
    inset: 0;
    z-index: 880;
    display: none;
}

.rx-tb-sheet.is-open {
    display: block;
}

.rx-tb-back {
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 17, .44);
}

.rx-tb-panel {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    max-height: 84vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -18px 44px rgba(17, 17, 17, .22);
    font-family: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
    color: #111;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    animation: rx-tb-rise .26s cubic-bezier(.22, .9, .3, 1) both;
}

@keyframes rx-tb-rise {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .rx-tb-panel {
        animation: none;
    }
}

.rx-tb-h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 8px;
}

.rx-tb-t {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .01em;
}

.rx-tb-x {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f4f4f6;
    color: #333;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.rx-tb-x svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
}

.rx-tb-b {
    flex: 1 1 auto;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 2px 12px 20px;
}

html.rx-tb-lock body {
    overflow: hidden;
}

/* ---- categories: the store's own categories, one tap each ---- */

.rx-tb-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 7px 6px;
    border-radius: 14px;
    color: #111;
    text-decoration: none;
}

.rx-tb-row:active {
    background: #f7f7f9;
}

.rx-tb-row + .rx-tb-row {
    box-shadow: inset 0 1px 0 #f1f1f4;
}

.rx-tb-rowi {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    overflow: hidden;
    background: #f4f1f6;
    color: #8a6a86;
    font-size: 15px;
    font-weight: 700;
}

.rx-tb-rowi img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rx-tb-rowi svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linejoin: round;
}

.rx-tb-rown {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rx-tb-chev {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #b9b9c2;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

html[dir="rtl"] .rx-tb-chev,
html[lang="ar"] .rx-tb-chev {
    transform: scaleX(-1);
}

/* ---- trends: the newest items in the store ---- */

.rx-tb-sub {
    margin: 2px 6px 10px;
    font-size: 12.5px;
    font-weight: 500;
    color: #8c8c94;
}

.rx-tb-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 12px;
    padding: 0 2px 4px;
}

.rx-tb-card {
    display: block;
    min-width: 0;
    color: #111;
    text-decoration: none;
}

.rx-tb-thumb {
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    background: #f4f1f6;
}

.rx-tb-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rx-tb-n {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.32;
    min-height: 2.64em;
}

.rx-tb-p {
    display: block;
    margin-top: 3px;
    font-size: 13px;
    font-weight: 700;
}

.rx-tb-p s {
    margin-inline-start: 6px;
    font-weight: 500;
    color: #9a9aa3;
}

.rx-tb-note {
    margin: 0;
    padding: 26px 12px;
    font-size: 13px;
    color: #8c8c94;
    text-align: center;
}
