/* ZMenu customer app — fresh, colorful, fun, fast.
   Colors are CSS variables so the admin-configurable theme (issue #52) can
   override them at runtime without a rebuild. */

:root {
    --zm-primary: #ff5722;      /* company color */
    --zm-primary-dark: #e64a19;
    --zm-accent: #ffc107;       /* accent */
    --zm-accent-2: #4caf50;
    --zm-bg: #fff8f2;
    --zm-card: #ffffff;
    --zm-ink: #2d2a26;
    --zm-muted: #8d837a;
    --zm-radius: 16px;
}

html, body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--zm-bg);
    color: var(--zm-ink);
    margin: 0;
}

h1:focus { outline: none; }

.zm-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* top bar */
.zm-topbar {
    position: sticky; top: 0; z-index: 100;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.6rem 1rem;
    background: var(--zm-primary);
    box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.zm-brand {
    color: #fff; text-decoration: none; font-size: 1.4rem; font-weight: 800;
    letter-spacing: .5px; display: flex; align-items: center; gap: .4rem;
}
.zm-logo { font-size: 1.6rem; }
.zm-logo-img { height: 2.2rem; border-radius: 6px; }
.zm-bell {
    background: rgba(255,255,255,.15); border: none; border-radius: 50%;
    width: 2.6rem; height: 2.6rem; font-size: 1.2rem; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.zm-bell:hover { transform: scale(1.1); }

.zm-lang {
    background: rgba(255,255,255,.15); color: #fff; border: none; border-radius: 8px;
    padding: .35rem .4rem; font-weight: 700; cursor: pointer;
}
.zm-lang option { color: var(--zm-ink); }

.zm-avatar {
    background: rgba(255,255,255,.15); color: #fff; border: none; border-radius: 50%;
    width: 2.6rem; height: 2.6rem; font-size: 1.1rem; font-weight: 800; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.zm-avatar:hover { transform: scale(1.1); }

/* small account popover under the top bar */
.zm-account-pop {
    position: fixed; top: 3.9rem; right: .8rem; z-index: 200;
    background: var(--zm-card); border-radius: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.18);
    padding: .9rem 1.1rem; display: flex; flex-direction: column; gap: .6rem; min-width: 12rem;
}
.zm-account-name { font-weight: 700; }
.zm-account-link { color: var(--zm-primary); font-weight: 600; text-decoration: none; }
.zm-account-logout {
    border: 2px solid var(--zm-primary); background: #fff; color: var(--zm-primary);
    border-radius: 999px; padding: .55rem 1rem; font-weight: 700; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.zm-account-logout:hover { background: var(--zm-primary); color: #fff; }

/* transient feedback message (e.g. why the notification bell stayed muted) */
.zm-toast {
    position: fixed; top: 4rem; left: 50%; transform: translateX(-50%); z-index: 300;
    max-width: min(92vw, 30rem); background: var(--zm-ink); color: #fff;
    border-radius: 12px; padding: .7rem 1rem; font-size: .92rem; cursor: pointer;
    box-shadow: 0 6px 24px rgba(0,0,0,.25);
}

.zm-cart-button, .zm-orders-button {
    position: relative; font-size: 1.5rem; text-decoration: none;
    background: rgba(255,255,255,.15); border-radius: 50%;
    width: 2.6rem; height: 2.6rem; display: grid; place-items: center;
    transition: transform .15s;
}
.zm-cart-button:hover, .zm-orders-button:hover { transform: scale(1.1); }
.zm-cart-badge {
    position: absolute; top: -4px; right: -4px;
    background: var(--zm-accent); color: var(--zm-ink);
    font-size: .75rem; font-weight: 700;
    border-radius: 999px; padding: 0 .4rem; min-width: 1.2rem; text-align: center;
}

.zm-main { flex: 1; padding: 1rem; max-width: 860px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.zm-footer { text-align: center; color: var(--zm-muted); padding: 1.2rem; font-size: .9rem; }

/* hero + categories */
.zm-hero {
    background: linear-gradient(120deg, var(--zm-primary), var(--zm-accent));
    color: #fff; border-radius: var(--zm-radius); padding: 1.6rem;
    margin-bottom: 1rem;
}
.zm-hero h1 { margin: 0 0 .3rem; font-size: 2rem; }
.zm-hero p { margin: 0; opacity: .95; }

.zm-category-chips {
    display: flex; gap: .5rem; overflow-x: auto; padding: .3rem 0 .8rem;
    position: sticky; top: 3.6rem; background: var(--zm-bg); z-index: 50;
}
.zm-chip {
    white-space: nowrap; text-decoration: none;
    background: var(--zm-card); color: var(--zm-ink);
    border: 2px solid var(--zm-primary); border-radius: 999px;
    padding: .55rem 1.1rem; font-weight: 600; font-size: .95rem;
    transition: background .15s, color .15s; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.zm-chip:hover { background: var(--zm-primary); color: #fff; }

.zm-category h2 { margin: 1.4rem 0 .2rem; }
.zm-category-desc { color: var(--zm-muted); margin: 0 0 .6rem; }

/* product cards */
.zm-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem; }
.zm-product-card {
    display: flex; flex-direction: column; text-align: left;
    background: var(--zm-card); border: none; border-radius: var(--zm-radius);
    box-shadow: 0 2px 10px rgba(0,0,0,.07); cursor: pointer; padding: 0;
    overflow: hidden; transition: transform .15s, box-shadow .15s;
}
.zm-product-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,.13); }
/* aspect-ratio + absolutely positioned img: a percentage height inside an auto grid
   track resolves to the intrinsic size, so tall (square) photos would overflow the
   box and paint over the product name */
.zm-product-image {
    position: relative; aspect-ratio: 4 / 3; overflow: hidden;
    background: linear-gradient(135deg, #ffe0b2, #ffccbc); display: grid; place-items: center;
}
.zm-product-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.zm-product-emoji { font-size: 3rem; }
.zm-product-info { padding: .7rem .9rem 0; flex: 1; }
.zm-product-info h3 { margin: 0 0 .2rem; font-size: 1.05rem; }
.zm-product-info p { margin: 0; color: var(--zm-muted); font-size: .88rem; }
/* the card is a teaser: the full description lives on the product page */
.zm-product-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.zm-allergens { color: #b26a00; font-size: .8rem; margin-top: .3rem; }
.zm-product-price {
    padding: .5rem .9rem .8rem; font-weight: 800; color: var(--zm-primary); font-size: 1.1rem;
}

/* product page */
.zm-product-page { background: var(--zm-card); border-radius: var(--zm-radius); padding: 1.2rem; box-shadow: 0 2px 10px rgba(0,0,0,.07); }
.zm-product-header { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.zm-product-hero { width: 220px; border-radius: var(--zm-radius); object-fit: cover; }
.zm-ingredients { color: var(--zm-muted); }
.zm-option-group { margin-top: 1.2rem; color: var(--zm-primary-dark); text-transform: uppercase; font-size: .85rem; letter-spacing: 1px; }
.zm-option { margin: 1rem 0; }
.zm-option-name { font-weight: 700; margin-bottom: .45rem; }

/* touch-first selectable rows: ≥48px targets, big friendly checkboxes/radios */
.zm-value {
    display: flex; align-items: center; gap: .8rem;
    min-height: 3rem; padding: .5rem .8rem; margin-bottom: .35rem;
    border: 2px solid #f0e6dd; border-radius: 14px;
    cursor: pointer; user-select: none;
    transition: border-color .12s, background .12s;
    -webkit-tap-highlight-color: transparent;
}
.zm-value:hover { background: var(--zm-bg); }
.zm-value:active { transform: scale(.99); }
.zm-value:has(input:checked) {
    border-color: var(--zm-primary);
    background: color-mix(in srgb, var(--zm-primary) 8%, white);
}
.zm-value input[type="checkbox"],
.zm-value input[type="radio"] {
    width: 1.5rem; height: 1.5rem; flex-shrink: 0; margin: 0;
    accent-color: var(--zm-primary); cursor: pointer;
}
.zm-value-off:has(input:disabled) { border-style: dashed; }
.zm-delta { margin-left: auto; color: var(--zm-muted); font-size: .95rem; font-weight: 600; }

/* comfortable inputs and selects everywhere on touch screens */
.zm-main .form-control, .zm-main .form-select {
    min-height: 3rem; border-radius: 12px; font-size: 1rem;
}
.zm-main textarea.form-control { min-height: auto; }
.zm-main .btn { min-height: 2.75rem; border-radius: 12px; }
.zm-line-notes { margin-top: 1rem; }
.zm-line-notes label { font-weight: 700; display: block; margin-bottom: .3rem; }

.zm-add-bar {
    display: flex; gap: 1rem; align-items: center; margin-top: 1.2rem;
    position: sticky; bottom: 0; background: var(--zm-card); padding: .8rem 0;
}
.zm-qty { display: flex; align-items: center; gap: .8rem; }
.zm-qty button {
    width: 3rem; height: 3rem; border-radius: 50%; border: 2px solid var(--zm-primary);
    background: #fff; color: var(--zm-primary); font-size: 1.5rem; font-weight: 700; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.zm-qty button:active { background: var(--zm-primary); color: #fff; }
.zm-qty span { font-weight: 800; min-width: 1.6rem; text-align: center; font-size: 1.15rem; }
.zm-add-button {
    flex: 1; border: none; border-radius: 999px; padding: .95rem 1.4rem; min-height: 3.25rem;
    background: var(--zm-primary); color: #fff; font-size: 1.1rem; font-weight: 700;
    cursor: pointer; transition: background .15s;
    -webkit-tap-highlight-color: transparent;
}
.zm-add-button:hover { background: var(--zm-primary-dark); }
.zm-add-button:disabled { background: var(--zm-muted); cursor: not-allowed; }

/* cart */
.zm-cart-list { display: flex; flex-direction: column; gap: .8rem; }
.zm-cart-item {
    display: flex; justify-content: space-between; gap: 1rem;
    background: var(--zm-card); border-radius: var(--zm-radius); padding: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
}
.zm-cart-item-info h3 { margin: 0 0 .3rem; }
.zm-cart-selection, .zm-cart-notes { color: var(--zm-muted); font-size: .9rem; }
.zm-cart-actions { margin-top: .5rem; display: flex; gap: 1rem; }
.zm-link-danger { background: none; border: none; color: #d32f2f; cursor: pointer; padding: 0; }
.zm-cart-item-side { display: flex; flex-direction: column; align-items: flex-end; gap: .6rem; }
.zm-cart-item-price { font-weight: 800; color: var(--zm-primary); }
.zm-cart-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 1.2rem; gap: 1rem;
}
.zm-cart-total { font-size: 1.2rem; }

/* checkout */
.zm-checkout-section {
    background: var(--zm-card); border-radius: var(--zm-radius); padding: 1rem 1.2rem;
    margin-bottom: 1rem; box-shadow: 0 2px 10px rgba(0,0,0,.07);
}
.zm-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem; }
.zm-form-grid label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .9rem; }
.zm-mode-switch { display: flex; gap: .6rem; margin-bottom: .8rem; }
.zm-mode-switch button {
    flex: 1; padding: .9rem .7rem; min-height: 3.25rem; border-radius: 14px;
    border: 2px solid var(--zm-primary);
    background: #fff; font-weight: 700; cursor: pointer; color: var(--zm-ink);
    font-size: 1.02rem; -webkit-tap-highlight-color: transparent;
}
.zm-mode-switch button.active { background: var(--zm-primary); color: #fff; }
.zm-time-picker { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; max-width: 280px; }

/* time-slot picker (issue #65) */
.zm-slot-section { margin: .8rem 0; }
.zm-day-chips { display: flex; gap: .5rem; overflow-x: auto; padding: .4rem 0; }
.zm-chip-on { background: var(--zm-primary); color: #fff; }
.zm-chip-off { opacity: .4; cursor: not-allowed; }
.zm-slot-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(5.4rem, 1fr));
    gap: .5rem; margin-top: .5rem;
}
.zm-slot {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 3rem; border: 2px solid var(--zm-primary); border-radius: 12px;
    background: #fff; color: var(--zm-ink); font-weight: 700; cursor: pointer;
    -webkit-tap-highlight-color: transparent; padding: .3rem;
}
.zm-slot small { font-weight: 500; font-size: .68rem; color: var(--zm-muted); }
.zm-slot:hover:not(:disabled) { background: var(--zm-bg); }
.zm-slot:disabled {
    border-color: #e8ded4; color: var(--zm-muted); cursor: not-allowed;
    text-decoration: line-through;
}
.zm-slot:disabled small { text-decoration: none; }
.zm-slot-on { background: var(--zm-primary); color: #fff; }
.zm-slot-on:hover:not(:disabled) { background: var(--zm-primary-dark); }
.zm-search-row { display: flex; gap: .5rem; }
.zm-search-results { list-style: none; margin: .4rem 0 0; padding: 0; border: 1px solid #eee; border-radius: 10px; overflow: hidden; }
.zm-search-results button {
    width: 100%; text-align: left; background: #fff; border: none; border-bottom: 1px solid #eee;
    padding: .85rem .9rem; min-height: 3rem; cursor: pointer;
}
.zm-search-results button:hover { background: var(--zm-bg); }
.zm-map { height: 300px; border-radius: var(--zm-radius); margin-top: .6rem; }
.zm-map-hint { margin-top: .8rem; font-size: .92rem; }
.zm-address-text { margin-top: .5rem; font-weight: 600; }
.zm-warning {
    background: #fff3cd; border: 1px solid #ffc107; color: #7a5c00;
    border-radius: 10px; padding: .7rem .9rem; margin-top: .7rem;
}
.zm-consent {
    display: flex; align-items: center; gap: .6rem; margin-top: .5rem;
    font-weight: 700; cursor: pointer;
}
.zm-consent input { width: 1.3rem; height: 1.3rem; accent-color: var(--zm-primary); }
.zm-summary-line { display: flex; justify-content: space-between; padding: .25rem 0; }
.zm-summary-sub { color: var(--zm-muted); font-size: .87rem; padding-left: 1rem; }
.zm-summary-total { border-top: 2px dashed #eee; margin-top: .5rem; padding-top: .6rem; font-weight: 800; font-size: 1.1rem; }
.zm-summary-when { color: var(--zm-muted); margin-top: .6rem; }
.zm-confirm { width: 100%; margin-bottom: 2rem; }

/* courier live tracking */
.zm-courier-live {
    background: var(--zm-card); border-radius: var(--zm-radius);
    padding: 1rem; margin: 1rem 0; box-shadow: 0 2px 10px rgba(0,0,0,.07); text-align: left;
}
.zm-eta { font-size: 1.1rem; }

/* tracking */
.zm-tracking { text-align: center; padding-top: 1rem; }
.zm-tracking-state {
    font-size: 1.2rem; border-radius: var(--zm-radius); padding: 1.2rem; margin: 1rem 0;
}
.zm-tracking-state.waiting { background: #fff3cd; }
.zm-tracking-state.ok { background: #d4edda; }
.zm-tracking-state.bad { background: #f8d7da; }
.zm-tracking-state.done { background: #d1ecf1; }
.zm-tracking-details { display: inline-grid; grid-template-columns: auto auto; gap: .3rem 1.2rem; text-align: left; }
.zm-tracking-details dt { color: var(--zm-muted); }

.zm-loading, .zm-empty { text-align: center; color: var(--zm-muted); padding: 3rem 0; font-size: 1.1rem; }
.zm-countdown { margin: .5rem 0 0; font-size: .95rem; color: var(--zm-muted); }
.zm-countdown strong { font-variant-numeric: tabular-nums; color: var(--zm-ink); }
.zm-pay-now { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .7rem; }
.zm-pay-button {
    background: var(--zm-primary); color: #fff; border: 0; border-radius: 10px;
    padding: .55rem 1.1rem; font-weight: 600; cursor: pointer;
}
.zm-pay-button:disabled { opacity: .6; cursor: wait; }
.zm-payinfo { font-size: .92rem; color: var(--zm-muted); }
.zm-payinfo.ok { color: #2e7d32; }
.zm-payinfo.due { color: #b26a00; font-weight: 600; }
.zm-payinfo s { opacity: .7; }
.zm-payinfo strong { color: var(--zm-ink); }

/* my orders (issue #71) */
.zm-my-orders { max-width: 46rem; margin: 0 auto; padding: 1rem; }
.zm-my-orders h2 { font-size: 1.1rem; margin: 1.4rem 0 .6rem; color: var(--zm-muted); }
.zm-order-card {
    display: flex; flex-direction: column; gap: .35rem;
    padding: .8rem 1rem; margin-bottom: .6rem; border-radius: 12px;
    text-decoration: none; color: var(--zm-ink);
    background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.08);
    border-left: 5px solid var(--zm-muted);
    transition: transform .1s;
}
.zm-order-card:hover { transform: translateY(-1px); }
.zm-order-card.waiting { border-left-color: #f0ad4e; }
.zm-order-card.ok { border-left-color: #4caf50; }
.zm-order-card.bad { border-left-color: #e05260; }
.zm-order-card.done { border-left-color: #58b8d0; }
.zm-order-head { display: flex; gap: .8rem; align-items: baseline; flex-wrap: wrap; }
.zm-order-total { margin-left: auto; font-weight: 700; }
.zm-order-state { display: flex; gap: .8rem; align-items: baseline; flex-wrap: wrap; font-size: .95rem; }
.zm-order-state .zm-countdown { margin: 0; }
.zm-order-reason { color: var(--zm-muted); font-style: italic; }

/* news */
.zm-news { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.zm-news-card {
    background: #fff3e0; border-left: 4px solid var(--zm-accent);
    border-radius: 10px; padding: .6rem .9rem;
}
.zm-news-card p { margin: .2rem 0 0; color: var(--zm-muted); }

/* saved addresses */
.zm-saved-addresses { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .6rem; }

/* shop status banner */
.zm-shop-status {
    border-radius: 12px; padding: .6rem 1rem; margin-bottom: 1rem; font-weight: 600;
}
.zm-shop-status.open { background: #d4edda; color: #155724; }
.zm-shop-status.closed { background: #f8d7da; color: #721c24; }

/* availability */
.zm-unavailable { opacity: .55; cursor: not-allowed; }
.zm-soldout {
    position: absolute; inset: auto 0 0 0; background: rgba(45,42,38,.85); color: #fff;
    font-weight: 700; text-align: center; padding: .25rem; font-size: .85rem;
}
.zm-value-off { opacity: .5; }
.zm-value-off span { text-decoration: line-through; }
.zm-value-off .zm-delta { text-decoration: none; font-style: italic; }

/* blazor plumbing */
#blazor-error-ui {
    background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

.loading-progress {
    position: relative; display: block; width: 8rem; height: 8rem; margin: 20vh auto 1rem;
}
.loading-progress circle {
    fill: none; stroke: #ffd9c9; stroke-width: 0.6rem;
    transform-origin: 50% 50%; transform: rotate(-90deg);
}
.loading-progress circle:last-child {
    stroke: var(--zm-primary);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}
.loading-progress-text { position: absolute; text-align: center; font-weight: bold; inset: calc(20vh + 3.25rem) 0 auto 0.2rem; }
.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Loading"); }

code { color: #c02d76; }
