/* public/assets/restaurants/menu.css
 * Restaurants module — public menu, kitchen view, edit panel.
 * Premium minimal style (Apple/DJI reference). Mobile-first.
 * CSS class prefix: r-
 */

/* ── Design tokens ────────────────────────────────────────────── */
:root {
    /* Typography */
    --r-font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --r-text-xs: 0.6875rem;   /* 11px */
    --r-text-sm: 0.8125rem;   /* 13px */
    --r-text-base: 0.9375rem; /* 15px */
    --r-text-md: 1.0625rem;   /* 17px */
    --r-text-lg: 1.25rem;     /* 20px */
    --r-text-xl: 1.625rem;    /* 26px */
    --r-text-2xl: 2.25rem;    /* 36px */

    /* Palette — warm neutrals (not pure black/white) */
    --r-ink: #1a1a2e;
    --r-ink-light: #2d2d44;
    --r-ink-muted: #6b7280;
    --r-ink-faint: #9ca3af;
    --r-surface: #ffffff;
    --r-surface-raised: #ffffff;
    --r-surface-subtle: #f8f9fb;
    --r-bg: #f3f4f6;
    --r-border: #e5e7eb;
    --r-border-light: #f0f1f3;
    --r-accent: #4f46e5;
    --r-accent-light: #eef2ff;
    --r-success: #059669;
    --r-success-light: #ecfdf5;
    --r-danger: #dc2626;
    --r-danger-light: #fef2f2;
    --r-warn: #d97706;
    --r-warn-light: #fffbeb;

    /* Shadows — multi-layer for depth */
    --r-shadow-xs: 0 1px 2px rgba(0,0,0,.04);
    --r-shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --r-shadow-md: 0 4px 12px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
    --r-shadow-lg: 0 8px 24px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
    --r-shadow-xl: 0 16px 48px rgba(0,0,0,.1), 0 4px 12px rgba(0,0,0,.06);

    /* Spacing — 4px scale */
    --r-sp-1: 4px;
    --r-sp-2: 8px;
    --r-sp-3: 12px;
    --r-sp-4: 16px;
    --r-sp-5: 20px;
    --r-sp-6: 24px;
    --r-sp-8: 32px;
    --r-sp-10: 40px;
    --r-sp-12: 48px;

    /* Radius — subtle, not rounded */
    --r-radius-sm: 4px;
    --r-radius-md: 8px;
    --r-radius-lg: 12px;
    --r-radius-xl: 16px;
    --r-radius-full: 9999px;

    /* Transitions */
    --r-tr-fast: 0.15s ease;
    --r-tr-base: 0.22s ease;
    --r-tr-smooth: 0.3s cubic-bezier(.4,0,.2,1);
    --r-tr-spring: 0.4s cubic-bezier(.34,1.56,.64,1);

    /* Layout */
    --r-header-h: 64px;
    --r-cat-nav-h: 52px;
}

* { box-sizing: border-box; }
html {
    scroll-behavior: smooth;
}
html, body {
    margin: 0; padding: 0;
    font-family: var(--r-font);
    background: var(--r-bg);
    color: var(--r-ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'kern', 'liga', 'cv11';
}
body { min-height: 100vh; min-height: 100dvh; }

/* El atributo HTML [hidden] debe ganar sobre cualquier display:flex/grid/block
   específico (.r-day-banner, .r-welcome-toast, .r-context-pill, etc. lo
   declaran y sin esto se ignoraba el hidden=true → banner vacío visible). */
[hidden] { display: none !important; }

a { color: inherit; text-decoration: none; }
button {
    font-family: inherit;
    cursor: pointer;
    /* Mobile touch baseline — eliminates 300ms double-tap-zoom delay,
       hides the ugly default grey tap highlight, prevents accidental selection */
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0,0,0,.08);
    user-select: none;
    -webkit-user-select: none;
}

/* ── Header / branding ─────────────────────────────────────────── */
/* Header del cliente público — sticky arriba con altura calculada via CSS var.
   La nav de categorías y el scroll-margin de las secciones leen --r-header-h
   para mantenerse sincronizados sin números mágicos. */
.r-header {
    background: var(--r-ink);
    color: #fff;
    padding: 0 var(--r-sp-5);
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 0 rgba(0,0,0,.1), var(--r-shadow-md);
    height: var(--r-header-h);
    box-sizing: border-box;
    display: flex;
    align-items: center;
}
.r-header__row {
    display: flex;
    align-items: center;
    gap: var(--r-sp-4);
    width: 100%;
    min-width: 0;
}
.r-brand {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.2;
}
.r-brand__name {
    display: block;
    font-size: var(--r-text-md);
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}
.r-brand__tagline {
    display: block;
    font-weight: 500;
    opacity: 0.55;
    font-size: var(--r-text-xs);
    margin-top: 2px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Native select for locale in client header — universal cross-browser. */
.r-header__locale {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    height: 36px;
    box-sizing: border-box;
    background-color: rgba(255,255,255,.08);
    color: #fff;
    border: 1px solid rgba(255,255,255,.15);
    padding: 0 30px 0 12px;
    font-family: inherit;
    font-size: var(--r-text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 9px center;
    border-radius: var(--r-radius-sm);
    margin: 0;
    transition: border-color var(--r-tr-fast), background-color var(--r-tr-fast);
}
.r-header__locale:hover { border-color: rgba(255,255,255,.4); background-color: rgba(255,255,255,.12); }
.r-header__locale:focus { outline: none; }
.r-header__locale option {
    background: var(--r-ink);
    color: #fff;
}

/* Sign-in link — same visual weight as locale select */
.r-header__signin {
    display: flex; align-items: center; gap: 6px;
    height: 36px; box-sizing: border-box;
    padding: 0 12px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: var(--r-radius-sm);
    color: #fff; text-decoration: none;
    font-size: var(--r-text-xs); font-weight: 600;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    transition: border-color var(--r-tr-fast), background-color var(--r-tr-fast);
}
.r-header__signin:hover { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.12); }
.r-signin-text { display: inline; }
.r-signin-icon { display: none; align-items: center; justify-content: center; }
.r-signin-icon svg { stroke: #fff; }

@media (max-width: 768px) {
    .r-signin-text { display: none; }
    .r-signin-icon { display: flex; }
    .r-header__signin { padding: 0 8px; border: none; background: none; }
}

/* ── Instalar la carta como app — paridad con el booking de klinio (verticales
   gemelas). Icono en cabecera (mismo peso que sign-in) + tarjeta pre-footer +
   pista iOS. Estilo flat/industrial de restaurants (tokens r-, no el radius HC). ── */
.r-header__install {
    display: flex; align-items: center; gap: 6px;
    height: 36px; box-sizing: border-box;
    padding: 0 12px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: var(--r-radius-sm);
    color: #fff;
    font-family: inherit;
    font-size: var(--r-text-xs); font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color var(--r-tr-fast), background-color var(--r-tr-fast);
}
.r-header__install:hover { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.12); }
.r-header__install svg { stroke: #fff; }
@media (max-width: 768px) {
    .r-header__install-label { display: none; }
    .r-header__install { padding: 0 8px; border: none; background: none; }
}

.r-install-card {
    display: flex; align-items: center; gap: 14px;
    max-width: 560px; margin: 24px auto; padding: 16px 18px;
    background: #fafafa; border: 1px solid var(--r-border); color: var(--r-ink);
    border-radius: var(--r-radius-sm);
}
.r-install-card__icon { flex-shrink: 0; display: inline-flex; }
.r-install-card__icon svg { width: 26px; height: 26px; fill: none; stroke: var(--r-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.r-install-card__body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.r-install-card__title { font-size: 15px; font-weight: 700; }
.r-install-card__sub { font-size: 13px; color: var(--r-ink-faint); line-height: 1.4; }
.r-install-card__btn {
    flex-shrink: 0; background: var(--r-ink); color: #fff; border: none;
    border-radius: var(--r-radius-sm);
    padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.r-install-card__btn:hover { opacity: .9; }
.r-install-card__hint {
    max-width: 560px; margin: -8px auto 16px; padding: 10px 14px;
    background: var(--r-ink); color: #fff; border-radius: var(--r-radius-sm);
    font-size: 13px; line-height: 1.4;
}
@media (max-width: 560px) {
    .r-install-card { flex-direction: column; align-items: flex-start; margin: 20px 16px; }
    .r-install-card__btn { align-self: stretch; }
    .r-install-card__hint { margin: -8px 16px 16px; }
}

/* ── Cart strip (sticky bajo el header, encima de la nav de categorías) ──
   Solo visible cuando hay items. Da feedback persistente al cliente
   incluso cuando hace scroll por las categorías o cambia de idioma. */
.r-cart-strip {
    /* Reset button */
    -webkit-appearance: none;
    appearance: none;
    border: none;
    border-radius: 0;
    margin: 0;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    /* Layout */
    position: -webkit-sticky;
    position: sticky;
    top: var(--r-header-h);
    z-index: 45;
    width: 100%;
    height: 44px;
    box-sizing: border-box;
    padding: 0 var(--r-sp-5);
    background: var(--r-accent);
    color: #fff;
    display: flex;
    align-items: center;
    gap: var(--r-sp-3);
    box-shadow: var(--r-shadow-sm);
    transition: -webkit-transform 250ms cubic-bezier(0.32, 0.72, 0, 1);
    transition:         transform 250ms cubic-bezier(0.32, 0.72, 0, 1);
}
.r-cart-strip__icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    color: #fafafa;
    opacity: 0.85;
}
.r-cart-strip__text {
    font-size: var(--r-text-sm);
    font-weight: 600;
    letter-spacing: 0.01em;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
}
.r-cart-strip__cta {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
    opacity: 0.9;
}
.r-cart-strip[hidden] { display: none; }

/* Pulse animation: scale 1 → 1.04 → 1 cuando el carrito cambia.
   Refuerzo visual psicológico — confirma al cliente que su acción se registró.
   Aplica tanto al strip de arriba como al cart bar de abajo. */
@-webkit-keyframes rCartPulse {
    0%, 100% { -webkit-transform: scale(1); transform: scale(1); }
    40%      { -webkit-transform: scale(1.04); transform: scale(1.04); }
}
@keyframes rCartPulse {
    0%, 100% { -webkit-transform: scale(1); transform: scale(1); }
    40%      { -webkit-transform: scale(1.04); transform: scale(1.04); }
}
.r-cart-strip.is-pulse,
.r-cart-bar.is-pulse {
    -webkit-animation: rCartPulse 320ms cubic-bezier(0.32, 0.72, 0, 1);
            animation: rCartPulse 320ms cubic-bezier(0.32, 0.72, 0, 1);
}

/* ── Session strip — accumulated table tab (Adyen / Sunday pattern) ──
   Shown above the cart-bar when the cart has items AND the user already
   sent earlier orders from the same table. Keeps the running tab visible
   without competing with the cart CTA.

   Semantic <div role="button"> — the entire strip is the tap target
   (≥48px tall thanks to padding+font-size), the "Ver" affordance inside
   is a visual hint, not an independent button. */
.r-session-strip {
    position: fixed;
    left: 0; right: 0;
    /* Sit just above the cart-bar; account for iOS safe-area so we don't
       slide under the gesture bar / notch on iPhones (15 Pro, etc). */
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    background: var(--r-accent-light);
    color: var(--r-ink);
    border-top: 1px solid var(--r-border);
    padding: var(--r-sp-3) var(--r-sp-5);
    display: flex;
    align-items: center;
    gap: var(--r-sp-3);
    font-size: var(--r-text-sm);
    z-index: 59;
    cursor: pointer;
    /* Mobile baseline from CLAUDE.md feedback_mobile_touch_baseline */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-user-select: none;
            user-select: none;
}
.r-session-strip[hidden] { display: none; }
.r-session-strip:active {
    background: color-mix(in srgb, var(--r-accent-light) 88%, var(--r-ink) 12%);
}
.r-session-strip:focus-visible {
    outline: 2px solid var(--r-accent);
    outline-offset: -2px;
}
.r-session-strip__label {
    color: var(--r-ink-muted);
    font-weight: 600;
    letter-spacing: 0.01em;
}
.r-session-strip__total {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--r-ink);
}
.r-session-strip__view {
    margin-left: auto;
    /* Visual button hint with comfortable touch padding (the whole strip
       is what the user actually taps — this just looks like a CTA). */
    color: var(--r-accent);
    font-weight: 600;
    font-size: var(--r-text-sm);
    padding: var(--r-sp-2) var(--r-sp-3);
    pointer-events: none; /* clicks fall through to the strip parent */
}
[dir="rtl"] .r-session-strip__view { margin-left: 0; margin-right: auto; }

/* ── Order detail card — line-by-line history in tracking drawer ─── */
.r-order-card {
    border: 1px solid var(--r-border);
    background: var(--r-surface);
    padding: var(--r-sp-4);
    margin-bottom: var(--r-sp-3);
}
.r-order-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--r-sp-3);
    font-size: var(--r-text-sm);
}
.r-order-card__id {
    font-weight: 700;
    color: var(--r-ink);
    font-variant-numeric: tabular-nums;
}
.r-order-card__status {
    color: var(--r-ink-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: var(--r-text-xs);
}
.r-order-card__status--ready    { color: var(--r-accent); }
.r-order-card__status--served   { color: var(--r-ink-muted); }
.r-order-card__status--cancelled { color: var(--r-ink-muted); }

/* S122 — diferenciación sutil del pedido activo en tab review (canon Sunday).
   Border accent destaca el ticket vigente sin alterar la estructura ni
   eliminar información. Si además está ready, el border pulsa suavemente
   para llamar la atención (canon: notificación visual no intrusiva). */
.r-order-card--active {
    border-color: var(--r-accent);
    border-width: 1px;
    box-shadow: 0 0 0 1px var(--r-accent);
}
.r-order-card--active-ready {
    -webkit-animation: rOrderActivePulse 1.6s ease-in-out infinite;
            animation: rOrderActivePulse 1.6s ease-in-out infinite;
}
@-webkit-keyframes rOrderActivePulse {
    0%, 100% { box-shadow: 0 0 0 1px var(--r-accent); }
    50%      { box-shadow: 0 0 0 3px var(--r-accent-light); }
}
@keyframes rOrderActivePulse {
    0%, 100% { box-shadow: 0 0 0 1px var(--r-accent); }
    50%      { box-shadow: 0 0 0 3px var(--r-accent-light); }
}
.r-order-card__items {
    display: flex;
    flex-direction: column;
    gap: var(--r-sp-2);
}
.r-order-card__line {
    display: flex;
    align-items: baseline;
    gap: var(--r-sp-3);
    font-size: var(--r-text-sm);
    color: var(--r-ink);
}
.r-order-card__line-qty {
    color: var(--r-ink-muted);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 1.8rem;
}
.r-order-card__line-name { flex: 1; }
.r-order-card__line-price {
    font-variant-numeric: tabular-nums;
    color: var(--r-ink);
}
.r-order-card__foot {
    margin-top: var(--r-sp-3);
    padding-top: var(--r-sp-3);
    border-top: 1px solid var(--r-border-light);
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: var(--r-text-sm);
    font-variant-numeric: tabular-nums;
}
.r-order-card__total--cancelled {
    text-decoration: line-through;
    color: var(--r-ink-muted);
}
.r-order-card--cancelled .r-order-card__line-name,
.r-order-card--cancelled .r-order-card__line-price {
    color: var(--r-ink-muted);
}

/* ── Session total — sticky summary at the bottom of tracking body ── */
.r-session-total {
    position: -webkit-sticky;
    position: sticky;
    bottom: 0;
    background: var(--r-surface);
    border-top: 1px solid var(--r-border);
    padding: var(--r-sp-4) 0;
    margin-top: var(--r-sp-3);
}
.r-session-total__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: var(--r-text-md);
    font-weight: 700;
    color: var(--r-ink);
}
.r-session-total__amount {
    font-variant-numeric: tabular-nums;
}
.r-session-total__hint {
    margin-top: var(--r-sp-2);
    font-size: var(--r-text-xs);
    color: var(--r-ink-muted);
    font-weight: 400;
}

/* S122 — hint agregado cuando todos los pedidos vigentes comparten estado.
   Canon Sunday/Adyen: anclaje contextual breve antes del total para que
   el cliente capte el momento sin leer ticket-por-ticket. Color por estado
   (accent para acción esperada, ink-muted para estados neutrales). */
.r-session-total__agg {
    margin-bottom: var(--r-sp-2);
    font-size: var(--r-text-sm);
    font-weight: 600;
    letter-spacing: 0.01em;
}
.r-session-total__agg--pending   { color: var(--r-ink-muted); }
.r-session-total__agg--preparing { color: var(--r-accent); }
.r-session-total__agg--ready     { color: var(--r-accent); }

/* ── Categories nav (sticky justo debajo del header + strip) ─── */
.r-cat-nav {
    background: var(--r-surface);
    border-bottom: 1px solid var(--r-border);
    padding: 0 var(--r-sp-5);
    position: -webkit-sticky;
    position: sticky;
    top: var(--r-header-h);
    z-index: 40;
    height: var(--r-cat-nav-h);
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    display: flex;
    align-items: center;
    gap: var(--r-sp-1);
    scrollbar-width: none;
}
.r-cat-nav::-webkit-scrollbar { display: none; }
.r-cat-nav button {
    background: transparent; border: none;
    padding: var(--r-sp-2) var(--r-sp-4);
    font-size: var(--r-text-sm); font-weight: 600;
    color: var(--r-ink-muted);
    border-bottom: 2px solid transparent;
    transition: color var(--r-tr-fast), border-color var(--r-tr-fast);
    border-radius: 0;
}
.r-cat-nav button:hover { color: var(--r-ink); }
.r-cat-nav button.is-active {
    color: var(--r-ink); border-bottom-color: var(--r-accent);
}

/* ── Menu list ────────────────────────────────────────────────── */
.r-main { padding: var(--r-sp-5) var(--r-sp-5) 8rem var(--r-sp-5); max-width: 720px; margin: 0 auto; }

/* Cuando el cart strip está visible, la nav de categorías queda debajo
   del strip (ambos sticky, stack natural). El scroll-margin-top de los
   títulos debe respetar también la altura del strip (44px) o se ocultan. */
:root { --r-cart-strip-h: 0px; }
body.has-cart-strip { --r-cart-strip-h: 44px; }
body.has-cart-strip .r-cat-nav {
    top: calc(var(--r-header-h) + var(--r-cart-strip-h));
}

.r-cat-title {
    font-size: var(--r-text-xs); font-weight: 700; margin: var(--r-sp-8) 0 var(--r-sp-4) 0;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--r-ink-muted);
    /* Reservar el espacio del header sticky + (strip si está) + nav sticky
       cuando se hace scroll-into-view via click en un tab. */
    scroll-margin-top: calc(var(--r-header-h) + var(--r-cart-strip-h) + var(--r-cat-nav-h) + 8px);
}
.r-cat-title:first-child { margin-top: var(--r-sp-4); }

.r-item {
    display: flex; gap: var(--r-sp-4);
    background: var(--r-surface);
    padding: var(--r-sp-4);
    margin-bottom: var(--r-sp-3);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-md);
    cursor: pointer;
    transition: box-shadow var(--r-tr-fast), border-color var(--r-tr-fast), transform var(--r-tr-fast);
    box-shadow: var(--r-shadow-xs);
}
.r-item:hover { box-shadow: var(--r-shadow-md); border-color: var(--r-border); }
.r-item:active { transform: scale(.985); box-shadow: var(--r-shadow-xs); }
.r-item__img {
    position: relative;
    width: 80px; height: 80px;
    background: #fff;
    flex-shrink: 0;
    /* contain — never crop. Product photos are shot on white, so a white tile
       lets them float seamlessly (no grey "boxed photo" band). */
    background-size: contain; background-repeat: no-repeat; background-position: center;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.25rem;
    line-height: 1;
    border-radius: var(--r-radius-sm);
    overflow: hidden;
}
.r-item__img--has-image { font-size: 0; }
.r-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.r-item__name {
    font-size: var(--r-text-base); font-weight: 600; margin: 0 0 var(--r-sp-1) 0;
    letter-spacing: -0.01em;
    color: var(--r-ink);
}
.r-item__desc {
    font-size: var(--r-text-sm); color: var(--r-ink-muted);
    margin: 0 0 var(--r-sp-2) 0; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.r-item__price {
    font-size: var(--r-text-base); font-weight: 700; color: var(--r-ink);
    font-variant-numeric: tabular-nums;
}

/* ── Modal (item detail / modifiers) ───────────────────────────── */
.r-modal {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex; align-items: flex-end; justify-content: center;
    z-index: 100;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 280ms cubic-bezier(0.32, 0.72, 0, 1);
}
.r-modal.is-open { opacity: 1; pointer-events: auto; }
.r-modal__panel {
    background: var(--r-surface);
    width: 100%; max-width: 560px;
    max-height: 90vh; overflow-y: auto;
    /* NO top padding: the sticky bar pins to the content-box top edge, so any
       top padding leaves a dead strip above the bar where scrolled content
       bleeds through. All content lives inside .r-modal__sheet (own padding). */
    padding: 0 var(--r-sp-6) var(--r-sp-6);
    border-radius: var(--r-radius-lg) var(--r-radius-lg) 0 0;
    box-shadow: var(--r-shadow-xl);
    -webkit-overflow-scrolling: touch;
    -webkit-transform: translate3d(0, 100%, 0);
            transform: translate3d(0, 100%, 0);
    transition: transform 350ms cubic-bezier(0.32, 0.72, 0, 1);
}
.r-modal.is-open .r-modal__panel {
    -webkit-transform: translate3d(0, 0, 0);
            transform: translate3d(0, 0, 0);
}
/* "Genie" confirm close on add-to-cart: the sheet shrinks toward the cart bar
   (bottom) instead of a plain slide. Slower + eased so it reads as a deliberate
   gesture. Overlay fade is slowed to match so the genie plays to the end. */
.r-modal.is-confirming { transition: opacity 480ms ease; }
.r-modal.is-confirming .r-modal__panel {
    transition: transform 480ms cubic-bezier(0.4, 0, 0.2, 1), opacity 380ms ease;
    transform-origin: 50% 130%;
    -webkit-transform: translate3d(0, 6%, 0) scale(0.86);
            transform: translate3d(0, 6%, 0) scale(0.86);
    opacity: 0;
}
.r-modal__img {
    /* Hero: full-bleed SQUARE — the exact 1:1 treatment that already works in the
       card. The source photos are 1024×1024, so a square box + `contain` fills the
       hero edge-to-edge with NO side/top gaps and never crops the product.
       STICKY: the hero pins to the top while the content sheet scrolls over it and
       fades it out (Material collapsing toolbar / Wikipedia gallery). The sticky
       bar (z-index 6) overlays its top corner. */
    position: sticky; top: 0; z-index: 0;
    aspect-ratio: 1 / 1;
    width: calc(100% + 2 * var(--r-sp-6));
    margin: 0 calc(-1 * var(--r-sp-6)) 0 calc(-1 * var(--r-sp-6));
    background-color: #fff;
    background-size: contain; background-repeat: no-repeat; background-position: center;
    display: flex; align-items: center; justify-content: center;
    font-size: 5rem;
    line-height: 1;
    border-radius: var(--r-radius-lg) var(--r-radius-lg) 0 0;
    overflow: hidden;
}
/* Content sheet that rises over the sticky hero (rounded top, soft lift). */
.r-modal__sheet {
    position: relative; z-index: 1;
    background: var(--r-surface);
    margin: calc(-1 * var(--r-sp-5)) calc(-1 * var(--r-sp-6)) calc(-1 * var(--r-sp-6));
    padding: var(--r-sp-5) var(--r-sp-6) var(--r-sp-6);
    border-radius: var(--r-radius-lg) var(--r-radius-lg) 0 0;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.06);
}
/* No hero (image-less item): the sheet is flush at the panel top, with room for
   the sticky back-bar (52px) instead of overlapping a hero. */
.r-modal__sheet--flush {
    margin-top: 0;
    border-radius: 0;
    box-shadow: none;
    padding-top: calc(52px + var(--r-sp-2));
}

/* ── Image preloader: skeleton shimmer → fade-in (cards, list, hero) ──
   Background-image boxes can't fire `load`, so JS preloads via `new Image()`,
   paints the bg + flips `.is-loaded`. The shimmer overlay fades out on top of
   the (now painted) image → reads as a smooth reveal. Same UX as Pharmacy. */
.r-img::before {
    content: ''; position: absolute; inset: 0; z-index: 1;
    opacity: 0; pointer-events: none;
    background: linear-gradient(90deg, #eef1f5 0%, #f7f9fb 40%, #eef1f5 80%);
    background-size: 200% 100%;
    transition: opacity 0.4s ease;
}
.r-img.is-loading::before {
    opacity: 1;
    animation: rImgShimmer 1.4s ease-in-out infinite;
}
@keyframes rImgShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.r-modal__img--has-image { background-color: #fff; font-size: 0; }

/* ── Collapsing app-bar over the hero (Material/Wikipedia pattern) ──
   Transparent bar overlaying the hero top; turns solid white + reveals the
   title once the sheet is scrolled past the hero. */
.r-modal__bar {
    position: sticky; top: 0; z-index: 6;
    height: 52px; margin: 0 calc(-1 * var(--r-sp-6)) -52px calc(-1 * var(--r-sp-6));
    width: calc(100% + 2 * var(--r-sp-6));
    display: flex; align-items: center; gap: var(--r-sp-2);
    padding: 0 var(--r-sp-3);
    /* Reveal driven by --bar-reveal (0→1), tied to the <h2> sliding under the
       bar. The reveal flips across a narrow band, so a short transition smooths
       the crossfade (no lag: reveal is ~binary, not tracking scroll frame-by-
       frame). bg/border/title/back-chip all interpolate from the same value. */
    background-color: rgba(255, 255, 255, var(--bar-reveal, 0));
    border-bottom: 1px solid rgba(15, 23, 42, calc(var(--bar-reveal, 0) * 0.08));
    transition: background-color 200ms ease, border-color 200ms ease;
    pointer-events: none;
}
.r-modal__bar.is-solid {
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
/* No-hero items: bar is solid white from the start so scrolled content never
   bleeds through it (the title still fades in on scroll via --bar-reveal). */
.r-modal__bar--plain {
    background: var(--r-surface);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.r-modal__bar-back {
    pointer-events: auto;
    width: 44px; height: 44px; flex: 0 0 auto;   /* ≥44px touch target (contract §7) */
    display: flex; align-items: center; justify-content: center;
    border: none; border-radius: var(--r-radius-full, 999px);
    /* the circular chip dissolves as the bar turns solid */
    background-color: rgba(255, 255, 255, calc(0.85 * (1 - var(--bar-reveal, 0))));
    box-shadow: 0 1px 2px rgba(0, 0, 0, calc(0.12 * (1 - var(--bar-reveal, 0))));
    color: var(--r-ink);
    font-size: 26px; line-height: 1; cursor: pointer;
    transition: background-color 200ms ease, box-shadow 200ms ease;
}
.r-modal__bar-title {
    flex: 1 1 auto; min-width: 0;                 /* required for ellipsis in flex */
    font-size: var(--r-text-md); font-weight: 700; letter-spacing: -0.01em;
    color: var(--r-ink); opacity: var(--bar-reveal, 0);
    transition: opacity 200ms ease;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.r-modal__name { font-size: var(--r-text-lg); font-weight: 700; margin: 0 0 var(--r-sp-1) 0; letter-spacing: -0.02em; }
.r-modal__desc { color: var(--r-ink-muted); font-size: var(--r-text-sm); margin: 0 0 var(--r-sp-5) 0; line-height: 1.5; }

.r-mod-group { margin: var(--r-sp-5) 0; }
.r-mod-group__name {
    font-size: var(--r-text-xs); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--r-ink-muted); margin-bottom: var(--r-sp-2);
}
.r-mod-option {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--r-sp-3) var(--r-sp-4);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-sm);
    margin-bottom: var(--r-sp-2); cursor: pointer;
    font-size: var(--r-text-sm);
    transition: border-color var(--r-tr-fast), background var(--r-tr-fast), color var(--r-tr-fast), box-shadow var(--r-tr-fast);
}
.r-mod-option:hover { border-color: var(--r-ink-faint); }
.r-mod-option.is-selected {
    border-color: var(--r-accent); background: var(--r-accent); color: #fff;
    box-shadow: 0 2px 8px rgba(79,70,229,.2);
}
.r-mod-option .r-delta { font-weight: 600; opacity: 0.85; }

.r-modal__qty {
    display: flex; justify-content: center;
    padding: var(--r-sp-4) 0;
}
.r-modal__actions {
    display: flex; gap: var(--r-sp-3);
    position: sticky; bottom: 0; background: var(--r-surface); padding-top: var(--r-sp-4);
    border-top: 1px solid var(--r-border-light);
}

/* Order confirmation screen inside cart drawer */
.r-order-confirmed {
    display: flex; flex-direction: column; align-items: center;
    text-align: center;
    padding: var(--r-sp-12) var(--r-sp-4);
}
.r-order-confirmed__icon {
    color: var(--r-success);
    margin-bottom: var(--r-sp-5);
    animation: rConfirmPop .4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes rConfirmPop {
    from { opacity: 0; transform: scale(.6); }
    to   { opacity: 1; transform: scale(1); }
}
.r-order-confirmed__id {
    font-size: var(--r-text-xl); font-weight: 700;
    color: var(--r-ink);
    margin-bottom: var(--r-sp-2);
    font-variant-numeric: tabular-nums;
}
.r-order-confirmed__text {
    font-size: var(--r-text-base);
    color: var(--r-ink-muted);
    line-height: 1.5;
}
.r-order-confirmed__status {
    font-size: var(--r-text-lg); font-weight: 600;
    color: var(--r-ink);
    margin-top: var(--r-sp-1);
}
.r-order-confirmed__cta {
    width: 100%;
    max-width: 280px;
    margin-top: var(--r-sp-8);
}
/* Status-specific icon colors */
.r-order-confirmed--pending .r-order-confirmed__icon   { color: #f59e0b; }
.r-order-confirmed--preparing .r-order-confirmed__icon  { color: #3b82f6; }
.r-order-confirmed--ready .r-order-confirmed__icon      { color: #16a34a; }
.r-order-confirmed--ready .r-order-confirmed__status    { color: #16a34a; }
.r-order-confirmed--served .r-order-confirmed__icon     { color: #16a34a; }
.r-order-confirmed--served .r-order-confirmed__status   { color: #16a34a; }
.r-order-confirmed--cancelled .r-order-confirmed__icon  { color: #ef4444; }
.r-order-confirmed--cancelled .r-order-confirmed__status { color: #ef4444; }
/* Pulse animation for "ready" state */
.r-order-confirmed__icon.is-pulse {
    animation: rTrackPulse 1.2s ease-in-out infinite;
}
@keyframes rTrackPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.12); }
}

/* Previous orders history (multi-order tracking) */
.r-track-history {
    border-top: 1px solid var(--r-border);
    margin-top: var(--r-sp-4);
    padding-top: var(--r-sp-4);
}
.r-track-history__title {
    font-size: var(--r-text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--r-ink-muted);
    margin-bottom: var(--r-sp-2);
}
.r-track-history__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--r-border-light);
    font-size: var(--r-text-sm);
}
.r-track-history__row:last-child { border-bottom: none; }
.r-track-history__id { font-weight: 700; font-variant-numeric: tabular-nums; }
.r-track-history__status { font-weight: 600; }
.r-track-history__row--served .r-track-history__status  { color: #16a34a; }
.r-track-history__row--ready .r-track-history__status   { color: #16a34a; }
.r-track-history__row--preparing .r-track-history__status { color: #3b82f6; }
.r-track-history__row--pending .r-track-history__status { color: #f59e0b; }
.r-track-history__row--cancelled .r-track-history__status { color: #ef4444; }

/* Push prompt in tracking footer */
.r-order-tracking__push {
    padding: var(--r-sp-4); text-align: center;
}
.r-order-tracking__push-text {
    font-size: var(--r-text-sm); color: var(--r-ink-muted);
    margin-bottom: var(--r-sp-3);
}
.r-order-tracking__push-text--ok {
    color: var(--r-success);
}
.r-order-tracking__push-btns {
    display: flex; gap: var(--r-sp-2); justify-content: center;
}
.r-order-tracking__hint {
    font-size: var(--r-text-xs); color: var(--r-ink-muted);
    text-align: center; padding: var(--r-sp-2) var(--r-sp-4) 0;
}

.r-btn {
    border: none;
    padding: var(--r-sp-4) var(--r-sp-5);
    font-size: var(--r-text-base); font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: var(--r-radius-sm);
    transition: background var(--r-tr-fast), transform 0.1s, box-shadow var(--r-tr-fast);
}
.r-btn:active { transform: scale(.98); }
.r-btn--primary { background: var(--r-ink); color: #fff; flex: 1; }
.r-btn--primary:hover { background: var(--r-ink-light); box-shadow: var(--r-shadow-md); }

/* Send-order button — app-like idle → spinner → check.
   Mismo mecanismo que .r-contact__btn-* (reusa @keyframes rSpin). */
.r-cart-send { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.r-cart-send__spinner,
.r-cart-send__check { display: none; }
.r-cart-send.is-sending .r-cart-send__text,
.r-cart-send.is-sent   .r-cart-send__text { display: none; }
.r-cart-send.is-sending .r-cart-send__spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rSpin .6s linear infinite;
}
.r-cart-send.is-sent .r-cart-send__check { display: inline-block; color: #fff; }
.r-btn--ghost { background: var(--r-surface-subtle); color: var(--r-ink); border: 1px solid var(--r-border); }

/* ── Cart bar (sticky bottom) ──────────────────────────────────── */
.r-cart-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--r-ink); color: #fff;
    padding: var(--r-sp-4) var(--r-sp-5);
    /* Reserve gesture-bar / notch on iOS so content doesn't sit under it */
    padding-bottom: calc(var(--r-sp-4) + env(safe-area-inset-bottom, 0px));
    display: none; align-items: center; justify-content: space-between;
    z-index: 60;
    box-shadow: 0 -4px 24px rgba(0,0,0,.12);
    border-radius: var(--r-radius-lg) var(--r-radius-lg) 0 0;
}
.r-cart-bar.is-visible { display: flex; }
/* Orders-mode: cart empty but active/past orders exist — accessible history */
.r-cart-bar.is-orders-mode {
    background: var(--r-accent, #4f46e5);
}
.r-cart-bar.is-orders-mode .r-cart-bar__count {
    background: rgba(255,255,255,.25);
}
.r-cart-bar__count {
    background: rgba(255,255,255,.15); color: #fff;
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: var(--r-text-sm);
    margin-right: var(--r-sp-3);
    border-radius: var(--r-radius-full);
}
.r-cart-bar__total { font-weight: 700; font-size: var(--r-text-md); font-variant-numeric: tabular-nums; }
.r-cart-bar__cta {
    background: var(--r-surface); color: var(--r-ink); border: none;
    padding: var(--r-sp-3) var(--r-sp-5); font-weight: 600;
    letter-spacing: 0.01em; font-size: var(--r-text-sm);
    border-radius: var(--r-radius-sm);
    transition: background var(--r-tr-fast), transform 0.1s;
}
.r-cart-bar__cta:hover { background: var(--r-surface-subtle); }
.r-cart-bar__cta:active { transform: scale(.97); }

/* ── Cart drawer (universal cross-browser) ─────────────────────────
   Patrón del drawer: el contenedor SIEMPRE está en el DOM con
   pointer-events:none + opacidad 0 + panel transformado off-screen.
   Esto da al browser dos estados detectables que SÍ animan en
   TODOS los motores (WebKit, Blink, Gecko). Sin display:none, sin
   visibility, sin requestAnimationFrame hacks.

   Backdrop: usamos rgba sólido como base (universal). Si el browser
   soporta backdrop-filter, lo aplicamos como mejora progresiva.
*/
.r-cart-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 280ms cubic-bezier(0.32, 0.72, 0, 1);
    -webkit-tap-highlight-color: transparent;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.r-cart-drawer.is-open {
    opacity: 1;
    pointer-events: auto;
}

.r-cart-drawer__panel {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 100%;
    max-width: 440px;
    background: var(--r-surface);
    -webkit-transform: translate3d(100%, 0, 0);
            transform: translate3d(100%, 0, 0);
    -webkit-transition: -webkit-transform 350ms cubic-bezier(0.32, 0.72, 0, 1);
            transition:         transform 350ms cubic-bezier(0.32, 0.72, 0, 1);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    box-shadow: var(--r-shadow-xl);
    will-change: transform;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--r-radius-lg) 0 0 var(--r-radius-lg);
}
.r-cart-drawer.is-open .r-cart-drawer__panel {
    -webkit-transform: translate3d(0, 0, 0);
            transform: translate3d(0, 0, 0);
}

.r-cart-drawer__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--r-sp-5) var(--r-sp-6);
    border-bottom: 1px solid var(--r-border-light);
    flex-shrink: 0;
}
.r-cart-drawer__title {
    font-size: var(--r-text-md); font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}
.r-cart-drawer__title-sub {
    font-size: var(--r-text-xs); font-weight: 500;
    color: var(--r-ink-muted); margin-top: 2px;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.r-cart-drawer__close {
    background: transparent; border: 1px solid var(--r-border);
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    border-radius: var(--r-radius-sm);
    transition: border-color var(--r-tr-fast), background-color var(--r-tr-fast);
}
.r-cart-drawer__close:hover { border-color: var(--r-ink-faint); background: var(--r-surface-subtle); }
.r-cart-drawer__close svg { stroke: var(--r-ink); }

.r-cart-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 0 var(--r-sp-6);
    -webkit-overflow-scrolling: touch;
}

.r-cart-drawer__foot {
    border-top: 1px solid var(--r-border-light);
    padding: var(--r-sp-5) var(--r-sp-6) var(--r-sp-6) var(--r-sp-6);
    flex-shrink: 0;
    background: var(--r-surface);
}

/* ── Cart line (with quantity stepper) ── */
.r-cart-line {
    display: flex; gap: var(--r-sp-4);
    align-items: flex-start;
    padding: var(--r-sp-4) 0;
    border-bottom: 1px solid var(--r-border-light);
}
.r-cart-line:first-child { padding-top: var(--r-sp-5); }
.r-cart-line:last-child { border-bottom: none; }
.r-cart-line__emoji {
    font-size: 1.75rem;
    line-height: 1;
    flex-shrink: 0;
    width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--r-surface-subtle);
    border-radius: var(--r-radius-sm);
}
.r-cart-line__img {
    flex-shrink: 0;
    width: 44px; height: 44px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: var(--r-surface-subtle);
    border-radius: var(--r-radius-sm);
}
.r-cart-line__body { flex: 1; min-width: 0; }
.r-cart-line__name {
    font-weight: 600; font-size: var(--r-text-base);
    color: var(--r-ink);
    line-height: 1.3;
}
.r-cart-line__mods {
    font-size: var(--r-text-xs); color: var(--r-ink-muted);
    margin-top: var(--r-sp-1);
    line-height: 1.4;
}
.r-cart-line__row {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: var(--r-sp-3);
    gap: var(--r-sp-3);
}
.r-cart-line__price {
    font-weight: 600; font-size: var(--r-text-base);
    color: var(--r-ink);
    font-variant-numeric: tabular-nums;
}

/* Quantity stepper */
.r-qty {
    display: inline-flex; align-items: center;
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-sm);
    overflow: hidden;
}
.r-qty button {
    background: transparent;
    border: none;
    width: 40px; height: 40px;
    font-size: 1.125rem; font-weight: 600;
    color: var(--r-ink);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background-color var(--r-tr-fast);
    /* Mobile touch baseline — prevents 300ms double-tap-zoom delay */
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0,0,0,.08);
    user-select: none;
    -webkit-user-select: none;
}
.r-qty button:hover { background: var(--r-surface-subtle); }
.r-qty button:disabled { color: var(--r-border); cursor: not-allowed; }
.r-qty__value {
    min-width: 36px; text-align: center;
    font-weight: 600; font-size: var(--r-text-base);
    color: var(--r-ink);
    font-variant-numeric: tabular-nums;
    user-select: none;
}

.r-cart-empty {
    text-align: center;
    padding: var(--r-sp-12) var(--r-sp-4);
    color: var(--r-ink-muted);
}
.r-cart-empty__icon {
    font-size: 3rem;
    margin-bottom: var(--r-sp-4);
    opacity: 0.3;
}
.r-cart-empty__title {
    font-size: var(--r-text-base); font-weight: 600;
    color: var(--r-ink-muted);
    margin-bottom: var(--r-sp-1);
}

.r-cart-total {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: var(--r-text-lg); font-weight: 700;
    margin-bottom: var(--r-sp-4);
    padding-bottom: var(--r-sp-4);
    border-bottom: 1px solid var(--r-border);
}
.r-cart-total__amount {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* Mobile: drawer enters from bottom, takes 90vh */
@media (max-width: 640px) {
    .r-cart-drawer__panel {
        top: auto;
        right: 0; left: 0;
        max-width: none;
        width: 100%;
        max-height: 92vh;
        -webkit-transform: translate3d(0, 100%, 0);
                transform: translate3d(0, 100%, 0);
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.16);
        border-radius: var(--r-radius-xl) var(--r-radius-xl) 0 0;
    }
    .r-cart-drawer.is-open .r-cart-drawer__panel {
        -webkit-transform: translate3d(0, 0, 0);
                transform: translate3d(0, 0, 0);
    }
}

/* ── Toast ─────────────────────────────────────────────────────── */
.r-toast {
    position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(8px);
    background: var(--r-ink); color: #fff;
    padding: var(--r-sp-3) var(--r-sp-6);
    font-weight: 600; font-size: var(--r-text-sm);
    letter-spacing: 0.01em;
    z-index: 200;
    opacity: 0; pointer-events: none;
    transition: opacity var(--r-tr-base), transform var(--r-tr-base);
    border-radius: var(--r-radius-full);
    box-shadow: var(--r-shadow-lg);
}
.r-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── KITCHEN view ──────────────────────────────────────────────── */
.r-kitchen { padding: 1.5rem; max-width: 1400px; margin: 0 auto; box-sizing: border-box; }

/* Kitchen tools (sound + refresh) — 2 small icon buttons that live in the
   header next to the locale select. Idéntico patrón visual. */
.r-kitchen__tools {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.r-kitchen__tool-btn {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    height: 36px;
    width: 36px;
    box-sizing: border-box;
    background: var(--r-surface);
    color: var(--r-ink);
    border: 1px solid var(--r-border);
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    transition: border-color 0.15s, background-color 0.15s;
}
.r-kitchen__tool-btn:hover {
    border-color: var(--r-ink);
    background: var(--r-surface-subtle);
}
.r-kitchen__tool-btn:focus { outline: none; }
.r-kitchen__tool-btn svg { display: block; }
.r-kitchen__tool-btn.is-muted svg { opacity: 0.4; }

/* LIVE badge (used in kitchen header) */
@-webkit-keyframes rPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
@keyframes rPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ── OWNER FOOTER (4 vistas: edit, kitchen, sales, qr) ────────
   Footer fijo con tab bar 4 cols equiespaciadas, ÚNICAMENTE visible
   en móvil (≤768px). En desktop la nav vive en el header arriba (.r-sales__nav)
   y este footer queda oculto.

   Patrón: iOS Mail / Slack mobile tab bars. */
.r-owner-footer {
    display: none; /* hidden by default — only shown in mobile via media query below */
}

@media (max-width: 768px) {
    /* In mobile: SHOW footer, HIDE the nav inline of header */
    .r-owner-nav-inline,
    .r-edit__header > nav,
    .r-sales__header > nav {
        display: none !important;
    }
    .r-owner-footer {
        display: block;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: var(--r-surface);
        border-top: 1px solid var(--r-border);
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.04);
        padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
        z-index: 90;
    }
    .r-owner-footer__row {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        width: 100%;
    }
    .r-owner-footer__cell {
        -webkit-appearance: none;
        appearance: none;
        background: var(--r-surface);
        border: none;
        border-left: 1px solid #f1f1f1;
        border-radius: 0;
        margin: 0;
        box-sizing: border-box;
        width: 100%;
        height: 56px;
        padding: 0 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-family: inherit;
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        line-height: 1;
        color: var(--r-ink-muted);
        text-decoration: none;
        cursor: pointer;
        transition: background-color 0.15s, color 0.15s;
    }
    .r-owner-footer__cell:first-child { border-left: none; }
    .r-owner-footer__cell:hover { background: #fafafa; color: #0a0a0a; }
    .r-owner-footer__cell.is-active {
        color: #fafafa;
        background: var(--r-ink);
    }

    /* Reserve space for the fixed footer so content doesn't get hidden */
    .r-edit, .r-sales, .r-kitchen {
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    }
    /* Demo mode (welcome/kitchen): no footer because no nav */
    .r-edit--demo {
        padding-bottom: 1.5rem !important;
    }
}

/* Sistema unificado de controles del header de kitchen.
   Misma altura exacta (36px), mismo border, mismo font.
   Aplica a select + buttons de icono → indistinguibles visualmente. */
.r-kitchen__control {
    height: 36px;
    box-sizing: border-box;
    background: var(--r-surface);
    color: var(--r-ink);
    border: 1px solid var(--r-border);
    padding: 0 12px;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: border-color 0.15s, background-color 0.15s;
    margin: 0;
    /* Reset all browser native styles */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 0;
}
.r-kitchen__control:hover {
    border-color: var(--r-ink);
    background: var(--r-surface-subtle);
}
.r-kitchen__control:focus-visible {
    outline: 2px solid var(--r-ink);
    outline-offset: -1px;
}

/* Select variant — chevron embedded SVG, no native dropdown arrow */
.r-kitchen__control--select {
    padding-right: 30px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230a0a0a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 9px center;
    min-width: 64px;
}

/* Icon-only variant — square 36×36 (sound, refresh) */
.r-kitchen__control--icon {
    width: 36px;
    padding: 0;
}
.r-kitchen__control--icon svg {
    width: 16px;
    height: 16px;
}
.r-kitchen__control--icon.is-muted svg { opacity: 0.4; }
.r-kitchen__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--r-sp-3);
}
@media (max-width: 599px) {
    .r-kitchen__grid { grid-template-columns: 1fr; gap: var(--r-sp-2); }
}

/* Filter warning — shows when orders are hidden by active filters */
.r-kitchen__filter-warn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    margin: 0 0 var(--r-sp-2);
    background: var(--r-warn-light, #fffbeb);
    border: 1px solid var(--r-warn, #d97706);
    color: #92400e;
    font-size: 0.8125rem;
    font-weight: 600;
}

/* ── KANBAN board ─────────────────────────────────────────────── */
.r-kitchen__stats {
    display: flex;
    gap: 16px;
    padding: 0 0 8px 0;
    font-size: 13px;
    color: var(--color-muted, #64748b);
}
.r-kitchen__stats > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.r-kitchen__stats svg {
    flex-shrink: 0;
}
.r-kitchen__filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 0 0 12px 0;
}
.r-kanban {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--r-sp-3);
    align-items: start;
}
.r-kanban__col {
    min-width: 0;
}
.r-kanban__col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: var(--r-sp-2);
    font-size: var(--r-text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fff;
    border: none;
}
.r-kanban__col-head--pending   { background: #f59e0b; }
.r-kanban__col-head--preparing { background: #3b82f6; }
.r-kanban__col-head--ready     { background: #16a34a; }
.r-kanban__col-body {
    display: flex;
    flex-direction: column;
    gap: var(--r-sp-2);
}
.r-kanban__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 800;
    border-radius: 10px;
    background: rgba(255,255,255,0.3);
    color: #fff;
    line-height: 1;
}

/* Kanban tabs — mobile only */
.r-kanban__tabs {
    display: none;
}
@media (max-width: 767px) {
    .r-kanban__tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0;
        margin-bottom: var(--r-sp-2);
        border: 1px solid var(--r-border);
    }
    .r-kanban__tab {
        -webkit-appearance: none;
        appearance: none;
        background: var(--r-surface);
        border: none;
        border-left: 1px solid var(--r-border);
        padding: 10px 4px;
        font-family: inherit;
        font-size: var(--r-text-xs);
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--r-ink-muted);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        transition: background-color 0.15s, color 0.15s;
    }
    .r-kanban__tab:first-child { border-left: none; }
    .r-kanban__tab .r-kanban__badge {
        background: var(--r-border);
        color: var(--r-ink-muted);
    }
    .r-kanban__tab.is-active {
        background: var(--r-ink);
        color: #fff;
    }
    .r-kanban__tab.is-active .r-kanban__badge {
        background: rgba(255,255,255,0.25);
        color: #fff;
    }
    /* In mobile: single column, hide non-active */
    .r-kanban {
        display: block;
    }
    .r-kanban__col.is-hidden-mobile {
        display: none;
    }
    .r-kanban__col-head {
        display: none; /* tabs replace headers */
    }
}
.r-order {
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-md);
    padding: var(--r-sp-4);
    box-shadow: var(--r-shadow-sm);
    transition: box-shadow var(--r-tr-fast);
    min-width: 0;
    word-break: break-word;
}
@media (min-width: 600px) { .r-order { padding: var(--r-sp-5); } }
.r-order--pending    { border-color: #f59e0b; }
.r-order--preparing  { border-color: #3b82f6; }
.r-order--ready      { border-color: #16a34a; }
.r-order--served     { opacity: 0.5; }

.r-order__head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 12px; flex-wrap: wrap; gap: 4px;
    min-width: 0;
}
.r-order__head > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; min-width: 0; }
.r-order__num { font-size: 1.25rem; font-weight: 800; }
.r-order__time { font-size: 0.75rem; color: #64748b; flex-shrink: 0; }
.r-order__table {
    background: var(--r-ink); color: #fff;
    padding: 2px 8px; font-size: 0.6875rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em;
    white-space: nowrap;
}
.r-order__items { margin: 12px 0; }
.r-order__item {
    padding: 10px 0; border-bottom: 1px dashed #e2e8f0;
    font-size: 0.9375rem;
}
.r-order__item:last-child { border-bottom: none; }
.r-order__item-name { font-weight: 700; word-break: break-word; }
.r-order__item-mods { font-size: 0.75rem; color: #64748b; margin-top: 2px; }
.r-order__item-qty {
    background: #f1f5f9; padding: 3px 8px;
    font-weight: 700; font-size: 0.8125rem; margin-right: 8px;
}
.r-order__total {
    display: flex; justify-content: space-between;
    padding-top: 12px; border-top: 1px solid #e2e8f0;
    font-weight: 800; font-size: 1rem;
}
.r-order__actions {
    display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap;
}
.r-order__btn {
    flex: 1 1 auto; border: none;
    padding: 12px 12px;
    font-size: 0.75rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.04em;
    min-width: 0; white-space: nowrap;
    cursor: pointer;
}
.r-order__btn--accept   { background: #3b82f6; color: #fff; }
.r-order__btn--ready    { background: #16a34a; color: #fff; }
.r-order__btn--served   { background: #475569; color: #fff; }
.r-order__btn--cancel   { background: #fee2e2; color: #b91c1c; }
.r-order__btn--cashier  {
    background: #fff; color: var(--r-ink);
    border: 1px solid var(--r-border);
    text-decoration: none;
    flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 12px;
}
.r-order__btn--cashier:hover { border-color: var(--r-ink); }

/* Fast checkout — inline pay button on each kitchen card (S58) */
.r-order__btn--pay {
    background: #0a7a3d;
    color: #fff;
    flex: 0 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 14px;
}
.r-order__btn--pay:hover { background: #086030; }
.r-order__btn--pay svg { flex-shrink: 0; }

/* Focus pulse — scroll-target highlight when arriving from a deep link
   like /restaurants/kitchen?focus=order:42 (kitchen) or
   /restaurants/tables?focus=table:5 (cashier).                          */
@keyframes r-focus-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(220, 38, 38, .6); }
    50%  { box-shadow: 0 0 0 6px rgba(220, 38, 38, .2); }
    100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}
.is-focused { animation: r-focus-pulse 1.5s ease-out; }

.r-empty {
    text-align: center; padding: 4rem 1rem;
    color: #94a3b8; font-size: 0.9375rem;
}
.r-empty strong { display: block; font-size: 1.125rem; color: #475569; margin-bottom: 4px; }

/* ── EDIT panel ────────────────────────────────────────────────── */
.r-edit { padding: 4px; max-width: 1100px; margin: 0 auto; }
@media (min-width: 600px) { .r-edit { padding: 1rem; } }
@media (min-width: 1024px) { .r-edit { padding: 1.5rem; } }
.r-edit__title {
    font-size: 1.25rem; font-weight: 800; margin: 0 0 1rem 0;
    padding-bottom: 0.75rem; border-bottom: 2px solid var(--r-ink);
}
.r-edit__bar {
    display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
    padding: 8px; background: #fff;
    border: 1px solid var(--r-border); margin-bottom: var(--r-sp-2);
    position: sticky; top: 0; z-index: 30;
}
@media (min-width: 600px) { .r-edit__bar { padding: 12px 16px; gap: 8px; } }
.r-edit__bar .r-spacer { flex: 1; }
.r-status {
    font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--r-ink-muted);
}
.r-status--ok { color: #16a34a; }
.r-status--error { color: #b91c1c; }

.r-edit__section {
    background: var(--r-surface); border: 1px solid var(--r-border);
    border-radius: var(--r-radius-md);
    padding: var(--r-sp-2); margin-bottom: var(--r-sp-2);
    box-shadow: var(--r-shadow-xs);
    min-width: 0; word-break: break-word;
}
@media (min-width: 600px) { .r-edit__section { padding: var(--r-sp-4); margin-bottom: var(--r-sp-4); } }
@media (min-width: 1024px) { .r-edit__section { padding: var(--r-sp-5); } }

/* Zone editor rows — single-line layout with expanding input */
.r-zone-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: nowrap;
    position: relative;
}
.r-zone-row--invalid {
    border-left: 3px solid #dc2626;
    background: #fef2f2;
    padding-left: 6px;
}
.r-zone-row--invalid input {
    border-color: #dc2626;
}
.r-zone-row__color {
    width: 28px; height: 28px;
    border: 1px solid var(--r-border);
    padding: 0; cursor: pointer;
    flex-shrink: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: none;
}
.r-zone-row__color::-webkit-color-swatch-wrapper { padding: 0; }
.r-zone-row__color::-webkit-color-swatch { border: none; }
.r-zone-row__color::-moz-color-swatch { border: none; }
.r-zone-row__name-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 0;
    flex: 1 1 auto;
    max-width: 200px;
}
.r-zone-row__name-ghost {
    visibility: hidden;
    white-space: pre;
    font-size: 0.875rem;
    font-family: inherit;
    padding: 6px 10px;
    border: 1px solid transparent; /* match input border for same box model */
    min-width: 50px;
    pointer-events: none;
    box-sizing: border-box;
}
.r-zone-row__name-ghost::after { content: '\00a0'; } /* prevent collapse when empty */
.r-zone-row__name {
    position: absolute;
    inset: 0;
    width: 100%;
    border: 1px solid var(--r-border);
    padding: 6px 10px;
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--r-surface);
    color: var(--r-ink);
    box-sizing: border-box;
}
.r-zone-row__name:focus { outline: 2px solid var(--r-ink); outline-offset: -1px; }
.r-zone-row__tables {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}
.r-zone-row__tables-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--r-ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.r-zone-row__tables-input {
    width: 46px;
    text-align: center;
    padding: 6px 2px;
    border: 1px solid var(--r-border);
    font-size: 0.8125rem;
    font-family: inherit;
    background: var(--r-surface);
    color: var(--r-ink);
    box-sizing: border-box;
}
.r-zone-row__tables-input:focus { outline: 2px solid var(--r-ink); outline-offset: -1px; }
/* Hide number input spinners to save space */
.r-zone-row__tables-input::-webkit-inner-spin-button,
.r-zone-row__tables-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.r-zone-row__tables-input[type=number] { -moz-appearance: textfield; }
.r-zone-row__tables-sep {
    color: var(--r-ink-muted);
    font-size: 0.8125rem;
}
.r-zone-row__delete {
    background: none;
    border: 1px solid var(--r-border);
    width: 28px; height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #991b1b;
    font-size: 13px;
    flex-shrink: 0;
    padding: 0;
    transition: border-color 0.15s;
}
.r-zone-row__delete:hover { border-color: #991b1b; }
@media (max-width: 479px) {
    .r-zone-row { gap: 4px; }
    .r-zone-row__color { width: 24px; height: 24px; }
    .r-zone-row__tables-label { display: none; }
    .r-zone-row__tables-input { width: 40px; padding: 5px 2px; font-size: 0.75rem; }
    .r-zone-row__name-wrap { max-width: 140px; }
    .r-zone-row__name { padding: 5px 8px; font-size: 0.8125rem; }
    .r-zone-row__name-ghost { padding: 5px 8px; font-size: 0.8125rem; min-width: 40px; }
    .r-zone-row__delete { width: 24px; height: 24px; font-size: 11px; }
}
.r-edit__section h2 {
    font-size: var(--r-text-xs); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--r-ink-muted); margin: 0 0 var(--r-sp-4) 0;
}
.r-field {
    display: block; margin-bottom: 12px;
}
.r-field label {
    display: block; font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--r-ink-muted); margin-bottom: 4px;
}
.r-field input,
.r-field textarea,
.r-field select {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--r-border);
    font-size: 0.9375rem; font-family: inherit;
    background: var(--r-surface); color: var(--r-ink);
}
.r-field input:focus,
.r-field textarea:focus,
.r-field select:focus { outline: 2px solid var(--r-ink); outline-offset: -1px; }
.r-field select { cursor: pointer; }
.r-field textarea { min-height: 60px; resize: vertical; }

/* Zone summary in QR page (replaces table count input when zones exist) */
.r-qr__zone-summary {
    font-size: 0.875rem;
    color: var(--r-ink);
    padding: 8px 0;
}
.r-qr__zone-summary strong {
    font-size: 1.125rem;
    font-weight: 800;
}

/* Locale checkboxes — inline row of language toggles */
.r-locale-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.r-locale-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--r-border);
    cursor: pointer;
    font-size: 0.8125rem;
    transition: border-color 0.15s, background-color 0.15s;
    user-select: none;
    -webkit-user-select: none;
}
/* :has() fallback for older browsers — JS adds .is-checked */
.r-locale-check:has(input:checked),
.r-locale-check.is-checked {
    border-color: var(--r-ink);
    background: var(--r-surface-subtle);
}
.r-locale-check input {
    width: 16px; height: 16px;
    margin: 0; cursor: pointer;
    accent-color: var(--r-ink);
}
.r-locale-check__code {
    font-weight: 700;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.r-locale-check__name {
    color: var(--r-ink-muted);
    font-size: 0.75rem;
}

.r-edit-tail-add {
    display: block;
    width: 100%;
    margin-top: var(--r-sp-4, 1rem);
    padding: 1.25rem var(--r-sp-4, 1rem);
    background: transparent;
    border: 1px dashed var(--r-border, #cbd5e1);
    color: var(--r-ink-muted, #64748b);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    text-align: center;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.r-edit-tail-add:hover,
.r-edit-tail-add:focus-visible {
    border-color: var(--r-ink, #0f172a);
    color: var(--r-ink, #0f172a);
    background: var(--r-surface, #f8fafc);
    outline: none;
}

/* ── Editor: live search + collapsible categories (Notion/Linear pattern) ── */
.r-edit-search {
    flex: 0 1 240px;
    min-width: 150px;
    padding: 7px 10px;
    font: inherit;
    font-size: 13px;
    color: var(--r-ink);
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    border-radius: 0;
}
.r-edit-search:focus { outline: none; border-color: var(--r-ink); }
.r-edit-cat__toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; flex: none;
    padding: 0; border: 1px solid transparent; background: transparent;
    color: #737373; cursor: pointer;
    transition: transform 0.15s ease, color 0.15s ease;
}
.r-edit-cat__toggle:hover { color: var(--r-ink); }
.r-edit-cat.is-collapsed .r-edit-cat__toggle { transform: rotate(-90deg); }
.r-edit-cat.is-collapsed .r-edit-cat__items { display: none; }
.r-edit-item.is-search-hidden,
.r-edit-cat.is-search-hidden { display: none; }

.r-edit-item {
    display: grid; grid-template-columns: 1fr;
    gap: 0.5rem; padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
    min-width: 0;
}
@media (min-width: 480px) {
    .r-edit-item { grid-template-columns: 72px 1fr; gap: 0.75rem; }
}
@media (min-width: 1024px) {
    .r-edit-item { grid-template-columns: 100px 1fr; gap: 1rem; padding: 1rem 0; }
}
.r-edit-item__img-wrap { position: relative; width: 100%; height: 100px; }
@media (min-width: 480px) { .r-edit-item__img-wrap { width: 72px; height: 72px; } }
@media (min-width: 1024px) { .r-edit-item__img-wrap { width: 100px; height: 100px; } }
.r-edit-item__img {
    width: 100%; height: 100%; position: relative;
    background: #e2e8f0; background-size: contain; background-repeat: no-repeat; background-position: center;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    user-select: none;
    -webkit-user-select: none;
}
.r-edit-item__img:hover { background-color: #cbd5e1; }
.r-edit-item__img-hint {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.4); color: #fff; opacity: 0;
    transition: opacity .15s;
    /* CRITICAL: opacity:0 keeps the element clickable, which was eating
       every click on the image. The image div needs to receive clicks
       to fire the file picker, so the hint must NOT capture them. */
    pointer-events: none;
}
.r-edit-item__img:hover .r-edit-item__img-hint { opacity: 1; }
.r-edit-item__img--dragover { outline: 2px solid var(--r-accent, #4f46e5); outline-offset: -2px; }
.r-edit-item__img--dragover .r-edit-item__img-hint { opacity: 1; }
.r-edit-item__img--uploading .r-edit-item__img-hint {
    opacity: 1; background: rgba(0,0,0,.6);
}
.r-edit-item__img--uploading .r-edit-item__img-hint svg {
    animation: r-spin .6s linear infinite;
}
@keyframes r-spin { to { transform: rotate(360deg); } }
.r-edit-item__img-remove {
    position: absolute; top: 2px; right: 2px;
    width: 22px; height: 22px; border: none; background: rgba(0,0,0,.55);
    color: #fff; font-size: 12px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .15s;
}
.r-edit-item__img-wrap:hover .r-edit-item__img-remove { opacity: 1; }
.r-edit-item__img-remove:hover { background: #991b1b; }
.r-edit-item__body { min-width: 0; }
.r-edit-item input,
.r-edit-item textarea {
    width: 100%; padding: 10px 12px; box-sizing: border-box;
    border: 1px solid var(--r-border, #e5e7eb);
    font-size: 0.9375rem; font-family: inherit;
    background: var(--r-surface, #fff); color: var(--r-ink, #1a1a2e);
}
.r-edit-item input:focus,
.r-edit-item textarea:focus { outline: 2px solid var(--r-ink, #1a1a2e); outline-offset: -1px; }
.r-edit-item textarea { min-height: 60px; resize: vertical; }
.r-edit-item__delete {
    background: none; border: 1px solid #e5e5e5; color: #991b1b;
    width: 32px; height: 32px; font-size: .75rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: background .15s, border-color .15s;
}
.r-edit-item__delete:hover { background: #fef2f2; border-color: #fca5a5; }
.r-edit-item__row {
    display: grid; grid-template-columns: 1fr 64px;
    gap: 6px; margin-bottom: 6px;
}
@media (min-width: 480px) { .r-edit-item__row { grid-template-columns: 1fr 80px; gap: 8px; } }
.r-locale-tabs {
    display: flex; gap: 0; margin-bottom: 6px;
}
.r-locale-tabs button {
    background: transparent; border: 1px solid #cbd5e1; border-right: none;
    padding: 4px 10px; font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; color: #64748b;
}
.r-locale-tabs button:last-child { border-right: 1px solid #cbd5e1; }
.r-locale-tabs button.is-active { background: var(--r-ink); color: #fff; border-color: var(--r-ink); }

@media (min-width: 768px) {
    .r-header { padding: 0 var(--r-sp-8); }
    .r-cat-nav { padding: 0 var(--r-sp-8); }
    .r-main { padding: var(--r-sp-6) var(--r-sp-8) 8rem var(--r-sp-8); }
    .r-modal { align-items: center; }
    .r-modal__panel { max-width: 520px; border-radius: var(--r-radius-lg); }
    .r-modal__img { border-radius: var(--r-radius-lg) var(--r-radius-lg) 0 0; }
}

/* ── Owner views: edit, sales, qr (shared header structure) ────
   Estructura común con flex-wrap para que NUNCA genere scroll horizontal.
   Identidad crece al máximo permitido; nav + select se acoplan a la
   derecha si hay espacio, o se apilan debajo si el viewport es estrecho. */

.r-sales { padding: 4px; max-width: 1200px; margin: 0 auto; box-sizing: border-box; }
@media (min-width: 600px) { .r-sales { padding: 1rem; } }
@media (min-width: 1024px) { .r-sales { padding: 1.5rem; } }

.r-sales__header,
.r-edit__header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #0a0a0a;
    width: 100%;
    min-width: 0;
}
/* El primer hijo del header (div con título + LIVE) debe crecer
   para empujar la nav y el resto a la derecha. Sin esto, en kitchen
   la nav se pegaba al título porque el div wrapper no tenía flex-grow. */
.r-sales__header > div:first-child,
.r-edit__header  > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.r-sales__title,
.r-edit__title {
    font-size: 1.375rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
    flex: 1 1 auto;
    min-width: 0;
}
.r-sales__sub,
.r-edit__sub {
    font-weight: 500;
    color: var(--r-ink-muted);
    margin-left: 0.25em;
}
.r-edit__live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #16a34a;
    margin-left: 8px;
}
.r-edit__live::before {
    content: '';
    width: 8px; height: 8px;
    background: #16a34a;
    border-radius: 50%;
    -webkit-animation: rPulse 2s infinite;
            animation: rPulse 2s infinite;
}

.r-sales__tools { display: flex; gap: 8px; align-items: center; }

/* Native select for locale, shared between edit + sales + qr.
   flex-shrink: 0 garantiza que NUNCA se comprima ni se desborde. */
.r-owner-locale-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    height: 36px;
    box-sizing: border-box;
    background-color: #fff;
    color: var(--r-ink);
    border: 1px solid var(--r-border);
    padding: 0 30px 0 12px;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230a0a0a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 9px center;
    border-radius: 0;
    margin: 0;
    transition: border-color 0.15s, background-color 0.15s;
}
.r-owner-locale-select:hover { border-color: #0a0a0a; background-color: #fafafa; }
.r-owner-locale-select:focus { outline: none; }

.r-sales__nav {
    display: flex; gap: 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--r-border);
}
.r-sales__nav-link {
    padding: 10px 18px;
    text-decoration: none;
    color: var(--r-ink-muted);
    font-size: 0.875rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}
.r-sales__nav-link:hover { color: #0a0a0a; }
.r-sales__nav-link.is-active {
    color: var(--r-ink);
    border-bottom-color: #0a0a0a;
}

.r-sales__range {
    display: flex; gap: 6px; align-items: center;
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    padding: 8px 12px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.r-sales__range button[data-range] {
    background: transparent;
    border: 1px solid transparent;
    padding: 6px 14px;
    font-size: 0.8125rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--r-ink-muted);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.r-sales__range button[data-range]:hover { color: #0a0a0a; }
.r-sales__range button[data-range].is-active {
    background: var(--r-ink);
    color: #fff;
    border-color: var(--r-ink);
}


.r-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--r-sp-4);
    margin-bottom: var(--r-sp-4);
}
.r-kpi {
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-md);
    padding: var(--r-sp-5) var(--r-sp-6);
    box-shadow: var(--r-shadow-sm);
}
.r-kpi__label {
    font-size: var(--r-text-xs); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--r-ink-muted);
    margin-bottom: var(--r-sp-2);
}
.r-kpi__value {
    font-size: var(--r-text-2xl); font-weight: 700;
    color: var(--r-ink);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.r-kpi__value--small { font-size: 1.125rem; line-height: 1.3; }

.r-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--r-surface);
    font-size: var(--r-text-sm);
    border-radius: var(--r-radius-md);
    overflow: hidden;
    box-shadow: var(--r-shadow-xs);
}
.r-table thead th {
    text-align: left;
    padding: var(--r-sp-3) var(--r-sp-4);
    border-bottom: 1px solid var(--r-border);
    font-size: var(--r-text-xs); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--r-ink-muted);
}
.r-table tbody td {
    padding: var(--r-sp-3) var(--r-sp-4);
    border-bottom: 1px solid var(--r-border-light);
    color: var(--r-ink);
}
.r-table tbody tr:last-child td { border-bottom: none; }
.r-table tbody tr:hover { background: var(--r-surface-subtle); }
.r-table__num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.r-table__rank {
    font-weight: 800; color: #737373;
    width: 40px;
}

@media (min-width: 768px) {
    .r-sales { padding: 2rem; }
}

/* ── WELCOME (public landing for personal sales pitch) ────────── */
.r-welcome-body {
    background: var(--r-surface);
    color: var(--r-ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'kern', 'liga', 'cv11';
}
.r-welcome {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 var(--r-sp-6);
}
.r-welcome__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--r-sp-5) 0;
    border-bottom: 1px solid var(--r-border-light);
    flex-wrap: wrap;
    gap: var(--r-sp-4);
}
/* Welcome nav */
.r-welcome__nav {
    display: flex; align-items: center; gap: var(--r-sp-6);
    margin-left: auto; margin-right: var(--r-sp-4);
}
.r-welcome__nav a {
    font-size: var(--r-text-sm); font-weight: 500;
    color: var(--r-ink-muted); text-decoration: none;
    transition: color var(--r-tr-fast);
    position: relative;
}
.r-welcome__nav a::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 1.5px;
    background: var(--r-accent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .2s ease;
}
.r-welcome__nav a:hover { color: var(--r-ink); }
.r-welcome__nav a:hover::after { transform: scaleX(1); }
.r-welcome__login-btn.r-welcome__login-btn {
    padding: 6px 16px;
    border: 1px solid var(--r-border);
    font-weight: 600;
    color: var(--r-ink);
    transition: background var(--r-tr-fast), border-color var(--r-tr-fast);
}
.r-welcome__login-btn.r-welcome__login-btn::after { display: none; }
.r-welcome__login-btn.r-welcome__login-btn:hover {
    background: var(--r-ink);
    color: #fff;
    border-color: var(--r-ink);
}
/* Login icon — visible only on mobile when nav hides */
.r-welcome__login-icon {
    display: none; color: var(--r-ink); padding: 6px;
    flex-shrink: 0; line-height: 0;
    margin-left: auto;
}
.r-welcome__login-icon svg { stroke: var(--r-ink); }

@media (max-width: 640px) {
    .r-welcome__nav { display: none; }
    .r-welcome__login-icon { display: flex; }
}

/* Language dropdown — animated open/close */
.r-lang { position: relative; }
.r-lang__btn {
    display: flex; align-items: center; gap: 6px;
    padding: 6px var(--r-sp-3);
    border: 1px solid var(--r-border);
    background: transparent;
    font: inherit; font-size: var(--r-text-sm); font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--r-ink-muted);
    cursor: pointer;
    border-radius: var(--r-radius-sm);
    transition: border-color var(--r-tr-fast), color var(--r-tr-fast), background var(--r-tr-fast);
}
.r-lang__btn:hover { border-color: var(--r-ink-faint); color: var(--r-ink); background: var(--r-surface-subtle); }
.r-lang__btn svg { opacity: 0.5; transition: opacity var(--r-tr-fast); }
.r-lang__btn:hover svg { opacity: 0.8; }
.r-lang__menu {
    position: absolute; right: 0; top: calc(100% + 6px);
    list-style: none; margin: 0; padding: var(--r-sp-1) 0;
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-md);
    box-shadow: var(--r-shadow-lg);
    min-width: 80px;
    z-index: 100;
    opacity: 1; transform: translateY(0);
    transition: opacity .18s ease, transform .18s ease;
}
.r-lang__menu[hidden] {
    display: block !important;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
}
.r-lang__option {
    padding: var(--r-sp-2) var(--r-sp-4);
    font-size: var(--r-text-sm); font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--r-ink-muted);
    cursor: pointer;
    transition: background var(--r-tr-fast), color var(--r-tr-fast);
}
.r-lang__option:hover { background: var(--r-surface-subtle); color: var(--r-ink); }
.r-lang__option.is-active { color: var(--r-accent); background: var(--r-accent-light); }

.r-welcome__brand {
    display: flex; flex-direction: column;
    line-height: 1.2;
}
.r-welcome__brand-name {
    font-size: var(--r-text-md);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--r-ink);
}
.r-welcome__brand-sub {
    font-size: var(--r-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--r-ink-faint);
    font-weight: 600;
    margin-top: 2px;
}

/* Hero */
.r-welcome__hero {
    padding: var(--r-sp-12) 0 var(--r-sp-10) 0;
    text-align: center;
}
.r-welcome__hero-title {
    font-size: clamp(1.75rem, 4.5vw, 2.875rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin: 0 0 var(--r-sp-6) 0;
    color: var(--r-ink);
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
.r-welcome__hero-sub {
    font-size: var(--r-text-md);
    line-height: 1.6;
    color: var(--r-ink-muted);
    max-width: 580px;
    margin: 0 auto;
    font-weight: 400;
}

/* QR section */
.r-welcome__qr-section {
    display: flex; justify-content: center;
    padding: var(--r-sp-4) 0 var(--r-sp-12) 0;
}
.r-welcome__qr-frame {
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-lg);
    padding: var(--r-sp-8) var(--r-sp-8);
    text-align: center;
    max-width: 360px;
    box-shadow: var(--r-shadow-md);
}
.r-welcome__qr-label {
    font-size: var(--r-text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--r-ink-muted);
    margin-bottom: var(--r-sp-5);
}
.r-welcome__qr-code {
    display: flex; justify-content: center;
    margin-bottom: 1.25rem;
    position: relative;                 /* anchor for the centre logo */
}
.r-welcome__qr-code canvas, .r-welcome__qr-code img {
    display: block;
    width: 240px; height: 240px;
}
.r-welcome__qr-help {
    font-size: var(--r-text-sm);
    color: var(--r-ink-faint);
    line-height: 1.55;
}
/* Direct link to open the demo without scanning (desktop convenience). */
.r-welcome__qr-open {
    display: inline-block;
    margin-top: var(--r-sp-3, 12px);
    font-size: var(--r-text-sm);
    font-weight: 700;
    color: var(--r-accent, #5b5bf5);
    text-decoration: none;
}
.r-welcome__qr-open:hover { text-decoration: underline; }

/* Generic section */
.r-welcome__section {
    padding: var(--r-sp-12) 0;
    border-top: 1px solid var(--r-border-light);
}
.r-welcome__section--alt {
    background: var(--r-surface-subtle);
    margin: 0 calc(-1 * var(--r-sp-6));
    padding-left: var(--r-sp-6);
    padding-right: var(--r-sp-6);
    border-color: var(--r-border-light);
}

.r-welcome__h2 {
    font-size: var(--r-text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--r-ink-faint);
    margin: 0 0 var(--r-sp-8) 0;
    text-align: center;
}

/* Benefits grid (3 main benefits, equal weight) */
.r-welcome__benefits {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--r-sp-5);
}
.r-welcome__benefit {
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-md);
    padding: var(--r-sp-8) var(--r-sp-6);
    box-shadow: var(--r-shadow-sm);
    transition: box-shadow var(--r-tr-base), transform var(--r-tr-base);
}
.r-welcome__benefit:hover { box-shadow: var(--r-shadow-md); transform: translateY(-2px); }
.r-welcome__benefit-icon {
    width: 48px; height: 48px;
    background: var(--r-accent-light);
    color: var(--r-accent);
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: var(--r-sp-5);
    border-radius: var(--r-radius-md);
}
.r-welcome__benefit-title {
    font-size: var(--r-text-md);
    font-weight: 600;
    margin: 0 0 var(--r-sp-2) 0;
    color: var(--r-ink);
    letter-spacing: -0.01em;
    line-height: 1.3;
}
.r-welcome__benefit-text {
    font-size: var(--r-text-base);
    line-height: 1.6;
    color: var(--r-ink-muted);
    margin: 0;
}

/* Cases list (when this helps) */
.r-welcome__cases-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--r-sp-3);
}
.r-welcome__cases-list li {
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-md);
    padding: var(--r-sp-4) var(--r-sp-5) var(--r-sp-4) var(--r-sp-10);
    font-size: var(--r-text-base);
    line-height: 1.6;
    color: var(--r-ink-muted);
    position: relative;
    box-shadow: var(--r-shadow-xs);
}
.r-welcome__cases-list li::before {
    content: '';
    position: absolute;
    left: var(--r-sp-5);
    top: 1.5rem;
    width: 6px; height: 6px;
    background: var(--r-accent);
    border-radius: var(--r-radius-full);
}

/* Trust list */
.r-welcome__trust {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-width: 680px;
    display: grid;
    gap: var(--r-sp-3);
}
.r-welcome__trust li {
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-md);
    padding: var(--r-sp-4) var(--r-sp-5);
    font-size: var(--r-text-base);
    line-height: 1.6;
    color: var(--r-ink-muted);
    box-shadow: var(--r-shadow-xs);
}

/* Steps grid */
.r-welcome__steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--r-sp-5);
}
.r-welcome__step {
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-md);
    padding: var(--r-sp-8) var(--r-sp-6);
    box-shadow: var(--r-shadow-sm);
}
.r-welcome__step-num {
    width: 36px; height: 36px;
    background: var(--r-accent);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: var(--r-text-base);
    font-variant-numeric: tabular-nums;
    margin-bottom: var(--r-sp-4);
    border-radius: var(--r-radius-sm);
}
.r-welcome__step-title {
    font-size: var(--r-text-md);
    font-weight: 600;
    margin: 0 0 var(--r-sp-2) 0;
    color: var(--r-ink);
    letter-spacing: -0.01em;
}
.r-welcome__step-text {
    font-size: var(--r-text-base);
    line-height: 1.6;
    color: var(--r-ink-muted);
    margin: 0;
}

/* Needs list */
.r-welcome__needs {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--r-sp-4);
}
.r-welcome__needs li {
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-md);
    padding: var(--r-sp-6);
    box-shadow: var(--r-shadow-xs);
}
.r-welcome__needs strong {
    display: block;
    font-size: var(--r-text-base);
    font-weight: 600;
    margin-bottom: var(--r-sp-2);
    color: var(--r-ink);
}
.r-welcome__needs span {
    font-size: var(--r-text-base);
    line-height: 1.6;
    color: var(--r-ink-muted);
}

/* Use cases */
.r-welcome__cases {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
.r-welcome__case {
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    padding: 1.75rem;
}
.r-welcome__case-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--r-ink);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.r-welcome__case p {
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--r-ink-muted);
    margin: 0;
}

/* Price */
.r-welcome__pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--r-sp-6);
    max-width: 960px;
    margin: 0 auto;
}
@media (max-width: 768px) {
    .r-welcome__pricing-grid { grid-template-columns: 1fr; max-width: 400px; }
}
.r-welcome__price {
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    padding: var(--r-sp-8);
    text-align: center;
    box-shadow: var(--r-shadow-sm);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.r-welcome__price--featured {
    border-color: var(--r-accent);
    box-shadow: var(--r-shadow-lg);
}
.r-welcome__price::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--r-border-light);
}
.r-welcome__price--featured::before {
    background: var(--r-accent);
}
.r-welcome__price-name {
    font-size: var(--r-text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--r-ink-muted);
    margin-bottom: var(--r-sp-4);
}
.r-welcome__price--featured .r-welcome__price-name {
    color: var(--r-accent);
}
.r-welcome__price-target {
    font-size: var(--r-text-sm);
    color: var(--r-ink-faint);
    margin-bottom: var(--r-sp-6);
}
.r-welcome__price .r-welcome__contact-btn {
    margin-top: auto;
    /* flex centering — el botón Pro tiene flex:1 (heredado de .r-btn--primary)
       y se estira verticalmente en .r-welcome__price (flex column). Sin estas
       3 props, el texto queda anclado arriba por el padding del .r-btn base.
       Aplica también a ghost (Starter/Enterprise) sin afectar — su altura no
       cambia, el texto queda centrado igual. */
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Ghost button (Starter/Enterprise) hover — bg pasa a ink (oscuro), texto debe
   pasar a blanco. Sin esto, el genérico .r-welcome__contact-btn:hover deja
   color: var(--r-ink) y resulta texto oscuro sobre fondo oscuro = ilegible. */
.r-welcome__price .r-btn--ghost.r-welcome__contact-btn:hover {
    background: var(--r-ink);
    color: #fff;
    border-color: var(--r-ink);
}
.r-welcome__price-amount {
    font-size: var(--r-text-2xl);
    font-weight: 700;
    color: var(--r-ink);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: var(--r-sp-6);
    font-variant-numeric: tabular-nums;
}
.r-welcome__price-period {
    font-size: var(--r-text-base);
    font-weight: 500;
    color: var(--r-ink-muted);
    letter-spacing: 0;
}
.r-welcome__price-features {
    display: grid;
    gap: var(--r-sp-3);
    text-align: left;
    max-width: 320px;
    margin: 0 auto var(--r-sp-8) auto;
    font-size: var(--r-text-base);
    color: var(--r-ink);
}

/* Who I am */
.r-welcome__who {
    max-width: 680px;
    margin: 0 auto;
}
.r-welcome__who p {
    font-size: var(--r-text-base);
    line-height: 1.7;
    color: var(--r-ink-muted);
    margin: 0 0 var(--r-sp-5) 0;
}
.r-welcome__who p:last-child { margin-bottom: 0; }
.r-welcome__who strong {
    color: var(--r-ink);
    font-weight: 600;
}

/* Contact CTA */
.r-welcome__section#contact {
    text-align: center;
}
.r-welcome__contact-help {
    font-size: var(--r-text-base);
    color: var(--r-ink-muted);
    text-align: center;
    max-width: 560px;
    margin: 0 auto var(--r-sp-8) auto;
    line-height: 1.6;
}
.r-welcome__contact-btn {
    display: inline-block;
    text-decoration: none;
    text-align: center;
    margin: 0 auto;
    font-size: var(--r-text-base);
    border-radius: var(--r-radius-sm);
    transition: background var(--r-tr-base), transform 0.15s ease, box-shadow var(--r-tr-base);
}
.r-welcome__contact-btn:hover {
    background: var(--r-ink-light);
    transform: translateY(-2px);
    box-shadow: var(--r-shadow-md);
}
.r-welcome__contact-btn:active {
    transform: scale(.985) translateY(0);
    box-shadow: none;
}

/* Footer */
.r-welcome__footer {
    padding: var(--r-sp-10) 0 var(--r-sp-12) 0;
    text-align: center;
    border-top: 1px solid var(--r-border-light);
    margin-top: var(--r-sp-8);
}
.r-welcome__footer p {
    font-size: var(--r-text-xs);
    color: var(--r-ink-faint);
    margin: 0;
    letter-spacing: 0.04em;
    font-weight: 500;
}
.r-welcome__footer-legal {
    margin-top: 8px !important;
}
.r-welcome__footer-legal a {
    color: var(--r-ink-faint);
    text-decoration: none;
}
.r-welcome__footer-legal a:hover {
    text-decoration: underline;
}

/* ── Pitch interno (solo Adan) ─────────────────────────────── */
.r-pitch-body {
    background: var(--r-surface-subtle);
    color: var(--r-ink);
    -webkit-font-smoothing: antialiased;
}
.r-pitch {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.25rem 4rem 1.25rem;
}

.r-pitch__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 0;
    border-bottom: 2px solid #0a0a0a;
    margin-bottom: 1.5rem;
}
.r-pitch__title {
    font-size: 1.375rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
    color: var(--r-ink);
}
.r-pitch__sub {
    font-size: 0.8125rem;
    color: var(--r-ink-muted);
    margin: 4px 0 0 0;
    line-height: 1.4;
}
.r-pitch__back {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--r-ink-muted);
    text-decoration: none;
    padding: 8px 12px;
    border: 1px solid var(--r-border);
    flex-shrink: 0;
    transition: border-color 0.15s, color 0.15s;
}
.r-pitch__back:hover { color: #0a0a0a; border-color: #0a0a0a; }

/* Landing URL card (la URL para mandarle al cliente, copiable) */
.r-pitch__url-card {
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
}
.r-pitch__url-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--r-ink-muted);
    margin-bottom: 8px;
}
.r-pitch__url-value {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    width: 100%;
    text-align: left;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--r-ink);
    cursor: pointer;
    word-break: break-all;
    line-height: 1.4;
}
.r-pitch__url-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}
.r-pitch__share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #25d366;
    color: #fff;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: background-color 0.15s;
}
.r-pitch__share-btn:hover { background: #1da851; }

/* Section: opening / editor / qr / client / kitchen / sales / connectors / objections / closing */
.r-pitch__section {
    margin-bottom: 2.5rem;
}
.r-pitch__section-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--r-border);
}
.r-pitch__section-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.r-pitch__section-title-wrap { flex: 1; min-width: 0; }
.r-pitch__section-title {
    font-size: 1rem;
    font-weight: 800;
    margin: 0 0 2px 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--r-ink);
}
.r-pitch__section-help {
    font-size: 0.75rem;
    color: var(--r-ink-muted);
    margin: 0;
    line-height: 1.4;
}

/* Phrase list */
.r-pitch__phrases {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}
.r-pitch__phrase {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.r-pitch__phrase-btn {
    flex: 1 1 auto;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    border-radius: 0;
    padding: 14px 16px;
    margin: 0;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s, transform 0.1s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.r-pitch__phrase-btn:hover {
    border-color: var(--r-ink);
    background: var(--r-surface-subtle);
}
.r-pitch__phrase-btn:active {
    -webkit-transform: scale(0.99);
            transform: scale(0.99);
}
.r-pitch__phrase-es {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--r-ink);
    line-height: 1.45;
}
.r-pitch__phrase-de {
    font-size: 0.8125rem;
    color: var(--r-ink-muted);
    line-height: 1.4;
}

.r-pitch__phrase-share {
    flex-shrink: 0;
    width: 44px;
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    color: #25d366;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s;
}
.r-pitch__phrase-share:hover {
    background: #f0fdf4;
    border-color: #25d366;
}

.r-pitch__footer {
    margin-top: 3rem;
    text-align: center;
}
.r-pitch__footer p {
    font-size: 0.6875rem;
    color: #a3a3a3;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin: 0;
}

/* Copy toast */
.r-pitch__toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    -webkit-transform: translateX(-50%) translateY(80px);
            transform: translateX(-50%) translateY(80px);
    background: var(--r-ink);
    color: #fafafa;
    padding: 12px 20px;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms cubic-bezier(0.32, 0.72, 0, 1),
                -webkit-transform 220ms cubic-bezier(0.32, 0.72, 0, 1);
    transition: opacity 220ms cubic-bezier(0.32, 0.72, 0, 1),
                transform 220ms cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.r-pitch__toast.is-visible {
    opacity: 1;
    -webkit-transform: translateX(-50%) translateY(0);
            transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* ── Try-it-yourself wizard ─────────────────────────────────── */
.r-welcome__try-section {
    padding: 0 0 3rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.r-try__cta {
    background: var(--r-ink);
    color: #fff;
    border: none;
    border-radius: var(--r-radius-md);
    padding: var(--r-sp-5) var(--r-sp-6);
    display: inline-flex;
    align-items: center;
    gap: var(--r-sp-4);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: transform 150ms cubic-bezier(0.32, 0.72, 0, 1), box-shadow var(--r-tr-base);
    max-width: 100%;
    box-shadow: var(--r-shadow-md);
}
.r-try__cta:hover { background: var(--r-ink-light); box-shadow: var(--r-shadow-lg); }
.r-try__cta:active { transform: scale(0.985); box-shadow: var(--r-shadow-sm); }
.r-try__cta-icon {
    width: 44px; height: 44px;
    background: rgba(255, 255, 255, 0.1);
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff;
    flex-shrink: 0;
    border-radius: var(--r-radius-sm);
}
.r-try__cta-body { display: flex; flex-direction: column; gap: 2px; }
.r-try__cta-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}
.r-try__cta-sub {
    font-size: 0.75rem;
    color: #a3a3a3;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.r-try {
    width: 100%;
    max-width: 540px;
    margin-top: var(--r-sp-6);
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-lg);
    padding: var(--r-sp-8) var(--r-sp-6);
    animation: rTryFadeIn 350ms cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: var(--r-shadow-md);
}
@keyframes rTryFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.r-try__progress {
    display: flex; gap: var(--r-sp-2); justify-content: center;
    margin-bottom: var(--r-sp-6);
}
.r-try__dot {
    width: 24px; height: 3px;
    background: var(--r-border);
    border-radius: var(--r-radius-full);
    transition: background-color 250ms cubic-bezier(0.32, 0.72, 0, 1);
}
.r-try__dot.is-active { background: var(--r-accent); }

.r-try__step {
    animation: rTryFadeIn 350ms cubic-bezier(0.32, 0.72, 0, 1);
}
.r-try__step-label {
    font-size: var(--r-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--r-ink-faint);
    font-weight: 600;
    margin-bottom: var(--r-sp-2);
}
.r-try__step-title {
    font-size: var(--r-text-lg);
    font-weight: 700;
    margin: 0 0 var(--r-sp-2) 0;
    color: var(--r-ink);
    letter-spacing: -0.02em;
    line-height: 1.25;
}
.r-try__step-text {
    font-size: var(--r-text-base);
    color: var(--r-ink-muted);
    line-height: 1.6;
    margin: 0 0 var(--r-sp-6) 0;
}

/* Step 1 — dish selection */
.r-try__menu {
    display: grid;
    gap: 10px;
    margin-bottom: 1rem;
}
.r-try__dish {
    background: var(--r-surface-subtle);
    border: 1.5px solid var(--r-border);
    border-radius: var(--r-radius-md);
    padding: var(--r-sp-4);
    display: flex; align-items: center; gap: var(--r-sp-4);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    width: 100%;
    transition: border-color var(--r-tr-fast), background-color var(--r-tr-fast), box-shadow var(--r-tr-fast);
}
.r-try__dish:hover { border-color: var(--r-ink-faint); box-shadow: var(--r-shadow-sm); }
.r-try__dish.is-selected {
    border-color: var(--r-accent);
    background: var(--r-accent-light);
    box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
.r-try__dish-emoji {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}
.r-try__dish-body {
    flex: 1;
    display: flex; flex-direction: column; gap: 2px;
    min-width: 0;
}
.r-try__dish-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--r-ink);
}
.r-try__dish-price {
    font-size: 0.8125rem;
    color: var(--r-ink-muted);
    font-variant-numeric: tabular-nums;
}

.r-try__cart-summary {
    background: #f1f1f1;
    border-left: 3px solid #0a0a0a;
    padding: 12px 16px;
    margin-top: 1rem;
    margin-bottom: 1rem;
    animation: rTryFadeIn 250ms cubic-bezier(0.32, 0.72, 0, 1);
}
.r-try__cart-line {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--r-ink);
}
.r-try__cart-line span:last-child { font-variant-numeric: tabular-nums; }

.r-try__actions {
    display: flex; gap: 8px;
    margin-top: 1.5rem;
}
.r-try__actions--final { flex-wrap: wrap; }
.r-try__main-btn {
    width: 100%;
    padding: 14px 18px;
    font-size: 0.9375rem;
    text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center;
}
.r-try__main-btn:disabled {
    background: #d4d4d4;
    color: var(--r-ink-muted);
    cursor: not-allowed;
}

/* Step 2 — kitchen ticket */
.r-try__audio-opt {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
    border-top: 1px dashed #e5e5e5;
    border-bottom: 1px dashed #e5e5e5;
}
.r-try__audio-opt .r-btn {
    width: 100%;
    max-width: 320px;
    padding: 14px 18px;
    font-size: 0.875rem;
}
.r-try__ticket {
    background: var(--r-warn-light);
    border: 1px solid #f59e0b;
    border-radius: var(--r-radius-md);
    padding: var(--r-sp-5) var(--r-sp-6);
    margin-top: var(--r-sp-2);
    animation: rTryFadeIn 300ms cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: var(--r-shadow-sm);
}
.r-try__ticket-head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--r-border);
}
.r-try__ticket-id {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--r-ink);
    font-variant-numeric: tabular-nums;
}
.r-try__ticket-time {
    font-size: 0.8125rem;
    color: var(--r-ink-muted);
    font-variant-numeric: tabular-nums;
}
.r-try__ticket-items { margin-bottom: 1rem; }
.r-try__ticket-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0;
    font-size: 0.9375rem;
    color: var(--r-ink);
}
.r-try__ticket-qty {
    background: #f1f1f1;
    padding: 2px 8px;
    font-weight: 700;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}
.r-try__ticket-total {
    display: flex; justify-content: space-between; align-items: baseline;
    padding-top: 0.75rem;
    border-top: 1px solid var(--r-border);
    font-weight: 700;
    font-size: 1rem;
}
.r-try__ticket-total span:last-child { font-variant-numeric: tabular-nums; }

/* Step 3 — sales KPIs */
.r-try__kpis {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 1rem;
}
.r-try__kpi {
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-md);
    padding: var(--r-sp-5) var(--r-sp-6);
    box-shadow: var(--r-shadow-xs);
}
.r-try__kpi-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--r-ink-muted);
    font-weight: 700;
    margin-bottom: 6px;
}
.r-try__kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--r-ink);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.r-try__kpi-value--small {
    font-size: 1rem;
    line-height: 1.3;
    font-variant-numeric: normal;
    letter-spacing: 0;
}

@media (min-width: 640px) {
    .r-try__kpis {
        grid-template-columns: repeat(3, 1fr);
    }
    .r-try__actions--final {
        flex-direction: row;
    }
    .r-try__actions--final .r-btn {
        width: auto;
        flex: 1;
    }
}

/* Responsive */
@media (min-width: 720px) {
    .r-welcome__benefits {
        grid-template-columns: repeat(3, 1fr);
    }
    .r-welcome__steps {
        grid-template-columns: repeat(3, 1fr);
    }
    .r-welcome__needs {
        grid-template-columns: repeat(3, 1fr);
    }
    .r-welcome__cases {
        grid-template-columns: repeat(2, 1fr);
    }
    .r-welcome__hero { padding: 5rem 0 4rem 0; }
}

/* ── QR view ───────────────────────────────────────────────────── */
.r-qr__help {
    color: var(--r-ink-muted);
    font-size: 0.875rem;
    margin: 0 0 1rem 0;
}
.r-qr__controls {
    display: flex; gap: 12px; align-items: flex-end;
    flex-wrap: wrap;
}
.r-qr__controls .r-field {
    display: flex; flex-direction: column; gap: 4px;
}
.r-qr__controls .r-field span {
    font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--r-ink-muted);
}
.r-qr__controls input[type="number"] {
    padding: 10px 12px;
    border: 1px solid var(--r-border);
    font-size: 1rem; font-family: inherit;
    background: var(--r-surface); color: #0a0a0a;
    font-variant-numeric: tabular-nums;
}
.r-qr__controls input[type="number"]:focus {
    outline: 2px solid var(--r-ink);
    outline-offset: -1px;
}

.r-qr__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.r-qr__card {
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-lg);
    padding: var(--r-sp-5);
    display: flex; flex-direction: column;
    align-items: center;
    text-align: center;
    page-break-inside: avoid;
    break-inside: avoid;
    box-shadow: var(--r-shadow-sm);
}
.r-qr__card--takeaway {
    border-color: var(--r-accent);
    background: var(--r-accent-light);
    grid-column: 1 / -1;
    max-width: 400px;
    margin: 0 auto 1rem auto;
}
.r-qr__card-head {
    width: 100%;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--r-border);
}
.r-qr__card-label {
    font-size: 1.25rem; font-weight: 800;
    color: var(--r-ink);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.r-qr__card-sub {
    font-size: 0.75rem;
    color: var(--r-ink-muted);
    margin-top: 4px;
    font-weight: 500;
}
.r-qr__card--takeaway .r-qr__card-sub {
    font-size: 0.8125rem;
    line-height: 1.4;
    margin-top: 6px;
}
.r-qr__code {
    margin: 0.5rem 0 1rem 0;
    /* qrcodejs renders a canvas inside this box */
}
.r-qr__code canvas, .r-qr__code img {
    display: block;
    max-width: 100%;
    height: auto;
}
.r-qr__card-foot {
    width: 100%;
    margin-top: auto;
}
.r-qr__card-scan {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--r-ink-muted);
    font-weight: 700;
    margin-bottom: 8px;
}
.r-qr__download {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.6875rem;
}

/* ── Print: hide chrome, A4 grid 2x2 ───────────────────────────── */
.r-no-print { /* default visible */ }

/* Zone header (h3 creado en qr.php JS). Estilo base para pantalla — print
   override añade page-break-after: avoid para que no quede huérfano. */
.r-qr__zone-header {
    grid-column: 1 / -1;
    margin: 1.5rem 0 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    color: #737373;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 6px;
}

@media print {
    @page { size: A4 portrait; margin: 10mm; }
    html, body { background: #fff; }
    .r-no-print { display: none !important; }
    .r-sales { padding: 0; max-width: none; }
    .r-qr__grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8mm;
    }
    .r-qr__card {
        border: 2px solid #0a0a0a;
        page-break-inside: avoid;
        break-inside: avoid;
        padding: 6mm;
        /* display:block en print: flex+page-break-inside es un combo roto
           en Safari/Chrome (bug histórico) — usa block para que el browser
           respete avoid en cards complejas. */
        display: block;
        text-align: center;
    }
    /* Takeaway en su propia página: garantiza que la sección "PARA LLEVAR"
       (más grande, máxima fila) no comparta página con las primeras mesas.
       Sin esto, Safari aprieta todo en página 1 → recortado vertical. */
    .r-qr__card--takeaway {
        grid-column: 1 / -1;
        max-width: none;
        page-break-after: always;
        break-after: page;
    }
    /* Header de zona NO debe quedar huérfano al final de una página
       empujando las mesas a la siguiente con recorte. */
    .r-qr__zone-header {
        page-break-after: avoid;
        break-after: avoid-page;
    }
    .r-qr__code canvas {
        width: 55mm !important;
        height: 55mm !important;
        margin: 0 auto;
        display: block;
    }
    .r-qr__card--takeaway .r-qr__code canvas {
        width: 80mm !important;
        height: 80mm !important;
    }
}

/* ── View Transitions + fade-in (app-like) ───────────────────── */

::view-transition-old(root) { animation: rVtOut .15s ease-out both; }
::view-transition-new(root) { animation: rVtIn  .2s  ease-in  both; }
@keyframes rVtOut { to   { opacity: 0; } }
@keyframes rVtIn  { from { opacity: 0; } }

.r-welcome__header { view-transition-name: r-header; }
::view-transition-group(r-header) { animation: none; }

.r-fade-in { animation: rFadeIn .35s cubic-bezier(.2,.6,.35,1); }
@keyframes rFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Staggered entrance for form fields */
.r-contact__field:nth-child(2) { animation: rFieldIn .4s cubic-bezier(.2,.6,.35,1) .05s both; }
.r-contact__field:nth-child(3) { animation: rFieldIn .4s cubic-bezier(.2,.6,.35,1) .1s both; }
.r-contact__field:nth-child(4) { animation: rFieldIn .4s cubic-bezier(.2,.6,.35,1) .15s both; }
.r-contact__submit { animation: rFieldIn .4s cubic-bezier(.2,.6,.35,1) .2s both; }
@keyframes rFieldIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ── Contact form (/restaurants/contact) — Polymer style ─────── */

.r-contact__hero {
    padding: var(--r-sp-12) var(--r-sp-6) var(--r-sp-12);
    max-width: 520px;
    margin: 0 auto;
}
.r-contact__icon {
    text-align: center;
    margin-bottom: 1.5rem;
    animation: rFieldIn .4s cubic-bezier(.2,.6,.35,1) both;
}
.r-contact__icon svg {
    opacity: .7;
}
.r-contact__title {
    font-size: var(--r-text-xl);
    font-weight: 700;
    color: var(--r-ink);
    text-align: center;
    margin: 0 0 var(--r-sp-3);
    letter-spacing: -0.025em;
}
.r-contact__intro {
    font-size: var(--r-text-base);
    color: var(--r-ink-muted);
    text-align: center;
    line-height: 1.6;
    margin: 0 0 var(--r-sp-10);
}
.r-contact__form {
    max-width: 420px;
    margin: 0 auto;
}
.r-contact__note {
    font-size: var(--r-text-sm);
    color: var(--r-ink-faint);
    text-align: center;
    margin: var(--r-sp-8) auto 0;
    line-height: 1.5;
}

/* Field — Polymer floating label: bottom-line gradient, no borders */
.r-contact__field {
    position: relative;
    padding-top: 24px;
    margin-bottom: 20px;
}
.r-contact__input {
    display: block;
    width: 100%;
    font-size: var(--r-text-base);
    font-weight: 400;
    font-family: inherit;
    color: var(--r-ink);
    padding: var(--r-sp-2) 0;
    border: none;
    border-bottom: 1px solid var(--r-border);
    border-radius: 0;
    outline: none;
    background-color: transparent;
    background-image: linear-gradient(var(--r-accent), var(--r-accent));
    background-position: bottom center;
    background-size: 0 2px;
    background-repeat: no-repeat;
    transition: background-size .2s ease-in;
}
.r-contact__input::placeholder { color: transparent; }
.r-contact__input:focus {
    border-bottom-color: transparent;
    background-size: 100% 2px;
}

/* Label — floats up on focus/filled (scale transform like CMS) */
.r-contact__label {
    position: absolute;
    left: 0;
    top: 32px;
    font-size: var(--r-text-base);
    font-weight: 400;
    color: var(--r-ink-faint);
    pointer-events: none;
    transform-origin: 0 0;
    transition: transform .15s ease-out, opacity .15s ease-out, color .15s ease-out;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.r-contact__input:focus ~ .r-contact__label {
    opacity: 1;
    transform: translate3d(0, -1.9em, 0) scale(.8);
    color: var(--r-accent);
}
.r-contact__input:not(:placeholder-shown) ~ .r-contact__label {
    opacity: 1;
    transform: translate3d(0, -1.9em, 0) scale(.8);
}

/* Select variant — un <select> no dispara :placeholder-shown (siempre tiene
   valor), así que la etiqueta se mantiene flotada de forma permanente. Apariencia
   nativa preservada (flecha del sistema) → robusto en cualquier navegador. */
.r-contact__field--select .r-contact__label {
    opacity: 1;
    transform: translate3d(0, -1.9em, 0) scale(.8);
}
.r-contact__field--select .r-contact__input { cursor: pointer; }

/* Validation — red underline + label color (aria-invalid, Polymer pattern) */
.r-contact__input[aria-invalid="true"] {
    border-bottom-color: transparent;
    background-image: linear-gradient(var(--r-danger), var(--r-danger));
    background-size: 100% 2px;
}
.r-contact__input[aria-invalid="true"] ~ .r-contact__label {
    color: var(--r-danger);
}

/* Textarea */
.r-contact__input--textarea {
    resize: vertical;
    min-height: 80px;
}

/* Password action buttons (reveal, generate, copy) */
.r-pw-actions {
    position: absolute;
    right: 0; top: 28px;
    display: flex; gap: 2px;
}
.r-pw-actions button {
    background: none; border: none; cursor: pointer;
    padding: 6px; color: var(--r-ink-faint);
    transition: color var(--r-tr-fast);
    display: flex; align-items: center;
}
.r-pw-actions button:hover { color: var(--r-ink); }
.r-pw-actions svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.r-pw-actions .icon-check svg { stroke: var(--r-success); }
.r-contact__field--has-action .r-contact__input {
    padding-right: 90px;
}
/* Legacy single button (backward compat) */
.r-pw-generate {
    position: absolute;
    right: 0; top: 32px;
    background: none; border: none; cursor: pointer;
    color: var(--r-ink-faint); padding: var(--r-sp-2);
    transition: color var(--r-tr-fast);
}
.r-pw-generate:hover { color: var(--r-ink); }

/* RTL */
[dir="rtl"] .r-contact__label {
    left: auto; right: 0;
    transform-origin: 100% 0;
}

/* Submit — Polymer button with expressive states */
.r-contact__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--r-sp-2);
    width: 100%;
    margin-top: var(--r-sp-8);
    padding: var(--r-sp-4) var(--r-sp-6);
    font-size: var(--r-text-base);
    font-weight: 600;
    font-family: inherit;
    letter-spacing: .01em;
    color: #fff;
    background: var(--r-ink);
    border: none;
    border-radius: var(--r-radius-sm);
    cursor: pointer;
    transition: background var(--r-tr-base), transform .12s cubic-bezier(.2,.6,.35,1), box-shadow var(--r-tr-base);
    -webkit-appearance: none;
    min-height: 52px;
}
.r-contact__submit:hover:not(:disabled) {
    background: var(--r-ink-light);
    box-shadow: var(--r-shadow-md);
    transform: translateY(-1px);
}
.r-contact__submit:active:not(:disabled) {
    transform: scale(.985) translateY(0);
    box-shadow: none;
}
.r-contact__submit:disabled { opacity: .5; cursor: not-allowed; }

/* Sending state */
.r-contact__submit.is-sending {
    background: var(--r-ink-muted);
}

/* Sent state — smooth green */
.r-contact__submit.is-sent {
    background: var(--r-success);
}

/* Spinner + Check — hidden by default, shown via JS class */
.r-contact__btn-spinner,
.r-contact__btn-check {
    display: none;
}
.r-contact__btn-spinner.is-visible {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rSpin .6s linear infinite;
}
@keyframes rSpin { to { transform: rotate(360deg); } }

.r-contact__btn-check.is-visible {
    display: inline-block;
    color: #fff;
}

/* Feedback area */
.r-contact__feedback {
    padding: .75rem 1rem;
    font-size: .875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    text-align: center;
}
.r-contact__feedback--success {
    color: var(--r-success);
}
.r-contact__feedback--error {
    color: var(--r-danger);
}

/* ── CASHIER view — open tables with pending bills ──────────────── */
.r-cashier__count {
    font-size: var(--r-text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--r-ink-muted);
    background: var(--r-surface-subtle);
    padding: 4px 10px;
    border: 1px solid var(--r-border);
}
.r-cashier__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--r-sp-3);
}
@media (max-width: 479px) {
    .r-cashier__list { grid-template-columns: 1fr; gap: var(--r-sp-2); }
}
.r-cashier__table {
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    padding: var(--r-sp-4);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    touch-action: manipulation;
}
.r-cashier__table:hover {
    border-color: var(--r-ink);
    box-shadow: var(--r-shadow-sm);
}
.r-cashier__table:active { transform: translateY(1px); }
.r-cashier__table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.r-cashier__table-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.r-cashier__table-num {
    font-size: var(--r-text-md);
    font-weight: 700;
    color: var(--r-ink);
}
.r-cashier__zone {
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
}
.r-cashier__table-total {
    font-size: var(--r-text-lg);
    font-weight: 800;
    color: var(--r-ink);
    font-variant-numeric: tabular-nums;
}
.r-cashier__table-meta {
    display: flex;
    gap: 8px;
    font-size: var(--r-text-xs);
    color: var(--r-ink-muted);
    font-weight: 500;
    align-items: center;
}
.r-cashier__kitchen-link {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 1px solid var(--r-border);
    background: var(--r-surface);
    color: var(--r-ink);
    text-decoration: none;
    font-size: var(--r-text-xs);
    font-weight: 600;
    transition: border-color .15s, background .15s;
}
.r-cashier__kitchen-link:hover { border-color: var(--r-ink); background: var(--r-surface-subtle); }
.r-cashier__kitchen-link svg { flex-shrink: 0; }

/* Detail modal */
.r-cashier__detail {
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.r-cashier__detail-sub {
    margin: 4px 0 0;
    font-size: var(--r-text-sm);
    color: var(--r-ink-muted);
}
.r-cashier__detail-body {
    padding: var(--r-sp-4);
    overflow-y: auto;
    flex: 1;
}
.r-cashier__lines {
    border-top: 1px solid var(--r-border);
    border-bottom: 1px solid var(--r-border);
    padding: var(--r-sp-2) 0;
}
.r-cashier__line {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 8px;
    padding: 6px 0;
    font-size: var(--r-text-sm);
    align-items: baseline;
}
.r-cashier__line-qty {
    font-weight: 700;
    color: var(--r-ink);
    background: var(--r-surface-subtle);
    text-align: center;
    padding: 2px 6px;
    font-variant-numeric: tabular-nums;
}
.r-cashier__line-name {
    color: var(--r-ink);
    word-break: break-word;
}
.r-cashier__line-total {
    font-weight: 600;
    color: var(--r-ink);
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.r-cashier__totals {
    margin-top: var(--r-sp-4);
}
.r-cashier__totals-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: var(--r-text-sm);
    color: var(--r-ink);
    font-variant-numeric: tabular-nums;
}
.r-cashier__totals-row--total {
    font-size: var(--r-text-lg);
    font-weight: 800;
    padding-top: 10px;
    margin-top: 6px;
    border-top: 1px solid var(--r-ink);
}
.r-cashier__detail-foot {
    display: flex;
    gap: 8px;
    padding: var(--r-sp-4);
    border-top: 1px solid var(--r-border);
    background: var(--r-surface-subtle);
    flex-wrap: wrap;
}
.r-cashier__detail-foot .btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    touch-action: manipulation;
}
/* Desktop / tablets: keep them on a single row when there's room. */
@media (min-width: 640px) {
    .r-cashier__detail-foot .btn {
        flex: 1;
    }
}

/* Table-detail footer only (#rDetailFoot): two tiers so 5 actions don't
   overflow. Utilities (Anular/Consumo/Imprimir) on top, money actions
   (Dividir/Cobrar) prominent below. Scoped by id so the shared
   .r-cashier__detail-foot (2-button modals) is untouched. */
#rDetailFoot {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
#rDetailFoot .r-cashier__foot-util,
#rDetailFoot .r-cashier__foot-primary {
    display: flex;
    gap: 8px;
}
#rDetailFoot .r-cashier__foot-util { flex-wrap: wrap; }
#rDetailFoot .r-cashier__foot-util .btn { flex: 1 1 auto; white-space: nowrap; }
#rDetailFoot .r-cashier__foot-primary .btn { flex: 1; }
/* "Dividir cuenta" reads as a co-primary money action (accent outline). */
.btn.btn--divide {
    border-color: var(--r-accent);
    color: var(--r-accent);
    font-weight: 700;
}
.btn.btn--divide:hover { background: var(--r-accent-light); }

/* ── Cash session banner (till open/closed state) ───────────── */
.r-cashier__session {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #065f46 0%, #0f766e 100%);
    color: #fff;
    margin-bottom: var(--r-sp-3);
    flex-wrap: wrap;
}
.r-cashier__session--closed {
    background: var(--r-warn-light, #fffbeb);
    color: #92400e;
    border: 1px solid var(--r-warn, #d97706);
}
.r-cashier__session-left {
    display: flex; flex-direction: column; gap: 2px;
}
.r-cashier__session-title {
    font-size: 13px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.r-cashier__session-meta {
    font-size: 12px; opacity: 0.85;
}
.r-cashier__session-amounts {
    display: flex; gap: 20px;
    font-size: 12px;
    flex-wrap: wrap;
}
.r-cashier__session-amounts > div {
    display: flex; flex-direction: column; gap: 2px;
}
.r-cashier__session-amounts span {
    opacity: 0.8; font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em;
}
.r-cashier__session-amounts strong {
    font-size: 14px; font-variant-numeric: tabular-nums;
}
.r-cashier__session-amounts .is-total strong { font-size: 18px; }
.r-cashier__session .btn--ghost {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}
.r-cashier__session .btn--ghost:hover {
    background: rgba(255,255,255,0.25);
}

/* Payment method buttons */
.r-cashier__pay-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
@media (max-width: 479px) {
    .r-cashier__pay-methods { grid-template-columns: 1fr; }
}
.r-cashier__pay-btn {
    -webkit-appearance: none; appearance: none;
    background: var(--r-surface-subtle);
    border: 2px solid var(--r-border);
    padding: 20px 12px;
    font-size: 13px; font-weight: 600;
    color: var(--r-ink);
    cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    touch-action: manipulation;
    transition: border-color 0.15s, background-color 0.15s, transform 0.1s;
}
.r-cashier__pay-btn:hover {
    border-color: var(--r-ink);
    background: var(--r-surface);
}
.r-cashier__pay-btn:active { transform: scale(0.97); }

/* Counter/takeaway order card — visual distinction from table cards */
.r-cashier__table--counter {
    border-left: 4px solid var(--r-accent, #4f46e5);
}
.r-cashier__table--counter .r-cashier__table-num {
    color: var(--r-accent, #4f46e5);
}

/* Unsettled / "served, not paid" recovery section (S122/S123)
   ──────────────────────────────────────────────────────────
   Pedidos entregados sin cobro automático (counter mode + caja cerrada).
   Visualmente diferenciado (amber accent) para que el cajero los reconcilie
   antes del cierre de día. Patrón canon Square POS "Needs Settlement". */
.r-cashier-section--unsettled {
    border-left: 3px solid var(--r-warn, #d97706);
    padding-left: 12px;
    background: linear-gradient(90deg, rgba(217, 119, 6, 0.04), transparent 60%);
}
.r-cashier__count--warn {
    background: var(--r-warn, #d97706);
    color: #fff;
    padding: 2px 8px;
    border-radius: 2px;
    font-weight: 600;
    font-size: 13px;
}
.r-cashier__hint {
    color: var(--r-ink-muted, #6b7280);
    font-size: 13px;
    margin: 0 0 .75rem 0;
}
.r-cashier__table--unsettled {
    border-left: 4px solid var(--r-warn, #d97706);
    background: rgba(217, 119, 6, 0.03);
}
.r-cashier__table--unsettled .r-cashier__table-num {
    color: var(--r-warn, #d97706);
}
.r-cashier__table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px 12px 12px;
    border-top: 1px solid var(--r-border);
    margin-top: 6px;
}
.r-cashier__table-actions .btn--sm {
    font-size: 13px;
    padding: 6px 12px;
}

/* Settings page (config del negocio) — tabs + panels */
.r-settings__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 1rem 0 0.75rem;
    color: var(--r-ink);
}
.r-settings__tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--r-border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.r-settings__tab {
    -webkit-appearance: none; appearance: none;
    background: transparent;
    border: 0;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--r-ink-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    touch-action: manipulation;
    transition: color 0.15s, border-color 0.15s;
}
.r-settings__tab:hover { color: var(--r-ink); }
.r-settings__tab.is-active {
    color: var(--r-ink);
    border-bottom-color: var(--r-ink);
}
.r-settings__panel {
    display: none;
    padding: 0.5rem 0 1.5rem;
}
.r-settings__panel.is-active { display: block; }
.r-settings__panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0.5rem;
}
.r-settings__panel-help {
    margin: 0 0 1rem;
    color: var(--r-ink-muted);
    font-size: 13px;
    line-height: 1.5;
}
.r-settings__summary {
    margin-top: 1rem;
    padding: 8px 12px;
    background: var(--r-surface-subtle);
    border-left: 3px solid var(--r-ink);
    color: var(--r-ink);
    font-size: 13px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* ── Veri*Factu — tarjeta del certificado fiscal (tab Impuestos) ──
   Onboarding guiado (patrón Stripe test-mode → activar), no un file-input a pelo:
   cabecera con sello + estado, dropzone real y microcopy de confianza. Plano
   (Stripe/Linear), tokens --r-*, mismo idioma que r-install-card. */
.r-fiscal {
    margin-top: 1.5rem;
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-md);
    background: var(--r-surface);
    overflow: hidden;
}
.r-fiscal__head {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 16px;
    background: #fafafa;
    border-bottom: 1px solid var(--r-border-light);
}
.r-fiscal__icon {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: var(--r-radius-sm);
    background: var(--r-accent-light); color: var(--r-accent);
}
.r-fiscal__icon--active { background: var(--r-success-light); color: var(--r-success); }
.r-fiscal__icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.r-fiscal__titles { flex: 1; min-width: 0; }
.r-fiscal__title { display: block; font-size: 0.9375rem; font-weight: 700; color: var(--r-ink); line-height: 1.2; }
.r-fiscal__subtitle { display: block; font-size: 0.6875rem; color: var(--r-ink-faint); margin-top: 2px; letter-spacing: 0.01em; }
.r-fiscal__pill {
    flex: none; display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.6875rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; padding: 4px 9px; border-radius: var(--r-radius-full);
    background: var(--r-surface-subtle); border: 1px solid var(--r-border);
    color: var(--r-ink-muted); white-space: nowrap;
}
.r-fiscal__pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--r-ink-faint); }
.r-fiscal__pill--active { background: var(--r-success-light); border-color: var(--r-success); color: var(--r-success); }
.r-fiscal__pill--active::before { background: var(--r-success); }
.r-fiscal__body { padding: 16px; }
.r-fiscal__lead { margin: 0 0 14px; color: var(--r-ink-light); font-size: 0.875rem; line-height: 1.5; }

/* Dropzone — reemplaza el <input type=file> nativo por una zona guiada. */
.r-fiscal__drop {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
    padding: 22px 16px; text-align: center; cursor: pointer;
    border: 1.5px dashed var(--r-border); border-radius: var(--r-radius-md);
    background: var(--r-surface-subtle); color: var(--r-ink-muted);
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.r-fiscal__drop:hover,
.r-fiscal__drop.is-dragover { border-color: var(--r-accent); background: var(--r-accent-light); color: var(--r-accent); }
.r-fiscal__drop.has-file { border-style: solid; border-color: var(--r-success); background: var(--r-success-light); color: var(--r-success); }
.r-fiscal__drop svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.r-fiscal__drop-cta { font-size: 0.8125rem; font-weight: 600; color: var(--r-ink); word-break: break-all; }
.r-fiscal__drop.has-file .r-fiscal__drop-cta { color: var(--r-success); }
.r-fiscal__drop-hint { font-size: 0.6875rem; color: var(--r-ink-faint); }
.r-fiscal__drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.r-fiscal__upload .r-field { margin: 12px 0 0; }
.r-fiscal__secure {
    display: flex; align-items: flex-start; gap: 8px;
    margin: 12px 0 0; font-size: 0.75rem; color: var(--r-ink-muted); line-height: 1.45;
}
.r-fiscal__secure svg { flex: none; width: 14px; height: 14px; margin-top: 1px; fill: none; stroke: var(--r-success); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.r-fiscal__meta { margin: 2px 0 0; display: grid; gap: 8px; }
.r-fiscal__meta div { display: flex; gap: 10px; font-size: 0.8125rem; align-items: baseline; }
.r-fiscal__meta dt { color: var(--r-ink-muted); font-weight: 600; min-width: 120px; }
.r-fiscal__meta dd { margin: 0; color: var(--r-ink); font-variant-numeric: tabular-nums; font-weight: 600; }
.r-fiscal__warn {
    margin: 12px 0 0; padding: 9px 11px;
    background: var(--r-warn-light); border-left: 3px solid var(--r-warn); border-radius: var(--r-radius-sm);
    color: var(--r-ink); font-size: 0.8125rem; line-height: 1.45;
}
.r-fiscal__muted { margin: 0; color: var(--r-ink-muted); font-size: 0.8125rem; font-style: italic; line-height: 1.45; }
.r-fiscal__upload { margin-top: 4px; }
.r-fiscal__upload.is-hidden { display: none; }
.r-fiscal__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.r-fiscal__remove { color: var(--r-danger); border-color: var(--r-danger); }
.r-fiscal__err {
    margin: 12px 0 0; padding: 9px 11px;
    background: var(--r-danger-light); border-left: 3px solid var(--r-danger); border-radius: var(--r-radius-sm);
    color: var(--r-danger); font-size: 0.8125rem; line-height: 1.45;
}
@media (max-width: 560px) {
    .r-fiscal__actions .r-btn--primary { flex: 1; }
}

/* Override admin shell label color inside restaurants panels — the shell uses
   theme-reactive --color-text-2 (light text on dark theme), but restaurants
   panels are hardcoded to light backgrounds (--r-surface = #fff). Without
   this override, labels render as light text on a white background and
   become invisible when the admin is on dark theme.
   Chips (.r-edit-item__modifier) are excluded here because they invert
   colors when active — their colors are managed below. */
.admin-main .r-edit label:not(.switch):not(.r-edit-item__modifier),
.admin-main .r-edit-item label:not(.switch):not(.r-edit-item__modifier),
.admin-main .r-modifier-group label:not(.switch),
.admin-main .r-modifier-option label:not(.switch),
.admin-main .r-settings label:not(.switch),
.admin-main .r-modifiers-details label:not(.switch) {
    color: var(--r-ink);
}

/* Modifier assignment chips — colors managed explicitly because the
   active state inverts (white text on dark background). Higher specificity
   than the generic label override so admin-shell colors don't bleed. */
.admin-main .r-edit-item__modifiers .r-edit-item__modifier {
    color: var(--r-ink);
}
.admin-main .r-edit-item__modifiers .r-edit-item__modifier.is-on {
    color: #fff;
}
.admin-main .r-edit-item__modifiers .r-edit-item__modifiers-label {
    color: var(--r-ink-muted);
}

/* Modifier groups editor (sub-section in /restaurants/edit) */
.r-modifiers-details {
    border: 1px solid var(--r-border);
    background: var(--r-surface-subtle);
    padding: 0.5rem 1rem;
}
.r-modifiers-details[open] { padding-bottom: 1rem; }
.r-modifiers-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.5rem 0;
    cursor: pointer;
    list-style: none;
}
.r-modifiers-summary::-webkit-details-marker { display: none; }
.r-modifiers-summary::before {
    content: '▸';
    color: var(--r-ink-muted);
    transition: transform 0.15s ease;
}
.r-modifiers-details[open] .r-modifiers-summary::before { transform: rotate(90deg); display: inline-block; }
.r-modifiers-summary__count {
    font-size: 12px;
    color: var(--r-ink-muted);
    font-weight: 500;
}
.r-modifiers-summary__hint {
    font-size: 12px;
    color: var(--r-ink-muted);
    margin-left: auto;
    font-style: italic;
}
.r-modifiers-body { padding-top: 1rem; }
.r-modifiers-help {
    margin: 0 0 1rem;
    color: var(--r-ink-muted);
    font-size: 13px;
    line-height: 1.5;
}
.r-modifiers-empty {
    color: var(--r-ink-muted);
    font-size: 13px;
    font-style: italic;
    padding: 8px 0;
}
.r-modifier-group {
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    padding: 12px;
    margin-bottom: 12px;
}
.r-modifier-group__head {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 12px;
}
.r-modifier-group__slug-wrap,
.r-modifier-group__name-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}
.r-modifier-group__name-wrap { margin-bottom: 12px; }
.r-modifier-group__field-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--r-ink-muted);
}
.r-modifiers-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.r-modifiers-toolbar__sep { color: var(--r-ink-muted); }
.r-modifiers-toolbar__label {
    font-size: 12px;
    color: var(--r-ink-muted);
}
.r-modifier-template-select {
    padding: 6px 10px;
    border: 1px solid var(--r-border);
    background: var(--r-surface);
    font-size: 13px;
    cursor: pointer;
}
.r-modifier-option__columns {
    display: grid;
    grid-template-columns: 130px 1fr 100px 28px;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--r-ink-muted);
    font-weight: 600;
}
@media (max-width: 640px) {
    .r-modifier-option__columns { display: none; }
}
.r-modifier-option__name-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.r-modifier-group__slug {
    font-family: ui-monospace, monospace;
    font-size: 13px;
    flex: 1;
}
.r-modifier-group__delete,
.r-modifier-option__delete {
    -webkit-appearance: none; appearance: none;
    background: transparent;
    border: 1px solid var(--r-border);
    color: #dc2626;
    width: 28px; height: 28px;
    cursor: pointer;
    font-weight: 700;
}
.r-modifier-group__delete:hover,
.r-modifier-option__delete:hover { background: #fef2f2; }
.r-modifier-group__name {
    width: 100%;
    margin-bottom: 8px;
}
.r-modifier-group__rules {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 8px 0 12px;
    padding: 8px;
    background: var(--r-surface-subtle);
    border-radius: 0;
}
.r-modifier-group__rules label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--r-ink-muted);
}
/* Inputs in the modifier group editor — match the look of .r-edit-item inputs.
   Override the admin shell's !important styles so the visual is consistent
   with the rest of the restaurants editor (white background, dark text,
   visible border). */
.admin-main .r-modifier-group input:not([type="checkbox"]):not([type="radio"]),
.admin-main .r-modifier-group select,
.admin-main .r-modifier-option input:not([type="checkbox"]):not([type="radio"]) {
    width: 100%; padding: 8px 10px; box-sizing: border-box;
    border: 1px solid var(--r-border) !important;
    background: var(--r-surface) !important;
    color: var(--r-ink) !important;
    font-size: 13px;
    font-family: inherit;
}
.admin-main .r-modifier-group input:focus,
.admin-main .r-modifier-group select:focus,
.admin-main .r-modifier-option input:focus {
    outline: 2px solid var(--r-ink) !important;
    outline-offset: -1px;
}
.admin-main .r-modifier-group input:disabled {
    background: var(--r-surface-subtle) !important;
    color: var(--r-ink-muted) !important;
}
@media (max-width: 640px) {
    .r-modifier-group__rules { grid-template-columns: 1fr 1fr; }
    .r-modifier-group__matches { grid-column: 1 / 3; }
}
.r-modifier-group__options {
    border-top: 1px solid var(--r-border);
    padding-top: 8px;
}
.r-modifier-group__options-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}
.r-modifier-option {
    display: grid;
    grid-template-columns: 130px 1fr 100px 28px;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
}
.r-modifier-option .r-locale-tabs--mini {
    grid-column: 1 / 5;
    margin-bottom: 4px;
}
.r-modifier-option .r-locale-tabs--mini button {
    padding: 2px 8px;
    font-size: 11px;
}
.r-modifier-option__slug {
    font-family: ui-monospace, monospace;
    font-size: 12px;
}
@media (max-width: 640px) {
    .r-modifier-option { grid-template-columns: 1fr 1fr 28px; }
    .r-modifier-option__slug { grid-column: 1 / 4; }
    .r-modifier-option__delta { grid-column: 1 / 3; }
}

/* Per-item modifier assignment chips */
.r-edit-item__modifiers {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--r-border);
}
.r-edit-item__modifiers-label {
    font-size: 11px;
    color: var(--r-ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 4px;
}
/* Per-dish template quick-apply (snapshot a whole set of options in one pick) */
.r-edit-item__tpl {
    font-size: 12px;
    padding: 4px 8px;
    border: 1px solid var(--r-border);
    background: var(--r-surface);
    color: var(--r-ink);
    font-family: inherit;
    cursor: pointer;
    border-radius: 0;
    width: auto;
}
.r-edit-item__tpl:focus { outline: none; border-color: var(--r-ink); }
.r-edit-item__modifier {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border: 1px solid var(--r-border);
    background: var(--r-surface);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.r-edit-item__modifier:hover { border-color: var(--r-ink); }
.r-edit-item__modifier.is-on {
    background: var(--r-ink);
    color: #fff;
    border-color: var(--r-ink);
}
.r-edit-item__modifier input {
    /* Visually-hidden pattern (accessible) — the input stays in the DOM and
       receives clicks via the wrapping <label>, but is not rendered. */
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    pointer-events: none;
}
/* Visible check icon — only shown when the chip is on. Makes the toggle
   state obvious without relying purely on background color. */
.r-edit-item__modifier-check {
    display: none;
    flex-shrink: 0;
}
.r-edit-item__modifier.is-on .r-edit-item__modifier-check {
    display: inline-block;
}

/* Client-side hints for modifier validation */
.r-mod-group__hint {
    font-size: 12px;
    color: var(--r-ink-muted);
    margin: 4px 0;
    min-height: 1em;
}
.r-mod-group__hint.is-active {
    color: #b45309;
    font-weight: 500;
}
.r-mod-group__hint--error {
    background: #fef2f2;
    color: #991b1b;
    padding: 8px 12px;
    margin: 8px 0;
    border-left: 3px solid #dc2626;
}

/* Stateful primary CTA — when modifier validation is incomplete the button
   itself reflects what's missing ("Selecciona Bolas") and looks disabled.
   Click is allowed because we use it to scroll-to-error, but aria-disabled
   keeps it accessible. */
.r-btn--primary.is-blocked {
    background: var(--r-line, #e5e7eb);
    color: var(--r-ink-muted, #6b7280);
    box-shadow: none;
    cursor: not-allowed;
}
.r-btn--primary.is-blocked:hover {
    background: var(--r-line, #e5e7eb);
    color: var(--r-ink-muted, #6b7280);
    box-shadow: none;
}

/* Flash a modifier group when the user tries to add without filling it.
   Pairs with scrollIntoView so the eye lands on the highlighted box. */
@keyframes r-mod-group-flash {
    0%   { background: #fef2f2; box-shadow: 0 0 0 2px #dc2626; }
    100% { background: transparent; box-shadow: 0 0 0 0 transparent; }
}
.r-mod-group.is-error {
    animation: r-mod-group-flash 1.5s ease-out;
    border-radius: 4px;
}

/* Just-added highlight pulse — gives visual feedback when + Plato / + Categoría
   creates an item at the end of the list, so the operator notices it landed. */
@keyframes r-edit-just-added {
    0%   { background-color: #fef3c7; }
    100% { background-color: transparent; }
}
.r-edit-item--just-added,
.r-edit-category--just-added {
    animation: r-edit-just-added 1.5s ease-out;
}

/* Cross-link banner from /restaurants/edit to /restaurants/settings */
.r-edit__settings-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    margin: 0 0 1rem;
    background: var(--r-surface-subtle);
    color: var(--r-ink);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--r-border);
    transition: border-color 0.15s, background-color 0.15s;
}
.r-edit__settings-link:hover {
    border-color: var(--r-ink);
    background: var(--r-surface);
}

/* Zone empty placeholder (shared between settings.php and old code paths) */
.r-zone-empty {
    color: var(--r-ink-muted);
    font-size: 13px;
    padding: 8px 0;
    font-style: italic;
}

/* QR generator: zone summary now includes an "edit zones" link */
.r-qr__zone-edit {
    color: var(--r-ink);
    text-decoration: none;
    font-weight: 600;
}
.r-qr__zone-edit:hover { text-decoration: underline; }

/* Upload preview modal — confirm before replacing item image */
.r-edit__upload-sub {
    margin: 0;
    padding: 0 var(--r-sp-4) var(--r-sp-2);
    color: var(--r-ink-muted);
    font-size: 13px;
    line-height: 1.4;
}
.r-upload-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--r-sp-3);
    padding: var(--r-sp-4);
}
.r-upload-preview__col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.r-upload-preview__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--r-ink-muted);
    text-align: center;
}
.r-upload-preview__img {
    aspect-ratio: 1 / 1;
    background: var(--r-surface-subtle);
    border: 1px solid var(--r-border);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--r-ink-muted);
    font-size: 12px;
    font-style: italic;
}
.r-upload-preview__img--empty {
    background: repeating-linear-gradient(45deg, var(--r-surface-subtle), var(--r-surface-subtle) 8px, var(--r-surface) 8px, var(--r-surface) 16px);
}

/* Demo pill — Polymer-style floating badge, bottom-center. Minimal footprint
   (no top space cost on mobile). Sits UNDER the cart bar (z 55 < 60) and is
   hidden via .is-hidden once the bar shows. Purely informational (no taps). */
.r-demo-pill {
    position: fixed;
    left: 50%;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 55;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(31, 41, 55, 0.92);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 999px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.22);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.r-demo-pill__dot {
    position: relative;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fbbf24;
}
/* Radar ping via a scaling pseudo-element: animate transform + opacity only
   (compositor thread, no per-frame repaint). Same look as the old box-shadow
   spread but ~free on the GPU. Pattern: the Google Maps blue-dot pulse. */
.r-demo-pill__dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(251, 191, 36, 0.5);
    animation: rDemoPulse 2s ease-out infinite;
}
@keyframes rDemoPulse {
    0%   { transform: scale(1);   opacity: 0.5; }
    100% { transform: scale(2.8); opacity: 0; }
}
.r-demo-pill.is-hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
}

/* Demo director bridge — post-order, links to the kitchen side so the prospect
   watches THEIR order land. Only rendered on demo networks. */
.r-demo-bridge {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 22px 0 8px;
    padding: 18px 16px;
    border: 1px dashed var(--r-border, #d8dbe0);
    border-radius: var(--r-radius-lg, 12px);
    background: var(--r-surface-subtle, #f7f8fa);
    text-align: center;
}
.r-demo-bridge__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--r-ink, #1f2937);
    margin: 0;
    line-height: 1.4;
}
.r-demo-bridge__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex: 0 0 auto;          /* neutraliza el flex:1 de .r-btn--primary (no estirar en columna) */
}

/* Coach del tour de demo (cocina): explica el flujo + CTA visible a Ventas. */
.r-demo-coach {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 16px;
    padding: 12px 16px;
    background: rgba(91, 91, 245, 0.08);
    border: 1px solid rgba(91, 91, 245, 0.25);
    border-radius: var(--r-radius-lg, 12px);
    font-size: 13px;
    line-height: 1.5;
    color: var(--r-ink, #1f2937);
}
.r-demo-coach__text { flex: 1; min-width: 200px; }
.r-demo-coach__cta {
    flex: 0 0 auto;
    background: var(--r-accent, #5b5bf5);
    color: #fff;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: var(--r-radius-sm, 4px);
    text-decoration: none;
    white-space: nowrap;
}
.r-demo-coach__cta:hover { filter: brightness(1.06); }
.r-demo-coach__close {
    flex: 0 0 auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: var(--r-ink-faint, #737373);
    padding: 0 4px;
}

/* SVG icons inline with text — flat/industrial replacement for emojis */
.r-cashier__icon {
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
    vertical-align: -3px;
    color: currentColor;
}
.r-cashier__icon svg { display: block; }
.r-cashier__pay-btn .r-icon {
    color: var(--r-ink);
    margin-bottom: 2px;
}
.r-cashier__pay-btn.is-selected {
    border-color: var(--r-ink);
    background: var(--r-surface);
    box-shadow: inset 0 0 0 1px var(--r-ink);
}
.r-cashier__session-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.r-cashier__warn {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    color: #78350f;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 12px;
}

/* Partial-payment state inside the table detail totals */
.r-cashier__partial { color: var(--r-ink-muted); font-weight: 600; }
.r-cashier__partial--rem { color: var(--r-accent); font-weight: 800; }

/* ── Divide the bill (split between diners) ─────────────────── */
.r-divide__progress { margin-bottom: var(--r-sp-4); }
.r-divide__remaining {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: var(--r-sp-3);
}
.r-divide__remaining > span {
    font-size: var(--r-text-sm); color: var(--r-ink-muted); font-weight: 600;
}
.r-divide__remaining > strong {
    font-size: 1.75rem; font-weight: 800; color: var(--r-accent);
    font-variant-numeric: tabular-nums;
}
.r-divide__bar {
    height: 10px; margin: var(--r-sp-2) 0 6px;
    background: var(--r-border);
    overflow: hidden;
}
.r-divide__bar-fill {
    height: 100%; width: 0; min-width: 0;
    background: var(--r-accent);
    transition: width 0.3s ease;
}
.r-divide__paidof {
    font-size: var(--r-text-xs); color: var(--r-ink-muted);
    font-variant-numeric: tabular-nums;
}

.r-divide__parts { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--r-sp-4); }
.r-divide__part {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    background: var(--r-surface-subtle);
    border: 1px solid var(--r-border);
}
.r-divide__part-label { font-size: var(--r-text-sm); font-weight: 600; color: var(--r-ink); }
.r-divide__part-amount {
    margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums;
    color: var(--r-ink);
}
.r-divide__part-btn {
    -webkit-appearance: none; appearance: none;
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--r-surface); border: 1px solid var(--r-border);
    color: var(--r-ink); cursor: pointer; font-size: 18px; line-height: 1;
    touch-action: manipulation;
}
.r-divide__part-btn:hover { border-color: var(--r-ink); }
.r-divide__part-void { color: var(--r-danger); }
.r-divide__part-void:hover { border-color: var(--r-danger); background: var(--r-danger-light); }

.r-divide__seg {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
    border: 1px solid var(--r-border);
    margin-bottom: var(--r-sp-4);
}
.r-divide__seg-btn {
    -webkit-appearance: none; appearance: none;
    background: var(--r-surface); border: none;
    padding: 12px 8px; font-size: var(--r-text-sm); font-weight: 700;
    color: var(--r-ink-muted); cursor: pointer;
    touch-action: manipulation; min-height: 44px;
    transition: background-color 0.15s, color 0.15s;
}
.r-divide__seg-btn + .r-divide__seg-btn { border-left: 1px solid var(--r-border); }
.r-divide__seg-btn.is-active { background: var(--r-ink); color: #fff; }

.r-divide__box { margin-bottom: var(--r-sp-4); }
.r-divide__label {
    display: block; font-size: var(--r-text-sm); font-weight: 600;
    color: var(--r-ink); margin-bottom: 8px;
}
/* Free-amount input — the protagonist number: big, centered, tabular. */
.r-divide__amount-input {
    width: 100%;
    text-align: center;
    font-size: 1.75rem; font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--r-ink);
    padding: 12px;
    border: 2px solid var(--r-border);
    background: var(--r-surface);
    -webkit-appearance: none; appearance: none;
}
.r-divide__amount-input:focus {
    outline: none;
    border-color: var(--r-accent);
}
.r-divide__amount-input::placeholder { color: var(--r-ink-faint); font-weight: 700; }
.r-divide__stepper {
    display: flex; align-items: center; justify-content: center; gap: var(--r-sp-4);
}
.r-divide__step {
    -webkit-appearance: none; appearance: none;
    width: 48px; height: 48px;
    background: var(--r-surface-subtle); border: 2px solid var(--r-border);
    color: var(--r-ink); font-size: 22px; font-weight: 700; line-height: 1;
    cursor: pointer; touch-action: manipulation;
    display: inline-flex; align-items: center; justify-content: center;
}
.r-divide__step:hover { border-color: var(--r-ink); }
.r-divide__step:active { transform: scale(0.95); }
.r-divide__count {
    min-width: 48px; text-align: center;
    font-size: 1.75rem; font-weight: 800; color: var(--r-ink);
    font-variant-numeric: tabular-nums;
}
.r-divide__preview {
    text-align: center; margin-top: 10px;
    font-size: var(--r-text-sm); color: var(--r-ink-muted); font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.r-divide__pay {
    border-top: 1px solid var(--r-border);
    padding-top: var(--r-sp-4);
}
.r-divide__pay-amount {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: var(--r-sp-3); margin-bottom: 10px;
}
.r-divide__pay-amount > span {
    font-size: var(--r-text-sm); color: var(--r-ink-muted); font-weight: 600;
}
.r-divide__pay-amount > strong {
    font-size: var(--r-text-lg); font-weight: 800; color: var(--r-ink);
    font-variant-numeric: tabular-nums;
}
/* No amount yet → mute the "Cobrar —" row so it doesn't read as active. */
.r-divide__pay.is-idle .r-divide__pay-amount { color: var(--r-ink-faint); }
.r-divide__pay.is-idle .r-divide__pay-amount > strong { color: var(--r-ink-faint); }
.r-divide__methods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.r-divide__method { padding: 14px 12px; }
/* Channel posture: single "print informative slip" button in place of methods. */
.r-divide__printslip { width: 100%; padding: 14px 12px; }
.r-divide__printslip:disabled { opacity: 0.4; cursor: not-allowed; }
.r-divide__method:disabled { opacity: 0.4; cursor: not-allowed; }
.r-divide__method:disabled:hover { border-color: var(--r-border); background: var(--r-surface-subtle); }

/* Cancel order — order picker list */
.r-cancel__list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
}
.r-cancel__item {
    -webkit-appearance: none; appearance: none;
    background: var(--r-surface-subtle);
    border: 2px solid var(--r-border);
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--r-ink);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    transition: border-color 0.15s, background-color 0.15s;
}
.r-cancel__item:hover { border-color: var(--r-ink); }
.r-cancel__item.is-selected {
    border-color: #dc2626;
    background: #fef2f2;
    color: #991b1b;
}
.r-cancel__total {
    font-variant-numeric: tabular-nums;
    color: var(--r-ink-muted);
}

/* ── Service mode picker — used in onboarding wizard + settings page ───── */
/* 3 selectable cards (counter / table_service / pay_first).               */
/* Generic class names (r-mode-*) so the same CSS lives in one place.      */
.r-mode-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.r-mode-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--r-border);
    background: var(--r-surface);
    cursor: pointer;
    transition: border-color .15s, background .15s;
    text-align: left;
    font: inherit;
    color: inherit;
    width: 100%;
}
.r-mode-card:hover { border-color: var(--r-ink-faint); }
.r-mode-card.is-selected {
    border-color: var(--r-ink);
    background: var(--r-surface-subtle);
}
.r-mode-card.is-selected .r-mode-icon { background: var(--r-ink); }
.r-mode-card.is-selected .r-mode-icon svg { stroke: var(--r-surface); }
.r-mode-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: var(--r-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.r-mode-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--r-ink);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke .15s;
}
.r-mode-body { flex: 1; min-width: 0; }
.r-mode-title { display: block; font-size: var(--r-text-base); font-weight: 600; margin: 0 0 2px; }
.r-mode-desc  { display: block; font-size: var(--r-text-sm); color: var(--r-ink-muted); margin: 0 0 4px; line-height: 1.4; }
.r-mode-example { display: block; font-size: var(--r-text-xs); color: var(--r-ink-faint); margin: 0; font-style: italic; }

/* ── Fast checkout toggle (settings page service tab — S58) ──────────── */
.r-fast-checkout {
    margin-top: 1.5rem;
    padding: 12px 14px;
    border: 1px solid var(--r-border);
    background: var(--r-surface);
}
.r-fast-checkout__label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    color: var(--r-ink);
}
.r-fast-checkout__label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
}
.r-fast-checkout__title {
    font-size: var(--r-text-base);
}
.r-fast-checkout__help {
    margin: 6px 0 0 28px;
    font-size: var(--r-text-sm);
    color: var(--r-ink-muted);
    line-height: 1.4;
}

/* ── Payment posture picker (till | channel) — orthogonal to service mode ── */
.r-posture-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--r-border);
}
.r-posture-section__title {
    font-size: var(--r-text-base);
    font-weight: 700;
    color: var(--r-ink);
    margin: 0 0 .25rem;
}
.r-posture-section .r-mode-grid {
    margin-top: 12px;
}

/* ── Context pill — "Mesa 5" / "Para llevar" (S58) ───────────────────── */
.r-context-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    margin: 8px auto 0;
    max-width: fit-content;
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    color: var(--r-ink);
    font-size: var(--r-text-sm);
    font-weight: 600;
}
.r-context-pill__icon { display: flex; align-items: center; }
.r-context-pill__icon svg { stroke: var(--r-accent); }
.r-context-pill__text { line-height: 1; }
.r-context-pill__close {
    background: transparent;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: var(--r-ink-muted);
    display: flex;
    align-items: center;
    margin-left: 4px;
}
.r-context-pill__close:hover { color: var(--r-ink); }

/* ── Day banner — owner-controlled message (S58) ─────────────────────── */
.r-day-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    margin: 8px;
    background: #fffbeb;
    border-left: 3px solid var(--r-warn);
    color: var(--r-ink);
    font-size: var(--r-text-sm);
    line-height: 1.4;
}
.r-day-banner__text { flex: 1; }
.r-day-banner__close {
    background: transparent;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: var(--r-ink-muted);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.r-day-banner__close:hover { color: var(--r-ink); }

/* ── Welcome toast — slides down from the top once per session (S58) ── */
.r-welcome-toast {
    position: fixed;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--r-ink);
    color: #fff;
    font-size: var(--r-text-sm);
    line-height: 1.4;
    box-shadow: 0 6px 20px rgba(0,0,0,.18);
    transform: translateY(-120%);
    transition: transform .35s cubic-bezier(.34,1.56,.64,1);
    max-width: 480px;
    margin: 0 auto;
}
.r-welcome-toast.is-visible {
    transform: translateY(0);
}
.r-welcome-toast__text { flex: 1; }
.r-welcome-toast__close {
    background: transparent;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: rgba(255,255,255,.7);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.r-welcome-toast__close:hover { color: #fff; }

/* ── Settings: Mensajes tab (welcome + day) (S58) ────────────────────── */
.r-message-block {
    margin-top: 1.25rem;
    padding: 12px 14px;
    border: 1px solid var(--r-border);
    background: var(--r-surface);
}
.r-message-block + .r-message-block { margin-top: 1rem; }
.r-message-block .r-locale-tabs { margin-top: 10px; }
.r-message-textarea {
    width: 100%;
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid var(--r-border);
    background: var(--r-surface);
    color: var(--r-ink);
    font: inherit;
    font-size: var(--r-text-sm);
    resize: vertical;
    box-sizing: border-box;
}
.r-message-textarea:focus { outline: 2px solid var(--r-accent); outline-offset: -1px; }

/* ── Pitch demo dual-link block (S58) ────────────────────────────────── */
.r-pitch__demo {
    margin-bottom: 1.5rem;
    border: 1px solid var(--r-border);
    background: var(--r-surface);
}
.r-pitch__demo-banner {
    background: #0a0a0a;
    color: #fff;
    padding: 8px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.r-pitch__demo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
@media (max-width: 640px) {
    .r-pitch__demo-grid { grid-template-columns: 1fr; }
}
.r-pitch__demo-card {
    padding: 16px;
    border-right: 1px solid var(--r-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.r-pitch__demo-card:last-child { border-right: none; }
@media (max-width: 640px) {
    .r-pitch__demo-card { border-right: none; border-bottom: 1px solid var(--r-border); }
    .r-pitch__demo-card:last-child { border-bottom: none; }
}
.r-pitch__demo-head {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
}
.r-pitch__demo-icon { font-size: 1.5rem; }
.r-pitch__demo-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--r-ink);
}
.r-pitch__demo-sub {
    font-size: 0.75rem;
    color: var(--r-ink-muted);
}
.r-pitch__demo-qr {
    width: 168px;
    height: 168px;
    background: #fff;
    padding: 6px;
    border: 1px solid var(--r-border);
}
.r-pitch__demo-qr img,
.r-pitch__demo-qr canvas { display: block; }
.r-pitch__demo-url {
    width: 100%;
    background: var(--r-bg);
    border: 1px solid var(--r-border);
    color: var(--r-ink);
    padding: 6px 10px;
    font-size: 0.6875rem;
    font-family: ui-monospace, monospace;
    cursor: pointer;
    word-break: break-all;
    text-align: left;
}
.r-pitch__demo-url:hover { border-color: var(--r-ink); }
.r-pitch__demo-actions {
    display: flex;
    gap: 8px;
    width: 100%;
}
.r-pitch__demo-btn {
    flex: 1;
    padding: 8px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    border: 1px solid var(--r-border);
    background: var(--r-surface);
    color: var(--r-ink);
    cursor: pointer;
    text-decoration: none;
}
.r-pitch__demo-btn:hover { border-color: var(--r-ink); background: var(--r-surface-subtle); }
.r-pitch__demo-btn--wa {
    background: #25d366;
    color: #fff;
    border-color: #25d366;
}
.r-pitch__demo-btn--wa:hover { background: #1ebe5d; border-color: #1ebe5d; }

/* ── Category bar wrapper (holds tabs + view toggle), sticky ─────────── */
.r-catbar {
    position: -webkit-sticky; position: sticky;
    top: var(--r-header-h);
    z-index: 40;
    background: var(--r-surface);
    border-bottom: 1px solid var(--r-border);
    display: flex; align-items: center;
    height: var(--r-cat-nav-h);
}
body.has-cart-strip .r-catbar { top: calc(var(--r-header-h) + var(--r-cart-strip-h)); }
/* The nav now lives inside the bar — neutralise its own sticky/border. */
.r-catbar .r-cat-nav {
    position: static; top: auto; z-index: auto;
    border-bottom: none; flex: 1 1 auto; min-width: 0;
}
body.has-cart-strip .r-catbar .r-cat-nav { top: auto; }
.r-view-toggle {
    flex: 0 0 auto;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; border-left: 1px solid var(--r-border);
    color: var(--r-ink-muted); cursor: pointer;
}
.r-view-toggle svg { width: 20px; height: 20px; }
.r-view-toggle:active { background: var(--r-surface-subtle); }
/* Show the icon of the mode you'd switch TO. */
.r-view-toggle__card { display: none; }
body.r-view-card .r-view-toggle__card { display: block; }
body.r-view-card .r-view-toggle__list { display: none; }

/* ── Card grid view ─────────────────────────────────────────────────── */
.r-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--r-sp-3);
    margin-bottom: var(--r-sp-4);
}
.r-card {
    display: flex; flex-direction: column;
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-md);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--r-shadow-xs);
    transition: box-shadow var(--r-tr-fast), transform var(--r-tr-fast), border-color var(--r-tr-fast);
}
.r-card:hover { box-shadow: var(--r-shadow-md); }
.r-card:active { transform: scale(.985); }
.r-card__img {
    position: relative;
    width: 100%; aspect-ratio: 1 / 1;
    background: #fff;
    background-size: contain; background-repeat: no-repeat; background-position: center;
    display: flex; align-items: center; justify-content: center;
    font-size: 3.5rem; line-height: 1;
}
.r-card__body { padding: var(--r-sp-3); display: flex; flex-direction: column; gap: var(--r-sp-1); flex: 1; }
.r-card__name {
    font-size: var(--r-text-sm); font-weight: 600; color: var(--r-ink);
    letter-spacing: -0.01em; line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.r-card__price {
    font-size: var(--r-text-base); font-weight: 700; color: var(--r-ink);
    font-variant-numeric: tabular-nums; margin-top: auto;
}
@media (min-width: 560px) { .r-cards { grid-template-columns: repeat(3, 1fr); } }

/* ── Motion / GPU hygiene (global, keep at the bottom) ─────────────────────
   Two safeguards against decorative animation burning CPU/GPU:

   1. prefers-reduced-motion (WCAG 2.3.3 Animation from Interactions) — when the
      OS asks for reduced motion, every looping/decorative animation collapses to
      a single frame. Same reset shipped by Primer (GitHub), Polaris (Shopify),
      Material and Tailwind's `motion-reduce`. Also frees the compositor: no
      `infinite` pulse/shimmer/spin keeps the GPU awake.

   2. Background tab pause — Chrome throttles JS timers on hidden tabs but does
      NOT pause CSS animations; they keep compositing and spinning the fan on a
      tab the user isn't even looking at. `.r-tab-hidden` (toggled on <html> by a
      `visibilitychange` listener on the customer menu) parks every animation.
      Scoped to pages that opt in — the kitchen display is a live screen and does
      not add the toggle, so its status pulses keep running when backgrounded. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
html.r-tab-hidden *,
html.r-tab-hidden *::before,
html.r-tab-hidden *::after {
    animation-play-state: paused !important;
}
