/* ---------------------------------
 * Website Layout
 * --------------------------------- */

.website-layout {
    --tblr-body-bg: #f8f5ef;
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

[data-bs-theme='dark'] .website-layout {
    --tblr-body-bg: var(--tblr-bg-surface);
}

@media (max-width: 575.98px) {
    .website-layout .container {
        --tblr-gutter-x: 2rem;
    }
}

/* ---------------------------------
 * Shared
 * --------------------------------- */

.save-button.is-compact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--save-button-color, var(--tblr-secondary));
    font-size: 1.25rem;
    transition: color 0.15s ease;
}

.save-button.is-compact:hover,
.save-button.is-active {
    color: var(--tblr-primary);
}

@media (prefers-reduced-motion: no-preference) {
    .save-button.is-compact:active {
        transform: scale(0.9);
    }
}

/* The bordered card surface behind store, category and post cards and the store page's asides */
.tile {
    border: 1px solid var(--tblr-border-color);
    border-radius: 1.25rem;
    background-color: var(--tblr-bg-surface);
    transition: border-color 0.15s ease;
}

[data-bs-theme='dark'] .tile {
    background-color: var(--tblr-bg-surface-secondary);
}

.tile,
.tile:hover {
    color: var(--tblr-body-color);
}

a.tile:hover {
    border-color: var(--tblr-primary);
}

.website-layout .card {
    --tblr-card-border-radius: 1.25rem;
}

@media (prefers-reduced-motion: no-preference) {
    .website-layout .btn {
        transition:
            color 0.15s ease-in-out,
            background-color 0.15s ease-in-out,
            border-color 0.15s ease-in-out,
            box-shadow 0.15s ease-in-out,
            transform 160ms var(--ease-out);
    }

    .website-layout .btn:active:not(:disabled, .disabled) {
        transform: scale(0.97);
    }
}

/* The pill behind the hero markets, the directory filter and the store page's categories; each sets its padding and colours */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: 2rem;
    color: var(--tblr-body-color);
    font-weight: 500;
}

.chip:hover {
    color: var(--tblr-body-color);
}

/* A block's heading, with an optional count beside it */
.block-title {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.block-title span {
    color: var(--tblr-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
}

.avatar.avatar-tile {
    --tblr-avatar-size: 5.5rem;
    flex-shrink: 0;
    border: 1px solid var(--tblr-border-color);
    border-radius: 1.5rem;
    background-color: var(--tblr-bg-surface);
    color: var(--tblr-primary);
    font-family: var(--app-font-display);
    font-size: 2.5rem;
    font-weight: 700;
}

.field-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin: 0.5rem 0 0;
    color: var(--tblr-secondary);
    font-size: 0.875rem;
}

/* A strip that scrolls sideways under the page gutters with no scrollbar showing */
.scroll-row {
    margin-inline: calc(var(--tblr-gutter-x, 1.5rem) * -0.5);
    padding-inline: calc(var(--tblr-gutter-x, 1.5rem) * 0.5);
    overflow-x: auto;
    scrollbar-width: none;
}

.scroll-row::-webkit-scrollbar {
    display: none;
}

/* Long names take a second line rather than losing their ending */
:is(.post-card-excerpt, .store-card-name, .product-card-title, .offer-ticket-title) {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

:is(.tile, .chip, .product-sort-item, .product-gallery-thumb, .store-mini-list a):focus-visible,
.product-card:has(a:focus-visible) .product-card-media {
    outline: 2px solid var(--tblr-primary);
    outline-offset: 2px;
}

/* The big display titles; Arabic script needs the taller line */
:is(.page-masthead-title, .home-hero-title, .store-header-title, .post-header-title) {
    font-weight: 700;
    line-height: 1.05;
}

[dir='rtl'] :is(.page-masthead-title, .home-hero-title, .store-header-title, .post-header-title) {
    line-height: 1.35;
}

/* Ends within days */
.is-soon {
    color: var(--tblr-primary);
}

.price {
    white-space: nowrap;
}

.price-currency {
    font-size: 0.7em;
    font-weight: 500;
}

/* ---------------------------------
 * Page Masthead
 * --------------------------------- */

.page-masthead {
    max-width: 46rem;
    margin-bottom: 3rem;
}

.page-masthead-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    line-height: 1;
    margin-bottom: 1rem;
    text-wrap: balance;
}

.page-masthead-lead {
    color: var(--tblr-secondary);
    font-size: 1.125rem;
    margin-bottom: 0;
}

.page-crumb {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--tblr-secondary);
    font-weight: 500;
}

.page-crumb:hover {
    color: var(--tblr-primary);
}

[dir='rtl'] .page-crumb .ti {
    transform: scaleX(-1);
}

.media-header {
    display: flex;
    align-items: center;
    gap: 1.25rem 1.75rem;
    margin-bottom: 2.5rem;
}

.media-header-body {
    min-width: 0;
}

.media-header-title {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 700;
    line-height: 1.05;
    margin-bottom: 0.5rem;
    overflow-wrap: anywhere;
}

[dir='rtl'] .media-header-title {
    line-height: 1.35;
}

.media-header-meta {
    color: var(--tblr-secondary);
    font-size: 1.0625rem;
    margin-bottom: 0;
}

@media (max-width: 575.98px) {
    .media-header {
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .media-header .avatar-tile {
        --tblr-avatar-size: 4rem;
        border-radius: 1.125rem;
        font-size: 1.75rem;
    }
}

/* ---------------------------------
 * Receipt
 * --------------------------------- */

.receipt-paper {
    padding: 1.75rem 1.75rem 2.5rem;
    border-radius: 1rem 1rem 0 0;
    background-color: var(--tblr-bg-surface);
    /* Torn zigzag edge along the bottom */
    mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 1rem 100%;
}

[data-bs-theme='dark'] .receipt-paper {
    background-color: color-mix(in srgb, var(--tblr-body-color) 7%, var(--tblr-bg-surface));
}

.receipt-head {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding-bottom: 1rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px dashed var(--tblr-border-color);
}

.receipt-caption {
    color: var(--tblr-secondary);
}

.receipt-product {
    font-size: 1.125rem;
    font-weight: 600;
}

.receipt-lines {
    margin-bottom: 0;
}

.receipt-line {
    position: relative;
    isolation: isolate;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding-block: 0.5rem;
}

/* Highlight band shown while the line's source is hovered */
.receipt-line::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0 -0.75rem;
    border-radius: 0.5rem;
    background-color: color-mix(in srgb, var(--tblr-primary) 9%, transparent);
    opacity: 0;
}

.receipt-line dt {
    color: var(--tblr-secondary);
    font-weight: 400;
}

.receipt-line dd {
    margin-bottom: 0;
    direction: ltr;
    font-family: var(--app-font-display);
    font-weight: 500;
}

.receipt-line:not(:first-child) dd {
    color: var(--tblr-primary);
}

.receipt-struck {
    position: relative;
    color: var(--tblr-secondary);
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
}

.receipt-struck::before {
    --strike-hidden: inset(0 100% 0 0);

    content: '';
    position: absolute;
    top: calc(50% - 0.075em);
    inset-inline: -0.15em;
    height: 0.15em;
    border-radius: 1em;
    background-color: var(--tblr-primary);
}

[dir='rtl'] .receipt-struck::before {
    --strike-hidden: inset(0 0 0 100%);
}

.receipt-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding-top: 1.25rem;
    margin-top: 0.75rem;
    border-top: 1px dashed var(--tblr-border-color);
}

.receipt-total span {
    font-weight: 600;
}

.receipt-total strong {
    font-family: var(--app-font-display);
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
}

.receipt-total small {
    color: var(--tblr-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: normal;
}

.receipt-saved {
    margin: 0.5rem 0 0;
    color: var(--tblr-primary);
    font-weight: 600;
    text-align: end;
}

@media (max-width: 575.98px) {
    .receipt-paper {
        padding: 1.25rem 1.25rem 2rem;
    }

    .receipt-total strong {
        font-size: 1.875rem;
    }
}

.receipt-head,
.receipt-line,
.receipt-total,
.receipt-saved {
    animation: receipt-print 400ms var(--hero-ease-out) backwards;
}

.receipt-head {
    animation-delay: 180ms;
}

.receipt-line:nth-child(1) {
    animation-delay: 250ms;
}

.receipt-line:nth-child(2) {
    animation-delay: 320ms;
}

.receipt-line:nth-child(3) {
    animation-delay: 390ms;
}

.receipt-line:nth-child(4) {
    animation-delay: 460ms;
}

.receipt-struck {
    animation: receipt-dim 300ms ease 700ms both;
}

.receipt-struck::before {
    animation: receipt-strike 300ms var(--hero-ease-out) 700ms both;
}

.receipt-total {
    animation-delay: 950ms;
}

.receipt-saved {
    animation-delay: 1050ms;
}

@keyframes receipt-print {
    from {
        opacity: 0;
        transform: translateY(0.5rem);
    }
}

@keyframes receipt-dim {
    from {
        color: var(--tblr-body-color);
    }
}

@keyframes receipt-strike {
    from {
        clip-path: var(--strike-hidden);
    }
}

/* ---------------------------------
 * Page Sections
 * --------------------------------- */

.page-section {
    padding-block: clamp(2rem, 5vw, 3.5rem);
    scroll-margin-top: 1rem;
}

.page-section:last-child {
    padding-bottom: clamp(3rem, 8vw, 6rem);
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.section-head .section-title {
    margin-bottom: 0;
}

/* ---------------------------------
 * Categories
 * --------------------------------- */

.category-tile-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: 0.75rem;
    background-color: var(--tblr-bg-surface);
    color: var(--tblr-secondary);
    font-size: 1.25rem;
    transition:
        border-color 0.15s ease,
        color 0.15s ease;
}

/* The categories page: each card previews a few of the category's store logos */
.category-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 1rem;
}

.category-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 1.25rem 0.875rem;
    padding: 1.25rem;
}

.category-card:hover .category-tile-icon {
    border-color: var(--tblr-primary);
    color: var(--tblr-primary);
}

.category-card-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.category-card-name {
    font-size: 1.0625rem;
    font-weight: 600;
}

.category-card-count {
    color: var(--tblr-secondary);
    font-size: 0.875rem;
}

.category-card-logos {
    grid-column: 1 / -1;
    display: flex;
    gap: 0.375rem;
}

/* Counts the category's stores beyond the one logo shown */
.category-card-more {
    --store-logo-size: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--store-logo-size);
    height: var(--store-logo-size);
    padding-inline: 0.375rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: calc(var(--store-logo-size) * 0.28);
    background-color: var(--tblr-bg-surface-secondary);
    color: var(--tblr-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    direction: ltr;
}

[data-bs-theme='dark'] .category-card-more {
    background-color: var(--tblr-bg-surface);
}

/* Phones read the categories as a list, with the logos at the row's end */
@media (max-width: 575.98px) {
    .category-card-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.5rem;
    }

    .category-card {
        grid-template-columns: auto minmax(0, 1fr) auto;
        padding: 0.875rem 1rem;
        border-radius: 1rem;
    }

    .category-card-logos {
        grid-column: auto;
    }

    .category-card-logos .store-logo,
    .category-card-more {
        --store-logo-size: 1.75rem;
    }

    /* Home and similar categories drop the logos, so they pair up as icon-topped tiles to keep the section short */
    .category-card-grid.is-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .category-card-grid.is-tiles .category-card {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }

    .category-card-grid.is-tiles .category-card .category-tile-icon {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 1.125rem;
    }

    .category-card-grid.is-tiles .category-card-name {
        font-size: 0.9375rem;
    }

    .category-card-grid.is-tiles .category-card-count {
        font-size: 0.8125rem;
    }
}

/* ---------------------------------
 * Auth Split
 * --------------------------------- */

.auth-split {
    display: grid;
    gap: 1rem;
    min-height: 100vh;
    padding: 1rem;
}

.auth-split-main {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 25rem;
    margin-inline: auto;
    padding-block: 1.5rem;
}

.auth-split-logo {
    align-self: flex-start;
    margin-bottom: auto;
    padding-bottom: 3rem;
}

.auth-split-logo img {
    height: 1.75rem;
}

.auth-split-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin-top: auto;
    padding-top: 3rem;
    font-size: 0.875rem;
}

.auth-split-footer a {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--tblr-secondary);
}

.auth-split-footer a:hover {
    color: var(--tblr-body-color);
}

.auth-panel {
    display: none;
    position: relative;
    flex-direction: column;
    overflow: hidden;
    padding: 3.5rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: 1.5rem;
    background-color: color-mix(in srgb, var(--tblr-primary) 7%, var(--tblr-bg-surface));
}

[data-bs-theme='dark'] .auth-panel {
    background-color: var(--tblr-bg-surface-secondary);
}

.auth-panel-mark {
    color: var(--tblr-primary);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.auth-panel-mark svg {
    width: 62%;
    max-height: 100%;
    overflow: visible;
}

.auth-panel-line {
    position: relative;
    margin: auto 0 0;
    font-family: var(--app-font-display);
    font-size: clamp(1.75rem, 2.5vw, 2.25rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

[dir='rtl'] .auth-panel-line {
    line-height: 1.35;
    letter-spacing: normal;
}

/* Register: the slashes run off the panel's edges */
.auth-panel[data-panel='register'] .auth-panel-mark {
    position: absolute;
    inset: 0 0 25%;
    align-items: flex-end;
}

.auth-panel[data-panel='register'] .auth-panel-mark svg {
    width: auto;
    height: 150%;
    max-height: none;
}

.auth-panel[data-panel='register'] .auth-panel-dot {
    display: none;
}

/* Magic link and code: only the two dots */
.auth-panel[data-panel='magic-link'] .auth-panel-slash {
    display: none;
}

.auth-panel[data-panel='magic-link'] .auth-panel-mark svg {
    width: 80%;
}

/* Forgot and reset password: a single slash */
.auth-panel[data-panel='recovery'] .auth-panel-dot,
.auth-panel[data-panel='recovery'] .auth-panel-slash:first-child {
    display: none;
}

.auth-panel[data-panel='recovery'] .auth-panel-mark svg {
    width: 70%;
    transform: translateX(-12%);
}

[dir='rtl'] .auth-panel[data-panel='recovery'] .auth-panel-mark svg {
    transform: translateX(12%);
}

/* Verify email: the whole mark, small, waiting at the top */
.auth-panel[data-panel='verify'] .auth-panel-mark {
    align-items: flex-start;
    justify-content: flex-start;
}

.auth-panel[data-panel='verify'] .auth-panel-mark svg {
    width: 6rem;
}

/* Below lg the tab bar replaces the footer, so the page fits above it */
@media (max-width: 991.98px) {
    .auth-split {
        min-height: calc(100vh - 5rem - env(safe-area-inset-bottom));
    }

    .auth-split-main::after {
        content: '';
        margin-top: auto;
    }

    .auth-split-main h2,
    .auth-split-main h2 + p {
        text-align: center;
    }
}

@media (min-width: 992px) {
    .auth-split {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .auth-panel {
        display: flex;
        position: sticky;
        top: 1rem;
        height: calc(100vh - 2rem);
    }
}

/* ---------------------------------
 * Posts
 * --------------------------------- */

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    gap: 1.25rem;
}

.post-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0.75rem;
}

.post-card-media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    border-radius: 0.875rem;
    background-color: color-mix(in srgb, var(--tblr-primary) 10%, var(--tblr-bg-surface));
}

.post-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Posts without a cover show the logo's double slash instead */
.post-card-media:not(:has(img))::before,
.post-card-media:not(:has(img))::after {
    content: '';
    position: absolute;
    top: -20%;
    bottom: -20%;
    width: 14%;
    background-color: color-mix(in srgb, var(--tblr-primary) 22%, transparent);
    transform: skewX(-18deg);
}

.post-card-media:not(:has(img))::before {
    inset-inline-start: 34%;
}

.post-card-media:not(:has(img))::after {
    inset-inline-start: 54%;
}

.post-card-body {
    display: flex;
    flex-direction: column;
    padding: 1rem 0.5rem 0.5rem;
}

.post-card-date {
    color: var(--tblr-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
}

.post-card-title {
    font-size: 1.1875rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    transition: color 0.15s ease;
}

[dir='rtl'] .post-card-title {
    line-height: 1.6;
}

.post-card:hover .post-card-title {
    color: var(--tblr-primary);
}

.post-card-excerpt {
    color: var(--tblr-secondary);
    margin-bottom: 0;
}

/* The first page opens with the latest post across the whole row */
.post-card-spotlight {
    grid-column: 1 / -1;
}

@media (min-width: 768px) {
    .post-card-spotlight {
        display: grid;
        grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
        align-items: center;
    }

    .post-card-spotlight .post-card-body {
        padding: 1.5rem 2.5rem;
    }

    .post-card-spotlight .post-card-title {
        font-size: clamp(1.5rem, 2.75vw, 2.25rem);
        font-weight: 700;
        line-height: 1.15;
        margin-bottom: 1rem;
        text-wrap: balance;
    }

    [dir='rtl'] .post-card-spotlight .post-card-title {
        line-height: 1.5;
    }

    .post-card-spotlight .post-card-excerpt {
        font-size: 1.125rem;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }
}

/* Phones read the posts as a list: a small cover beside the title */
@media (max-width: 575.98px) {
    .post-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.75rem;
    }

    .post-card {
        display: grid;
        grid-template-columns: 6.5rem minmax(0, 1fr);
        align-items: center;
        gap: 1rem;
        padding: 0.625rem;
        border-radius: 1rem;
    }

    .post-card-media {
        aspect-ratio: 1;
        border-radius: 0.625rem;
    }

    .post-card-body {
        padding: 0;
        padding-inline-end: 0.5rem;
    }

    .post-card-title {
        font-size: 1.0625rem;
        margin-bottom: 0;
    }

    .post-card-excerpt {
        display: none;
    }

    .post-card.post-card-spotlight {
        display: flex;
        align-items: stretch;
        padding: 0.75rem;
        border-radius: 1.25rem;
    }

    .post-card-spotlight .post-card-media {
        aspect-ratio: 16 / 10;
        border-radius: 0.875rem;
    }

    .post-card-spotlight .post-card-body {
        padding: 1rem 0.5rem 0.5rem;
    }

    .post-card-spotlight .post-card-title {
        font-size: 1.375rem;
        margin-bottom: 0.5rem;
    }

    .post-card-spotlight .post-card-excerpt {
        display: -webkit-box;
    }
}

.post-header {
    margin-bottom: 2.5rem;
}

.post-header-title {
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    margin-bottom: 1rem;
}

.post-header-date {
    display: block;
    color: var(--tblr-secondary);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.post-header-lead {
    color: var(--tblr-secondary);
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 0;
}

.post-cover {
    display: block;
    width: 100%;
    max-width: 64rem;
    max-height: 32rem;
    margin: 0 auto 3rem;
    object-fit: cover;
    border-radius: 1.5rem;
}

/* ---------------------------------
 * Directory
 * --------------------------------- */

/* The stores, offers and products listings: a title and search, then a filter that narrows the list in place */
.directory-search {
    position: relative;
    max-width: 32rem;
    margin-bottom: 1.5rem;
}

.directory-search .ti {
    position: absolute;
    top: 50%;
    inset-inline-start: 1rem;
    color: var(--tblr-secondary);
    font-size: 1.25rem;
    transform: translateY(-50%);
    pointer-events: none;
}

.directory-search .form-control {
    padding-inline-start: 2.75rem;
    border-radius: 2rem;
    background-color: var(--tblr-bg-surface);
}

@media (max-width: 767.98px) {
    .directory-search .form-control {
        min-height: 2.75rem;
    }
}

/* The filter is a scrolling chip row on small screens and a side list from lg */
.directory {
    display: grid;
    gap: 1.5rem;
}

/* With the scrollbar hidden, an edge fades out wherever more items wait past it */
.directory-filter {
    --filter-fade-direction: to right;
    --filter-fade-back: 0rem;
    --filter-fade-forward: 0rem;

    display: flex;
    gap: 0.5rem;
    padding-bottom: 0.25rem;
    mask-image: linear-gradient(
        var(--filter-fade-direction),
        #0000,
        #000 var(--filter-fade-back),
        #000 calc(100% - var(--filter-fade-forward)),
        #0000
    );
}

[dir='rtl'] .directory-filter {
    --filter-fade-direction: to left;
}

.directory-filter.can-scroll-back {
    --filter-fade-back: 2.5rem;
}

.directory-filter.can-scroll-forward {
    --filter-fade-forward: 2.5rem;
}

.directory-filter-item {
    flex-shrink: 0;
    min-height: 2.75rem;
    padding: 0.5rem 0.875rem;
    background-color: var(--tblr-bg-surface);
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.directory-filter-item .ti {
    color: var(--tblr-secondary);
    font-size: 1.125rem;
}

.directory-filter-item.active {
    border-color: var(--tblr-primary);
    background-color: color-mix(in srgb, var(--tblr-primary) 12%, var(--tblr-bg-surface));
    color: var(--tblr-primary);
}

.directory-filter-item.active .ti {
    color: inherit;
}

.directory-filter-count {
    color: var(--tblr-secondary);
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
}

.directory-filter-item.active .directory-filter-count {
    color: inherit;
}

.directory-results-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.directory-results-head > div {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.directory-results-head .block-title {
    margin-bottom: 0;
}

.directory-results-count {
    flex-shrink: 0;
    color: var(--tblr-secondary);
}

.directory-results-head .page-crumb {
    margin-inline-start: auto;
    font-size: 0.875rem;
}

.directory-results {
    transition: opacity 0.15s ease;
}

.directory-results.is-loading {
    opacity: 0.6;
}

@media (min-width: 992px) {
    .directory-head {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 2rem;
        margin-bottom: 2rem;
    }

    .directory-head .page-masthead,
    .directory-head .directory-search {
        margin-bottom: 0;
    }

    .directory-head .directory-search {
        flex: 0 1 22rem;
    }

    .directory {
        grid-template-columns: 15rem minmax(0, 1fr);
        align-items: start;
        gap: 3rem;
    }

    /* Without a filter list the results take both columns instead of the filter's */
    .directory-results:first-child {
        grid-column: 1 / -1;
    }

    .directory-filter {
        position: sticky;
        top: 1.5rem;
        flex-direction: column;
        gap: 0.125rem;
        max-height: calc(100vh - 3rem);
        margin: -0.5rem 0 0;
        padding: 0;
        overflow-y: auto;
    }

    .directory-filter,
    [dir='rtl'] .directory-filter {
        --filter-fade-direction: to bottom;
    }

    .directory-filter-item {
        min-height: 2.5rem;
        padding: 0.5rem 0.75rem;
        border: 0;
        border-radius: 0.75rem;
        background: none;
        white-space: normal;
    }

    .directory-filter-item:hover {
        background-color: color-mix(in srgb, var(--tblr-body-color) 5%, transparent);
    }

    .directory-filter-item.active {
        background-color: color-mix(in srgb, var(--tblr-primary) 12%, transparent);
    }

    [data-bs-theme='dark'] .directory-filter-item.active {
        background-color: color-mix(in srgb, var(--tblr-primary) 20%, transparent);
    }

    .directory-filter-count {
        margin-inline-start: auto;
    }
}

/* ---------------------------------
 * Stores
 * --------------------------------- */

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: 1rem;
}

.store-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    min-width: 0;
    padding: 1.25rem;
}

.store-card-logo {
    display: inline-flex;
    margin-bottom: 1rem;
}

/* Marks stores with Waffrlly exclusive codes */
.store-card-exclusive {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.375rem;
    height: 1.375rem;
    margin-inline-start: 0.125rem;
    border-radius: 50%;
    background-color: color-mix(in srgb, var(--tblr-primary) 8%, transparent);
    color: var(--tblr-primary);
    font-size: 0.875rem;
    vertical-align: text-bottom;
}

[data-bs-theme='dark'] .store-card-exclusive {
    background-color: color-mix(in srgb, var(--tblr-primary) 16%, transparent);
}

.store-card-name {
    max-width: 100%;
    font-weight: 600;
    font-size: 1.0625rem;
    line-height: 1.3;
}

[dir='rtl'] .store-card-name {
    line-height: 1.6;
}

.store-card-count {
    color: var(--tblr-secondary);
}

/* Phones read the directory as a list: logo beside the name */
@media (max-width: 575.98px) {
    .store-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.5rem;
    }

    .store-card {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 0 0.875rem;
        padding: 0.75rem 1rem;
        border-radius: 1rem;
    }

    .store-card .store-logo {
        --store-logo-size: 2.75rem;
    }

    .store-card-logo {
        grid-row: span 2;
        margin-bottom: 0;
    }

    .store-card-name {
        align-self: end;
    }

    .store-card-count {
        align-self: start;
        font-size: 0.875rem;
    }
}

/* On home, the twelve top stores read as rows like on phones: logo beside the name, in even columns of two to four */
@media (min-width: 576px) {
    .store-grid.is-rows {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }

    .store-grid.is-rows .store-card {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 0.125rem 1rem;
        padding: 1.125rem 1.25rem;
    }

    .store-grid.is-rows .store-card-logo {
        grid-row: span 2;
        margin-bottom: 0;
    }

    .store-grid.is-rows .store-card-name {
        align-self: end;
    }

    .store-grid.is-rows .store-card-count {
        align-self: start;
        font-size: 0.875rem;
    }
}

@media (min-width: 992px) {
    .store-grid.is-rows {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

@media (min-width: 1200px) {
    .store-grid.is-rows {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Logos sit on white in both themes so dark marks stay legible */
.store-logo {
    --store-logo-size: 3rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--store-logo-size);
    height: var(--store-logo-size);
    overflow: hidden;
    border: 1px solid var(--tblr-border-color);
    border-radius: calc(var(--store-logo-size) * 0.28);
    background-color: #fff;
}

[data-bs-theme='dark'] .store-logo {
    border-color: transparent;
    background-color: #ece8e4;
}

/* Logos are square brand icons, so they fill the tile edge to edge */
.store-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Stores without a logo show their initial in the brand red */
.store-logo > span {
    color: var(--tblr-primary);
    font-family: var(--app-font-display);
    font-size: calc(var(--store-logo-size) * 0.45);
    font-weight: 700;
    line-height: 1;
}

.store-logo-xs {
    --store-logo-size: 1.5rem;
}

.store-logo-sm {
    --store-logo-size: 2.25rem;
}

.store-logo-lg {
    --store-logo-size: 3.5rem;
}

.store-logo-xl {
    --store-logo-size: 5.5rem;
}

.store-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 1.25rem 1.75rem;
    margin-bottom: 2.5rem;
}

.store-header-title {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    margin-bottom: 0.75rem;
}

.store-header-lead {
    max-width: 40rem;
    color: var(--tblr-secondary);
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.store-header-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-block: 0;
    list-style: none;
}

.store-header-categories .chip {
    padding: 0.25rem 0.75rem;
    color: var(--tblr-secondary);
}

.store-header-categories .chip:hover {
    border-color: var(--tblr-body-color);
    color: var(--tblr-body-color);
}

.store-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    grid-column: 1 / -1;
}

/* Phones put the name beside the logo and give the rest the full width, so the first code shows sooner */
@media (max-width: 575.98px) {
    .store-header {
        align-items: center;
        gap: 0.75rem 1rem;
        margin-bottom: 1.5rem;
    }

    .store-header .store-logo-xl {
        --store-logo-size: 4rem;
    }

    .store-header-body {
        display: contents;
    }

    .store-header-title {
        margin-bottom: 0;
    }

    .store-header-lead,
    .store-header-categories {
        grid-column: 1 / -1;
        margin-bottom: 0;
    }

    .store-header-lead {
        font-size: 1rem;
    }

    /* The categories scroll as one row */
    .store-header-categories {
        flex-wrap: nowrap;
    }

    .store-header-categories li {
        flex-shrink: 0;
    }
}

.store-header-delivery {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin: 1rem 0 0;
    color: var(--tblr-secondary);
}

@media (max-width: 575.98px) {
    .store-header-delivery {
        grid-column: 1 / -1;
        margin-top: 0;
    }
}

.store-expired {
    margin-top: 2rem;
}

.store-expired summary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    color: var(--tblr-secondary);
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}

.store-expired summary::-webkit-details-marker {
    display: none;
}

.store-expired summary span {
    font-size: 0.8125rem;
    font-weight: 500;
}

.store-expired summary .ti {
    transition: transform 0.2s ease;
}

.store-expired[open] summary .ti {
    transform: rotate(180deg);
}

.store-expired-hint {
    margin: 0.25rem 0 1rem;
    color: var(--tblr-secondary);
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .store-header {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .store-header-actions {
        grid-column: auto;
        margin-top: 0.5rem;
    }
}

.store-aside {
    padding: 1.5rem;
}

.store-aside + .store-aside {
    margin-top: 1rem;
}

.store-steps {
    display: grid;
    gap: 0.875rem;
    padding: 0;
    margin: 0;
    list-style: none;
    counter-reset: step;
}

.store-steps li {
    display: grid;
    grid-template-columns: 1.75rem minmax(0, 1fr);
    gap: 0.75rem;
    align-items: baseline;
    counter-increment: step;
}

.store-steps li::before {
    content: counter(step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background-color: color-mix(in srgb, var(--tblr-primary) 12%, transparent);
    color: var(--tblr-primary);
    font-family: var(--app-font-display);
    font-weight: 700;
}

.store-mini-list {
    display: grid;
    gap: 0.25rem;
    padding: 0;
    margin: 0 -0.5rem;
    list-style: none;
}

.store-mini-list a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 0.75rem;
    color: var(--tblr-body-color);
}

.store-mini-list a:hover {
    background-color: var(--tblr-bg-surface-secondary);
}

.store-mini-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.store-mini-count {
    color: var(--tblr-secondary);
    white-space: nowrap;
}

/* ---------------------------------
 * Products
 * --------------------------------- */

.product-sort {
    display: inline-flex;
    padding: 0.25rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: 2rem;
    background-color: var(--tblr-bg-surface);
}

.product-sort-item {
    padding: 0.375rem 0.875rem;
    border-radius: 2rem;
    color: var(--tblr-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.product-sort-item:hover {
    color: var(--tblr-body-color);
}

.product-sort-item.active {
    background-color: color-mix(in srgb, var(--tblr-primary) 12%, var(--tblr-bg-surface));
    color: var(--tblr-primary);
}

@media (max-width: 575.98px) {
    .product-sort {
        display: flex;
        width: 100%;
    }

    .product-sort-item {
        flex: 1;
        text-align: center;
    }
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 2.25rem 1.25rem;
}

@media (max-width: 575.98px) {
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.75rem 0.75rem;
    }
}

/* A single row of cards that previews a longer list: two rows of two on phones, then as many as fit one row */
.product-row {
    --product-row-count: 2;

    grid-template-columns: repeat(var(--product-row-count), minmax(0, 1fr));
}

.product-row > :nth-child(n + 5) {
    display: none;
}

@media (min-width: 768px) {
    .product-row {
        --product-row-count: 3;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .product-row > :nth-child(4) {
        display: none;
    }
}

@media (min-width: 992px) {
    .product-row {
        --product-row-count: 4;
    }
}

@media (min-width: 1200px) {
    .product-row {
        --product-row-count: 5;
    }

    .product-row > :nth-child(5) {
        display: flex;
    }
}

@media (min-width: 1400px) {
    .product-row {
        --product-row-count: 6;
    }

    .product-row > :nth-child(6) {
        display: flex;
    }
}

/* The title's link stretches over the whole card, and the title always takes two lines so the prices line up across a row */
.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    min-width: 0;
}

/* Product photos are shot on white, so the tile stays white in both themes and the photo blends into it */
.product-card-media,
.product-gallery-main,
.product-gallery-thumb {
    --product-tile: #fff;

    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--tblr-border-color);
    background-color: var(--product-tile);
    color: var(--tblr-gray-400);
}

[data-bs-theme='dark'] :is(.product-card-media, .product-gallery-main, .product-gallery-thumb) {
    --product-tile: #e9e5e1;
    border-color: transparent;
}

:is(.product-card-media, .product-gallery-main, .product-gallery-thumb) img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.product-card-media {
    aspect-ratio: 1;
    padding: 12%;
    border-radius: 1.25rem;
    font-size: 2.5rem;
    transition: border-color 0.15s ease;
}

.product-card:hover .product-card-media {
    border-color: var(--tblr-primary);
}

/* A torn-off price tag in the tile's corner */
.product-card-discount {
    position: absolute;
    top: 0.75rem;
    inset-inline-start: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    background-color: var(--tblr-primary);
    color: #fff;
    font-family: var(--app-font-display);
    font-size: 0.875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.product-card-save {
    position: absolute;
    top: 0.5rem;
    inset-inline-end: 0.5rem;
    z-index: 1;
    --save-button-color: var(--tblr-gray-500);
    background-color: var(--product-tile);
}

.product-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 0;
}

.product-card-store {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
    color: var(--tblr-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.product-card-store .store-logo {
    --store-logo-size: 1.25rem;
}

.product-card-title {
    margin: 0;
    font-family: var(--tblr-font-sans-serif);
    height: 2.8em;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: normal;
}

.product-card-title a {
    color: var(--tblr-body-color);
    outline: none;
}

.product-card-title a::after {
    content: '';
    position: absolute;
    inset: 0;
}

[dir='rtl'] .product-card-title {
    height: 3.2em;
    line-height: 1.6;
}

.product-card-prices {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 0.625rem;
    margin-top: 0.125rem;
}

.product-card-price {
    font-family: var(--app-font-display);
    font-size: 1.3125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.product-card-old-price {
    position: relative;
    color: var(--tblr-secondary);
    font-size: 0.875rem;
    text-decoration: none;
}

/* The receipt's red dash, small */
.product-card-old-price::before {
    content: '';
    position: absolute;
    top: calc(50% - 1px);
    inset-inline: -0.125em;
    height: 2px;
    border-radius: 1em;
    background-color: var(--tblr-primary);
}

@media (max-width: 575.98px) {
    .product-card-media {
        border-radius: 1rem;
    }

    .product-card-discount {
        top: 0.5rem;
        inset-inline-start: 0.5rem;
        font-size: 0.8125rem;
    }

    .product-card-title {
        font-size: 0.875rem;
    }

    .product-card-price {
        font-size: 1.125rem;
    }
}

/* The product page: the photos beside the price receipt */
.product-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-gallery-main {
    aspect-ratio: 1;
    padding: 8%;
    border-radius: 1.5rem;
    font-size: 4rem;
}

.product-gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-block: 0.125rem;
}

.product-gallery-thumb {
    flex-shrink: 0;
    width: 4.5rem;
    height: 4.5rem;
    padding: 0.375rem;
    border-radius: 0.875rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.product-gallery-thumb.active {
    border-color: var(--tblr-primary);
    box-shadow: inset 0 0 0 1px var(--tblr-primary);
}

.product-summary-store {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--tblr-body-color);
    font-weight: 600;
}

.product-summary-store:hover {
    color: var(--tblr-primary);
}

.product-summary-title {
    margin: 1rem 0 1.75rem;
    font-size: clamp(1.5rem, 2.6vw, 2.125rem);
    font-weight: 600;
    line-height: 1.15;
    text-wrap: balance;
}

[dir='rtl'] .product-summary-title {
    line-height: 1.5;
}

.product-receipt {
    --hero-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --visual-shadow: var(--tblr-body-color);

    filter: drop-shadow(0 1rem 1.5rem color-mix(in srgb, var(--visual-shadow) 10%, transparent))
        drop-shadow(0 1px 2px color-mix(in srgb, var(--visual-shadow) 8%, transparent));
    font-variant-numeric: tabular-nums;
}

[data-bs-theme='dark'] .product-receipt {
    --visual-shadow: #000;
}

.product-receipt .receipt-paper {
    padding: 1.25rem 1.5rem 2.25rem;
}

.product-receipt .receipt-struck .price-currency {
    font-size: 0.6em;
}

.product-receipt .receipt-total {
    flex-wrap: wrap;
}

.product-receipt .receipt-lines + .receipt-total {
    margin-top: 0.5rem;
}

.product-receipt .receipt-lines:empty + .receipt-total,
.product-receipt .receipt-total:first-child {
    padding-top: 0.5rem;
    margin-top: 0;
    border-top: 0;
}

.product-receipt .receipt-total strong {
    font-size: clamp(2rem, 4vw, 2.5rem);
}

.product-receipt .receipt-total .price-currency {
    color: var(--tblr-secondary);
    font-size: 0.875rem;
    letter-spacing: normal;
}

.product-receipt.is-ended .receipt-total strong {
    color: var(--tblr-secondary);
}

.product-summary-buy {
    margin-top: 1.5rem;
}

.product-summary-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    padding: 0;
    margin: 1rem 0 0;
    color: var(--tblr-secondary);
    list-style: none;
}

.product-summary-facts li {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.product-codes {
    margin-top: 2.5rem;
}

.product-codes-hint {
    margin: -0.5rem 0 1rem;
    color: var(--tblr-secondary);
}

.product-about {
    max-width: 44rem;
}

@media (min-width: 992px) {
    .product-hero {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
        align-items: start;
        gap: 4rem;
    }

    .product-gallery {
        position: sticky;
        top: 1.5rem;
    }

    .product-summary {
        padding-top: 1rem;
    }

    .product-gallery-thumbs {
        flex-wrap: wrap;
        margin-inline: 0;
        padding-inline: 0;
        overflow: visible;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-receipt *,
    .product-receipt *::before {
        animation: none;
    }
}

/* ---------------------------------
 * Offers
 * --------------------------------- */

.offer-list {
    display: grid;
    gap: 1rem;
}

.offer-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 992px) {
    .offer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Beside the category list two tickets fit only from xxl; narrower, they run as one list like the store page */
@media (max-width: 1399.98px) {
    .directory .offer-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* A coupon like the tab bar: a discount stub, a perforation between two notches, then the offer */
.offer-ticket {
    --ticket-stub: 7.5rem;
    --ticket-notch: 0.625rem;
    --ticket-notch-x: var(--ticket-stub);
    --ticket-edge: var(--tblr-gray-300);
    --ticket-paper: var(--tblr-bg-surface);
    /* A tinted stub keeps the red for the discount and the action, so a grid of tickets doesn't read as a wall of red */
    --ticket-stub-bg: color-mix(in srgb, var(--tblr-primary) 8%, var(--ticket-paper));
    --ticket-stub-color: var(--tblr-primary);
    --ticket-stub-muted: var(--tblr-secondary);
    --ticket-perforation: color-mix(in srgb, var(--tblr-primary) 30%, var(--ticket-paper));
    filter: drop-shadow(0 0 0.5px var(--ticket-edge)) drop-shadow(0 0 0.5px var(--ticket-edge));
}

[dir='rtl'] .offer-ticket {
    --ticket-notch-x: calc(100% - var(--ticket-stub));
}

[data-bs-theme='dark'] .offer-ticket {
    --ticket-edge: var(--tblr-border-color);
    --ticket-paper: var(--tblr-bg-surface-secondary);
    --ticket-stub-bg: color-mix(in srgb, var(--tblr-primary) 6%, var(--ticket-paper));
    --ticket-perforation: var(--tblr-border-color);
}

/* Ended offers stay readable but drop their colour, so live ones lead */
.offer-ticket.is-expired {
    --ticket-stub-bg: var(--tblr-bg-surface-secondary);
    --ticket-stub-color: var(--tblr-secondary);
    --ticket-stub-muted: var(--tblr-secondary);
    --ticket-perforation: var(--tblr-border-color);
}

/* The whole ticket opens its offer, so hovering it lights the action as hovering the action does; the store link and Terms keep their own */
.offer-ticket:has(.offer-ticket-action):hover:not(
        :has(a:not(.offer-ticket-action):hover, button:not(.offer-ticket-action):hover)
    ) {
    --ticket-edge: var(--tblr-primary);
}

.offer-ticket:hover:not(:has(a:not(.offer-ticket-action):hover, button:not(.offer-ticket-action):hover))
    .offer-ticket-action {
    --tblr-btn-bg: var(--tblr-btn-hover-bg);
    --tblr-btn-color: var(--tblr-btn-hover-color);
    --tblr-btn-border-color: var(--tblr-btn-hover-border-color);
}

.offer-ticket-paper {
    display: grid;
    position: relative;
    cursor: pointer;
    grid-template-columns: var(--ticket-stub) minmax(0, 1fr);
    height: 100%;
    border-radius: 1.25rem;
    background-color: var(--ticket-paper);
    mask:
        radial-gradient(
                circle at var(--ticket-notch-x) 0,
                #0000 var(--ticket-notch),
                #000 calc(var(--ticket-notch) + 0.5px)
            )
            top / 100% 51% no-repeat,
        radial-gradient(
                circle at var(--ticket-notch-x) 100%,
                #0000 var(--ticket-notch),
                #000 calc(var(--ticket-notch) + 0.5px)
            )
            bottom / 100% 51% no-repeat;
}

.offer-ticket-stub {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 1.25rem 0.75rem;
    border-inline-end: 2px dashed var(--ticket-perforation);
    background-color: var(--ticket-stub-bg);
    color: var(--ticket-stub-color);
    text-align: center;
}

.offer-ticket-discount {
    font-family: var(--app-font-display);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.offer-ticket-type {
    color: var(--ticket-stub-muted);
    font-size: 0.8125rem;
}

.offer-ticket-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1.125rem 1.25rem;
}

.offer-ticket-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.offer-ticket-store {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    color: var(--tblr-secondary);
    font-weight: 500;
}

.offer-ticket-store:hover {
    color: var(--tblr-body-color);
}

.offer-ticket-title {
    margin-bottom: 0.375rem;
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.4;
}

/* The fine print shares one quiet line under the title, like a receipt's small type */
.offer-ticket-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.875rem;
    color: var(--tblr-secondary);
    font-size: 0.8125rem;
}

.offer-ticket-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-top: auto;
    padding-top: 1rem;
}

.offer-ticket-facts > * {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.offer-ticket-exclusive {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-inline-start: auto;
    padding: 0.125rem 0.5rem;
    border-radius: var(--tblr-border-radius-pill);
    background-color: color-mix(in srgb, var(--tblr-primary) 8%, transparent);
    color: var(--tblr-primary);
    font-size: 0.75rem;
    font-weight: 600;
}

.offer-ticket-countries .flag {
    margin-inline-end: 0.125rem;
}

.offer-ticket.is-expired .offer-ticket-exclusive {
    background-color: var(--tblr-bg-surface-secondary);
    color: var(--tblr-secondary);
}

.offer-ticket.is-expired .offer-ticket-action {
    --tblr-btn-bg: var(--tblr-bg-surface);
    --tblr-btn-color: var(--tblr-body-color);
    --tblr-btn-border-color: var(--tblr-border-color);
    --tblr-btn-hover-bg: var(--tblr-bg-surface-secondary);
    --tblr-btn-hover-color: var(--tblr-body-color);
    --tblr-btn-hover-border-color: var(--tblr-border-color);
}

.offer-ticket-ended {
    color: var(--tblr-secondary);
    font-weight: 500;
}

.offer-ticket-save {
    margin-inline-start: auto;
}

.offer-ticket-terms-toggle {
    padding: 0.625rem 0;
    margin-block: -0.625rem;
    border: 0;
    background: none;
    color: var(--tblr-secondary);
    font-size: 0.8125rem;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.offer-ticket-terms-toggle:hover {
    color: var(--tblr-body-color);
}

/* The code's last characters sit in a dashed stub before the action, cut along the ticket's perforation */
.offer-ticket-action:has(.offer-ticket-peek) {
    --tblr-btn-border-color: var(--tblr-btn-bg);
    --tblr-btn-hover-border-color: var(--tblr-btn-hover-bg);
    --tblr-btn-active-border-color: var(--tblr-btn-active-bg);
    align-items: stretch;
    gap: 0;
    overflow: hidden;
    padding: 0;
    border-style: dashed;
    /* The dash gaps show the ticket, not the button's fill */
    background-clip: padding-box;
}

.offer-ticket-peek {
    display: flex;
    align-items: center;
    padding-inline: 0.75rem;
    background-color: var(--ticket-paper);
    color: var(--tblr-body-color);
    font-family: var(--app-font-display);
    font-weight: 700;
    letter-spacing: 0.06em;
}

.offer-ticket-action-label {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding-inline: var(--tblr-btn-padding-x);
}

/* Phones tear the stub off the top, with the notches on the side edges */
@media (max-width: 575.98px) {
    .offer-ticket {
        --ticket-stub: 3rem;
    }

    .offer-ticket-paper {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: var(--ticket-stub) auto;
        mask:
            radial-gradient(
                    circle at 0 var(--ticket-stub),
                    #0000 var(--ticket-notch),
                    #000 calc(var(--ticket-notch) + 0.5px)
                )
                left / 51% 100% no-repeat,
            radial-gradient(
                    circle at 100% var(--ticket-stub),
                    #0000 var(--ticket-notch),
                    #000 calc(var(--ticket-notch) + 0.5px)
                )
                right / 51% 100% no-repeat;
    }

    .offer-ticket-stub {
        flex-direction: row;
        justify-content: space-between;
        padding: 0 1rem;
        border-inline-end: 0;
        border-bottom: 2px dashed var(--ticket-perforation);
    }

    .offer-ticket-discount {
        font-size: 1.25rem;
    }

    .offer-ticket-body {
        padding: 1rem;
    }

    /* The action fills the row, leaving Terms beside it instead of on a line of its own */
    .offer-ticket-action {
        flex: 1;
    }
}

/* The code reveal */
.offer-code {
    position: relative;
    padding: 2rem;
    border-radius: 1.5rem;
}

.offer-code .btn-close {
    position: absolute;
    top: 1.25rem;
    inset-inline-end: 1.25rem;
}

.offer-code-store {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--tblr-secondary);
    font-weight: 600;
}

.offer-code-title {
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1.5rem;
}

.offer-code-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0.75rem 0.75rem 1.25rem;
    border: 2px dashed color-mix(in srgb, var(--tblr-primary) 55%, transparent);
    border-radius: 1rem;
    background-color: color-mix(in srgb, var(--tblr-primary) 5%, var(--tblr-bg-surface));
}

[dir='rtl'] .offer-code-box {
    padding: 0.75rem 1.25rem 0.75rem 0.75rem;
}

.offer-code-value {
    min-width: 0;
    overflow-wrap: anywhere;
    font-family: var(--app-font-display);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    user-select: all;
}

.offer-code-copy {
    flex-shrink: 0;
}

.offer-code-copy .ti-check {
    animation: copy-check 200ms var(--ease-out);
}

@keyframes copy-check {
    from {
        opacity: 0;
        transform: scale(0.6);
    }
}

@keyframes copy-check-fade {
    from {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .offer-code-copy .ti-check {
        animation-name: copy-check-fade;
    }
}

/* As a bottom sheet the code clears the home indicator */
@media (max-width: 575.98px) {
    .offer-code {
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }

    .offer-terms {
        overscroll-behavior: contain;
    }
}

/* Long terms scroll inside the dialog, keeping the store and title in view */
.offer-terms {
    max-height: 60vh;
    overflow-y: auto;
    color: var(--tblr-secondary);
    font-size: 0.9375rem;
}

.offer-terms > :last-child {
    margin-bottom: 0;
}

.offer-code-hint {
    margin: 0.75rem 0 1.5rem;
    color: var(--tblr-secondary);
    font-size: 0.875rem;
}

/* ---------------------------------
 * For You
 * --------------------------------- */

/* Each store's drop hangs off a rail perforated like the line between a ticket's stub and its offer, with the store's logo as its stop */
.feed {
    --feed-node: 3.5rem;
    --feed-rail: calc(var(--feed-node) + 1.25rem);
    --feed-gap: 3.5rem;
    --feed-perforation: color-mix(in srgb, var(--tblr-primary) 30%, var(--tblr-body-bg));

    display: grid;
    gap: var(--feed-gap);
}

[data-bs-theme='dark'] .feed {
    --feed-perforation: var(--tblr-border-color);
}

.feed-drop {
    position: relative;
    display: grid;
    gap: 1.25rem;
    min-width: 0;
}

.feed-drop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.feed-drop-title {
    min-width: 0;
    margin: 0;
    font-family: var(--tblr-font-sans-serif);
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: normal;
}

.feed-drop-store {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-width: 0;
    color: var(--tblr-body-color);
}

.feed-drop-store:hover {
    color: var(--tblr-body-color);
}

.feed-drop-store:focus-visible {
    outline: 2px solid var(--tblr-primary);
    outline-offset: 4px;
    border-radius: 0.5rem;
}

.feed-drop-node {
    --store-logo-size: 2.75rem;
}

/* A store with something new today gets its stop punched out in the brand red */
.feed-drop.is-today .feed-drop-node {
    box-shadow:
        0 0 0 0.1875rem var(--tblr-body-bg),
        0 0 0 0.3125rem var(--tblr-primary);
}

.feed-drop-store-body {
    display: grid;
    min-width: 0;
}

.feed-drop-name {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

.feed-drop-name > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feed-drop-name .ti {
    flex-shrink: 0;
    color: var(--tblr-secondary);
    transition: color 0.15s ease;
}

.feed-drop-store:hover .feed-drop-name .ti {
    color: var(--tblr-primary);
}

[dir='rtl'] .feed-drop-name .ti {
    transform: scaleX(-1);
}

.feed-drop-count {
    color: var(--tblr-secondary);
    font-size: 0.875rem;
    font-weight: 400;
}

.feed-drop-date {
    flex-shrink: 0;
    color: var(--tblr-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.feed-drop.is-today .feed-drop-date {
    color: var(--tblr-primary);
}

/* From sm the logo leaves the header for the rail, and the drop's items line up beside it */
@media (min-width: 576px) {
    .feed-drop {
        padding-inline-start: var(--feed-rail);
    }

    .feed-drop::before {
        content: '';
        position: absolute;
        top: calc(var(--feed-node) + 0.75rem);
        bottom: calc(var(--feed-gap) * -1 + 0.75rem);
        inset-inline-start: calc(var(--feed-node) / 2 - 1px);
        border-inline-start: 2px dashed var(--feed-perforation);
    }

    .feed-drop:last-child::before {
        bottom: 0;
        mask-image: linear-gradient(#000 60%, #0000);
    }

    .feed-drop-header {
        min-height: var(--feed-node);
    }

    .feed-drop-node {
        --store-logo-size: var(--feed-node);

        position: absolute;
        top: 0;
        inset-inline-start: 0;
    }
}

/* A store's products scroll sideways in one row, running off the page's end edge */
.feed-drop-products {
    display: flex;
    gap: 1.25rem;
    margin-inline-end: calc(var(--tblr-gutter-x, 1.5rem) * -0.5);
    padding-inline-end: calc(var(--tblr-gutter-x, 1.5rem) * 0.5);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.feed-drop-products::-webkit-scrollbar {
    display: none;
}

.feed-drop-products > .product-card {
    flex: 0 0 11rem;
    scroll-snap-align: start;
}

/* A mouse can't swipe, so it gets a thin scrollbar under the row */
@media (hover: hover) and (pointer: fine) {
    .feed-drop-products {
        padding-bottom: 0.75rem;
        scrollbar-width: thin;
        scrollbar-color: var(--tblr-border-color) transparent;
    }

    .feed-drop-products::-webkit-scrollbar {
        display: block;
        height: 0.375rem;
    }

    .feed-drop-products::-webkit-scrollbar-thumb {
        border-radius: 1rem;
        background-color: var(--tblr-border-color);
    }
}

@media (max-width: 575.98px) {
    .feed {
        --feed-gap: 3rem;
    }

    /* Phones run the products under the page's start gutter too */
    .feed-drop-products {
        margin-inline-start: calc(var(--tblr-gutter-x, 1.5rem) * -0.5);
        padding-inline-start: calc(var(--tblr-gutter-x, 1.5rem) * 0.5);
        scroll-padding-inline: calc(var(--tblr-gutter-x, 1.5rem) * 0.5);
    }

    .feed-drop-products {
        gap: 0.75rem;
    }

    .feed-drop-products > .product-card {
        flex-basis: 10.5rem;
    }
}

/* ---------------------------------
 * Tab Bar
 * --------------------------------- */

/* A floating capsule of labelled tabs; the active one is tinted in the brand red */
.tab-bar {
    --tab-bar-height: 4rem;
    --tab-bar-inset: 0.375rem;
    position: fixed;
    inset-inline: 1rem;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    z-index: 1030;
    max-width: 26rem;
    height: var(--tab-bar-height);
    margin-inline: auto;
    display: grid;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
    padding: var(--tab-bar-inset);
    border: 1px solid var(--tblr-border-color);
    border-radius: 2rem;
    background-color: var(--tblr-bg-surface);
    color: var(--tblr-secondary);
    box-shadow: 0 0.75rem 2rem -0.5rem rgba(var(--tblr-gray-900-rgb), 0.18);
}

[data-bs-theme='dark'] .tab-bar {
    background-color: var(--tblr-bg-surface-secondary);
    box-shadow: 0 0.75rem 2rem -0.5rem rgba(0, 0, 0, 0.5);
}

/* Keep the page content clear of the floating bar */
@media (max-width: 991.98px) {
    .page:has(.tab-bar) {
        padding-bottom: calc(var(--tab-bar-height, 4rem) + 1.5rem + env(safe-area-inset-bottom));
    }
}

.tab-bar-item {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    padding: 0 0.25rem;
    border: 0;
    border-radius: 1.625rem;
    background: none;
    color: inherit;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

@media (hover: hover) {
    .tab-bar-item:hover {
        color: var(--tblr-body-color);
    }
}

.tab-bar-item.active {
    color: var(--tblr-primary);
    font-weight: 600;
}

.tab-bar-item-icon {
    --tblr-icon-size: 1.375rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    transition: transform 0.15s ease;
}

.tab-bar-item:active .tab-bar-item-icon {
    transform: scale(0.9);
}

.tab-bar-item-icon .avatar {
    --tblr-avatar-size: 1.5rem;
    border-radius: 50%;
    background-color: var(--tblr-primary);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 600;
}

.tab-bar-item.active .tab-bar-item-icon .avatar {
    box-shadow:
        0 0 0 2px var(--tblr-bg-surface),
        0 0 0 3.5px var(--tblr-primary);
}

.tab-bar-item-label {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* The ring sits inside the capsule */
.tab-bar-item:focus-visible {
    outline: 2px solid var(--tblr-primary);
    outline-offset: -2px;
}

/* ---------------------------------
 * Bottom Sheets
 * --------------------------------- */

/* A grab handle hints that a sheet is dismissed by dragging it down; each sheet places it along its top edge */
.modal-sheet .modal-content::before,
.navbar .offcanvas-bottom::before {
    width: 2.25rem;
    height: 0.3125rem;
    border-radius: 1rem;
    background-color: var(--tblr-border-color);
}

/* Phones get the code and terms modals as bottom sheets, like the navbar menu */
@media (max-width: 575.98px) {
    .modal-sheet .modal-dialog {
        position: absolute;
        inset: auto 0 0;
        min-height: 0;
        max-width: none;
        margin: 0;
    }

    .modal-sheet.fade .modal-dialog {
        transform: translateY(100%);
    }

    .modal-sheet.show .modal-dialog {
        transform: none;
    }

    .modal-sheet .modal-content {
        border-radius: 1.5rem 1.5rem 0 0;
    }

    .modal-sheet .modal-content::before {
        content: '';
        position: absolute;
        top: 0.5rem;
        inset-inline: 0;
        margin-inline: auto;
    }
}

/* The navbar menu becomes a bottom sheet below lg */
@media (max-width: 991.98px) {
    .navbar .offcanvas-bottom {
        --tblr-offcanvas-height: auto;
        max-height: 85vh;
        border: 0;
        border-radius: 1.5rem 1.5rem 0 0;
    }

    .navbar .offcanvas-bottom::before {
        content: '';
        flex-shrink: 0;
        margin: 0.5rem auto 0;
    }

    /* Scrolling inside the sheet never chains to the page behind it */
    .navbar .offcanvas-bottom .offcanvas-body {
        padding: 1rem 1.25rem max(1.25rem, env(safe-area-inset-bottom));
        overscroll-behavior: contain;
    }

    .offcanvas-backdrop {
        touch-action: none;
    }

    .navbar .offcanvas-bottom .nav-link {
        justify-content: flex-start;
        padding: 0.75rem 0.25rem;
        font-size: 0.9375rem;
    }

    .navbar .offcanvas-bottom .dropdown-toggle::after {
        margin-inline-start: auto;
    }

    /* Dropdowns open inline as nested rows */
    .navbar .offcanvas-bottom .dropdown-menu {
        position: static;
        min-width: 0;
        margin: 0 0 0.5rem;
        padding: 0;
        border: 0;
        box-shadow: none;
        background-color: transparent;
    }

    .navbar .offcanvas-bottom .dropdown-item {
        padding: 0.625rem 0.25rem 0.625rem 2.25rem;
        border-radius: 0.5rem;
    }

    [dir='rtl'] .navbar .offcanvas-bottom .dropdown-item {
        padding: 0.625rem 2.25rem 0.625rem 0.25rem;
    }
}

/* ---------------------------------
 * Reading Layout
 * --------------------------------- */

.reading-column {
    max-width: 60rem;
    margin-inline: auto;
}

.reading-column.prose {
    font-size: 1.125rem;
    line-height: 1.8;
}
