/* ==========================================================================
   Pecel Lele Lamongan Cak Nur — design foundation (Tahap 1)
   Minimalist, warm, mobile-first. No framework dependencies.
   ========================================================================== */

/* 1. Design tokens
   ----------------------------------------------------------------------- */
:root {
    /* Colour */
    --color-bg: #FAF8F3;
    --color-surface: #FFFFFF;
    --color-surface-muted: #F4F1EA;
    --color-accent: #F4B400;
    --color-accent-hover: #E0A500;
    --color-accent-soft: #FFF6DB;
    --color-accent-strong: #8A6200;
    /* accent tone for text/links on light bg (AA) */
    --color-on-accent: #252525;
    --color-text: #252525;
    --color-text-muted: #737373;
    --color-border: #EAE7E0;
    --color-border-strong: #D6D1C6;
    --color-focus: #B07D00;

    /* Status (text on tinted background, all ≥ 4.5:1) */
    --color-success: #1E6B3E;
    --color-success-bg: #E7F4EC;
    --color-warning: #7A5200;
    --color-warning-bg: #FFF4D6;
    --color-danger: #A8261C;
    --color-danger-bg: #FDECEA;
    --color-info: #2A5580;
    --color-info-bg: #EAF1F8;

    /* Typography */
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --text-xs: 0.8125rem;
    /* 13px */
    --text-sm: 0.875rem;
    /* 14px */
    --text-base: 1rem;
    /* 16px */
    --text-lg: 1.125rem;
    /* 18px */
    --text-xl: 1.375rem;
    /* 22px */
    --text-2xl: clamp(1.625rem, 1.3rem + 1.4vw, 2.25rem);
    /* 26–36px */
    --leading-tight: 1.25;
    --leading-normal: 1.6;
    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;

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

    /* Shape & depth */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(37, 37, 37, 0.05);
    --shadow-md: 0 4px 16px rgba(37, 37, 37, 0.07);
    --shadow-lg: 0 16px 48px rgba(37, 37, 37, 0.12);

    /* Layout */
    --container: 1120px;
    --gutter: var(--space-4);
    --tap: 44px;
    --control-height: 48px;
    --transition: 160ms ease;
}

@media (min-width: 768px) {
    :root {
        --gutter: var(--space-8);
    }
}

/* 2. Reset & base
   ----------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 4.5rem;
}

html:has(body.has-floating) {
    scroll-padding-bottom: 140px;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    overflow-x: clip;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
}

body:has(#methodStepSlot:not(.hidden)) {
    background: var(--color-surface);
}

body.in-menu,
body.in-menu #menu {
    background: var(--color-surface);
}

body.in-order,
body.in-order #checkout,
body.in-order #checkout .cart-summary {
    background: var(--color-surface);
}

body:has(#methodDialog[open]) {
    overflow: hidden;
}

h1,
h2,
h3,
h4,
p,
figure,
ol,
ul,
fieldset {
    margin: 0;
}

ol,
ul {
    padding: 0;
}

fieldset {
    padding: 0;
    border: 0;
    min-width: 0;
}

img,
svg,
video,
canvas {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

/* Leaflet tiles must not be constrained by the global image rule. */
.leaflet-container img {
    max-width: none !important;
}

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

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button,
a,
input,
select,
textarea,
label {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
}

:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 3px;
}

::selection {
    background: var(--color-accent-soft);
}

/* 3. Typography
   ----------------------------------------------------------------------- */
h1,
h2,
h3 {
    color: var(--color-text);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    letter-spacing: -0.01em;
}

h1 {
    font-size: var(--text-2xl);
    letter-spacing: -0.02em;
}

h2 {
    font-size: var(--text-xl);
}

h3 {
    font-size: var(--text-lg);
}

p {
    max-width: 68ch;
}

small {
    font-size: var(--text-sm);
}

strong,
b {
    font-weight: var(--weight-bold);
}

.eyebrow {
    display: block;
    margin-bottom: var(--space-2);
    color: var(--color-accent-strong);
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sub,
.section-head p {
    margin-top: var(--space-2);
    color: var(--color-text-muted);
}

.notice {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    line-height: 1.55;
}

.text-link {
    color: var(--color-accent-strong);
    font-weight: var(--weight-semibold);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* 4. Layout
   ----------------------------------------------------------------------- */
.wrap {
    width: min(var(--container), 100% - 2 * var(--gutter));
    margin: 0 auto;
}

.order-step h1:focus {
    outline: none;
}

.order-step:not(.hidden) {
    animation: step-in 180ms ease-out;
}

@keyframes step-in {
    from {
        opacity: 0.6;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* 5. Buttons
   ----------------------------------------------------------------------- */
.button,
.submit,
.add,
.location-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: var(--control-height);
    padding: var(--space-3) var(--space-5);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    line-height: 1.2;
    text-align: center;
    transition: background-color var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.button.primary,
.submit {
    background: var(--color-accent);
    color: var(--color-on-accent);
}

.button.primary:hover:not(:disabled),
.submit:hover:not(:disabled) {
    background: var(--color-accent-hover);
}

.button.secondary,
.location-button {
    background: var(--color-surface);
    border-color: var(--color-border-strong);
    color: var(--color-text);
}

.button.secondary:hover,
.location-button:hover {
    border-color: var(--color-text-muted);
    background: var(--color-surface-muted);
}

.add {
    min-height: var(--tap);
    padding: var(--space-2) var(--space-4);
    background: var(--color-accent-soft);
    border-color: #F3E2AE;
    color: var(--color-on-accent);
    font-size: var(--text-sm);
}

.add:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.button:disabled,
.submit:disabled,
.add:disabled,
.location-button:disabled {
    opacity: 0.5;
}

.link-button {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    padding: var(--space-2) 0;
    border: 0;
    background: none;
    color: var(--color-accent-strong);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.submit {
    width: 100%;
    margin-top: var(--space-6);
}

/* 6. Form controls
   ----------------------------------------------------------------------- */
label {
    display: block;
    margin: var(--space-4) 0 var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
}

input:not([type="radio"]):not([type="checkbox"]),
textarea,
select {
    display: block;
    width: 100%;
    min-height: var(--control-height);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--text-base);
    /* ≥16px prevents iOS zoom on focus */
    transition: border-color var(--transition), box-shadow var(--transition);
}

textarea {
    min-height: 96px;
    resize: vertical;
}

select {
    cursor: pointer;
}

input::placeholder,
textarea::placeholder {
    color: #9A9A9A;
}

input:not([type="radio"]):not([type="checkbox"]):focus,
textarea:focus,
select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(244, 180, 0, 0.25);
    outline: none;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
    border-color: var(--color-danger);
}

.form-error {
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--color-danger-bg);
    color: var(--color-danger);
    font-size: var(--text-sm);
}

.field-error {
    display: block;
    margin: var(--space-1) 0 var(--space-3);
    color: var(--color-danger);
    font-size: var(--text-xs);
}

#customerName[aria-invalid="true"],
#phone[aria-invalid="true"] {
    border-color: var(--color-border-strong);
    box-shadow: 0 0 0 3px rgba(168, 38, 28, 0.15);
}

#customerName[aria-invalid="true"]:focus,
#phone[aria-invalid="true"]:focus {
    border-color: var(--color-border-strong);
    box-shadow: 0 0 0 3px rgba(244, 180, 0, 0.25);
}

/* 7. Header — compact app bar
   ----------------------------------------------------------------------- */
header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    min-height: 56px;
    padding-block: var(--space-2);
}

.checkout-back {
    flex-shrink: 0;
    gap: var(--space-2);
    padding-inline: var(--space-2);
    text-decoration: none;
}

body.in-order header#beranda .top {
    position: relative;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    max-width: none;
    min-height: calc(56px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) var(--space-3) 0;
}

body.in-order .method-summary {
    justify-self: end;
    max-width: min(48vw, 190px);
    min-height: 40px;
    padding-inline: var(--space-3);
}

body.in-order .method-summary > strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.checkout-nav-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    min-width: 0;
    overflow: hidden;
    color: var(--color-text);
    font-size: 15px;
    font-weight: var(--weight-semibold);
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    flex: 1;
}

.brand-mark {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-on-accent);
    font-size: 0.8125rem;
    font-weight: var(--weight-bold);
    line-height: 1;
}

.brand-mark span {
    margin-top: 1px;
    font-size: 5px;
    letter-spacing: 0.1em;
}

.brand {
    min-width: 0;
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    line-height: 1.25;
}

.brand small {
    display: none;
    margin-top: 1px;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    font-weight: var(--weight-regular);
}

@media (min-width: 768px) {
    .top {
        min-height: 60px;
    }

    .brand-mark {
        width: 40px;
        height: 40px;
        font-size: 0.9375rem;
    }

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

    .brand small {
        display: block;
    }
}

/* 8. Order method (native dialog)
   ----------------------------------------------------------------------- */
.order-shell {
    padding-top: 0;
}

#methodStepSlot {
    padding-block: var(--space-6) var(--space-8);
}

#methodStepSlot .method-step {
    width: min(760px, 100%);
    margin-inline: auto;
    padding: var(--space-6);
    border: 0;
    border-radius: var(--radius-xl);
    background: transparent;
    box-shadow: none;
}

#methodDialog {
    width: min(520px, 100% - 2rem);
    max-height: calc(100dvh - 2rem);
    margin: auto;
    padding: var(--space-8) var(--space-6);
    overflow: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: var(--shadow-lg);
}

#methodDialog::backdrop {
    background: rgba(37, 37, 37, 0.45);
    backdrop-filter: blur(4px);
}

#methodDialog[open] {
    animation: method-appear 200ms ease-out;
}

.bottom-sheet {
    position: fixed;
    inset: 0;
    display: none;
    place-items: end center;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
    color: var(--color-text);
}

.bottom-sheet[open] {
    display: grid;
}

.bottom-sheet::backdrop {
    background: rgba(37, 37, 37, 0.48);
}

.bottom-sheet-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    width: min(100%, 720px);
    max-height: min(86dvh, 760px);
    padding-bottom: max(var(--space-3), env(safe-area-inset-bottom));
    border: 1px solid var(--color-border);
    border-bottom: 0;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
    animation: bottom-sheet-in 180ms ease-out;
}

.bottom-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.bottom-sheet-header h2 {
    margin: 0;
    font-size: var(--text-lg);
}

.bottom-sheet-close {
    display: grid;
    place-items: center;
    flex: 0 0 var(--tap);
    width: var(--tap);
    height: var(--tap);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: var(--text-xl);
}

.bottom-sheet-content {
    min-height: 0;
    padding: var(--space-4) var(--space-5);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.bottom-sheet-content #deliveryFields,
.bottom-sheet-content #pickupFields {
    margin-top: 0;
}

.bottom-sheet-panel > .form-error {
    margin: 0 var(--space-5) var(--space-3);
}

.bottom-sheet-actions {
    padding: var(--space-3) var(--space-5) 0;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}

.bottom-sheet-actions .button {
    width: 100%;
}

@keyframes bottom-sheet-in {
    from { transform: translateY(18px); opacity: 0.85; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes method-appear {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.step-intro {
    text-align: center;
}

.step-intro>p {
    margin: var(--space-2) auto 0;
    color: var(--color-text-muted);
}

.method-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    margin-top: var(--space-5);
}

.method-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    margin: 0;
    padding: var(--space-4) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    text-align: center;
    font-weight: var(--weight-regular);
    cursor: pointer;
    transition: border-color var(--transition), background-color var(--transition);
}

.method-card:hover {
    border-color: var(--color-border-strong);
}

.method-card:has(input:checked) {
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
}

.method-card:has(input:focus-visible) {
    outline: 3px solid var(--color-focus);
    outline-offset: 3px;
}

.method-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.method-icon {
    width: 40px;
    height: 40px;
    margin-bottom: var(--space-1);
    color: var(--color-text);
}

.method-icon svg {
    width: 100%;
    height: 100%;
}

.method-card strong {
    font-size: var(--text-base);
}

.method-card>span:not(.method-icon):not(.selection-mark) {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    line-height: 1.45;
}

.method-card small {
    margin-top: var(--space-1);
    color: var(--color-accent-strong);
    font-size: var(--text-xs);
}

.selection-mark {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-on-accent);
    font-size: 12px;
    opacity: 0;
    transition: opacity var(--transition);
}

.method-card:has(input:checked) .selection-mark {
    opacity: 1;
}

.method-next {
    margin-top: var(--space-5);
}

.method-next .notice {
    margin-inline: auto;
    text-align: center;
}

.method-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

.method-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    flex: 0 1 auto;
    max-width: min(52%, 280px);
    margin: 0;
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-bg);
    font-size: var(--text-xs);
    white-space: nowrap;
}

.method-summary>span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.method-summary .link-button {
    flex-shrink: 0;
    min-height: 36px;
    padding-inline: var(--space-1);
    font-size: var(--text-xs);
}

@media (max-width: 430px) {
    body.in-order .method-summary {
        max-width: min(34vw, 142px);
        padding-inline: var(--space-2);
    }

    body.in-order .method-summary-label {
        display: none;
    }
}

/* 9. Catalog
   ----------------------------------------------------------------------- */
#menu {
    padding: 0 0 120px;
}

body.in-menu header#beranda {
    display: none;
}

.menu-hero {
    position: relative;
    height: clamp(170px, 32vw, 260px);
    overflow: hidden;
    background: var(--color-bg);
}

.menu-hero > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.menu-hero-controls {
    position: absolute;
    inset: max(var(--space-3), env(safe-area-inset-top)) var(--gutter) auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

.menu-icon-button {
    display: grid;
    place-items: center;
    flex: 0 0 var(--tap);
    width: var(--tap);
    height: var(--tap);
    padding: var(--space-2);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    color: var(--color-text);
    box-shadow: var(--shadow-md);
    pointer-events: auto;
}

.menu-icon-button svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.in-order .checkout-back {
    width: 36px;
    height: 36px;
    padding: var(--space-2);
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

body.in-order .checkout-back svg {
    width: 22px;
    height: 22px;
}

.menu-sticky-header {
    position: fixed;
    z-index: 60;
    inset: 0 0 auto;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    align-items: center;
    min-height: calc(56px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) var(--space-3) 0;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

.menu-sticky-header .menu-icon-button {
    width: 36px;
    height: 36px;
    padding: var(--space-2);
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.menu-sticky-header .menu-icon-button svg {
    width: 22px;
    height: 22px;
}

.menu-sticky-title {
    min-width: 0;
    overflow: hidden;
    color: var(--color-text);
    font-size: 15px;
    font-weight: var(--weight-semibold);
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.catalog-content {
    padding-top: var(--space-4);
}

.order-type-panel {
    margin-bottom: var(--space-5);
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    background:
        linear-gradient(var(--color-surface), var(--color-surface)) padding-box,
        linear-gradient(125deg, rgba(244, 180, 0, 0.62), #fff 42%, rgba(196, 173, 113, 0.52)) border-box;
    box-shadow: 0 8px 24px rgba(37, 37, 37, 0.08), 0 0 18px rgba(244, 180, 0, 0.08);
}

.order-type-row,
.order-detail-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
}

.order-type-row {
    justify-content: space-between;
    min-height: 48px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: var(--text-sm);
}

.method-choice-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 36px;
    max-width: 62%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
}

.method-choice-chevron {
    color: var(--color-text-muted);
    font-size: var(--text-lg);
    line-height: 1;
}

.order-detail-row {
    min-height: 68px;
}

.order-detail-row.has-scheduled-time {
    min-height: 64px;
    padding-block: var(--space-3);
}

.order-detail-row.has-scheduled-time .order-detail-icon {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
    color: var(--color-text);
}

.order-detail-icon {
    display: grid;
    place-items: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    color: var(--color-text-muted);
}

.order-detail-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.order-detail-copy {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    gap: 2px;
}

.order-detail-copy strong {
    font-size: var(--text-sm);
}

.order-detail-copy span,
.order-detail-copy small {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    overflow-wrap: anywhere;
}

.order-detail-copy span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-detail-action {
    flex: 0 0 auto;
    min-height: 36px;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-accent-strong);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-accent-strong);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
}

.order-detail-row.has-scheduled-time .order-detail-action {
    min-height: 34px;
    padding: var(--space-1) var(--space-3);
    border-color: var(--color-accent);
    border-radius: 999px;
    color: var(--color-accent-strong);
    background: #FFF;
}

.pickup-time-picker {
    display: grid;
    gap: var(--space-3);
}

.pickup-now-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 60px;
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    text-align: left;
}

.pickup-now-option > span:first-child {
    display: grid;
    gap: 2px;
}

.pickup-now-option small {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.pickup-choice-check {
    display: grid;
    width: 24px;
    height: 24px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--color-border-strong);
    border-radius: 50%;
    color: transparent;
}

.pickup-schedule-check {
    cursor: pointer;
}

.pickup-now-option.is-selected {
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
}

.pickup-schedule-option {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    min-height: 84px;
    padding: var(--space-2) var(--space-3);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-text);
    text-align: left;
}

.pickup-schedule-option > span:first-child {
    display: grid;
    gap: 2px;
}

.pickup-schedule-option strong {
    font-weight: var(--weight-semibold);
}

.pickup-schedule-option small {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    font-weight: var(--weight-regular);
}

.pickup-now-option:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.pickup-now-option.is-selected .pickup-choice-check,
.pickup-schedule-option.is-selected ~ .pickup-choice-check {
    border-color: var(--color-accent);
    background: var(--color-accent);
    color: var(--color-on-accent);
}

.pickup-time-schedule {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 24px;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    transition: border-color var(--transition), background var(--transition);
}

.pickup-time-schedule:has(.pickup-schedule-option.is-selected) {
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
}

.pickup-schedule-option.is-selected + .pickup-time-wheels + .pickup-choice-check {
    border-color: var(--color-accent);
    background: var(--color-accent);
    color: var(--color-on-accent);
}

.pickup-time-wheels {
    display: grid;
    grid-template-columns: 64px 18px 64px;
    align-items: center;
    justify-content: center;
    width: 146px;
    height: 44px;
    text-align: center;
}

.pickup-time-wheel {
    display: grid;
    align-items: center;
    height: 44px;
    overflow: hidden;
}

.pickup-time-wheel select {
    min-height: 32px;
    padding: 0;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    appearance: none;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    text-align: center;
}

.pickup-hour-toggle {
    width: 100%;
    min-height: 32px;
    padding: 0;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    cursor: ns-resize;
    touch-action: none;
    user-select: none;
}

.pickup-hour-toggle:active {
    background: var(--color-accent-soft);
}

.pickup-hour-value {
    display: none !important;
}

.menu-search {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.menu-search input {
    min-width: 0;
}

.menu-search .link-button {
    flex: 0 0 auto;
}

@media (max-width: 639px) {

    #catalogStep .eyebrow,
    #catalogStep .section-head p {
        display: none;
    }
}

#menuGrid {
    display: grid;
    gap: var(--space-6);
}

#menuGrid.menu-loading-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
}

.menu-category-section {
    min-width: 0;
}

.menu-category-section + .menu-category-section {
    position: relative;
    margin-top: calc(-1 * var(--space-2));
    padding-top: var(--space-5);
}

.menu-category-section + .menu-category-section::before {
    position: absolute;
    top: 0;
    right: calc(-1 * var(--gutter));
    left: calc(-1 * var(--gutter));
    height: 12px;
    border-block: 1px solid #ECECEC;
    background: #F3F3F3;
    content: "";
}

.menu-category-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-border);
    scroll-margin-top: calc(64px + env(safe-area-inset-top));
}

.menu-category-heading h2 {
    font-size: var(--text-xl);
    line-height: var(--leading-tight);
}

.menu-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.menu-skeleton {
    pointer-events: none;
}

.menu-skeleton-image,
.menu-skeleton-line,
.menu-skeleton-button {
    position: relative;
    overflow: hidden;
    background: #e8e8e8;
}

.menu-skeleton-image::after,
.menu-skeleton-line::after,
.menu-skeleton-button::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 20%, #fff 45%, #c9c9c9 52%, transparent 76%);
    content: "";
    transform: translateX(-100%);
    animation: menu-skeleton-shimmer 1.4s ease-in-out infinite;
}

.menu-skeleton-image {
    flex: none;
    width: 100%;
    aspect-ratio: 1.55 / 1;
}

.menu-skeleton-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-2);
}

.menu-skeleton-line {
    display: block;
    height: 14px;
    border-radius: var(--radius-pill);
}

.menu-skeleton-title {
    width: 78%;
    height: 18px;
}

.menu-skeleton-price {
    width: 42%;
}

.menu-skeleton-button {
    width: 100%;
    height: var(--tap);
    margin-top: auto;
    border-radius: var(--radius-sm);
}

@keyframes menu-skeleton-shimmer {
    to {
        transform: translateX(100%);
    }
}

.item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(112px, 31vw, 128px);
    grid-template-areas: "body art";
    column-gap: var(--space-3);
    align-items: stretch;
    min-width: 0;
    padding-block: var(--space-3) calc(42px + var(--space-2));
    border-bottom: 1px solid var(--color-border);
    transition: border-color var(--transition);
}

.item:has(.product-qty) {
    border-color: var(--color-accent);
}

.food-art {
    grid-area: art;
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--color-surface-muted);
}

.food-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.food-art span {
    display: none;
    position: absolute;
    bottom: var(--space-1);
    left: var(--space-1);
    padding: 2px var(--space-2);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-text-muted);
    font-size: 0.6875rem;
}

.item-body {
    grid-area: body;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    gap: var(--space-2);
    min-width: 0;
    padding: 0;
}

.item h3 {
    display: -webkit-box;
    overflow: hidden;
    font-size: var(--text-base);
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.item p {
    display: -webkit-box;
    overflow: hidden;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    line-height: 1.45;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.item .price {
    margin-top: auto;
    padding-top: var(--space-2);
}

.item-actions {
    grid-area: art;
    z-index: 1;
    align-self: end;
    width: calc(100% - var(--space-2));
    min-width: 0;
    transform: translateY(84%);
}

.item .add {
    width: 100%;
    min-height: 46px;
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    color: var(--color-accent-strong);
    font-weight: var(--weight-bold);
    box-shadow: none;
}

.item .variant-add {
    display: grid;
    justify-items: center;
    gap: 2px;
}

.variant-count {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
}

.item .product-qty {
    min-width: 0;
}

.item .qty button {
    width: var(--tap);
    height: var(--tap);
}

#menuGrid.menu-loading-grid .menu-skeleton {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

#menuGrid.menu-loading-grid .menu-skeleton-image {
    width: 100%;
    aspect-ratio: 1.55 / 1;
}

@media (min-width: 640px) {
    .menu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-4);
    }

    #menuGrid.menu-loading-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-4);
    }

    .item {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0;
        overflow: hidden;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-lg);
        background: var(--color-surface);
        box-shadow: var(--shadow-sm);
    }

    .food-art {
        order: 0;
        flex: none;
        width: auto;
        aspect-ratio: 16 / 10;
        border-radius: 0;
    }

    .food-art span {
        display: inline-block;
        bottom: var(--space-2);
        left: var(--space-2);
        font-size: 0.75rem;
    }

    .item-body {
        order: 1;
        gap: var(--space-1);
        padding: var(--space-4);
    }

    .item-actions {
        order: 2;
        width: auto;
        padding: 0 var(--space-4) var(--space-4);
        transform: none;
    }

    .menu-skeleton-body {
        gap: var(--space-3);
        padding: var(--space-4);
    }

    .item h3 {
        font-size: var(--text-base);
    }

    .item p {
        font-size: var(--text-sm);
        -webkit-line-clamp: 3;
    }

    .item .add {
        width: auto;
    }
}

@media (min-width: 960px) {
    .menu-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.price {
    font-size: var(--text-base);
    font-weight: var(--weight-bold);
}

.qty {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.qty button {
    display: grid;
    place-items: center;
    width: var(--tap);
    height: var(--tap);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    font-size: var(--text-lg);
    line-height: 1;
}

.qty button:hover {
    background: var(--color-surface-muted);
}

.qty b {
    min-width: 2ch;
    text-align: center;
}

.product-qty {
    justify-content: space-between;
    align-items: center;
    gap: 0;
    width: 100%;
    min-height: 46px;
    min-width: 120px;
    padding: 0 2px;
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-pill);
    background: var(--color-accent-soft);
}

.product-qty button {
    flex: 0 0 var(--tap);
    width: var(--tap);
    height: var(--tap);
    border: 0;
    border-radius: 50%;
    background: transparent;
}

.empty {
    padding: var(--space-6) var(--space-4);
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    text-align: center;
}

.category-empty {
    grid-column: 1 / -1;
    display: grid;
    justify-items: center;
    gap: var(--space-2);
}

.category-empty .button {
    margin-top: var(--space-2);
}

/* Floating cart bar */
.floating-cart {
    position: fixed;
    z-index: 100;
    left: 50%;
    bottom: max(var(--space-4), env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    width: min(720px, 100% - 2rem);
    padding: var(--space-3) var(--space-3) var(--space-3) var(--space-5);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
}

.floating-cart>div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.floating-cart strong {
    font-size: var(--text-base);
}

.floating-cart>div>span {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.floating-cart b {
    margin-left: var(--space-1);
    color: var(--color-text);
}

.floating-cart .button {
    flex-shrink: 0;
    white-space: nowrap;
}

.floating-cart {
    transition: transform 220ms ease, opacity 180ms ease, visibility 220ms;
}

.floating-cart.is-scroll-hidden {
    transform: translate(-50%, calc(100% + 24px));
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.floating-menu-button {
    position: fixed;
    z-index: 90;
    left: 50%;
    bottom: max(var(--space-4), env(safe-area-inset-bottom));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 40px;
    padding: 0 var(--space-4);
    transform: translateX(-50%);
    border: 0;
    border-radius: var(--radius-pill);
    background: #e5233d;
    color: #fff;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    box-shadow: var(--shadow-lg);
    transition: background-color var(--transition), transform var(--transition);
}

.floating-menu-button:hover {
    background: #ca1830;
}

.floating-menu-button:active {
    transform: translateX(-50%) scale(0.97);
}

.floating-menu-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.floating-menu-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.category-menu-dialog {
    position: fixed;
    inset: auto 0 calc(80px + env(safe-area-inset-bottom));
    width: min(620px, calc(100% - 2rem));
    max-width: none;
    max-height: min(72dvh, 640px);
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius-xl);
    background: transparent;
    color: var(--color-text);
}

.category-menu-dialog::backdrop {
    background: rgba(37, 37, 37, 0.42);
    backdrop-filter: blur(2px);
}

.category-menu-panel {
    display: flex;
    flex-direction: column;
    max-height: min(72dvh, 640px);
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
}

.category-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.category-menu-header h2 {
    font-size: var(--text-lg);
}

.category-menu-close {
    display: grid;
    place-items: center;
    flex: 0 0 var(--tap);
    width: var(--tap);
    height: var(--tap);
    border: 0;
    border-radius: 50%;
    background: var(--color-surface-muted);
    color: var(--color-text);
    font-size: var(--text-xl);
}

.category-menu-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.category-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    width: 100%;
    min-height: 64px;
    padding: var(--space-3) var(--space-5);
    border: 0;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    text-align: left;
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
}

.category-menu-item:hover,
.category-menu-item:focus-visible {
    background: var(--color-surface-muted);
}

.category-menu-done.button.primary {
    align-self: center;
    min-height: 44px;
    margin: var(--space-4) auto;
    padding-inline: var(--space-6);
    border-radius: var(--radius-pill);
    background: #e5233d;
    color: #fff;
}

.category-menu-done.button.primary:hover:not(:disabled) {
    background: #ca1830;
}

.has-floating .floating-menu-button {
    bottom: calc(94px + env(safe-area-inset-bottom));
}

body.cart-scroll-hidden .floating-menu-button {
    bottom: max(var(--space-4), env(safe-area-inset-bottom));
}

.has-floating main#menu {
    padding-bottom: 200px;
}

.has-floating .floating-cart.keyboard-open {
    display: none;
}

/* 10. Checkout
   ----------------------------------------------------------------------- */
.panel {
    min-width: 0;
    margin-bottom: var(--space-12);
    padding: var(--space-5);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

#checkout.panel {
    padding: var(--space-4) 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

body.in-checkout #checkout.panel {
    padding-bottom: calc(120px + env(safe-area-inset-bottom));
}

#checkout .cart-order-type-panel {
    display: grid;
    gap: 0;
    margin-bottom: var(--space-4);
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

#checkout .cart-order-type-panel .order-type-row {
    min-height: 34px;
    padding-block: var(--space-1);
    border: 1px solid var(--color-accent);
    border-radius: 9px;
    background: rgba(244, 180, 0, 0.08);
}

.cart-method-value {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: var(--weight-semibold);
}

.cart-method-value svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#checkout .cart-order-type-panel .order-detail-row {
    min-height: 68px;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: 0 6px 18px rgba(37, 37, 37, 0.08);
}

#checkout .checkout-layout {
    margin-top: 0;
}

.checkout-layout {
    display: grid;
    gap: var(--space-6);
    margin-top: var(--space-4);
}

.checkout-layout>* {
    min-width: 0;
}

.cart-summary {
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
}

#orderForm>h2,
#deliveryFields>h2,
#pickupFields>h2,
.cart-summary>h2 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-2);
}

body.in-order #checkout #orderForm > #deliveryFields {
    display: none !important;
}

#deliveryFields,
#pickupFields,
.pay-box,
#totals {
    margin-top: var(--space-6);
}

.checkout-layout #pickupFields {
    display: none !important;
    margin-top: 0;
}

.checkout-bottom-bar {
    display: none;
}

body.in-checkout .checkout-bottom-bar {
    position: fixed;
    z-index: 120;
    inset: auto 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    width: min(100%, var(--container));
    margin-inline: auto;
    padding: var(--space-3) var(--gutter) max(var(--space-3), env(safe-area-inset-bottom));
    border: 1px solid var(--color-border);
    border-bottom: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--color-surface);
    box-shadow: 0 -6px 24px rgba(37, 37, 37, 0.12);
}

.checkout-bottom-total {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.checkout-bottom-total span {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.checkout-bottom-total strong {
    font-size: var(--text-lg);
    line-height: 1.25;
}

.checkout-bottom-bar .submit {
    flex: 0 0 auto;
    width: auto;
    min-width: 160px;
    margin: 0;
}

.bottom-sheet-content #pickupFields {
    display: block !important;
}

@media (min-width: 900px) {
    .panel {
        padding: var(--space-8);
    }

    #checkout.panel {
        padding: var(--space-8);
    }

    .checkout-layout {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
        align-items: start;
    }

    .cart-summary {
        grid-column: 2;
        grid-row: 1;
        position: sticky;
        top: var(--space-6);
    }

    #orderForm {
        grid-column: 1;
        grid-row: 1;
    }
}

.cart-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border);
}

.cart-summary-header h2 {
    margin: 0;
    font-size: var(--text-base);
    white-space: nowrap;
}

.cart-summary-header h2 span {
    color: var(--color-text-muted);
    font-weight: var(--weight-medium);
}

.cart-add-item {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 2px var(--space-2);
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--color-accent);
    color: var(--color-on-accent);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    white-space: nowrap;
}

.cart-line {
    display: grid;
    gap: var(--space-2);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border);
}

.cart-line:last-child {
    border-bottom: 0;
}

.cart-line-heading,
.cart-line-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.cart-line-heading strong {
    min-width: 0;
    font-weight: var(--weight-medium);
}

.cart-edit-label {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 2px var(--space-2);
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--color-accent);
    color: var(--color-on-accent);
    cursor: pointer;
    font-size: var(--text-sm);
    font-family: inherit;
    font-weight: var(--weight-semibold);
    box-shadow: none;
}

.cart-edit-label:focus-visible {
    outline: none;
    background: var(--color-accent);
}

.cart-line-note {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: var(--space-2);
}

.cart-line-note svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--color-text-muted);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
}

.cart-line-note-text {
    min-width: 0;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    line-height: 1.4;
    text-align: left;
    overflow-wrap: anywhere;
}

.cart-note-sheet .bottom-sheet-panel {
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: min(52dvh, 520px);
    max-height: min(78dvh, 680px);
}

.cart-note-item-name {
    margin-top: var(--space-1);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.cart-note-content {
    display: grid;
    grid-template-rows: auto minmax(150px, 1fr);
    gap: var(--space-2);
}

.cart-note-content label {
    margin: 0;
}

.cart-note-content textarea {
    height: 100%;
    min-height: 150px;
    resize: none;
}

.cart-note-sheet .bottom-sheet-actions {
    padding-bottom: var(--space-3);
    border-top: 0;
}

.cart-note-sheet.is-typing .bottom-sheet-actions {
    display: none;
}

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

.cart-line-variants {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    line-height: 1.4;
}

.menu-variant-sheet .bottom-sheet-panel {
    grid-template-rows: auto minmax(0, 1fr) auto;
    max-height: min(92dvh, 860px);
}

.menu-variant-content {
    padding: 0;
}

.menu-variant-summary {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

.menu-variant-summary img {
    width: 76px;
    height: 76px;
    border-radius: var(--radius-md);
    background: var(--color-surface-muted);
    object-fit: cover;
}

.menu-variant-summary-copy {
    display: grid;
    gap: var(--space-1);
    min-width: 0;
}

.menu-variant-summary-copy h3 {
    font-size: var(--text-base);
    line-height: 1.3;
}

.menu-variant-summary-copy p {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.menu-variant-summary-copy strong {
    color: var(--color-accent-strong);
    font-size: var(--text-lg);
}

.menu-variant-quantity {
    gap: var(--space-2);
}

.menu-variant-quantity button {
    width: 34px;
    height: 34px;
}

.menu-variant-group {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.menu-variant-group legend {
    width: 100%;
    padding: var(--space-2) var(--space-4);
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.menu-variant-group legend span {
    color: var(--color-text-muted);
}

.menu-variant-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    min-height: 64px;
    margin: 0;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
}

.menu-variant-option>span {
    display: grid;
    gap: 2px;
}

.menu-variant-option small {
    color: var(--color-text-muted);
}

.menu-variant-option input {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: var(--color-accent-strong);
}

.menu-variant-note-label {
    display: block;
    margin: var(--space-4) var(--space-4) var(--space-2);
}

#menuVariantNote {
    display: block;
    width: calc(100% - 2 * var(--space-4));
    min-height: 84px;
    margin: 0 var(--space-4) var(--space-4);
}

.menu-variant-actions {
    position: sticky;
    bottom: 0;
    padding-bottom: var(--space-3);
    box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.06);
}

.menu-variant-actions .button:disabled {
    background: var(--color-border);
    color: var(--color-text-muted);
    box-shadow: none;
}

.cart-line .qty {
    gap: var(--space-4);
}

.cart-line .qty button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

@media (max-width: 380px) {
    .cart-summary-header {
        gap: var(--space-2);
    }

    .cart-summary-header h2 {
        font-size: var(--text-sm);
    }

    .cart-add-item {
        padding-inline: var(--space-2);
        font-size: var(--text-xs);
    }
}

.remove-item {
    min-height: var(--tap);
    padding: var(--space-2);
    border: 0;
    background: none;
    color: var(--color-danger);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    white-space: nowrap;
}

.location-button {
    margin-top: var(--space-3);
    font-size: var(--text-sm);
}

#deliveryMap {
    z-index: 0;
    width: 100%;
    height: 280px;
    margin-top: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-muted);
}

#gpsStatus:not(:empty),
#mapStatus:not(:empty) {
    margin-top: var(--space-2);
}

.route-status {
    margin: var(--space-3) 0;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--color-info-bg);
    color: var(--color-text);
    font-size: var(--text-sm);
    overflow-wrap: anywhere;
}

.route-status[data-state="loading"] {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.route-status[data-state="ready"] {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.route-status[data-state="error"],
.route-status[data-state="outside"] {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.pay-box {
    padding: var(--space-4);
    border: 1px solid #F3E2AE;
    border-radius: var(--radius-md);
    background: var(--color-accent-soft);
    font-size: var(--text-sm);
}

.pay-box strong {
    display: block;
    margin-bottom: var(--space-1);
    font-size: var(--text-base);
}

.total-row {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-2) 0;
    font-size: var(--text-sm);
}

.total-row.grand {
    margin-top: var(--space-2);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
    font-size: var(--text-lg);
}

#totals .notice {
    margin-top: var(--space-2);
}

.submit+.notice {
    margin-top: var(--space-3);
}

/* 11. Order guide
   ----------------------------------------------------------------------- */
.order-guide {
    padding-block: var(--space-12);
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}

.order-guide-content {
    max-width: 600px;
    margin-inline: auto;
}

.order-guide h2 {
    margin-bottom: var(--space-6);
}

.order-guide-list {
    display: grid;
    gap: var(--space-5);
    list-style: none;
}

.order-guide-list li {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: start;
    gap: var(--space-4);
}

.order-guide-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--color-accent-soft);
    color: var(--color-accent-strong);
}

.order-guide-icon svg {
    width: 26px;
    height: 26px;
}

.order-guide-list h3 {
    margin-bottom: var(--space-1);
    font-size: var(--text-base);
}

.order-guide-list p {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

/* 12. Footer
   ----------------------------------------------------------------------- */
.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
}

.has-floating .site-footer {
    padding-bottom: 120px;
}

.footer-main {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-8);
    padding-block: var(--space-10) var(--space-6);
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    line-height: 1.3;
}

.footer-logo strong {
    font-size: var(--text-lg);
}

.footer-identity p {
    margin-top: var(--space-3);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.footer-location {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    color: var(--color-accent-strong);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer-contact h2 {
    font-size: var(--text-base);
    margin-bottom: var(--space-1);
}

.footer-contact p {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.footer-contact-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--control-height);
    margin-top: var(--space-3);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    background: var(--color-accent);
    color: var(--color-on-accent);
    font-weight: var(--weight-semibold);
    transition: background-color var(--transition);
}

.footer-contact-button:hover {
    background: var(--color-accent-hover);
}

.footer-contact-button svg {
    width: 22px;
    height: 22px;
}

.footer-copyright {
    padding-block: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

/* 13. Utilities
   ----------------------------------------------------------------------- */
.hidden {
    display: none !important;
}

.sr-only,
.skip-link:not(:focus) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link:focus {
    position: fixed;
    z-index: 1000;
    top: var(--space-2);
    left: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-md);
}

/* 14. Small screens & motion
   ----------------------------------------------------------------------- */
@media (max-width: 400px) {
    .has-floating .floating-menu-button {
        bottom: calc(94px + env(safe-area-inset-bottom));
    }

    .cart-scroll-hidden .floating-menu-button {
        bottom: max(var(--space-4), env(safe-area-inset-bottom));
    }

    #methodStepSlot .method-step {
        padding: var(--space-6) var(--space-4);
    }

    #methodDialog {
        padding: var(--space-6) var(--space-4);
    }

    .method-cards {
        gap: var(--space-2);
    }

    .method-card {
        padding: var(--space-4) var(--space-2);
    }

    .method-actions {
        flex-direction: column-reverse;
    }

    .floating-cart {
        gap: var(--space-2);
        padding-left: var(--space-4);
    }

    .floating-cart .button {
        padding-inline: var(--space-4);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dialog sukses pesanan */
.success-dialog {
    width: min(92vw, 440px);
    max-width: 440px;
    max-height: 85dvh;
    padding: 0;
    border: 0;
    border-radius: 24px;
    background: #fff;
    color: #26332b;
    overflow: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
}

.success-dialog::backdrop {
    background: rgba(24, 32, 26, 0.58);
    backdrop-filter: blur(3px);
}

.success-content {
    padding: 28px 22px 22px;
    text-align: center;
}

.success-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #e7f6dc;
    color: #39752c;
    font-size: 32px;
    font-weight: 800;
}

.success-content h2 {
    margin: 0 0 8px;
    font-size: 1.45rem;
}

.success-content>p {
    margin: 0 0 20px;
    color: #687168;
    line-height: 1.5;
}

.success-summary,
.success-details {
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid #eee8dc;
    border-radius: 14px;
    background: #faf8f3;
    text-align: left;
}

.success-summary p,
.success-details p {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0;
}

.success-summary .success-total {
    padding-top: 10px;
    border-top: 1px solid #e6dfd2;
    font-weight: 800;
}

.success-dialog .button {
    width: 100%;
    margin-bottom: 10px;
}

.success-dialog #closeSuccessDialog {
    display: block;
    margin: 8px auto 0;
    padding: 10px 18px;
}

.success-details h3 {
    margin-top: 0;
    font-size: 1rem;
}

.success-item {
    padding: 8px 0;
    border-bottom: 1px solid #eee8dc;
}

.success-item:last-child {
    border-bottom: 0;
}

@media (prefers-reduced-motion: no-preference) {
    .success-dialog[open] {
        animation: success-dialog-in 180ms ease-out;
    }

    @keyframes success-dialog-in {
        from {
            opacity: 0;
            transform: translateY(10px) scale(0.98);
        }

        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
}

/* Status and digital receipt pages */
.order-page-nav {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
}

.order-page-shell {
    width: min(100% - 2 * var(--gutter), 680px);
    margin: calc(56px + env(safe-area-inset-top) + var(--space-6)) auto var(--space-16);
}

.order-back-link {
    display: inline-flex;
    min-height: var(--tap);
    align-items: center;
    margin-bottom: var(--space-4);
    color: var(--color-info);
    font-weight: var(--weight-semibold);
}

.order-page-shell > h1 {
    margin-bottom: var(--space-2);
    font-size: var(--text-2xl);
    line-height: var(--leading-tight);
}

.order-page-intro {
    margin-bottom: var(--space-6);
    color: var(--color-text-muted);
}

.order-loading,
.order-error,
.order-confirmation-status,
.order-card {
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background: var(--color-surface);
    box-shadow: var(--shadow-md);
}

.order-loading,
.order-error,
.order-confirmation-status {
    margin-bottom: var(--space-4);
    padding: var(--space-4);
}

.order-confirmation-status {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    align-items: start;
    gap: 0 var(--space-3);
    border-color: #ead9a6;
    background: linear-gradient(135deg, #fff9e8, var(--color-warning-bg));
}

.order-card + .order-confirmation-status {
    margin-top: var(--space-3);
}

.order-confirmation-status::before {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--color-accent);
    box-shadow: 0 0 0 4px rgba(244, 180, 0, 0.18);
}

.order-confirmation-status h2 {
    grid-column: 2;
    display: block;
    margin-bottom: 2px;
    color: var(--color-warning);
    font-size: var(--text-base);
    line-height: var(--leading-tight);
}

.order-confirmation-status p {
    grid-column: 2;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    line-height: 1.5;
}

.order-error {
    border-color: #e8b8b4;
    background: var(--color-danger-bg);
}

.order-error p {
    margin-bottom: var(--space-3);
    color: var(--color-danger);
}

.order-card {
    padding: clamp(var(--space-4), 4vw, var(--space-6));
}

.order-identity {
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

.order-eyebrow {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.order-number {
    margin-top: var(--space-1);
    font-size: clamp(var(--text-lg), 4vw, var(--text-xl));
    font-weight: var(--weight-bold);
    letter-spacing: 0.02em;
    overflow-wrap: anywhere;
}

.order-datetime {
    margin-top: var(--space-1);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.order-facts {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--color-border);
}

.order-fact dt {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.order-fact dd {
    margin: 0;
    font-weight: var(--weight-medium);
    white-space: pre-wrap;
}

.order-section-heading {
    margin: var(--space-4) 0 var(--space-2);
    font-size: var(--text-base);
}

.order-items {
    list-style: none;
    border-top: 1px solid var(--color-border);
}

.order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--color-border);
}

.order-item-description {
    display: grid;
    min-width: 0;
    gap: var(--space-1);
}

.order-item-name {
    overflow-wrap: anywhere;
}

.order-item-unit {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.order-item-variants,
.order-item-note {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    line-height: 1.4;
}

.order-item-total {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.order-totals {
    display: grid;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    background: var(--color-surface-muted);
}

.order-total-row {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
}

.order-total-row dt {
    color: var(--color-text-muted);
}

.order-total-row dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.order-grand-total {
    margin-top: var(--space-2);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border-strong);
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
}

.order-grand-total dt,
.order-grand-total dd {
    color: var(--color-text);
}

.order-receipt-link {
    min-height: 0;
    display: block;
    margin: var(--space-1) auto 0;
    padding: 2px var(--space-3);
    border: 0;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
    text-align: center;
    text-decoration: none;
    transition: background-color var(--transition);
}

.order-receipt-link:hover {
    color: var(--color-text);
    background: var(--color-surface-muted);
}

.order-notes {
    margin-top: var(--space-4);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--color-surface-muted);
}

.order-notes p {
    white-space: pre-wrap;
}

.order-actions {
    display: grid;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.order-actions .button {
    width: 100%;
    min-height: 52px;
    border-radius: var(--radius-md);
    font-weight: var(--weight-semibold);
    text-align: center;
}

.order-action-feedback {
    margin-top: var(--space-2);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.receipt-image-preview {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: #fffdf8;
}

.receipt-sheet .bottom-sheet-panel {
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.receipt-sheet-content {
    display: grid;
    align-content: start;
    justify-items: center;
    gap: var(--space-3);
}

.receipt-sheet .receipt-image-preview {
    width: min(100%, 520px);
    max-height: 52dvh;
    object-fit: contain;
}

.receipt-sheet .bottom-sheet-actions .button {
    display: block;
    text-align: center;
}

@media (min-width: 560px) {
    .order-card {
        padding: var(--space-6);
    }

    .order-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .order-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media print {
    body {
        min-height: auto;
        background: #fff;
        color: #000;
        font-size: 11pt;
    }

    .order-page-shell {
        width: 100%;
        max-width: 720px;
        margin: 20px auto;
    }

    .order-back-link,
    .order-actions,
    .order-action-feedback,
    .order-page-nav,
    #orderLoading,
    #orderError {
        display: none !important;
    }

    #orderContent {
        display: block !important;
    }

    .order-card,
    .order-confirmation-status {
        border-color: #aaa;
        box-shadow: none;
        break-inside: avoid;
    }

    .order-item,
    .order-total-row {
        break-inside: avoid;
    }
}
