/* Kika Coffee - "Botanical Elegance" design system, mobile-first */

:root {
    --color-bg: #fbf9f5;
    --color-surface: #ffffff;
    --color-surface-alt: #f5f3ef;
    --color-surface-high: #eae8e4;
    --color-text: #1b1c1a;
    --color-text-muted: #534341;
    --color-border: rgba(134, 115, 112, 0.25);

    --color-accent: #8f4b41;
    --color-accent-dark: #632821;
    --color-accent-container: #e28f83;
    --color-on-accent: #ffffff;

    --color-secondary: #53624f;
    --color-secondary-container: #d4e5cc;
    --color-on-secondary-container: #586753;

    --color-danger: #ba1a1a;
    --color-danger-container: #ffdad6;
    --color-on-danger-container: #93000a;
    --color-success: #53624f;

    --radius: 1rem;
    --radius-sm: 0.75rem;
    --radius-lg: 1.5rem;
    --radius-pill: 9999px;
    --max-width: 480px;

    --font-heading: 'Libre Caslon Text', Georgia, serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 15px;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-text);
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    display: inline-block;
    line-height: 1;
    vertical-align: middle;
}

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

.site-header,
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1rem;
    position: sticky;
    top: 0.6rem;
    margin: 0 0.6rem 0;
    border-radius: var(--radius-lg);
    background: rgba(248, 227, 225, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 12px 28px rgba(143, 75, 65, 0.16);
    z-index: 10;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 1.25rem;
    color: var(--color-accent);
    text-decoration: none;
    letter-spacing: 0.01em;
}

.brand-logo {
    width: 1.75rem;
    height: 1.75rem;
    object-fit: contain;
    flex: none;
}

.site-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.8rem;
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--color-text-muted);
    cursor: pointer;
}

.inline-form {
    display: inline;
}

.site-main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1rem 6rem;
}

/* wider content (admin/kasir tables) can opt out of the narrow max-width */
.site-main.wide {
    max-width: 900px;
}

/* ---------- Category sections (legacy admin use) ---------- */

.category-section {
    margin-bottom: 2rem;
}

.category-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 400;
    margin: 0 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--color-accent);
    display: inline-block;
}

/* ---------- Buttons (pill-shaped) ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: none;
    border-radius: var(--radius-pill);
    padding: 0.6rem 1.1rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    width: 100%;
    transition: transform 0.15s ease;
}

.btn:active {
    transform: scale(0.97);
}

.btn-accent {
    background: var(--color-accent);
    color: var(--color-on-accent);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.btn-accent-outline {
    background: transparent;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}

.btn-sm {
    padding: 0.4rem 0.7rem;
    font-size: 0.78rem;
    width: auto;
}

.btn-block {
    width: 100%;
}

/* ---------- Qty stepper ---------- */

.qty-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.qty-stepper button {
    background: var(--color-surface-alt);
    border: none;
    padding: 0.4rem 0.75rem;
    font-size: 1rem;
    cursor: pointer;
}

.qty-stepper input {
    border: none;
    width: 2.2rem;
    text-align: center;
    font-size: 0.85rem;
    background: transparent;
}

/* ---------- Forms ---------- */

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: var(--font-body);
    background: var(--color-surface);
    color: var(--color-text);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-secondary);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kasir-nav {
    display: flex;
    gap: 0.5rem;
}

.kasir-nav .btn {
    flex: 1;
    width: auto;
    white-space: nowrap;
    border-radius: var(--radius-sm);
}

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-right: 2.6rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.4rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    background: none;
    color: var(--color-text-muted, var(--color-text));
    cursor: pointer;
    padding: 0;
}

.password-toggle .material-symbols-outlined {
    font-size: 20px;
}

.field-validation-error, .validation-summary-errors {
    color: var(--color-danger);
    font-size: 0.78rem;
}

/* ---------- Cards / lists (admin & kasir) ---------- */

.card-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.item-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.85rem;
}

.item-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.item-card-title {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 1.05rem;
}

.badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-pill);
}

.badge-baru { background: var(--color-danger-container); color: var(--color-on-danger-container); }
.badge-diproses { background: var(--color-accent-container); color: var(--color-accent-dark); }
.badge-selesai { background: var(--color-secondary-container); color: var(--color-on-secondary-container); }

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.stat-tile {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--color-accent-dark);
    margin-top: 0.15rem;
}

.mini-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 120px;
    padding-top: 0.5rem;
}

.mini-chart-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.mini-chart-fill {
    width: 100%;
    background: var(--color-accent-container);
    border-radius: 4px 4px 0 0;
}

.mini-chart-label {
    font-size: 0.62rem;
    color: var(--color-text-muted);
    margin-top: 0.3rem;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
}

.tabs .tab {
    flex: none;
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-pill);
    background: var(--color-surface-high);
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.tabs .tab.active {
    background: var(--color-accent);
    color: var(--color-on-accent);
}

.item-card-lines {
    display: grid;
    grid-template-columns: 1fr auto auto;
    column-gap: 0.6rem;
    row-gap: 0.2rem;
    font-size: 0.85rem;
    margin: 0.4rem 0;
    padding-left: 0;
    list-style: none;
}

/* li becomes a transparent grouping element so its children line up as
   columns in the parent grid, keeping Qty/Harga aligned across every item. */
.item-card-lines li {
    display: contents;
}

.item-line-qty {
    color: var(--color-text-muted);
    text-align: right;
}

.item-line-price {
    text-align: right;
    font-weight: 600;
}

.item-line-note {
    grid-column: 1 / -1;
    font-size: 0.76rem;
    font-style: italic;
    color: var(--color-text-muted);
    padding-left: 0.75rem;
    border-left: 2px solid var(--color-border);
    margin-bottom: 0.3rem;
}

/* ---------- Cart line with thumbnail (checkout page) ---------- */

.cart-line {
    display: flex;
    gap: 0.7rem;
}

.cart-line-thumb {
    width: 3.6rem;
    height: 3.6rem;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--color-surface-high);
    flex-shrink: 0;
}

.cart-line-thumb.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 1.3rem;
}

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

.item-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.85rem;
    flex-wrap: wrap;
    align-items: center;
}

.item-card-actions .btn {
    width: auto;
    flex: 1;
}

/* use when actions should stay their natural width instead of stretching evenly */
.item-card-actions.compact .btn {
    flex: none;
}

/* Kasir "confirm payment" row: dropdown and button should look like one
   balanced control pair, not a tiny select next to a stretched-out button. */
.payment-confirm-row .form-control {
    flex: 1;
    width: auto;
    padding: 0.4rem 0.7rem;
    font-size: 0.78rem;
}

.payment-confirm-row .btn {
    flex: 1;
}

.category-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.category-row .item-card-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-row-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
    margin-left: auto;
}

.icon-btn {
    padding: 0.35rem;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.category-row-form {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.form-group-inline {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.form-group-inline .form-label {
    font-size: 0.72rem;
    margin-bottom: 0.2rem;
}

/* ---------- Login ---------- */

.auth-box {
    max-width: 360px;
    margin: 3rem auto;
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
}

.auth-box h1 {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 1.4rem;
    margin-top: 0;
    color: var(--color-accent);
}

/* ---------- Status page ---------- */

.status-hero {
    text-align: center;
    padding: 1.5rem 0 1rem;
}

.status-icon {
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    background: var(--color-accent-container);
    color: var(--color-on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-icon .material-symbols-outlined {
    font-size: 2.2rem;
}

.status-icon.cancelled {
    background: var(--color-danger-container);
    color: var(--color-on-danger-container);
}

.status-code {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    color: var(--color-text);
}

.status-label {
    display: inline-block;
    margin-top: 0.4rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-accent-dark);
}

.status-label.cancelled {
    color: var(--color-danger);
}

.status-message {
    margin-top: 0.4rem;
    font-size: 0.85rem;
}

.status-time {
    font-size: 0.75rem;
    margin-top: 0.15rem;
}

.status-timeline {
    margin: 1.5rem 0;
    padding-left: 0.5rem;
}

.timeline-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1.5rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 24px;
    bottom: -4px;
    width: 2px;
    background: var(--color-border);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-item.done::before {
    background: var(--color-accent);
}

.timeline-marker {
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    background: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.timeline-marker .material-symbols-outlined {
    font-size: 16px;
    color: var(--color-on-accent);
}

.timeline-item.done .timeline-marker {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.timeline-item.active .timeline-marker {
    border-color: var(--color-accent);
    background: var(--color-accent-container);
}

.timeline-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.timeline-item.done .timeline-label,
.timeline-item.active .timeline-label {
    color: var(--color-text);
    font-weight: 700;
}

.empty-state {
    text-align: center;
    color: var(--color-text-muted);
    padding: 2rem 1rem;
}

.text-muted {
    color: var(--color-text-muted);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* ---------- Toast ---------- */

.toast-container {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: calc(100% - 2rem);
    max-width: var(--max-width);
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: 0.7rem 1.1rem;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 4px 14px rgba(27, 28, 26, 0.18);
    animation: toast-in 0.25s ease-out, toast-out 0.3s ease-in 3.2s forwards;
}

.toast-success { background: var(--color-secondary); }
.toast-error { background: var(--color-danger); }
.toast-info { background: var(--color-text); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
    from { opacity: 1; }
    to { opacity: 0; visibility: hidden; }
}

/* ---------- Confirm modal ---------- */

.confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(27, 28, 26, 0.45);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.confirm-overlay.open {
    display: flex;
}

.confirm-box {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 8px 24px rgba(27, 28, 26, 0.2);
}

.confirm-box p {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--color-text);
}

.confirm-box .confirm-actions {
    display: flex;
    gap: 0.6rem;
}

.confirm-box .confirm-actions .btn {
    width: auto;
    flex: 1;
}

/* =====================================================================
   Home page - "Botanical Elegance" customer-facing layout
   ===================================================================== */

.app-header {
    height: 4rem;
    padding: 0 1.1rem;
}

.app-header .brand {
    font-size: 1.3rem;
}

.app-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.app-header-actions a,
.app-header-actions .link-button,
.site-nav a,
.site-nav .link-button {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--color-text-muted);
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    border: 1px solid transparent;
    background: none;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.app-header-actions a:hover,
.app-header-actions a:focus-visible,
.app-header-actions .link-button:hover,
.app-header-actions .link-button:focus-visible,
.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav .link-button:hover,
.site-nav .link-button:focus-visible {
    background: var(--color-surface-alt);
    color: var(--color-accent);
}

.app-header-actions a:active,
.app-header-actions .link-button:active,
.site-nav a:active,
.site-nav .link-button:active {
    background: var(--color-surface-high);
}

.app-footer {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-surface-high);
}

.app-footer-staff-link {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-decoration: none;
    opacity: 0.7;
    padding: 0.4rem 0.8rem;
}

.app-footer-staff-link:hover,
.app-footer-staff-link:focus-visible {
    opacity: 1;
    color: var(--color-accent);
}

.app-main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.25rem 1.1rem 7rem;
}

.app-main.wide-page {
    max-width: 900px;
}

/* ---------- Hero banner ---------- */

.hero-banner {
    position: relative;
    height: 12rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.75rem;
    background-color: var(--color-accent-dark);
}

.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.hero-slide.active {
    opacity: 1;
}

.hero-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(27, 28, 26, 0.65) 0%, rgba(27, 28, 26, 0) 65%);
}

.hero-banner-content {
    position: absolute;
    left: 1.5rem;
    right: 1.5rem;
    bottom: 1.1rem;
    color: #fff;
}

.hero-dots {
    position: absolute;
    bottom: 0.6rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    z-index: 5;
}

.hero-dot {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    padding: 0;
    cursor: pointer;
}

.hero-dot.active {
    background: #fff;
    width: 1.1rem;
    border-radius: var(--radius-pill);
}

.hero-banner-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0 0 0.25rem;
}

.hero-banner-subtitle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

/* ---------- Store info strip ---------- */

.store-info-strip {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: var(--color-secondary-container);
    color: var(--color-on-secondary-container);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.9rem;
    font-size: 0.78rem;
    line-height: 1.4;
    margin-bottom: 1.5rem;
}

.store-info-strip .material-symbols-outlined {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

/* ---------- Category pills ---------- */

.category-pills {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    margin: 0 -1.1rem 1.5rem;
    padding: 0 1.1rem;
    scrollbar-width: none;
}

.category-pills::-webkit-scrollbar {
    display: none;
}

.pill {
    flex: none;
    border: none;
    background: var(--color-surface-high);
    color: var(--color-text-muted);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.55rem 1.2rem;
    border-radius: var(--radius-pill);
    cursor: pointer;
    white-space: nowrap;
}

.pill.active {
    background: var(--color-accent-container);
    color: var(--color-accent-dark);
}

/* ---------- Menu list (horizontal cards) ---------- */

.menu-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.menu-list-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 0.9rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    box-shadow: 0 10px 24px rgba(143, 75, 65, 0.06);
}

.menu-list-card.unavailable {
    opacity: 0.55;
}

.menu-list-thumb-wrap {
    position: relative;
    flex: none;
}

.menu-list-thumb {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--color-surface-high);
    display: block;
}

.menu-list-thumb.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 1.6rem;
}

.menu-list-tag {
    position: absolute;
    top: 0.3rem;
    left: 0.3rem;
    background: var(--color-secondary-container);
    color: var(--color-on-secondary-container);
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.1rem 0.5rem;
    border-radius: var(--radius-pill);
}

.menu-list-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.menu-list-name {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 1.05rem;
    color: var(--color-accent);
    margin: 0;
}

.menu-list-desc {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    line-height: 1.35;
    margin: 0;
}

.menu-list-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.3rem;
}

.menu-list-price {
    font-family: var(--font-heading);
    color: var(--color-accent);
    font-weight: 400;
    font-size: 1rem;
}

.menu-list-status {
    font-size: 0.72rem;
    color: var(--color-danger);
    font-weight: 600;
}

.add-btn {
    width: 2.5rem;
    height: 2.5rem;
    flex: none;
    border-radius: 50%;
    border: none;
    background: var(--color-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(143, 75, 65, 0.25);
}

.add-btn:active {
    transform: scale(0.9);
}

.switch {
    display: inline-flex;
    position: relative;
    cursor: pointer;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.switch-track {
    width: 2.6rem;
    height: 1.5rem;
    border-radius: var(--radius-pill);
    background: var(--color-border);
    transition: background 0.15s ease;
    display: inline-flex;
    align-items: center;
    padding: 0 2px;
}

.switch-thumb {
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease;
}

.switch input:checked + .switch-track {
    background: var(--color-secondary);
}

.switch input:checked + .switch-track .switch-thumb {
    transform: translateX(1.1rem);
}

.switch input:focus-visible + .switch-track {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.segmented-control {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.segmented-control .segmented-option {
    flex: 1 1 45%;
}

.segmented-option {
    flex: 1;
    position: relative;
}

.segmented-option input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.segmented-option span {
    display: block;
    text-align: center;
    padding: 0.6rem 0.5rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.segmented-option input:checked + span {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-on-accent);
}

.segmented-option input:focus-visible + span {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(27, 28, 26, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 150;
}

.sheet-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

body.sheet-open {
    overflow: hidden;
}

.bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0 auto;
    max-width: var(--max-width);
    background: var(--color-surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 0.6rem 1.25rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.25s ease;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15);
    z-index: 151;
}

.bottom-sheet.open {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 2.5rem;
    height: 4px;
    border-radius: var(--radius-pill);
    background: var(--color-border);
    margin: 0 auto 0.75rem;
}

.bottom-sheet .qty-stepper {
    width: 8rem;
}

.bottom-sheet input[type="text"] {
    font-size: 0.78rem;
    padding: 0.45rem 0.7rem;
}

.bottom-sheet-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.bottom-sheet-actions .btn {
    width: auto;
    flex: 1;
}

/* ---------- Floating cart bar (glass) ---------- */

.cart-bar {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2.2rem);
    max-width: calc(var(--max-width) - 1.1rem);
    background: rgba(251, 249, 245, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(143, 75, 65, 0.12);
    color: var(--color-text);
    padding: 0.8rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--radius-lg);
    text-decoration: none;
    gap: 1rem;
    box-shadow: 0 8px 24px rgba(27, 28, 26, 0.12);
    z-index: 30;
}

.cart-bar .cart-bar-left {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.cart-bar .cart-qty {
    background: var(--color-accent);
    color: #fff;
    border-radius: 999px;
    min-width: 1.3rem;
    height: 1.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

.cart-bar .cart-bar-label {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
}

.cart-bar .cart-bar-sub {
    font-size: 0.72rem;
    color: var(--color-text-muted);
}

.cart-bar .cart-total {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 1.05rem;
    color: var(--color-accent);
}

/* ---------- Bottom navigation ---------- */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom));
    background: var(--color-surface-alt);
    box-shadow: 0 -4px 16px rgba(143, 75, 65, 0.06);
    border-radius: var(--radius) var(--radius) 0 0;
    z-index: 30;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    text-decoration: none;
    color: var(--color-text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.3rem 1rem;
    border-radius: var(--radius-pill);
}

.bottom-nav-item.active {
    background: var(--color-accent-container);
    color: var(--color-accent-dark);
}

/* =====================================================================
   Cart / Checkout page
   ===================================================================== */

.cart-page-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 4rem;
    position: sticky;
    top: 0;
    background: var(--color-bg);
    box-shadow: 0 2px 8px rgba(27, 28, 26, 0.04);
    z-index: 10;
}

.cart-page-header .back-btn {
    position: absolute;
    left: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
    text-decoration: none;
}

.cart-page-title {
    text-align: center;
    margin: 1.75rem 0 2rem;
}

.cart-page-title .eyebrow {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent-container);
    margin-bottom: 0.4rem;
}

.cart-page-title h1 {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 1.6rem;
    margin: 0;
}

.cart-page-title .divider {
    width: 3rem;
    height: 2px;
    background: var(--color-accent-container);
    border-radius: var(--radius-pill);
    margin: 1rem auto 0;
}

.cart-item-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1.1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    box-shadow: 0 12px 28px rgba(143, 75, 65, 0.07);
    position: relative;
}

.cart-item-photo {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--color-surface-high);
    flex-shrink: 0;
}

.cart-item-photo.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 1.5rem;
}

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

.cart-item-name {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 1.05rem;
    color: var(--color-accent);
    margin: 0 0 0.2rem;
}

.cart-item-note {
    font-size: 0.78rem;
    font-style: italic;
    color: var(--color-text-muted);
    margin: 0 0 0.6rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.cart-item-price {
    font-family: var(--font-heading);
    color: var(--color-accent);
    font-weight: 400;
    font-size: 0.95rem;
}

.cart-item-remove {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.cart-item-remove:hover {
    color: var(--color-danger);
}

.cart-suggest {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 1.6rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.summary-card {
    background: var(--color-surface);
    border: 1px solid var(--color-surface-high);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 12px 28px rgba(143, 75, 65, 0.07);
    margin-top: 1.5rem;
}

.summary-card h2 {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 1.2rem;
    margin: 0 0 1rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    color: var(--color-text-muted);
    margin-bottom: 0.6rem;
}

.summary-divider {
    height: 1px;
    background: var(--color-surface-high);
    margin: 0.9rem 0;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.summary-total span:first-child {
    font-family: var(--font-heading);
    font-size: 1.1rem;
}

.summary-total .amount {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--color-accent);
}

/* =====================================================================
   Admin quick-menu
   ===================================================================== */

.quick-menu-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin: 1.1rem 0 0.5rem;
}

.quick-menu-label:first-child {
    margin-top: 0;
}

.quick-menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

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

.quick-menu-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.1rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--color-text);
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(143, 75, 65, 0.06);
}

.quick-menu-card .material-symbols-outlined {
    font-size: 28px;
    color: var(--color-accent);
}

/* ---------- QR code print card ---------- */

.qrcode-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 380px;
    margin: 0 auto 2rem;
}

.qrcode-card {
    text-align: center;
    background: var(--color-surface);
    border: 2px solid var(--color-accent);
    border-radius: var(--radius-lg);
    padding: 1.1rem 0.85rem 0.85rem;
    box-shadow: 0 16px 40px rgba(143, 75, 65, 0.14);
    position: relative;
    overflow: hidden;
}

.qrcode-card::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px solid var(--color-accent-container);
    border-radius: calc(var(--radius-lg) - 6px);
    pointer-events: none;
}

.qrcode-card-logo {
    width: 3rem;
    height: 3rem;
    object-fit: contain;
    margin: 0 auto 0.6rem;
}

.qrcode-card-store {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-accent-dark);
}

.qrcode-card-tagline {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin: 0.3rem 0 1.5rem;
}

.qrcode-card-frame {
    display: inline-block;
    padding: 0.6rem;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

.qrcode-card-image {
    width: 220px;
    height: 220px;
    display: block;
    image-rendering: pixelated;
}

.qrcode-card-cta {
    margin-top: 1.4rem;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--color-text);
}

.qrcode-card-url {
    margin-top: 0.35rem;
    font-size: 0.68rem;
    color: var(--color-text-muted);
    word-break: break-all;
}

.qrcode-card-meja {
    margin-top: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--color-text);
}

.qrcode-card-meja-line {
    display: inline-block;
    width: 4rem;
    border-bottom: 1px solid var(--color-text-muted);
}

.qrcode-card-footer {
    margin-top: 1.5rem;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--color-border);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-accent-container);
}

@media print {
    @page {
        margin: 0;
    }

    .no-print,
    .site-header,
    .bottom-nav,
    #toast-root {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .qrcode-grid {
        max-width: 9cm;
        grid-template-columns: 1fr;
        margin: 1.5cm auto;
    }

    .qrcode-card {
        box-shadow: none;
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ---------- Home menu empty state ---------- */

.menu-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--color-text-muted);
}

.menu-empty-state .material-symbols-outlined {
    font-size: 3rem;
    color: var(--color-accent-container);
}

.menu-empty-state h2 {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 1.2rem;
    color: var(--color-text);
    margin: 0.75rem 0 0.4rem;
}

.menu-empty-state p {
    font-size: 0.85rem;
    margin: 0;
    max-width: 22rem;
    margin-inline: auto;
}

/* ---------- FilePond theme overrides ---------- */

.filepond--root {
    font-family: var(--font-body);
    margin-bottom: 0.5rem;
}

.filepond--panel-root {
    background-color: var(--color-surface-alt);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-sm);
}

.filepond--drop-label {
    color: var(--color-text-muted);
    font-size: 0.78rem;
    min-height: 2.75rem;
}

.filepond--label-action {
    color: var(--color-accent);
    text-decoration-color: var(--color-accent);
}

.filepond--file-action-button {
    cursor: pointer;
}
