@layer pages {
/* Shared checkout shell for shop payment option (/shop/<uri>/paymeth?v=2),
   BNPL provider (/shop/<uri>/bnpl?v=2), payment info (/shop/<uri>/source?v=2),
   and pay confirm (/pay/<uri>/confirm?v=2) -> .psw-shop-paymeth.

   Mobile: single column under workflow_header; submit lives in the sticky
   footer; the cart icon opens a bottom sheet with the order summary.
   Desktop (>=769px): centered 1128px two-column grid — payment options on the
   left, summary card + submit on the right — and the footer hides itself. */

.psw-shop-paymeth {
    /* The footer's own height (psw-footer.css models it term-by-term, including
       the safe-area inset, and tracks the CTA count each step renders — the
       categories step's button-less footer included) plus 24px of breathing
       room, the gap the content ends up sitting above the fixed footer. */
    --shop-paymeth-footer-clearance: calc(var(--psw-footer-height) + var(--space-6));
    min-height: 100vh;
    background: var(--color-white);
    color: var(--color-gray-700);
}

.psw-shop-paymeth__form {
    padding: 0 var(--space-4) var(--shop-paymeth-footer-clearance);
}

/* The header's back-control/title gap is workflow_header's own — 8px on mobile,
   16px on desktop. Don't restate the mobile value unconditionally here: a rule
   in the pages layer also wins on desktop and collapses that 16px back to 8px. */

/* Storefront + logistics + gratuity/payment-plan steps; Storefront + logistics + gratuity steps - 24px between the back control and the title. */
.psw-shop-paymeth--source-plan .psw-workflow-header,
.psw-shop-paymeth--items .psw-workflow-header,
.psw-shop-paymeth--type .psw-workflow-header,
.psw-shop-paymeth--results .psw-workflow-header,
.psw-shop-paymeth--delivery .psw-workflow-header,
.psw-shop-paymeth--location .psw-workflow-header,
.psw-shop-paymeth--gratuity .psw-workflow-header {
    gap: var(--space-6);
}

.psw-pay-bnplemail .psw-workflow-header,
.psw-pay-bnpladdress .psw-workflow-header {
    gap: var(--space-6);
}

.psw-shop-paymeth .psw-workflow-header__title {
    color: var(--color-gray-700);
    text-align: center;
    font-family: var(--font-sans);
    font-size: var(--text-label-lg);
    font-weight: var(--font-weight-bold);
    line-height: var(--text-label-lg--line-height);
}

.psw-shop-paymeth__option-stack {
    --psw-stack-gap: var(--space-3);
}

.psw-shop-paymeth__options .psw-list-item {
    padding: var(--space-4);
    min-height: 0;
}

/* Selected options — colored border only; no gray hover/press overlay on the card. */
.psw-shop-paymeth .psw-list-item:not(.psw-list-item--disabled):has(.psw-list-item__input:checked):hover,
.psw-shop-paymeth .psw-list-item:not(.psw-list-item--disabled):has(.psw-list-item__input:checked):active {
    background: var(--color-white);
}

.psw-shop-paymeth__layout {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    /* Desktop: 32px from the nav bar (back/title/cart row) to the first
       content. Mobile drops it — see below. */
    margin-top: var(--space-8);
}

@media (max-width: 768px) {
    /* Every step sits 12px below the nav bar, which is workflow_header's own
       bottom clearance — the layout adds nothing of its own. The Pay widget
       shares this shell and its confirm and gratuity steps follow suit
       (ENG-37067 iteration 2); nothing opts back into the desktop 32px. */
    .psw-shop-paymeth__layout {
        margin-top: 0;
    }
}

.psw-shop-paymeth__main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.psw-shop-paymeth__aside {
    display: none;
}

/* Account picker cards use the 48px avatar treatment from Figma. */
.psw-shop-roles__option-stack {
    --psw-stack-gap: var(--space-3);
}

.psw-shop-roles__options .psw-list-item {
    padding: 17px;
}

/* Product grid (/shop/<uri>/items) — 12px between the choice cards. */
.psw-shop-items__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* Category grid (/shop/<uri>/items category state) — nav cards linking into
   each category's item list. Mirrors book's psw-book-items__card. */
.psw-shop-categories {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.psw-shop-categories__card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-4);
    border: var(--border-width-sm) solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    background: var(--color-white);
    text-decoration: none;
    color: inherit;
}

a.psw-shop-categories__card:hover {
    background:
        linear-gradient(rgba(15, 15, 15, 0.04), rgba(15, 15, 15, 0.04)),
        var(--color-white);
}

.psw-shop-categories__card--inert {
    cursor: default;
}

.psw-shop-categories__text {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    flex: 1;
    min-width: 0;
}

.psw-shop-categories__title {
    font-family: var(--font-sans);
    font-size: var(--text-label-lg);
    font-weight: var(--font-weight-bold);
    line-height: var(--text-label-lg--line-height);
    color: var(--color-content-high);
    overflow-wrap: anywhere;
}

.psw-shop-categories__memo {
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: var(--font-sans);
    font-size: var(--text-paragraph-md);
    line-height: var(--text-paragraph-md--line-height);
    color: var(--color-content-medium);
}

.psw-shop-categories__image {
    flex: none;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-max);
    object-fit: cover;
}

/* Pickup date & time step (/shop/<uri>/results) — calendar + available times. */
.psw-shop-results__month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.psw-shop-results__month-label {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--text-heading-xs);
    line-height: var(--text-heading-xs--line-height);
    font-weight: var(--font-weight-bold);
    color: var(--color-gray-700);
}

.psw-shop-results__month-nav {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

@media (max-width: 768px) {
    /* 24px below the month title on mobile (Figma). */
    .psw-shop-results__month-header {
        margin-bottom: var(--space-6);
    }

    /* Let the calendar stretch to the page width instead of the component's
       fixed 7x49px track, which overflows the narrower phone gutters. Mirrors
       the booking widget's date step. */
    .psw-shop-results .psw-calendar {
        display: flex;
        width: 100%;
    }

    .psw-shop-results .psw-calendar__weekdays,
    .psw-shop-results .psw-calendar__grid {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }
}

/* Mobile picks times on the standalone page (times.html); the in-page column
   is desktop chrome (the --hidden state hides it there until a day is
   selected). Mirrors the booking widget's results step. */
.psw-shop-results__times-wrapper {
    display: none;
}

@media (min-width: 769px) {
    .psw-shop-results__times-wrapper {
        display: block;
    }

    .psw-shop-results__times-wrapper--hidden {
        display: none;
    }
}

/* Selected-day heading on the standalone "Select time" page (times.html). */
.psw-shop-results__date-heading {
    margin: 0 0 var(--space-6);
    font-family: var(--font-sans);
    font-size: var(--text-heading-xs);
    line-height: var(--text-heading-xs--line-height);
    font-weight: var(--font-weight-bold);
    color: var(--color-gray-700);
}

.psw-shop-results__divider {
    border: 0;
    border-top: var(--border-width-sm) solid var(--color-gray-200);
    margin: 0 0 var(--space-6) 0;
}

.psw-shop-results__times-heading {
    margin: 0 0 var(--space-4) 0;
    font-family: var(--font-sans);
    font-size: var(--text-heading-xs);
    line-height: var(--text-heading-xs--line-height);
    font-weight: var(--font-weight-bold);
    color: var(--color-gray-700);
}

.psw-shop-times__section + .psw-shop-times__section {
    margin-top: var(--space-6);
}

.psw-shop-times__label {
    margin: 0 0 var(--space-4) 0;
    font-family: var(--font-sans);
    font-size: var(--text-paragraph-md);
    line-height: var(--text-paragraph-md--line-height);
    font-weight: var(--font-weight-regular);
    color: var(--color-gray-600);
}

.psw-shop-times__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
}

/* Each slot is the shared `button` component — secondary when free, primary
   when selected (see _times.html) — so its fill, border, hover, active and
   focus all come from psw-btn.css. Mirrors the booking widget's time slots. */

.psw-shop-times__empty {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--text-paragraph-md);
    color: var(--color-gray-600);
}

@media (min-width: 769px) {
    /* Desktop rhythm for the pickup date & time step (Figma): both section
       titles step up to Heading/Small, and the "Available times" block sits in
       32px of air — below the last calendar row, above the title and below it.
       Matches the booking widget's date & time column. */
    .psw-shop-results__month-label,
    .psw-shop-results__times-heading {
        font-size: var(--text-heading-sm);
        line-height: var(--text-heading-sm--line-height);
    }

    .psw-shop-results__divider {
        margin: var(--space-8) 0;
    }

    .psw-shop-results__times-heading {
        margin-bottom: var(--space-8);
    }
}

/* Mobile cart screen */
.psw-shop-paymeth__cart-sheet[hidden] {
    display: none;
}

.psw-shop-paymeth__cart-sheet:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    background: var(--color-white);
}

.psw-shop-paymeth__cart-scrim {
    display: none;
}

.psw-shop-paymeth__cart-panel {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100dvh;
    background: var(--color-white);
    overflow: hidden;
}

.psw-shop-paymeth__cart-head.psw-workflow-header {
    padding-right: var(--space-4);
    padding-left: var(--space-4);
    flex-shrink: 0;
}

.psw-shop-paymeth__cart-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 0 var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom));
}

body.psw-shop-paymeth--cart-open {
    overflow: hidden;
}

@media (min-width: 769px) {
    .psw-shop-paymeth__form {
        padding: var(--space-8) var(--space-6);
    }

    .psw-shop-paymeth__form > .psw-workflow-header,
    .psw-shop-paymeth__layout {
        max-width: 1128px;
        margin-left: auto;
        margin-right: auto;
    }

    /* Desktop header — Heading/Small (24/32), left-aligned title. */
    .psw-shop-paymeth .psw-workflow-header__title {
        text-align: left;
        color: var(--color-gray-700);
        font-family: var(--font-sans);
        font-size: var(--text-heading-sm);
        font-weight: var(--font-weight-bold);
        line-height: var(--text-heading-sm--line-height);
    }

    /* Desktop back button — 36px bordered square with 9px inset. */
    .psw-shop-paymeth .psw-workflow-header .psw-btn--icon-only {
        display: flex;
        width: 36px;
        height: 36px;
        padding: 9px;
        justify-content: center;
        align-items: center;
        gap: var(--space-2);
        flex-shrink: 0;
        border-radius: var(--radius-lg);
        border: var(--border-width-sm) solid var(--color-gray-300);
        background: var(--color-white);
    }

    .psw-shop-paymeth .psw-workflow-header .psw-btn--icon-only .psw-icon {
        width: 18px;
        height: 18px;
    }

    .psw-shop-paymeth__layout {
        display: grid;
        grid-template-columns: minmax(0, 638px) 442px;
        column-gap: 48px;
        margin-top: var(--space-8);
        align-items: start;
    }

    .psw-shop-paymeth__options .psw-list-item,
    .psw-shop-paymeth__options .psw-bnpl-provider-picker__option {
        padding: var(--space-6);
    }

    .psw-shop-roles__options .psw-list-item {
        padding: 25px;
    }

    .psw-shop-paymeth .psw-bnpl-provider-picker__option:has(.psw-bnpl-provider-picker__input:checked):hover,
    .psw-shop-paymeth .psw-bnpl-provider-picker__option:has(.psw-bnpl-provider-picker__input:checked):active {
        background: var(--color-white);
    }

    .psw-shop-paymeth__aside {
        display: flex;
        flex-direction: column;
        gap: var(--space-6);
        position: sticky;
        top: var(--space-8);
    }

    .psw-shop-paymeth__summary-card {
        display: flex;
        padding: var(--space-6);
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-6);
        align-self: stretch;
        border-radius: var(--radius-lg);
        border: 1px solid var(--color-gray-200);
        background: var(--color-white);
    }

    /* Gratuity, Select payment plan and Delivery speed take the 24px back/title
       gap on mobile only, so they step back down to workflow_header's 16px here.
       The storefront steps sharing that unconditional rule keep 24px at both
       widths; every step not named in it already inherits the 16px. */
    .psw-shop-paymeth--gratuity .psw-workflow-header,
    .psw-shop-paymeth--source-plan .psw-workflow-header,
    .psw-shop-paymeth--delivery .psw-workflow-header {
        gap: var(--space-4);
    }

    .psw-shop-paymeth--paymeth .psw-shop-paymeth__layout,
    .psw-shop-paymeth--bnpl .psw-shop-paymeth__layout,
    .psw-shop-paymeth--source .psw-shop-paymeth__layout,
    .psw-shop-paymeth--confirm .psw-shop-paymeth__layout,
    .psw-shop-paymeth--register .psw-shop-paymeth__layout {
        margin-top: 34px;
    }

    .psw-shop-paymeth--paymeth .psw-shop-paymeth__summary-card,
    .psw-shop-paymeth--bnpl .psw-shop-paymeth__summary-card,
    .psw-shop-paymeth--source .psw-shop-paymeth__summary-card,
    .psw-shop-paymeth--confirm .psw-shop-paymeth__summary-card,
    .psw-shop-paymeth--register .psw-shop-paymeth__summary-card,
    .psw-shop-paymeth--sign .psw-shop-paymeth__summary-card,
    .psw-shop-paymeth--roles .psw-shop-paymeth__summary-card {
        gap: var(--space-6);
    }

    /* Any summary-card lays its summary out borderless (the card supplies the
       frame) with a full-width CTA below it. */
    .psw-shop-paymeth__summary-card .psw-summary {
        padding: 0;
        border: none;
        border-radius: 0;
        background: transparent;
    }

    .psw-shop-paymeth__summary-card > .psw-btn {
        align-self: stretch;
        width: 100%;
    }

    .psw-shop-paymeth__cart-sheet {
        display: none !important;
    }
}

/* Register page — main column stack */
.psw-shop-paymeth--register .psw-shop-register__content {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.psw-shop-register__intro,
.psw-shop-location__intro,
.psw-pay-location__intro,
.psw-shop-bnpl__intro {
    margin: 0;
    color: var(--color-gray-600);
    font-family: var(--font-sans);
    font-size: var(--text-paragraph-md);
    font-weight: var(--font-weight-regular);
    line-height: var(--text-paragraph-md--line-height);
}

/* Location page — main column stack (intro + address/map) */
.psw-shop-paymeth--location .psw-shop-paymeth__main {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

@media (min-width: 769px) {
    /* Register keeps the shared 24px section stack, but the introductory
       subtitle needs 32px before the first form section on desktop. */
    .psw-shop-paymeth--register .psw-shop-register__intro {
        margin-bottom: var(--space-2);
    }

    /* Roomier desktop rhythm on the steps that carry a subtitle/intro: 32px
       between the subtitle and the fields/form (Figma). Mobile keeps its
       tighter gaps. */
    .psw-shop-paymeth--location .psw-shop-paymeth__main,
    .psw-shop-paymeth--capture .psw-shop-paymeth__main {
        gap: var(--space-8);
    }

    /* Enter location also opens the gap between the two address fields to 32px. */
    .psw-shop-paymeth--location .psw-location-picker {
        gap: var(--space-8);
    }
}

/* Payment info page — main column stack */
.psw-shop-paymeth--source .psw-shop-paymeth__options {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

/* The closing policy sits in 32px of air — above its rule and below it (Figma).
   The stack above is 24px, so each side takes 8 more. */
.psw-shop-paymeth--source .psw-shop-source__divider:has(+ .psw-shop-source__policy),
.psw-shop-paymeth--source .psw-shop-source__policy {
    margin-top: var(--space-2);
}

.psw-pay-bnplemail__fields,
.psw-pay-bnpladdress__fields {
    --psw-stack-gap: var(--space-6);
}

/* The BNPL email / address steps stack input components directly, so the
   container owns the field-to-field rhythm the data_entry_form (and the
   book flow's twin) uses: 24px mobile, 32px desktop. */
.psw-shop-bnpl {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.psw-shop-bnpl__row {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

@media (min-width: 769px) {
    .psw-shop-bnpl {
        gap: var(--space-8);
    }

    .psw-pay-bnplemail__fields,
    .psw-pay-bnpladdress__fields {
        --psw-stack-gap: var(--space-8);
    }

    .psw-shop-bnpl__row {
        flex-direction: row;
        gap: var(--space-4);
    }

    .psw-shop-bnpl__row > * {
        flex: 1 1 0;
        min-width: 0;
    }
}

.psw-pay-bnpllearnmore {
    min-height: 100vh;
    background: var(--color-white);
    color: var(--color-content-high);
}

.psw-pay-bnpllearnmore__main {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: var(--space-10) var(--space-4);
}

.psw-pay-bnpllearnmore__content {
    width: 100%;
    max-width: 430px;
}

.psw-pay-bnpllearnmore__content h1 {
    margin: 0 0 var(--space-2);
    font-family: var(--font-sans);
    font-size: var(--text-label-lg);
    line-height: var(--text-label-lg--line-height);
    font-weight: var(--font-weight-bold);
    color: var(--color-gray-700);
}

.psw-pay-bnpllearnmore__message {
    min-height: 80px;
}

.psw-shop-source__divider {
    width: 100%;
    margin: 0;
    border: none;
    border-top: 1px solid var(--color-gray-200);
}

/* Installment "amount to pay" selector (payment-plan records) */
.psw-shop-source__plan {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.psw-shop-source__plan-title {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 18px;
    line-height: 28px;
    font-weight: 700;
    color: #0F0F0F;
}

/* Stripe entry block on the payment info page */
.psw-shop-source-stripe {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.psw-shop-source-stripe--modal {
    display: contents;
}

.psw-shop-source-stripe[hidden] {
    display: none;
}

.psw-shop-source-stripe__card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.psw-shop-source-stripe__card[hidden] {
    display: none;
}

.psw-shop-source-stripe__link {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.psw-shop-source-stripe__link[hidden] {
    display: none;
}

.psw-shop-source-stripe__field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.psw-shop-source-stripe__element {
    padding: var(--space-3) var(--space-4);
    border: var(--border-width-sm) solid var(--color-gray-200);
    border-radius: var(--radius-md);
    background: var(--color-white);
}

.psw-shop-source-stripe__element--embedded {
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
}

.psw-shop-source-stripe--modal .psw-shop-source-stripe__card {
    gap: var(--space-8);
}

.psw-shop-source-stripe--modal .psw-shop-source-stripe__field {
    gap: var(--space-3);
}

.psw-shop-source-stripe--modal .psw-shop-source-stripe__element {
    min-height: 48px;
    border-color: var(--color-gray-500);
}

.psw-shop-source-stripe--modal .psw-shop-source-stripe__element--embedded {
    min-height: 0;
    border: 0;
}

.psw-shop-source-stripe__errors {
    margin: var(--space-4) 0 0;
    color: var(--color-danger-500);
    font-family: var(--font-sans);
    font-size: var(--text-paragraph-sm);
    line-height: var(--text-paragraph-sm--line-height);
}

.psw-shop-source-stripe__errors[hidden] {
    display: none;
}
}
