/* ==========================================================================
   Delivery Hub — theme.css (cliente)
   Web app instantâneo: abre pelo link do WhatsApp ou pelo QR, sem instalação.
   Mobile-first (390×844), escala compacta de app: texto 11–17px, controles 40–44px,
   uma única região sticky (busca/categorias). Funciona com a barra do navegador
   visível ou recolhida (unidades dvh/svh e safe areas). Depende de tokens.css;
   a identidade da loja chega como --store-* (inc/branding.php, inline no <head>) e alimenta os
   papéis abaixo. Sem identidade personalizada os tokens resolvem para o tema padrão.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
[x-cloak], [hidden] { display: none !important; }

:root {
	/* Store identity → theme roles (inc/branding.php emits --store-*). Fallbacks = Delivery Hub default theme.
	   Text colors are per SURFACE: the page context is set here; .dh-surface-context (below) switches every
	   card/header/sheet to the colors computed for --store-surface. No per-store selectors anywhere. */
	--dh-primary: var(--store-primary, #ea1d2c);
	--dh-primary-dark: var(--store-primary-dark, color-mix(in srgb, var(--dh-primary) 82%, black));
	--dh-primary-soft: var(--store-accent, color-mix(in srgb, var(--dh-primary) 10%, white));   /* selected backgrounds */
	--dh-on-accent: var(--store-on-accent, var(--dh-primary-dark));                               /* text on selected backgrounds */
	--dh-on-primary: var(--store-on-primary, #fff);
	--dh-primary-contrast: var(--dh-on-primary);
	--dh-cta: var(--store-cta, var(--dh-primary));                                               /* conversion actions */
	--dh-cta-contrast: var(--store-on-cta, #fff);
	--dh-brand-line: var(--store-secondary, transparent);                                        /* brand rule under the banner */
	--dh-brand-soft: var(--store-secondary-light, var(--dh-surface));                            /* product "+" button */
	--dh-bg: var(--store-bg, #f5f5f7);
	--dh-surface: var(--store-surface, #fff);
	--dh-selection: var(--store-selection-on-surface, var(--dh-primary));                       /* borders, checked inputs, focus */
	--dh-surface-2: color-mix(in srgb, var(--store-on-surface, #13203a) 4%, var(--dh-surface));
	--dh-line: color-mix(in srgb, var(--store-on-surface, #13203a) 11%, var(--dh-surface));
	--dh-line-strong: color-mix(in srgb, var(--store-on-surface, #13203a) 20%, var(--dh-surface));
	/* Page context (text sitting directly on --dh-bg). */
	--dh-ink: var(--store-on-background, #13203a);
	--dh-ink-2: color-mix(in srgb, var(--store-on-background, #13203a) 82%, var(--dh-bg));
	--dh-muted: var(--store-muted-on-background, #64748b);
	--dh-link: var(--store-link-on-background, var(--dh-primary));
	--dh-success-on: var(--dh-success);
	--dh-warning-on: var(--dh-warning);
	--dh-danger-on: var(--dh-danger);
	--dh-text: var(--dh-ink);
	--dh-border: var(--dh-line);
	--dh-shadow-sm: var(--dh-shadow-1);
	--dh-shadow: var(--dh-shadow-2);
	--dh-shadow-lg: var(--dh-shadow-3);
	--dh-radius: var(--dh-radius-md);
	--dh-max: 960px;
	--dh-cartbar-h: 48px;
	--dh-nav-h: 0px;
	--dh-btn-h: 42px;
	--dh-fs-xs: 11px; --dh-fs-sm: 12.5px; --dh-fs-md: 14px; --dh-fs-lg: 15px; --dh-fs-xl: 17px;
	--dh-ease-app: cubic-bezier(.2, .8, .2, 1);
	--dh-t: 180ms;
}
/* Surface context: everything painted with --dh-surface uses the colors derived for the surface. */
.dh-surface-context, .dh-header, .dh-sticky, .dh-items-grid, .dh-item, .dh-modal-panel, .dh-modal, .dh-drawer, .dh-drawer-panel, .dh-bottom-nav,
.dh-table-welcome-card, .dh-mo-card, .dh-mo-order, .dh-mo-hero, .dh-mo-login, .dh-mo-empty, .dh-mo-section, .dh-mo-topbar, .dh-tk-card, .dh-tk-hero-card, .dh-tk-confirm-card,
.dh-saved-addr, .dh-type-picker label, .dh-payment-picker label, .dh-input, .ui-card, .ui-dialog-panel {
	--dh-ink: var(--store-on-surface, #13203a);
	--dh-ink-2: color-mix(in srgb, var(--store-on-surface, #13203a) 82%, var(--dh-surface));
	--dh-text: var(--store-on-surface, #13203a); /* alias resolved per element, so it must follow the context too */
	--dh-muted: var(--store-muted-on-surface, #64748b);
	--dh-link: var(--store-link-on-surface, var(--dh-primary));
	--dh-success-on: var(--store-success-on-surface, var(--dh-success));
	--dh-warning-on: var(--store-warning-on-surface, var(--dh-warning));
	--dh-danger-on: var(--store-danger-on-surface, var(--dh-danger));
}

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 104px; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--dh-font); font-size: var(--dh-fs-md); background: var(--dh-bg); color: var(--dh-ink); line-height: 1.4; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; color: inherit; }
a { color: var(--dh-link); }
:focus-visible { outline: 2px solid var(--dh-selection); outline-offset: 2px; }
#dh-app { min-height: 100dvh; padding-bottom: calc(var(--dh-cartbar-h) + 20px + env(safe-area-inset-bottom)); }

/* ---------- Controls ---------- */
.dh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--dh-btn-h); padding: 0 16px; border: 1px solid transparent; border-radius: 12px;
	font: 600 var(--dh-fs-md)/1.1 var(--dh-font); text-decoration: none; cursor: pointer; transition: background var(--dh-t), transform var(--dh-t); }
.dh-btn:active { transform: scale(.98); }
.dh-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.dh-btn-primary { background: var(--dh-cta); color: var(--dh-cta-contrast); }
.dh-btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--dh-cta) 86%, black); color: var(--dh-cta-contrast); }
.dh-btn-ghost { background: var(--dh-surface); border-color: var(--dh-line-strong); color: var(--dh-ink); }
.dh-btn-ghost:hover { background: var(--dh-surface-2); }
.dh-btn-block { display: flex; width: 100%; }
.dh-btn-lg { min-height: 46px; font-size: var(--dh-fs-lg); }
.dh-btn-primary.dh-btn-block:has(> strong:not([style*="display: none"])) { justify-content: space-between; }
.dh-icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: transparent; color: var(--dh-ink); font-size: 20px; line-height: 1; text-decoration: none; }
.dh-icon-btn:hover { background: var(--dh-surface-2); }
.dh-link { border: 0; background: none; padding: 0; color: var(--dh-link); font-weight: 600; text-decoration: underline; cursor: pointer; font-size: inherit; }
.dh-label, .dh-field-group label { display: block; margin: 10px 0 4px; font-size: var(--dh-fs-sm); font-weight: 600; color: var(--dh-ink-2); }
.dh-optional { font-weight: 400; color: var(--dh-muted); }
/* Inputs keep 16px: iOS zooms the page when a focused field is smaller. */
.dh-input, .dh-field-group input:not([type="radio"]):not([type="checkbox"]), .dh-field-group textarea, .dh-obs textarea {
	width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--dh-line-strong); border-radius: 10px; background: var(--dh-surface); color: var(--dh-ink); font: 400 16px/1.3 var(--dh-font); }
textarea.dh-input, .dh-field-group textarea, .dh-obs textarea { min-height: 64px; resize: vertical; }
.dh-input:focus, .dh-field-group input:focus, .dh-field-group textarea:focus, .dh-obs textarea:focus { outline: none; border-color: var(--dh-selection); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dh-selection) 15%, transparent); }
.dh-check { display: flex; gap: 8px; align-items: center; margin: 10px 0; font-size: var(--dh-fs-sm); color: var(--dh-ink-2); }
.dh-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--dh-selection); flex: none; }
.dh-form-error, .dh-cart-error { margin: 6px 0; padding: 8px 10px; border-radius: 10px; background: var(--dh-danger-soft); color: var(--dh-danger); font-size: var(--dh-fs-sm); font-weight: 600; }
.dh-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: dh-spin .8s linear infinite; vertical-align: -2px; }
@keyframes dh-spin { to { transform: rotate(360deg); } }
.dh-muted { color: var(--dh-muted); margin: 0; font-size: var(--dh-fs-sm); }

/* ---------- Toasts / offline ---------- */
.dh-toasts { position: fixed; z-index: var(--dh-z-toast); left: 50%; bottom: calc(var(--dh-nav-h) + var(--dh-cartbar-h) + 24px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 6px; width: min(92vw, 400px); pointer-events: none; }
.dh-toast { padding: 10px 14px; border-radius: 12px; background: #1c2433; color: #fff; font-size: var(--dh-fs-md); font-weight: 500; box-shadow: var(--dh-shadow-3); animation: dh-toast-in var(--dh-t) var(--dh-ease-app); }
.dh-toast.is-success { background: #0c5c37; }
.dh-toast.is-error { background: #9b1c22; }
@keyframes dh-toast-in { from { opacity: 0; transform: translateY(8px); } }
.dh-offline { position: fixed; z-index: var(--dh-z-toast); top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); padding: 7px 14px; border-radius: var(--dh-radius-pill); background: var(--dh-ink); color: #fff; font-size: var(--dh-fs-sm); font-weight: 600; box-shadow: var(--dh-shadow-3); white-space: nowrap; }

/* ---------- Store state banners ---------- */
.dh-store-banner { display: flex; align-items: flex-start; gap: 8px; max-width: min(calc(var(--dh-max) - 24px), calc(100% - 24px)); margin: 8px auto 0; padding: 9px 12px; border-radius: 12px; background: var(--dh-warning-soft); color: #6b3d00; font-size: var(--dh-fs-sm); line-height: 1.35; }
.dh-store-banner svg { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.dh-store-banner.is-muted { background: var(--dh-surface); color: var(--dh-ink-2); border: 1px solid var(--dh-line); align-items: center; justify-content: space-between; }
.dh-closed-warning { display: grid; gap: 2px; padding: 8px 10px; margin-bottom: 8px; border-radius: 10px; background: var(--dh-warning-soft); color: #6b3d00; font-size: var(--dh-fs-sm); }

/* ---------- App bar (header) ---------- */
.dh-header { max-width: var(--dh-max); margin: 0 auto; background: var(--dh-surface); padding-top: env(safe-area-inset-top); }
.dh-cover { display: none; }
/* Banner (optional): on phones a short 3:1 strip (≤ 128px) cropped with object-fit — never a tall hero. */
.dh-cover.has-image { display: block; overflow: hidden; background: var(--dh-surface-2); }
.dh-cover-img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; max-height: 128px; object-fit: cover; object-position: center; }
.dh-header-info { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 6px 6px 12px; box-shadow: inset 0 3px 0 var(--dh-brand-line); }
.dh-logo { flex: none; width: 40px; height: 40px; border-radius: 12px; overflow: hidden; background: var(--dh-surface-2); box-shadow: inset 0 0 0 1px var(--dh-line); }
.dh-logo img { width: 100%; height: 100%; object-fit: cover; }
/* Store logo (often a transparent PNG/WebP): whole mark, proportion preserved, no tile behind it. */
.dh-logo.has-image { border-radius: 0; background: transparent; box-shadow: none; }
.dh-logo .dh-logo-img { object-fit: contain; }
.dh-logo-placeholder { display: grid; place-items: center; width: 100%; height: 100%; background: var(--dh-primary); color: var(--dh-on-primary); font-weight: 700; font-size: 15px; }
.dh-store-meta { flex: 1; min-width: 0; }
.dh-store-meta h1 { margin: 0; font-size: var(--dh-fs-xl); line-height: 1.2; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dh-meta-row { display: flex; align-items: center; gap: 0; margin: 2px 0 0; font-size: var(--dh-fs-sm); color: var(--dh-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dh-meta-item::before { content: "·"; margin: 0 6px; color: var(--dh-line-strong); }
.dh-status { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--dh-muted); }
.dh-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dh-status.is-open { color: var(--dh-success-on); }
.dh-status.is-closed { color: var(--dh-danger-on); }
.dh-store-desc { margin: 0; padding: 0 12px 10px; color: var(--dh-muted); font-size: var(--dh-fs-sm); }
.dh-hide-mobile { display: none; }

/* ---------- Sticky region: search + categories (single sticky element) ---------- */
.dh-sticky { position: sticky; top: 0; z-index: var(--dh-z-sticky); max-width: var(--dh-max); margin: 0 auto; background: color-mix(in srgb, var(--dh-surface) 96%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--dh-line); }
body.admin-bar .dh-sticky { top: 46px; }
@media (min-width: 783px) { body.admin-bar .dh-sticky { top: 32px; } }
.dh-search { display: flex; align-items: center; gap: 8px; padding: 8px 12px 0; }
.dh-search-input { flex: 1; min-width: 0; height: 40px; padding: 0 12px 0 36px; border: 0; border-radius: 12px; background: var(--dh-surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center; font: 400 16px/1 var(--dh-font); color: var(--dh-ink); }
.dh-search-input:focus { outline: 2px solid var(--dh-selection); }
.dh-search-cancel { border: 0; background: none; color: var(--dh-link); font-weight: 600; font-size: var(--dh-fs-md); padding: 8px 4px; }
.dh-categories-nav { background: transparent; }
.dh-categories-scroll { display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
.dh-categories-scroll::-webkit-scrollbar { display: none; }
.dh-categories-scroll a { flex: none; scroll-snap-align: start; display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: var(--dh-radius-pill); background: var(--dh-surface-2); color: var(--dh-ink-2); font-size: var(--dh-fs-sm); font-weight: 600; text-decoration: none; white-space: nowrap; transition: background var(--dh-t), color var(--dh-t); }
.dh-categories-scroll a.is-active { background: var(--dh-ink); color: var(--dh-surface); }

/* ---------- Menu ---------- */
.dh-main { max-width: var(--dh-max); margin: 0 auto; padding: 0 12px; }
.dh-category { padding-top: 14px; scroll-margin-top: 104px; }
.dh-category-title { margin: 0 2px; font-size: var(--dh-fs-lg); font-weight: 700; letter-spacing: -.005em; }
.dh-category-desc { margin: 2px 2px 0; color: var(--dh-muted); font-size: var(--dh-fs-sm); }
.dh-items-grid { display: grid; margin-top: 6px; border-radius: 14px; background: var(--dh-surface); border: 1px solid var(--dh-line); overflow: hidden; }
.dh-item { position: relative; display: flex; gap: 12px; align-items: flex-start; width: 100%; min-height: 92px; padding: 12px; border: 0; border-bottom: 1px solid var(--dh-line); background: var(--dh-surface);
	text-align: left; font: inherit; color: inherit; cursor: pointer; transition: background var(--dh-t); -webkit-tap-highlight-color: transparent; }
.dh-item:last-child { border-bottom: 0; }
.dh-item:hover { background: var(--dh-surface-2); }
.dh-item-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; min-height: 68px; }
.dh-item-name { font-size: var(--dh-fs-lg); font-weight: 600; line-height: 1.25; }
.dh-item-desc { color: var(--dh-muted); font-size: var(--dh-fs-sm); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dh-item-price-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin-top: auto; padding-top: 4px; }
.dh-price { font-size: var(--dh-fs-lg); font-weight: 600; color: var(--dh-ink); }
.dh-price-old { font-size: var(--dh-fs-sm); color: var(--dh-muted); text-decoration: line-through; }
.dh-item-media { flex: none; width: 80px; height: 80px; border-radius: 12px; overflow: hidden; background: var(--dh-surface-2); }
.dh-item-image { width: 100%; height: 100%; object-fit: cover; }
.dh-item-add { position: absolute; right: 12px; bottom: 10px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--dh-brand-soft); color: var(--dh-primary-dark); font-size: 19px; font-weight: 600; line-height: 1; box-shadow: var(--dh-shadow-2); }
.dh-item.is-soldout { cursor: not-allowed; }
.dh-item.is-soldout .dh-item-media { filter: grayscale(1); opacity: .5; }
.dh-item.is-soldout .dh-item-name, .dh-item.is-soldout .dh-price { color: var(--dh-muted); } /* no opacity on text: keeps 4.5:1 */
.dh-item.is-soldout .dh-item-add { display: none; }
.dh-badge-soldout { padding: 1px 7px; border-radius: var(--dh-radius-pill); background: var(--dh-surface-2); color: var(--dh-muted); font-size: var(--dh-fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.dh-empty { padding: 40px 16px; text-align: center; color: var(--dh-muted); font-size: var(--dh-fs-md); }
.dh-empty h2, .dh-empty strong { display: block; color: var(--dh-ink); margin: 0 0 4px; font-size: var(--dh-fs-lg); }
.dh-empty p { margin: 0; }

/* ---------- Cart bar ---------- */
.dh-cart-bar-wrap { position: fixed; z-index: calc(var(--dh-z-drawer) - 10); left: 0; right: 0; bottom: calc(var(--dh-nav-h) + env(safe-area-inset-bottom)); padding: 8px 12px; pointer-events: none; }
.dh-cart-bar { pointer-events: auto; display: flex; align-items: center; gap: 10px; width: 100%; max-width: 520px; height: var(--dh-cartbar-h); margin: 0 auto; padding: 0 14px; border: 0; border-radius: 14px;
	background: var(--dh-cta); color: var(--dh-cta-contrast); font-size: var(--dh-fs-md); font-weight: 600; box-shadow: 0 8px 22px color-mix(in srgb, var(--dh-cta) 32%, transparent); }
.dh-cart-bar-count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 7px; background: var(--dh-cta-contrast); color: var(--dh-cta); font-size: var(--dh-fs-sm); font-weight: 700; } /* inverse chip: same ratio as the CTA */
.dh-cart-bar-label { flex: 1; text-align: left; }
.dh-cart-bar.is-bump { animation: dh-bump .35s var(--dh-ease-app); }
@keyframes dh-bump { 40% { transform: scale(1.03); } }

/* ---------- Sheets, modals ---------- */
.dh-modal-overlay { position: fixed; inset: 0; z-index: var(--dh-z-modal); display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 23, 42, .5); }
.dh-modal { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 520px; max-height: min(90dvh, 860px); background: var(--dh-surface); border-radius: 20px; box-shadow: var(--dh-shadow-3); overflow: hidden; }
.dh-modal-scroll { overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; }
.dh-modal-close { position: absolute; top: 10px; right: 10px; z-index: 2; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--dh-surface); color: var(--store-on-surface, #13203a); font-size: 20px; line-height: 1; box-shadow: var(--dh-shadow-1); } /* sits on the photo: surface + its own text */
.dh-modal-hero { aspect-ratio: 16 / 9; background: var(--dh-surface-2); overflow: hidden; }
.dh-modal-hero img { width: 100%; height: 100%; object-fit: cover; }
.dh-modal-body { padding: 14px 16px 6px; }
.dh-modal-body h2 { margin: 0 36px 4px 0; font-size: var(--dh-fs-xl); line-height: 1.25; font-weight: 700; }
.dh-modal-desc { margin: 0 0 6px; color: var(--dh-muted); font-size: var(--dh-fs-sm); line-height: 1.4; }
.dh-modal-price { margin: 0 0 4px; font-size: var(--dh-fs-lg); font-weight: 600; }
.dh-extra-group { margin: 12px -16px 0; padding: 0; border: 0; }
.dh-extra-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 8px 16px; background: var(--dh-surface-2); }
.dh-extra-head span:first-child { display: grid; }
.dh-extra-head strong { font-size: var(--dh-fs-md); font-weight: 600; }
.dh-extra-head small { color: var(--dh-muted); font-size: var(--dh-fs-xs); }
.dh-extra-req { flex: none; padding: 2px 8px; border-radius: var(--dh-radius-pill); background: var(--dh-ink); color: var(--dh-surface); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.dh-extra-req.is-done { background: var(--dh-success); }
.dh-extra-group.has-error .dh-extra-head { background: var(--dh-danger-soft); }
.dh-extra-group.has-error .dh-extra-req { background: var(--dh-danger); }
.dh-extra-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 6px 16px; border-bottom: 1px solid var(--dh-line); cursor: pointer; }
.dh-extra-opt:last-child { border-bottom: 0; }
.dh-extra-text { display: grid; }
.dh-extra-label { font-size: var(--dh-fs-md); }
.dh-extra-price { font-size: var(--dh-fs-sm); color: var(--dh-muted); }
.dh-extra-opt input { width: 20px; height: 20px; margin: 0; accent-color: var(--dh-selection); flex: none; }
.dh-obs { margin: 12px 0 6px; }
.dh-modal-footer { display: flex; gap: 8px; align-items: center; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--dh-line); background: var(--dh-surface); flex: none; }
.dh-qty { display: inline-flex; align-items: center; padding: 2px; border: 1px solid var(--dh-line-strong); border-radius: 12px; background: var(--dh-surface); flex: none; }
.dh-qty button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--dh-link); font-size: 20px; font-weight: 500; }
.dh-qty button:disabled { color: var(--dh-line-strong); cursor: not-allowed; }
.dh-qty span { min-width: 22px; text-align: center; font-weight: 600; font-size: var(--dh-fs-lg); }
.dh-qty-sm { border-radius: 10px; }
.dh-qty-sm button { width: 30px; height: 30px; font-size: 17px; }
.dh-qty-sm span { font-size: var(--dh-fs-md); min-width: 18px; }
.dh-btn-add { flex: 1; justify-content: space-between; min-height: 44px; }
.dh-btn-add > span[aria-hidden] { display: none; }
@media (max-width: 767px) {
	.dh-modal-overlay.dh-sheet { align-items: flex-end; padding: 0; }
	/* --dh-vvh follows the visual viewport, so the CTA stays visible with the keyboard open. */
	.dh-sheet .dh-modal { max-width: none; max-height: calc(var(--dh-vvh, 100dvh) - 24px); border-radius: 20px 20px 0 0; animation: dh-sheet-in var(--dh-t) var(--dh-ease-app); }
	.dh-sheet .dh-modal-checkout { height: var(--dh-vvh, 100dvh); max-height: var(--dh-vvh, 100dvh); border-radius: 0; }
}
@keyframes dh-sheet-in { from { transform: translateY(24px); opacity: .6; } }

/* ---------- Cart drawer ---------- */
.dh-drawer-overlay { position: fixed; inset: 0; z-index: calc(var(--dh-z-drawer) - 1); background: rgba(15, 23, 42, .45); }
.dh-drawer { position: fixed; z-index: var(--dh-z-drawer); top: 0; right: 0; height: var(--dh-vvh, 100dvh); display: flex; flex-direction: column; width: min(100%, 420px); background: var(--dh-surface); box-shadow: var(--dh-shadow-3);
	transform: translateX(105%); visibility: hidden; transition: transform var(--dh-t) var(--dh-ease-app), visibility var(--dh-t); }
.dh-drawer.is-open { transform: none; visibility: visible; }
.dh-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 8px 8px 16px; border-bottom: 1px solid var(--dh-line); }
.dh-drawer-head h2 { margin: 0; font-size: var(--dh-fs-xl); font-weight: 700; }
.dh-drawer-head small { color: var(--dh-muted); font-size: var(--dh-fs-sm); }
.dh-drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 12px; }
.dh-cart-empty { display: grid; justify-items: center; gap: 4px; padding: 40px 12px; text-align: center; color: var(--dh-muted); }
.dh-cart-empty svg { width: 40px; height: 40px; color: var(--dh-selection); } /* ≥ 3:1 on the sheet */
.dh-cart-empty strong { color: var(--dh-ink); font-size: var(--dh-fs-lg); }
.dh-cart-empty p { margin: 0 0 8px; font-size: var(--dh-fs-sm); }
.dh-cart-line { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--dh-line); }
.dh-cart-line-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.dh-cart-line-name { font-size: var(--dh-fs-md); font-weight: 600; }
.dh-cart-line-opts { margin: 0; padding: 0; list-style: none; color: var(--dh-muted); font-size: var(--dh-fs-sm); }
.dh-cart-line-opts li::before { content: "+ "; }
.dh-cart-line-obs { margin: 0; color: var(--dh-warning); font-size: var(--dh-fs-sm); }
.dh-cart-line-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.dh-cart-remove { border: 0; background: none; padding: 4px 0; color: var(--dh-muted); font-size: var(--dh-fs-sm); text-decoration: underline; }
.dh-cart-line-price { font-weight: 600; font-size: var(--dh-fs-md); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dh-bumps { margin-top: 14px; }
.dh-bumps h3 { margin: 0 0 6px; font-size: var(--dh-fs-md); font-weight: 600; }
.dh-bumps-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.dh-bump { display: flex; align-items: center; gap: 8px; flex: none; width: 200px; padding: 6px; border: 1px solid var(--dh-line); border-radius: 12px; background: var(--dh-surface); text-align: left; }
.dh-bump-img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; }
.dh-bump-info { display: grid; flex: 1; min-width: 0; font-size: var(--dh-fs-sm); }
.dh-bump-info strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dh-bump-info span { color: var(--dh-muted); }
.dh-bump-add { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--dh-primary-soft); color: var(--dh-on-accent); font-weight: 700; font-size: 17px; }
.dh-drawer-foot { display: grid; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--dh-line); background: var(--dh-surface); }
.dh-summary { display: grid; gap: 2px; font-size: var(--dh-fs-md); }
.dh-summary > div { display: flex; justify-content: space-between; gap: 12px; }
.dh-summary-muted { color: var(--dh-muted); font-size: var(--dh-fs-sm); }
.dh-summary-total { font-size: var(--dh-fs-lg); font-weight: 700; }
.dh-drawer-hint { margin: 0; text-align: center; color: var(--dh-muted); font-size: var(--dh-fs-sm); }
.dh-min-order-warn { margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--dh-warning-soft); color: #6b3d00; font-size: var(--dh-fs-sm); }

/* ---------- Checkout: light sections, app flow ---------- */
.dh-modal-checkout { max-width: 560px; }
.dh-checkout-head { display: flex; align-items: center; gap: 6px; padding: calc(6px + env(safe-area-inset-top)) 8px 6px; border-bottom: 1px solid var(--dh-line); flex: none; }
.dh-checkout-head h2 { margin: 0; font-size: var(--dh-fs-xl); font-weight: 700; }
.dh-checkout-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 12px; }
.dh-field-group { padding: 12px 0; border-bottom: 1px solid var(--dh-line); }
.dh-field-group:last-of-type { border-bottom: 0; }
.dh-field-group h3 { margin: 0 0 2px; font-size: var(--dh-fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--dh-muted); }
.dh-field-group p { margin: 4px 0; color: var(--dh-ink-2); font-size: var(--dh-fs-sm); }
.dh-field-hint { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--dh-info-soft); color: var(--dh-info); font-size: var(--dh-fs-sm); }
.dh-type-picker, .dh-payment-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dh-type-picker label, .dh-payment-picker label { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; margin: 0; padding: 6px 14px; border: 1px solid var(--dh-line-strong); border-radius: var(--dh-radius-pill); background: var(--dh-surface); cursor: pointer; font-size: var(--dh-fs-md); font-weight: 500; color: var(--dh-ink); }
.dh-type-picker label div { display: flex; gap: 6px; align-items: baseline; }
.dh-type-picker small { color: var(--dh-muted); font-weight: 400; font-size: var(--dh-fs-xs); }
.dh-type-picker label.is-active small, .dh-payment-picker label.is-active small { color: var(--dh-on-accent); } /* on the accent, not on the card */
.dh-type-picker input, .dh-payment-picker input { position: absolute; opacity: 0; pointer-events: none; }
.dh-type-picker label.is-active, .dh-payment-picker label.is-active { border-color: var(--dh-selection); background: var(--dh-primary-soft); color: var(--dh-on-accent); font-weight: 600; }
.dh-type-picker label:has(input:focus-visible), .dh-payment-picker label:has(input:focus-visible) { outline: 2px solid color-mix(in srgb, var(--dh-selection) 70%, transparent); }
.dh-checkout-summary { display: grid; gap: 4px; padding: 12px 0 2px; font-size: var(--dh-fs-md); }
.dh-checkout-summary > div { display: flex; justify-content: space-between; gap: 12px; }
.dh-checkout-summary .dh-total { padding-top: 6px; border-top: 1px dashed var(--dh-line-strong); font-size: var(--dh-fs-lg); font-weight: 700; }
.dh-checkout-foot { display: grid; gap: 6px; }
.dh-checkout-foot .dh-btn { width: 100%; }
.dh-checkout-note { margin: 0; color: var(--dh-muted); font-size: var(--dh-fs-xs); text-align: center; }
.dh-link-back { border: 0; background: none; padding: 6px 0; color: var(--dh-link); font-weight: 600; font-size: var(--dh-fs-sm); }
.dh-cep-row { display: flex; gap: 8px; align-items: center; }
.dh-cep-row input { max-width: 160px; }
.dh-cep-status { font-size: var(--dh-fs-sm); color: var(--dh-muted); }
.dh-cep-ok { color: var(--dh-success); font-weight: 600; }
.dh-cep-err { color: var(--dh-danger); font-weight: 600; }
.dh-address-grid { display: grid; grid-template-columns: 1fr 96px; gap: 0 8px; }
.dh-grid-full, .dh-grid-city { grid-column: 1 / -1; }
.dh-area-status { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 9px 10px; border-radius: 10px; font-size: var(--dh-fs-sm); }
.dh-area-status svg { width: 16px; height: 16px; flex: none; }
.dh-area-status > div { display: grid; gap: 1px; flex: 1; }
.dh-area-loading { background: var(--dh-surface-2); color: var(--dh-ink-2); align-items: center; }
.dh-area-spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: dh-spin .8s linear infinite; }
.dh-area-ok { background: var(--dh-success-soft); color: var(--dh-success); }
.dh-area-fallback { background: var(--dh-warning-soft); color: #6b3d00; }
.dh-area-rejected { background: var(--dh-danger-soft); color: var(--dh-danger); flex-wrap: wrap; }
.dh-area-pickup-btn { min-height: 36px; padding: 0 12px; border: 1px solid currentColor; border-radius: 10px; background: var(--dh-surface); color: inherit; font-weight: 600; font-size: var(--dh-fs-sm); }
.dh-saved-addresses { display: grid; gap: 6px; }
.dh-saved-addr { display: flex !important; gap: 8px; align-items: flex-start; margin: 0 !important; padding: 10px; border: 1px solid var(--dh-line-strong); border-radius: 12px; cursor: pointer; font-weight: 400 !important; font-size: var(--dh-fs-sm) !important; }
.dh-saved-addr.is-active { border-color: var(--dh-selection); background: var(--dh-primary-soft); }
.dh-saved-addr div { display: grid; }
.dh-saved-addr small { color: var(--dh-muted); }

/* ---------- Success ---------- */
.dh-modal-success { max-width: 380px; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); text-align: center; display: grid; gap: 8px; }
.dh-modal-success h2 { margin: 2px 0 0; font-size: var(--dh-fs-xl); font-weight: 700; }
.dh-modal-success p { margin: 0; color: var(--dh-ink-2); font-size: var(--dh-fs-md); }
.dh-success-icon { justify-self: center; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--dh-success-soft); color: var(--dh-success); }
.dh-success-icon svg { width: 30px; height: 30px; }

/* ---------- Table identification (one short step after the QR) ---------- */
.dh-table-welcome { min-height: 100dvh; display: grid; align-items: center; justify-items: center; padding: max(16px, env(safe-area-inset-top)) 16px 16px; background: var(--dh-bg); }
.dh-table-welcome-card { width: min(100%, 400px); padding: 20px 18px; border-radius: 20px; background: var(--dh-surface); box-shadow: var(--dh-shadow-2); }
.dh-table-welcome-logo { width: 56px; height: 56px; object-fit: contain; margin-bottom: 10px; }
.dh-table-welcome-eyebrow { margin: 0; color: var(--dh-muted); font-weight: 600; font-size: var(--dh-fs-sm); }
.dh-table-welcome-card h1 { margin: 0 0 4px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.dh-table-welcome-lead { margin: 0 0 4px; color: var(--dh-ink-2); font-size: var(--dh-fs-md); }
.dh-table-welcome-checking { display: flex; gap: 8px; align-items: center; color: var(--dh-muted); font-size: var(--dh-fs-sm); }
.dh-table-welcome .dh-btn { margin-top: 6px; }

/* ---------- Tablet / desktop ---------- */
@media (min-width: 768px) {
	.dh-cover { display: block; height: 160px; background: linear-gradient(135deg, var(--dh-primary), var(--dh-primary-dark)); background-size: cover; background-position: center; border-radius: 0 0 20px 20px; }
	.dh-cover.has-image { height: auto; background: var(--dh-surface-2); }
	.dh-cover-img { max-height: 300px; }
	.dh-header-info { padding: 12px 16px; }
	.dh-logo { width: 64px; height: 64px; border-radius: 16px; margin-top: -36px; border: 3px solid var(--dh-surface); }
	.dh-logo.has-image { border-radius: 16px; border: 0; background: var(--dh-surface); box-shadow: var(--dh-shadow-2); padding: 3px; } /* any logo shape: no circular crop */
	.dh-store-meta h1 { font-size: 20px; }
	.dh-hide-mobile { display: inline; }
	.dh-store-desc.dh-hide-mobile { display: block; padding: 0 16px 12px; }
	.dh-main { padding: 0 16px; }
	.dh-items-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
	.dh-item { border-right: 1px solid var(--dh-line); }
	.dh-item:nth-child(2n) { border-right: 0; }
	.dh-item:nth-last-child(-n+2):nth-child(odd), .dh-item:last-child { border-bottom: 0; }
}
/* --------- Meus Pedidos (redesign v2) --------- */
.dh-mo-wrap {
	max-width: 720px;
	margin: 0 auto;
	padding: 0 16px 60px;
	min-height: 100vh;
}

.dh-mo-topbar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 4px;
	position: sticky;
	top: 0;
	background: var(--dh-bg);
	z-index: 10;
}
.dh-mo-back, .dh-mo-logout {
	width: 40px; height: 40px;
	border-radius: 50%;
	background: var(--dh-surface);
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--dh-text);
	cursor: pointer;
	text-decoration: none;
	box-shadow: var(--dh-shadow-sm);
	transition: transform .1s, box-shadow .15s;
}
.dh-mo-back:hover, .dh-mo-logout:hover { box-shadow: var(--dh-shadow); }
.dh-mo-back:active, .dh-mo-logout:active { transform: scale(.95); }
.dh-mo-topbar h1 { flex: 1; margin: 0; font-size: 20px; font-weight: 800; }

.dh-mo-main { padding-top: 8px; }

/* Skeleton loader */
.dh-mo-skeleton { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.dh-skel {
	background: linear-gradient(90deg, var(--dh-surface-2) 25%, var(--dh-line) 50%, var(--dh-surface-2) 75%);
	background-size: 200% 100%;
	animation: dh-skel-shine 1.4s linear infinite;
	border-radius: var(--dh-radius);
}
.dh-skel-header { height: 90px; }
.dh-skel-card { height: 180px; }
@keyframes dh-skel-shine { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Login card */
.dh-mo-login {
	background: var(--dh-surface);
	border-radius: 20px;
	padding: 40px 28px;
	text-align: center;
	box-shadow: var(--dh-shadow);
	margin: 40px auto 0;
	max-width: 420px;
}
.dh-mo-login-icon {
	width: 88px; height: 88px;
	margin: 0 auto 20px;
	background: color-mix(in srgb, var(--dh-selection) 14%, var(--dh-surface));
	color: var(--dh-selection); /* icon ≥ 3:1 on the card surface */
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}
.dh-mo-login h2 { margin: 0 0 8px; font-size: 22px; }
.dh-mo-login p { margin: 0 0 24px; color: var(--dh-muted); font-size: 14px; }
.dh-mo-login input {
	width: 100%;
	padding: 14px 16px;
	border: 2px solid var(--dh-border);
	border-radius: var(--dh-radius-sm);
	font-size: 16px;
	text-align: center;
	font-variant-numeric: tabular-nums;
	letter-spacing: .5px;
	margin-bottom: 14px;
	transition: border-color .15s;
}
.dh-mo-login input:focus { outline: none; border-color: var(--dh-selection); }

/* Empty state */
.dh-mo-empty {
	background: var(--dh-surface);
	border-radius: 20px;
	padding: 48px 24px;
	text-align: center;
	box-shadow: var(--dh-shadow);
	margin-top: 20px;
}
.dh-mo-empty-icon {
	width: 120px; height: 120px;
	margin: 0 auto 20px;
	background: color-mix(in srgb, var(--dh-selection) 14%, var(--dh-surface));
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--dh-selection); /* icon ≥ 3:1 on the card surface */
}
.dh-mo-empty h2 { margin: 0 0 8px; font-size: 22px; }
.dh-mo-empty p { margin: 0 0 24px; color: var(--dh-muted); font-size: 14px; }

/* Hero cliente */
.dh-mo-content { display: flex; flex-direction: column; gap: 24px; }
.dh-mo-hero {
	background: var(--dh-surface);
	border-radius: 20px;
	padding: 20px;
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 16px;
	align-items: center;
	box-shadow: var(--dh-shadow-sm);
}
.dh-mo-avatar {
	width: 56px; height: 56px;
	border-radius: 50%;
	color: white;
	font-weight: 800;
	font-size: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.dh-mo-hero-info h2 { margin: 0 0 2px; font-size: 17px; font-weight: 800; }
.dh-mo-hero-info small { color: var(--dh-muted); font-size: 13px; }
.dh-mo-stats {
	display: flex;
	gap: 16px;
	border-left: 1px solid var(--dh-border);
	padding-left: 16px;
}
.dh-mo-stats > div { text-align: center; }
.dh-mo-stats strong { display: block; font-size: 18px; color: var(--dh-text); font-weight: 800; line-height: 1; }
.dh-mo-stats span { display: block; font-size: 11px; color: var(--dh-muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
@media (max-width: 480px) {
	.dh-mo-hero { grid-template-columns: auto 1fr; }
	.dh-mo-stats {
		grid-column: 1 / -1;
		border-left: none;
		border-top: 1px solid var(--dh-border);
		padding: 12px 0 0;
		justify-content: space-around;
	}
}

/* Seções */
.dh-mo-section { display: flex; flex-direction: column; gap: 12px; }
.dh-mo-section h3 {
	margin: 0 0 4px;
	font-size: 13px;
	font-weight: 700;
	color: var(--dh-muted);
	text-transform: uppercase;
	letter-spacing: .8px;
	display: flex;
	align-items: center;
	gap: 8px;
}
.dh-mo-section h3 em { font-style: normal; color: var(--dh-muted); font-weight: 500; }
.dh-mo-badge-live {
	display: inline-block;
	width: 8px; height: 8px;
	background: var(--dh-danger);
	color: transparent;
	border-radius: 50%;
	animation: dh-live-pulse 1.4s ease-in-out infinite;
	overflow: hidden;
	line-height: 8px;
}
@keyframes dh-live-pulse {
	0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--dh-danger) 40%, transparent); }
	50%      { box-shadow: 0 0 0 6px color-mix(in srgb, var(--dh-danger) 0%,   transparent); }
}

/* Card pedido */
.dh-mo-order {
	background: var(--dh-surface);
	border-radius: 16px;
	padding: 18px 20px;
	text-decoration: none;
	color: var(--dh-text);
	display: block;
	box-shadow: var(--dh-shadow-sm);
	transition: box-shadow .15s, transform .1s;
	position: relative;
	overflow: hidden;
}
.dh-mo-order:hover { box-shadow: var(--dh-shadow); }
.dh-mo-order-open::before {
	content: '';
	position: absolute;
	top: 0; left: 0;
	width: 4px; height: 100%;
	background: var(--dh-primary);
}
.dh-mo-order-past { opacity: .92; }

.dh-mo-order-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
}
.dh-mo-status {
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .3px;
}
.dh-mo-order-top time { color: var(--dh-muted); font-size: 12px; }

/* Mini timeline nos pedidos ativos */
.dh-mo-mini-timeline {
	display: flex;
	gap: 4px;
	margin-bottom: 14px;
}
.dh-mo-mini-step {
	flex: 1;
	height: 4px;
	background: var(--dh-border);
	border-radius: 2px;
	transition: background .3s;
}
.dh-mo-mini-step.is-active { animation: dh-mo-step-pulse 1.4s ease-in-out infinite; }
@keyframes dh-mo-step-pulse { 50% { opacity: .6; } }

.dh-mo-order-title { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.dh-mo-items { list-style: none; padding: 0; margin: 0; color: var(--dh-muted); font-size: 13px; }
.dh-mo-items li { padding: 2px 0; }
.dh-mo-items .dh-mo-more { color: var(--dh-link); font-weight: 600; font-size: 12px; }

.dh-mo-order-foot {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-top: 14px;
	margin-top: 14px;
	border-top: 1px dashed var(--dh-border);
}
.dh-mo-order-foot strong { font-size: 18px; color: var(--dh-link); font-weight: 800; }
.dh-mo-cta {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--dh-primary);
	font-weight: 700;
	font-size: 14px;
}
.dh-mo-reorder {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--dh-muted);
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--dh-bg);
	transition: background .15s, color .15s;
}
.dh-mo-reorder:hover { background: var(--dh-primary); color: var(--dh-on-primary); }

/* --------- Order tracking (redesign v2) --------- */
.dh-tk-main { display: flex; flex-direction: column; gap: 20px; padding-top: 8px; }

/* HERO — minimal */
.dh-tk-hero {
	background: transparent;
	padding: 4px 4px 8px;
	display: flex;
	gap: 14px;
	align-items: center;
}
.dh-tk-hero-icon {
	width: 44px; height: 44px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--tk-color) 12%, white);
	color: var(--tk-color);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.dh-tk-hero-icon svg { width: 22px; height: 22px; }

.dh-tk-hero-body { flex: 1; min-width: 0; }
.dh-tk-hero-body h2 {
	margin: 2px 0 2px;
	font-size: 17px;
	font-weight: 700;
	color: var(--dh-text);
	line-height: 1.2;
}
.dh-tk-hero-body p { margin: 0; color: var(--dh-muted); font-size: 13px; line-height: 1.4; }

.dh-tk-live {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 10px;
	font-weight: 600;
	color: var(--dh-muted);
	text-transform: uppercase;
	letter-spacing: .4px;
}
.dh-live-dot {
	width: 5px; height: 5px;
	background: #10b981;
	border-radius: 50%;
	animation: dh-live-blink 1.6s ease-in-out infinite;
}
@keyframes dh-live-blink {
	0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,.5); }
	50%      { box-shadow: 0 0 0 4px rgba(16,185,129,0); }
}

/* TIMELINE */
.dh-tk-timeline {
	background: var(--dh-surface);
	border-radius: 16px;
	padding: 20px 12px 16px;
	display: flex;
	align-items: flex-start;
	overflow-x: auto;
	gap: 0;
	box-shadow: var(--dh-shadow-sm);
	scrollbar-width: none;
}
.dh-tk-timeline::-webkit-scrollbar { display: none; }
.dh-tk-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	flex: 1;
	min-width: 68px;
	text-align: center;
}
.dh-tk-dot {
	width: 32px; height: 32px;
	border-radius: 50%;
	background: var(--dh-surface);
	border: 2px solid var(--dh-border);
	display: flex;
	align-items: center;
	justify-content: center;
	color: transparent;
	transition: background .3s, border-color .3s, transform .3s;
	position: relative;
	z-index: 1;
}
.dh-tk-step.is-done .dh-tk-dot {
	background: var(--dot-color);
	border-color: var(--dot-color);
	color: white;
}
.dh-tk-step.is-active .dh-tk-dot {
	background: var(--dot-color);
	border-color: var(--dot-color);
	transform: scale(1.15);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--dot-color) 20%, transparent);
	animation: dh-tk-active-pulse 1.6s ease-in-out infinite;
}
@keyframes dh-tk-active-pulse {
	0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--dot-color) 30%, transparent); }
	50%      { box-shadow: 0 0 0 10px color-mix(in srgb, var(--dot-color) 0%,  transparent); }
}
.dh-tk-step-label {
	font-size: 11px;
	font-weight: 700;
	color: var(--dh-muted);
	line-height: 1.2;
}
.dh-tk-step.is-done .dh-tk-step-label,
.dh-tk-step.is-active .dh-tk-step-label { color: var(--dh-text); }
.dh-tk-step time {
	font-size: 10px;
	color: var(--dh-muted);
	font-weight: 500;
}
.dh-tk-line {
	flex: 1;
	min-width: 12px;
	height: 3px;
	background: var(--dh-border);
	margin-top: 15px;
	border-radius: 2px;
	transition: background .3s;
}
.dh-tk-line.is-done { background: #10b981; }

/* CARDS */
.dh-tk-cards { display: flex; flex-direction: column; gap: 12px; }
.dh-tk-card {
	background: var(--dh-surface);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: var(--dh-shadow-sm);
}
.dh-tk-card-head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 18px;
	border-bottom: 1px solid var(--dh-border);
	color: var(--dh-muted);
}
.dh-tk-card-head h3 {
	margin: 0;
	font-size: 13px;
	font-weight: 700;
	color: var(--dh-text);
	text-transform: uppercase;
	letter-spacing: .5px;
}
.dh-tk-card-head h3 em { color: var(--dh-muted); font-weight: 500; font-style: normal; }
.dh-tk-card-body { padding: 16px 18px; }

.dh-tk-address { margin: 0; font-size: 14px; line-height: 1.5; }
.dh-tk-address strong { display: block; font-size: 15px; margin-bottom: 4px; }
.dh-tk-ref { margin: 8px 0 0; font-size: 13px; color: var(--dh-muted); font-style: italic; }

.dh-tk-items { list-style: none; padding: 0; margin: 0; }
.dh-tk-items li {
	display: grid;
	grid-template-columns: 32px 1fr auto;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid var(--dh-border);
	align-items: flex-start;
}
.dh-tk-items li:last-child { border-bottom: none; }
.dh-tk-qty {
	background: var(--dh-primary-soft);
	color: var(--dh-on-accent);
	font-weight: 800;
	font-size: 13px;
	border-radius: 6px;
	padding: 4px 0;
	text-align: center;
	line-height: 1;
	height: fit-content;
}
.dh-tk-qty::after { content: 'x'; opacity: .6; }
.dh-tk-item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dh-tk-item-info strong { font-size: 14px; font-weight: 600; }
.dh-tk-item-info small { font-size: 12px; color: var(--dh-muted); }
.dh-tk-item-info em { font-size: 12px; color: var(--dh-warning-on); font-style: italic; }
.dh-tk-item-total { font-weight: 700; color: var(--dh-text); font-size: 14px; white-space: nowrap; }

.dh-tk-totals {
	margin-top: 16px;
	padding-top: 14px;
	border-top: 2px dashed var(--dh-border);
}
.dh-tk-totals > div {
	display: flex;
	justify-content: space-between;
	padding: 4px 0;
	font-size: 14px;
	color: var(--dh-muted);
}
.dh-tk-total-row {
	color: var(--dh-text) !important;
	font-size: 18px !important;
	padding-top: 10px !important;
	border-top: 1px solid var(--dh-border);
	margin-top: 6px;
}
.dh-tk-total-row strong { color: var(--dh-link); font-weight: 800; }

.dh-tk-payment strong { font-size: 15px; display: block; }
.dh-tk-payment small { color: var(--dh-muted); font-size: 12px; display: block; margin-top: 4px; }

/* Card do entregador */
.dh-tk-driver { display: flex; align-items: center; gap: 12px; }
.dh-tk-driver img,
.dh-tk-driver-initial {
	width: 48px; height: 48px;
	border-radius: 50%;
	object-fit: cover;
	background: var(--dh-primary-soft);
	color: var(--dh-on-accent);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	font-weight: 800;
	flex-shrink: 0;
}
.dh-tk-driver strong { display: block; font-size: 15px; }
.dh-tk-driver small { display: block; color: var(--dh-muted); font-size: 12px; margin-top: 2px; }

/* Área de ações no rodapé */
.dh-tk-actions { display: flex; flex-direction: column; gap: 10px; }

/* Card de confirmação — pergunta explícita ao cliente (não parece afirmação da loja) */
.dh-tk-confirm-card {
	background: var(--dh-surface);
	border: 1.5px dashed color-mix(in srgb, var(--dh-success-on) 50%, var(--dh-surface));
	border-radius: 12px;
	padding: 16px 18px;
	display: flex;
	gap: 14px;
	align-items: flex-start;
}
.dh-tk-confirm-icon {
	width: 40px; height: 40px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--dh-success-on) 14%, var(--dh-surface));
	color: var(--dh-success-on);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.dh-tk-confirm-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.dh-tk-confirm-body strong { font-size: 14px; color: var(--dh-text); }
.dh-tk-confirm-body small { font-size: 12px; color: var(--dh-muted); line-height: 1.4; margin-bottom: 8px; }
.dh-tk-confirm-btn {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	background: var(--dh-surface);
	color: var(--dh-success-on);
	border: 1.5px solid var(--dh-success-on);
	border-radius: 8px;
	font-family: inherit;
	font-weight: 600;
	font-size: 13px;
	cursor: pointer;
	transition: background .15s, color .15s;
}
.dh-tk-confirm-btn:hover { background: var(--dh-success-on); color: var(--dh-surface); }
.dh-tk-confirm-btn:disabled { opacity: .6; cursor: wait; }

/* WhatsApp button — estilo CardapioWeb (flat, retangular, full width) */
.dh-tk-wa {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 14px 18px;
	background: #25D366;
	color: white;
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	border-radius: 8px;
	transition: background .15s;
}
.dh-tk-wa:hover { background: #1ea952; }
.dh-tk-wa svg { width: 18px; height: 18px; }


/* QR Code renderizado localmente (Pix e cadastro de mesas). */
.dh-qr svg { display: block; width: 100%; height: auto; image-rendering: pixelated; }

/* ==========================================================================
   Camada "app" (Material Design 3, sem instalação): barra inferior, ripple.
   ========================================================================== */
.dh-bottom-nav { display: none; }
.dh-ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .14; transform: scale(0); animation: dh-ripple .45s var(--dh-ease-app); pointer-events: none; }
@keyframes dh-ripple { to { transform: scale(1); opacity: 0; } }
.dh-btn, .dh-item, .dh-nav-item, .dh-cart-bar, .dh-categories-scroll a, .dh-extra-opt, .dh-type-picker label, .dh-payment-picker label, .dh-bump { position: relative; overflow: hidden; -webkit-tap-highlight-color: transparent; }
.dh-btn, .dh-nav-item, .dh-cart-bar, .dh-categories-scroll a { user-select: none; }

@media (max-width: 767px) {
	:root { --dh-nav-h: 56px; }
	#dh-app { padding-bottom: calc(var(--dh-nav-h) + var(--dh-cartbar-h) + 24px + env(safe-area-inset-bottom)); }
	.dh-bottom-nav { position: fixed; z-index: calc(var(--dh-z-drawer) - 5); left: 0; right: 0; bottom: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
		height: calc(var(--dh-nav-h) + env(safe-area-inset-bottom)); padding: 0 4px env(safe-area-inset-bottom); background: var(--dh-surface); border-top: 1px solid var(--dh-line); }
	.dh-nav-item { display: grid; justify-items: center; align-content: center; gap: 2px; border: 0; background: none; color: var(--dh-muted); font: 500 10.5px/1.1 var(--dh-font); text-decoration: none; }
	.dh-nav-icon { position: relative; display: grid; place-items: center; width: 48px; height: 26px; border-radius: var(--dh-radius-pill); transition: background var(--dh-t); }
	.dh-nav-icon svg { width: 21px; height: 21px; }
	.dh-nav-item.is-active { color: var(--dh-ink); font-weight: 700; }
	.dh-nav-item.is-active .dh-nav-icon { background: var(--dh-primary-soft); color: var(--dh-on-accent); }
	.dh-nav-badge { position: absolute; top: -3px; right: 8px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--dh-cta); color: var(--dh-cta-contrast); font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
}

/* ==========================================================================
   Meus pedidos e acompanhamento — escala compacta e timeline vertical.
   (Os estilos-base dessas telas estão acima; aqui só a densidade de app.)
   ========================================================================== */
.dh-mo-topbar { position: sticky; top: 0; z-index: var(--dh-z-header); min-height: 52px; padding: calc(4px + env(safe-area-inset-top)) 8px 4px !important; gap: 4px !important; background: var(--dh-surface) !important; border-bottom: 1px solid var(--dh-line); box-shadow: none !important; }
.dh-mo-topbar h1 { font-size: var(--dh-fs-xl) !important; font-weight: 700 !important; margin: 0 !important; }
.dh-mo-back, .dh-mo-logout { width: 40px !important; height: 40px !important; border-radius: 50% !important; box-shadow: none !important; background: transparent !important; }
.dh-mo-main { padding: 12px !important; gap: 10px !important; }
.dh-mo-login, .dh-mo-empty { padding: 28px 18px !important; border-radius: 16px !important; box-shadow: none !important; border: 1px solid var(--dh-line); }
.dh-mo-login h2, .dh-mo-empty h2 { font-size: var(--dh-fs-lg) !important; font-weight: 700 !important; }
.dh-mo-login p, .dh-mo-empty p { font-size: var(--dh-fs-sm) !important; }
.dh-mo-login-icon, .dh-mo-empty-icon { width: 52px !important; height: 52px !important; }
.dh-mo-login-icon svg, .dh-mo-empty-icon svg { width: 24px !important; height: 24px !important; }
.dh-mo-login .dh-btn, .dh-mo-empty .dh-btn, .dh-mo-cta { min-height: var(--dh-btn-h) !important; font-size: var(--dh-fs-md) !important; }
.dh-mo-order { border-radius: 14px !important; box-shadow: none !important; border: 1px solid var(--dh-line); }
.dh-mo-order-title { font-size: var(--dh-fs-md) !important; }
.dh-mo-section h2, .dh-mo-section h3 { font-size: var(--dh-fs-xs) !important; text-transform: uppercase; letter-spacing: .06em; color: var(--dh-muted) !important; }

.dh-tk-hero { padding: 12px 14px !important; gap: 12px !important; border-radius: 14px !important; box-shadow: none !important; border: 1px solid var(--dh-line); }
.dh-tk-hero-icon { width: 40px !important; height: 40px !important; }
.dh-tk-hero-icon svg { width: 20px !important; height: 20px !important; }
.dh-tk-hero h2 { font-size: var(--dh-fs-xl) !important; margin: 2px 0 !important; }
.dh-tk-hero p { font-size: var(--dh-fs-sm) !important; margin: 0 !important; }
.dh-tk-live { font-size: var(--dh-fs-xs) !important; }
/* Timeline: ✓ concluído · ● atual · ○ próximo, uma linha por etapa. */
.dh-tk-timeline { display: grid !important; grid-template-columns: 1fr !important; gap: 0 !important; padding: 8px 14px !important; border-radius: 14px !important; background: var(--dh-surface) !important; border: 1px solid var(--dh-line); box-shadow: none !important; overflow: visible !important; }
.dh-tk-line { display: none !important; }
.dh-tk-step { position: relative; display: grid !important; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px; min-height: 34px; padding: 0 !important; text-align: left !important; flex: none !important; width: auto !important; }
.dh-tk-step:not(:last-child)::after { content: ""; position: absolute; left: 10px; top: 24px; bottom: -10px; width: 2px; background: var(--dh-line); }
.dh-tk-step.is-done:not(:last-child)::after { background: var(--dh-success); }
.dh-tk-dot { width: 22px !important; height: 22px !important; margin: 0 !important; border-radius: 50% !important; border: 2px solid var(--dh-line-strong) !important; background: var(--dh-surface) !important; display: grid !important; place-items: center; position: relative; z-index: 1; box-shadow: none !important; }
.dh-tk-check { display: none; color: #fff; }
.dh-tk-check svg { width: 12px !important; height: 12px !important; }
.dh-tk-step.is-done .dh-tk-dot { background: var(--dh-success) !important; border-color: var(--dh-success) !important; }
.dh-tk-step.is-done .dh-tk-check { display: grid; }
.dh-tk-step.is-active .dh-tk-dot { border-color: var(--dh-selection) !important; }
.dh-tk-step.is-active .dh-tk-dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--dh-selection); }
.dh-tk-step-label { font-size: var(--dh-fs-md) !important; font-weight: 500 !important; color: var(--dh-ink-2) !important; margin: 0 !important; }
.dh-tk-step.is-active .dh-tk-step-label { font-weight: 700 !important; color: var(--dh-ink) !important; }
.dh-tk-step.is-pending .dh-tk-step-label { color: var(--dh-muted) !important; }
.dh-tk-step time { font-size: var(--dh-fs-xs) !important; color: var(--dh-muted) !important; margin: 0 !important; }
.dh-tk-cards { gap: 10px !important; }
.dh-tk-card { border-radius: 14px !important; box-shadow: none !important; border: 1px solid var(--dh-line); }
.dh-tk-card-head { padding: 10px 14px !important; gap: 8px !important; }
.dh-tk-card-head h3 { font-size: var(--dh-fs-md) !important; font-weight: 600 !important; }
.dh-tk-card-head svg { width: 16px !important; height: 16px !important; }
.dh-tk-card-body { padding: 0 14px 12px !important; font-size: var(--dh-fs-sm) !important; }
.dh-tk-items li { gap: 8px !important; padding: 6px 0 !important; font-size: var(--dh-fs-sm) !important; }
.dh-tk-qty { min-width: 22px !important; height: 22px !important; font-size: var(--dh-fs-xs) !important; }
.dh-tk-item-info strong { font-size: var(--dh-fs-md) !important; font-weight: 600 !important; }
.dh-tk-totals { font-size: var(--dh-fs-sm) !important; }
.dh-tk-total-row { font-size: var(--dh-fs-lg) !important; }
.dh-tk-confirm-card { padding: 14px !important; border-radius: 14px !important; box-shadow: none !important; }
.dh-tk-confirm-btn, .dh-tk-wa { min-height: var(--dh-btn-h) !important; font-size: var(--dh-fs-md) !important; border-radius: 12px !important; }

/* ==========================================================================
   Minha conta (mesa) e pagamento Pix — app bar, linhas de valores, CTA.
   ========================================================================== */
.dh-table-page { background: var(--dh-bg); font-size: var(--dh-fs-md); }
.dh-appbar { position: sticky; top: 0; z-index: var(--dh-z-header); display: flex; align-items: center; gap: 6px; min-height: 52px; padding: calc(4px + env(safe-area-inset-top)) 12px 4px 4px; background: var(--dh-surface); border-bottom: 1px solid var(--dh-line); }
.dh-appbar h1 { margin: 0; font-size: var(--dh-fs-xl); font-weight: 700; }
.dh-appbar small { display: block; color: var(--dh-muted); font-size: var(--dh-fs-xs); }
.dh-appbar-logo { width: 32px; height: 32px; border-radius: 10px; object-fit: cover; margin-left: 8px; }
.dh-account-main { max-width: 520px; margin: 0 auto; padding: 12px 12px calc(var(--dh-nav-h) + 20px + env(safe-area-inset-bottom)); display: grid; gap: 10px; }
.dh-account-card { padding: 14px; border-radius: 16px; background: var(--dh-surface); border: 1px solid var(--dh-line); display: grid; gap: 10px; }
#dh-account-content { display: grid; gap: 10px; }
.dh-account-card h2 { margin: 0; font-size: var(--dh-fs-lg); font-weight: 700; }
.dh-account-empty { text-align: center; justify-items: center; padding: 28px 16px; }
.dh-account-empty strong { font-size: var(--dh-fs-lg); }
.dh-account-empty p { margin: 0; color: var(--dh-muted); font-size: var(--dh-fs-sm); }
.dh-bill-figures { display: grid; gap: 0; }
.dh-bill-figures > div { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--dh-line); }
.dh-bill-figures small { color: var(--dh-muted); font-size: var(--dh-fs-md); }
.dh-bill-figures strong { font-size: var(--dh-fs-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.dh-bill-figures .is-balance { border-bottom: 0; padding-top: 8px; }
.dh-bill-figures .is-balance small { color: var(--dh-ink); font-weight: 600; }
.dh-bill-figures .is-balance strong { font-size: 20px; font-weight: 700; }
.dh-bill-note { margin: 0; color: var(--dh-warning); font-size: var(--dh-fs-sm); }
.dh-bill-ok, .dh-bill-done { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; border-radius: 12px; background: var(--dh-success-soft); color: var(--dh-success); font-size: var(--dh-fs-sm); }
.dh-bill-ok strong, .dh-bill-done strong { font-size: var(--dh-fs-lg); }
.dh-account-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dh-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.dh-order-mini { padding: 8px 0; border-top: 1px solid var(--dh-line); display: grid; gap: 2px; }
.dh-order-mini:first-child { border-top: 0; padding-top: 0; }
.dh-order-mini-head { display: flex; align-items: center; gap: 8px; font-size: var(--dh-fs-md); }
.dh-order-mini-head strong { font-weight: 600; }
.dh-order-mini-head .dh-money { margin-left: auto; }
.dh-order-mini ul { margin: 0; padding: 0; list-style: none; color: var(--dh-muted); font-size: var(--dh-fs-sm); }
.dh-chip-status { padding: 1px 8px; border-radius: var(--dh-radius-pill); background: var(--dh-surface-2); color: var(--dh-ink-2); font-size: var(--dh-fs-xs); font-weight: 600; }
.dh-inline { display: flex; gap: 8px; }
.dh-pix-custom summary { cursor: pointer; font-weight: 600; color: var(--dh-link); min-height: 36px; display: flex; align-items: center; font-size: var(--dh-fs-md); }
.dh-requests { display: grid; gap: 6px; }
.dh-request { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--dh-surface-2); }
.dh-request a { display: grid; color: var(--dh-ink); text-decoration: none; font-size: var(--dh-fs-md); }
.dh-request small { color: var(--dh-muted); font-size: var(--dh-fs-xs); }
.dh-pay-hero { text-align: center; justify-items: center; gap: 4px; }
.dh-pay-hero small { color: var(--dh-muted); font-size: var(--dh-fs-sm); }
.dh-pay-amount { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.dh-pay-status { margin: 4px 0 0; padding: 5px 12px; border-radius: var(--dh-radius-pill); background: var(--dh-surface-2); color: var(--dh-ink-2); font-weight: 600; font-size: var(--dh-fs-sm); }
.dh-pay-status[data-tone="success"] { background: var(--dh-success-soft); color: var(--dh-success); }
.dh-pay-status[data-tone="info"] { background: var(--dh-info-soft); color: var(--dh-info); }
.dh-pay-status[data-tone="error"] { background: var(--dh-danger-soft); color: var(--dh-danger); }
.dh-pay-qr { justify-self: center; width: min(100%, 200px); }
.dh-pay-qr svg, .dh-pay-qr canvas, .dh-pay-qr img { width: 100%; height: auto; }
.dh-pay-code { font: 400 13px/1.35 ui-monospace, Menlo, monospace !important; word-break: break-all; }

.dh-toasts.is-raised { bottom: calc(132px + env(safe-area-inset-bottom)); }
.dh-mo-wrap { padding-bottom: calc(var(--dh-nav-h) + var(--dh-cartbar-h) + 32px + env(safe-area-inset-bottom)); }
.dh-extra-price.is-final { color: var(--dh-ink); font-weight: 600; } /* size/variant: final price, not an add-on */
