/*
 * Wakdo — Design system for the kiosk front (Bloc 1)
 *
 * Tokens extracted from the school maquette PDF:
 *   - Brand yellow  : #FFC72C  (M arches / button fills / card borders active)
 *   - Brand red     : #DA020E  (nav arrows in maquette — kept for potential future use)
 *   - Neutral dark  : #1A1A1A  (headings, primary text)
 *   - Neutral mid   : #4A4A4A  (body copy)
 *   - Neutral light : #F5F5F5  (page backgrounds, card backgrounds)
 *   - White         : #FFFFFF  (overlays, cards)
 *   - Border radius : 12px (cards), 8px (buttons)
 *   - Card border   : 2px solid #FFC72C when selected / active
 *
 * Kiosk target: 1080x1920 portrait (touch screen).
 * Font stack: system-ui fallback — school font is not available as a web asset.
 * OpenDys is loaded conditionally for accessibility (RGAA Cr 1.c.4).
 */

/* ============================================================
   1. CSS CUSTOM PROPERTIES (design tokens)
   ============================================================ */

:root {
    /* Brand palette */
    --color-brand-yellow:    #FFC72C;
    --color-brand-yellow-dk: #E6A800; /* darker shade for focus/hover contrast */
    --color-brand-red:       #DA020E;
    --color-brand-dark:      #1A1A1A;

    /* Neutral palette */
    --color-text-primary:    #1A1A1A;
    --color-text-secondary:  #4A4A4A;
    --color-text-muted:      #767676; /* min WCAG AA contrast on white */
    --color-bg-page:         #F5F5F5;
    --color-bg-card:         #FFFFFF;
    --color-border-default:  #D1D1D1;
    --color-border-active:   #FFC72C;

    /* Typography */
    --font-family-base:  system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    --font-size-xs:      0.75rem;   /* 12px */
    --font-size-sm:      0.875rem;  /* 14px */
    --font-size-base:    1rem;      /* 16px */
    --font-size-md:      1.25rem;   /* 20px */
    --font-size-lg:      1.5rem;    /* 24px */
    --font-size-xl:      2rem;      /* 32px */
    --font-size-2xl:     2.5rem;    /* 40px */
    --font-weight-normal: 400;
    --font-weight-bold:   700;

    /* Spacing scale (8px base) */
    --space-1:  0.25rem;  /*  4px */
    --space-2:  0.5rem;   /*  8px */
    --space-3:  0.75rem;  /* 12px */
    --space-4:  1rem;     /* 16px */
    --space-5:  1.5rem;   /* 24px */
    --space-6:  2rem;     /* 32px */
    --space-8:  3rem;     /* 48px */
    --space-10: 4rem;     /* 64px */

    /* Border radius */
    --radius-sm:   6px;
    --radius-md:   12px;
    --radius-lg:   20px;
    --radius-pill: 9999px;

    /* Shadows */
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.10);
    --shadow-overlay: 0 4px 32px rgba(0, 0, 0, 0.18);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    /* touch-action on html prevents accidental pinch-zoom on kiosk */
    touch-action: manipulation;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    color: var(--color-text-primary);
    background-color: var(--color-bg-page);
    line-height: 1.5;
    min-height: 100vh;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
}

/* ============================================================
   3. UTILITY CLASSES
   ============================================================ */

.sr-only {
    /* Screen-reader only — visually hidden but accessible (RGAA) */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
   4. COMPONENT — WELCOME SCREEN (index.html)
   ============================================================ */

/*
 * Layout: full-viewport, background photo, centered white card.
 * The maquette shows the M logo arches as a background image (mc-landing-banner.png).
 * The white card floats left-center in the maquette; on 1080x1920 portrait we center it.
 */

.welcome {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    overflow: hidden;
}

.welcome__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}

.welcome__card {
    position: relative;
    z-index: 1;
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-overlay);
    padding: var(--space-8) var(--space-8);
    max-width: 700px;
    width: 100%;
}

.welcome__greeting {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-5);
    line-height: 1.2;
}

.welcome__question {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-6);
    line-height: 1.4;
}

.welcome__choices {
    display: flex;
    gap: var(--space-5);
    flex-wrap: wrap;
}

.choice-btn {
    flex: 1 1 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-4);
    background: var(--color-bg-card);
    border: 2px solid var(--color-border-default);
    border-radius: var(--radius-md);
    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        transform var(--transition-fast);
    -webkit-tap-highlight-color: transparent; /* suppress blue flash on mobile tap */
    min-height: 200px;
    justify-content: center;
}

.choice-btn:hover,
.choice-btn:focus-visible {
    border-color: var(--color-border-active);
    box-shadow: 0 0 0 3px rgba(255, 199, 44, 0.35);
    outline: none;
    /* slight lift gives tactile feedback on kiosk screen */
    transform: translateY(-2px);
}

.choice-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.choice-btn__image {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.choice-btn__label {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    text-align: center;
}

/* ============================================================
   5. COMPONENT — CATEGORIES SCREEN (categories.html)
   ============================================================ */

/*
 * Layout: header bar at top with logo, then a full-page category grid.
 * The maquette shows categories as a horizontal scrollable strip at the top
 * of the product-list screen. Here we present them as a full-page grid
 * (intermediate screen before the product list, P5 scope).
 * 3-column grid on portrait kiosk (1080px wide).
 */

.categories-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-page);
}

/* ---------- header ---------- */

.site-header {
    background: var(--color-bg-card);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: var(--space-4) var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Sticky so the logo stays visible while user scrolls categories */
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header__logo {
    height: 56px;
    width: auto;
}

.site-header__back {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-secondary);
    padding: var(--space-2) var(--space-4);
    border: 2px solid var(--color-border-default);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.site-header__back:hover,
.site-header__back:focus-visible {
    border-color: var(--color-border-active);
    color: var(--color-text-primary);
    outline: none;
}

/* ---------- main content area ---------- */

.categories-main {
    flex: 1;
    padding: var(--space-6) var(--space-6) var(--space-10);
}

.categories-main__heading {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.categories-main__sub {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-6);
}

/* ---------- category grid ---------- */

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
}

/*
 * Each category card is a link (<a>) styled as a card.
 * Large tap target (min 160px) for kiosk touch use.
 */
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-4);
    background: var(--color-bg-card);
    border: 2px solid var(--color-border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        transform var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    min-height: 220px;
    justify-content: center;
    text-align: center;
}

.category-card:hover,
.category-card:focus-visible {
    border-color: var(--color-border-active);
    box-shadow: 0 0 0 3px rgba(255, 199, 44, 0.35), var(--shadow-card);
    outline: none;
    transform: translateY(-3px);
}

.category-card:active {
    transform: translateY(0);
    box-shadow: var(--shadow-card);
}

.category-card__image {
    width: 140px;
    height: 140px;
    object-fit: contain;
}

.category-card__label {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    /* Capitalize first letter to match maquette label style */
    text-transform: capitalize;
}

/* ============================================================
   6. RESPONSIVE — kiosk portrait 1080px is primary target.
   Desktop landscape / smaller tablets get a simplified layout.
   ============================================================ */

/* Landscape / wide desktop: welcome card can be wider */
@media (min-width: 1080px) {
    .welcome__card {
        max-width: 820px;
        padding: var(--space-10) var(--space-10);
    }

    .choice-btn__image {
        width: 150px;
        height: 150px;
    }

    .category-grid {
        /* 4 columns on very wide screens so the grid uses the space */
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Narrow screens (phones, small tablets) */
@media (max-width: 600px) {
    .welcome__card {
        padding: var(--space-5) var(--space-4);
    }

    .welcome__greeting {
        font-size: var(--font-size-xl);
    }

    .welcome__question {
        font-size: var(--font-size-base);
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .categories-main {
        padding: var(--space-4);
    }
}

/* Portrait kiosk explicit — enforce single-column choice layout below 480px */
@media (max-width: 480px) {
    .welcome__choices {
        flex-direction: column;
    }
}

/* ============================================================
   7. SHARED COMPONENTS — header extensions + badges + buttons
   ============================================================ */

/* Cart link in header (products / product / cart pages) */
.site-header__cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
    font-size: 1.6rem;
    color: var(--color-text-primary);
    text-decoration: none;
}

.site-header__cart:hover,
.site-header__cart:focus-visible {
    background: rgba(255, 199, 44, 0.18);
    outline: none;
}

.cart-icon {
    line-height: 1;
}

.cart-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    border-radius: var(--radius-pill);
    background: var(--color-brand-red);
    color: #fff;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Mode badge — shown in header for context */
.mode-badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: var(--color-brand-yellow);
    border-radius: var(--radius-pill);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    color: var(--color-brand-dark);
    white-space: nowrap;
}

.site-header__mode {
    /* Keeps mode badge aligned right in the header flex */
    margin-left: auto;
}

/* Minimal header variant (confirmation page — no back button) */
.site-header--minimal {
    justify-content: center;
}

/* Primary / secondary button primitives reused across pages */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-md);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition:
        background var(--transition-fast),
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        transform var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    /* Generous tap target for kiosk touch */
    min-height: 64px;
}

.btn--primary {
    background: var(--color-brand-yellow);
    color: var(--color-brand-dark);
}

.btn--primary:hover,
.btn--primary:focus-visible {
    background: var(--color-brand-yellow-dk);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 199, 44, 0.40);
    transform: translateY(-1px);
}

.btn--primary:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn--primary:disabled,
.btn--primary[aria-disabled="true"] {
    background: var(--color-border-default);
    color: var(--color-text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    pointer-events: none;
}

.btn--secondary {
    background: var(--color-bg-card);
    color: var(--color-text-primary);
    border-color: var(--color-border-default);
}

.btn--secondary:hover,
.btn--secondary:focus-visible {
    border-color: var(--color-border-active);
    outline: none;
}

.btn--large {
    font-size: var(--font-size-lg);
    padding: var(--space-5) var(--space-8);
    min-height: 80px;
}

/* ============================================================
   8. COMPONENT — PRODUCTS LIST (products.html)
   ============================================================ */

.products-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-page);
}

.products-main {
    flex: 1;
    padding: var(--space-6);
}

.products-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
    gap: var(--space-4);
    flex-wrap: wrap;
}

.products-main__heading {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

.products-error {
    color: var(--color-brand-red);
    font-size: var(--font-size-md);
    margin-bottom: var(--space-5);
}

.products-empty {
    color: var(--color-text-muted);
    font-size: var(--font-size-md);
    padding: var(--space-8) 0;
    text-align: center;
}

/* Product grid — 3 columns on kiosk portrait */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
    list-style: none;
    padding: 0;
    margin: 0;
}

/*
 * product-card — clickable card linking to product detail.
 * The <a> is the grid child; using display:flex so image + text stack.
 */
.product-card {
    display: flex;
    flex-direction: column;
    background: var(--color-bg-card);
    border: 2px solid var(--color-border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        transform var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    color: inherit;
}

.product-card:hover,
.product-card:focus-visible {
    border-color: var(--color-border-active);
    box-shadow: 0 0 0 3px rgba(255, 199, 44, 0.35), var(--shadow-card);
    outline: none;
    transform: translateY(-3px);
}

.product-card:active {
    transform: translateY(0);
    box-shadow: var(--shadow-card);
}

.product-card__image-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--color-bg-page);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-card__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: var(--space-3);
}

.product-card__body {
    padding: var(--space-3) var(--space-4) var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    flex: 1;
}

.product-card__name {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    line-height: 1.3;
}

.product-card__price {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
    color: var(--color-brand-dark);
}

/* ============================================================
   9. COMPONENT — PRODUCT DETAIL (product.html)
   ============================================================ */

.product-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-page);
}

.product-main {
    flex: 1;
    padding: var(--space-6);
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.product-error {
    color: var(--color-brand-red);
    font-size: var(--font-size-md);
    padding: var(--space-5);
}

.product-detail {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.product-detail__skeleton {
    /* Placeholder shown while JS loads data */
    width: 100%;
    height: 300px;
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    animation: skeleton-pulse 1.4s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.product-detail__image-wrap {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-detail__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: var(--space-5);
}

.product-detail__info {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.product-detail__name {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    line-height: 1.2;
}

.product-detail__price {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-brand-dark);
}

.product-detail__composition {
    background: var(--color-bg-card);
    border-left: 4px solid var(--color-brand-yellow);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: var(--space-4) var(--space-5);
}

.product-detail__composition-title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-2);
    color: var(--color-text-primary);
}

.product-detail__composition-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.product-detail__add {
    width: 100%;
    margin-top: var(--space-2);
}

/* ============================================================
   10. COMPONENT — CART (cart.html)
   ============================================================ */

.cart-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-page);
}

.cart-main {
    flex: 1;
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.cart-main__heading {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

.cart-empty {
    text-align: center;
    padding: var(--space-10) var(--space-6);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-5);
}

.cart-empty__message {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
}

.cart-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    list-style: none;
    padding: 0;
    margin: 0;
}

/* One cart line */
.cart-line {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: var(--space-3) var(--space-4);
}

.cart-line__image {
    width: 72px;
    height: 72px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    background: var(--color-bg-page);
}

.cart-line__info {
    flex: 1;
    min-width: 0;
}

.cart-line__name {
    display: block;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-line__unit-price {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* Quantity controls */
.cart-line__qty {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.qty-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--color-border-default);
    background: var(--color-bg-card);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
    /* Large tap target for kiosk */
}

.qty-btn:hover,
.qty-btn:focus-visible {
    border-color: var(--color-border-active);
    background: rgba(255, 199, 44, 0.10);
    outline: none;
}

.qty-value {
    min-width: 32px;
    text-align: center;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
}

.cart-line__total {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    flex-shrink: 0;
    min-width: 80px;
    text-align: right;
}

.cart-line__remove {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition-fast);
}

.cart-line__remove:hover,
.cart-line__remove:focus-visible {
    background: rgba(218, 2, 14, 0.10);
    outline: none;
}

/* Order summary block */
.cart-summary {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.cart-summary__line {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
}

.cart-summary__line--total {
    padding-top: var(--space-3);
    border-top: 2px solid var(--color-border-default);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

/* Cart action row */
.cart-actions {
    display: flex;
    gap: var(--space-4);
    justify-content: space-between;
    flex-wrap: wrap;
    padding-bottom: var(--space-8);
}

.cart-actions .btn {
    flex: 1 1 200px;
}

/* ============================================================
   11. COMPONENT — PAYMENT (payment.html)
   ============================================================ */

.payment-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-page);
}

.payment-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-8) var(--space-6);
    gap: var(--space-8);
}

.payment-main__heading {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    text-align: center;
}

.payment-recap {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: var(--space-5) var(--space-6);
    text-align: center;
    width: 100%;
    max-width: 480px;
}

.payment-recap__mode {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-1);
}

.payment-recap__items {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2);
}

.payment-recap__total {
    font-size: var(--font-size-lg);
    color: var(--color-text-primary);
}

/* Two payment method buttons side by side */
.payment-methods {
    display: flex;
    gap: var(--space-6);
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 640px;
}

.payment-choice {
    flex: 1 1 220px;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    padding: var(--space-6);
    background: var(--color-bg-card);
    border: 2px solid var(--color-border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        transform var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}

.payment-choice:hover,
.payment-choice:focus-visible {
    border-color: var(--color-border-active);
    box-shadow: 0 0 0 3px rgba(255, 199, 44, 0.35), var(--shadow-card);
    outline: none;
    transform: translateY(-3px);
}

.payment-choice:active {
    transform: translateY(0);
    box-shadow: var(--shadow-card);
}

.payment-choice__icon {
    width: 80px;
    height: 80px;
}

.payment-choice__label {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    text-align: center;
}

/* ============================================================
   12. COMPONENT — CONFIRMATION (confirmation.html)
   ============================================================ */

.confirmation-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-page);
}

.confirmation-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8) var(--space-6);
    gap: var(--space-8);
}

.confirmation-banner {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-overlay);
    padding: var(--space-8);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-5);
    text-align: center;
    max-width: 560px;
    width: 100%;
}

.confirmation-banner__check {
    width: 96px;
    height: 96px;
    /* Subtle entrance animation */
    animation: check-pop 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes check-pop {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.confirmation-banner__title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

.confirmation-banner__sub {
    font-size: var(--font-size-md);
    color: var(--color-text-secondary);
}

.confirmation-banner__number-block {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    background: var(--color-bg-page);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-6);
    min-width: 200px;
}

.confirmation-banner__number-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.confirmation-banner__number {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-brand-dark);
    letter-spacing: 0.04em;
}

.confirmation-banner__total {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
}

.confirmation-banner__delay {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
}

.confirmation-new-order {
    /* Full-width CTA on kiosk portrait */
    min-width: 320px;
}

/* ============================================================
   13. RESPONSIVE EXTENSIONS — new pages
   ============================================================ */

@media (max-width: 700px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cart-line {
        flex-wrap: wrap;
        gap: var(--space-3);
    }

    .cart-line__info {
        flex: 1 1 calc(100% - 80px);
    }

    .payment-methods {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-3);
    }

    .products-main {
        padding: var(--space-4);
    }

    .cart-main {
        padding: var(--space-4);
    }
}

/* ============================================================
   14. COMPONENT — MENU COMPOSER MODAL (product.html, type=menu)
   ============================================================ */

/*
 * Overlay dims the page content while the composer is open.
 * z-index 200 sits above the sticky header (z-index 100).
 */
.composer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    /* Subtle fade-in so the overlay does not feel abrupt */
    animation: composer-fade-in var(--transition-base) both;
}

@keyframes composer-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* White container centred inside the overlay */
.composer-container {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-overlay);
    width: 100%;
    max-width: 1080px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Slide-up entrance from maquette aesthetic */
    animation: composer-slide-up var(--transition-base) both;
}

@keyframes composer-slide-up {
    from { transform: translateY(32px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ---------- Header ------------------------------------------ */

.composer-header {
    padding: var(--space-5) var(--space-6) var(--space-4);
    border-bottom: 1px solid var(--color-border-default);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    flex-shrink: 0;
}

.composer-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

/* Progress indicator */
.composer-progress {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.composer-progress__text {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    white-space: nowrap;
    min-width: 6rem;
}

.composer-progress__bar {
    flex: 1;
    height: 6px;
    background: var(--color-bg-page);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.composer-progress__fill {
    height: 100%;
    background: var(--color-brand-yellow);
    border-radius: var(--radius-pill);
    transition: width var(--transition-base);
}

/* ---------- Body -------------------------------------------- */

.composer-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-5) var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    /* Visible focus outline inside scrollable area */
    outline: none;
}

.composer-step__subtitle {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

/* ---------- Selectable card grid ----------------------------- */

.composer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-4);
    list-style: none;
    padding: 0;
    margin: 0;
}

/*
 * composer-card — button variant of the product card.
 * Displays image + name (+ price for burgers).
 * Uses aria-pressed to expose selection state to assistive tech.
 */
.composer-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-3) var(--space-4);
    background: var(--color-bg-card);
    border: 2px solid var(--color-border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    cursor: pointer;
    text-align: center;
    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        transform var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.composer-card:hover,
.composer-card:focus-visible {
    border-color: var(--color-border-active);
    box-shadow: 0 0 0 3px rgba(255, 199, 44, 0.35), var(--shadow-card);
    outline: none;
    transform: translateY(-2px);
}

.composer-card:active {
    transform: translateY(0);
}

/* Selected state — mirrors aria-pressed=true */
.composer-card--selected {
    border-color: var(--color-border-active);
    box-shadow: 0 0 0 3px rgba(255, 199, 44, 0.45), var(--shadow-card);
    background: rgba(255, 199, 44, 0.06);
}

.composer-card__image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    max-height: 120px;
    border-radius: var(--radius-sm);
}

.composer-card__name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    line-height: 1.3;
}

.composer-card__price {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* ---------- Personalisation checkboxes ----------------------- */

.composer-options {
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.composer-options__legend {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-secondary);
    padding: 0 var(--space-2);
}

.composer-option-label {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--font-size-base);
    color: var(--color-text-primary);
    cursor: pointer;
}

.composer-option-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--color-brand-yellow);
    cursor: pointer;
    flex-shrink: 0;
}

/* ---------- Taille toggle ------------------------------------ */

.composer-taille {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    flex-wrap: wrap;
}

.composer-taille__btn {
    flex: 1 1 160px;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--color-border-default);
    border-radius: var(--radius-md);
    background: var(--color-bg-card);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    cursor: pointer;
    transition:
        border-color var(--transition-fast),
        background var(--transition-fast),
        box-shadow var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 56px;
}

.composer-taille__btn:hover,
.composer-taille__btn:focus-visible {
    border-color: var(--color-border-active);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 199, 44, 0.25);
}

/* Active/selected taille button */
.composer-taille__btn--active {
    border-color: var(--color-brand-yellow);
    background: rgba(255, 199, 44, 0.10);
}

/* Supplement price hint inside the Grande button */
.composer-taille__price-hint {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-normal);
    color: var(--color-text-muted);
    background: var(--color-bg-page);
    padding: 2px var(--space-2);
    border-radius: var(--radius-pill);
}

/* ---------- Recap (step 5) ----------------------------------- */

.composer-recap {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.composer-recap__line {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-base);
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--color-border-default);
}

.composer-recap__line:last-child {
    border-bottom: none;
}

.composer-recap__icon {
    color: var(--color-brand-yellow);
    font-size: var(--font-size-xs);
    flex-shrink: 0;
}

.composer-recap__label {
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.composer-recap__opts {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.composer-recap__taille {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.composer-recap__suppl {
    font-size: var(--font-size-sm);
    color: var(--color-brand-yellow-dk);
    font-weight: var(--font-weight-bold);
}

/* Totals block below the recap list */
.composer-recap__totals {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-4) 0;
}

.composer-recap__base,
.composer-recap__suppl-total {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.composer-recap__total-line {
    font-size: var(--font-size-lg);
    color: var(--color-text-primary);
}

/* ---------- Footer ------------------------------------------ */

.composer-footer {
    flex-shrink: 0;
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-border-default);
    background: var(--color-bg-card);
}

.composer-footer__row {
    display: flex;
    gap: var(--space-4);
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.composer-footer__cancel {
    /* Pushed to the left so it is visually separated from the nav buttons */
    margin-right: auto;
}

/* ---------- Cart line composition display -------------------- */

.cart-line__composition {
    list-style: none;
    padding: var(--space-1) 0 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cart-line__comp-item {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    line-height: 1.4;
}

.cart-line__comp-suppl {
    font-size: var(--font-size-xs);
    color: var(--color-brand-yellow-dk);
    font-weight: var(--font-weight-bold);
    line-height: 1.4;
    padding-top: var(--space-1);
}

/* ---------- Responsive — narrow screens --------------------- */

@media (max-width: 600px) {
    .composer-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: var(--space-3);
    }

    .composer-container {
        max-height: 95vh;
    }

    .composer-header,
    .composer-body,
    .composer-footer {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    .composer-footer__row {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .composer-footer__cancel {
        margin-right: 0;
    }
}
