@import url('tokens.css?v=5');

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); font-family: var(--font-body); color: var(--ink-2); }

.cat-header {
    background: var(--ink); color: #fff; padding: 40px 24px 32px; text-align: center;
}
.cat-header h1 { font-family: var(--font-display); font-size: 28px; margin: 0 0 8px; }
.cat-header p { font-size: 13px; color: rgba(255,255,255,.6); margin: 0; }
.cat-header a { color: var(--cat-accent, var(--amber)); text-decoration: none; }

.cat-main { max-width: 900px; margin: 0 auto; padding: 32px 20px 60px; }
.cat-empty { text-align: center; color: #6B7280; padding: 60px 0; }

.cat-section { margin-bottom: 36px; }
.cat-section h2 {
    font-family: var(--font-display); font-size: 20px; color: var(--ink-2);
    border-bottom: 2px solid var(--amber-soft); padding-bottom: 8px; margin-bottom: 18px;
}
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.cat-card {
    background: #fff; border: 1px solid var(--paper-line); border-radius: var(--radius-md);
    overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s ease;
}
.cat-card:hover { box-shadow: 0 10px 24px rgba(15,23,32,.1); }
.cat-card img { width: 100%; height: 150px; object-fit: cover; display: block; }
.cat-card-placeholder {
    width: 100%; height: 150px; background: var(--amber-soft); color: var(--amber-dark);
    display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 40px; font-weight: 700;
}
.cat-card-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; }
.cat-card-body h3 { font-size: 15px; margin: 0 0 6px; color: var(--ink-2); }
.cat-desc { font-size: 12.5px; color: #6B7280; margin: 0 0 10px; line-height: 1.4; }
.cat-price {
    font-family: var(--font-mono); font-size: 18px; font-weight: 700; color: var(--ink-2);
    margin-top: auto; padding-top: 6px;
}
.cat-order-btn {
    display: block; text-align: center; margin-top: 10px; background: var(--cat-accent, var(--amber)); color: #FFFFFF;
    text-decoration: none; font-weight: 700; font-size: 12.5px; padding: 9px; border-radius: 999px;
}

.cat-footer { text-align: center; padding: 28px; font-size: 12.5px; color: #9AA3AC; border-top: 1px solid var(--paper-line); }
.cat-footer a { color: var(--amber-dark); font-weight: 600; text-decoration: none; }

/* ============================================================
   REDISEÑO ESTILO RAPPI — pastillas de categoría, selector de
   cantidad por producto, carrito flotante con resumen y pedido
   consolidado en un solo mensaje de WhatsApp
   ============================================================ */
.cat-chips-scroll {
    display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px; background: #fff;
    border-bottom: 1px solid var(--paper-line); position: sticky; top: 0; z-index: 30;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.cat-chips-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
    flex-shrink: 0; padding: 8px 16px; border-radius: 999px; background: var(--paper);
    color: var(--ink-2); font-size: 13px; font-weight: 600; text-decoration: none;
    border: 1px solid var(--paper-line); transition: background .15s ease, color .15s ease;
}
.cat-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.cat-qty-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.cat-qty-btn {
    width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--paper-line); background: #fff;
    font-size: 16px; font-weight: 700; color: var(--ink-2); cursor: pointer; line-height: 1;
    display: flex; align-items: center; justify-content: center; transition: transform .1s ease;
}
.cat-qty-btn:active { transform: scale(.9); }
.cat-qty-btn.cat-qty-add { background: var(--cat-accent, var(--amber)); border-color: var(--cat-accent, var(--amber)); color: #FFFFFF; }
.cat-qty-num { font-family: var(--font-mono); font-weight: 700; min-width: 18px; text-align: center; }

/* Barra flotante del carrito — aparece en cuanto hay algo agregado */
.cat-cart-bar {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60;
    background: var(--ink); color: #fff; border-radius: 999px; padding: 14px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    box-shadow: 0 12px 30px rgba(15,23,32,.35);
    opacity: 0; transform: translateY(20px); pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}
.cat-cart-bar.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.cat-cart-bar span { font-weight: 600; font-size: 13.5px; }
.cat-cart-bar button {
    background: var(--cat-accent, var(--amber)); color: #FFFFFF; border: none; border-radius: 999px;
    padding: 8px 16px; font-weight: 700; font-size: 13px; cursor: pointer;
}

.cat-cart-overlay {
    position: fixed; inset: 0; background: rgba(15,23,32,.5); z-index: 70;
    opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.cat-cart-overlay.open { opacity: 1; pointer-events: auto; }
.cat-cart-panel {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; background: #fff;
    border-radius: 20px 20px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
    max-height: 70vh; overflow-y: auto;
    transform: translateY(100%); transition: transform .25s ease;
    box-shadow: 0 -10px 40px rgba(15,23,32,.25);
}
.cat-cart-panel.open { transform: translateY(0); }
.cat-cart-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.cat-cart-panel-head h3 { font-family: var(--font-display); font-size: 18px; margin: 0; }
.cat-cart-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--ink-2); line-height: 1; }
.cat-cart-item { display: flex; justify-content: space-between; font-size: 14px; padding: 8px 0; border-bottom: 1px solid var(--paper-line); }
.cat-cart-total { display: flex; justify-content: flex-end; font-weight: 700; font-size: 16px; padding: 14px 0; }
#sendOrderBtn { width: 100%; border: none; cursor: pointer; }

/* Mobile-first real: en pantallas angostas, 2 columnas de tarjetas
   compactas (igual que las apps de domicilios), no 1 sola columna ancha. */
@media (max-width: 480px) {
    .cat-header h1 { font-size: 22px; }
    .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .cat-card img, .cat-card-placeholder { height: 110px; }
    .cat-card-body { padding: 10px 12px; }
    .cat-card-body h3 { font-size: 13.5px; }
    .cat-desc { display: none; } /* en tarjetas compactas de celular, la descripción sobra y satura */
    .cat-price { font-size: 15px; }
}

/* ============================================================
   PLANTILLAS DEL CATÁLOGO — cada negocio elige la suya desde
   "Catálogo digital" en su panel. La estructura HTML es la misma
   para las 4; solo cambia el vestido visual.
   ============================================================ */

/* --- Moderno: encabezado claro con degradado, tarjetas grandes y redondeadas --- */
.cat-tpl-moderno .cat-header {
    background: linear-gradient(135deg, #fff 0%, color-mix(in srgb, var(--cat-accent, var(--amber)) 18%, #fff) 100%);
    color: var(--ink-2);
}
.cat-tpl-moderno .cat-header p { color: #6B7280; }
.cat-tpl-moderno .cat-header a { color: var(--cat-accent, var(--amber-dark)); font-weight: 700; }
.cat-tpl-moderno .cat-card { border-radius: 20px; border: none; box-shadow: 0 8px 24px rgba(15,23,32,.08); }
.cat-tpl-moderno .cat-card img, .cat-tpl-moderno .cat-card-placeholder { height: 170px; border-radius: 20px 20px 0 0; }
.cat-tpl-moderno .cat-price { font-size: 21px; }
.cat-tpl-moderno .cat-chip.active { background: var(--cat-accent, var(--amber)); color: #fff; border-color: transparent; }

/* --- Minimalista: blanco y negro, sin sombras, muy limpio --- */
.cat-tpl-minimalista { background: #fff; }
.cat-tpl-minimalista .cat-header { background: #fff; color: #111; border-bottom: 1px solid #E5E5E5; }
.cat-tpl-minimalista .cat-header h1 { font-family: var(--font-body); font-weight: 700; }
.cat-tpl-minimalista .cat-header p { color: #888; }
.cat-tpl-minimalista .cat-header a { color: #111; text-decoration: underline; }
.cat-tpl-minimalista .cat-chip { border-radius: 4px; border-color: #111; background: #fff; }
.cat-tpl-minimalista .cat-chip.active { background: #111; color: #fff; border-color: #111; }
.cat-tpl-minimalista .cat-card { border-radius: 4px; box-shadow: none; border: 1px solid #E5E5E5; }
.cat-tpl-minimalista .cat-card:hover { box-shadow: none; border-color: #111; }
.cat-tpl-minimalista .cat-card img, .cat-tpl-minimalista .cat-card-placeholder { border-radius: 0; }
.cat-tpl-minimalista .cat-section h2 { border-bottom-color: #111; font-family: var(--font-body); }
.cat-tpl-minimalista .cat-order-btn, .cat-tpl-minimalista .cat-qty-btn.cat-qty-add { border-radius: 4px; }

/* --- Vibrante: encabezado a todo color con el acento del negocio, formas redondeadas y llamativas --- */
.cat-tpl-vibrante .cat-header { background: var(--cat-accent, var(--amber)); color: #fff; }
.cat-tpl-vibrante .cat-header h1 { color: #fff; }
.cat-tpl-vibrante .cat-header p { color: rgba(255,255,255,.85); }
.cat-tpl-vibrante .cat-header a { color: #fff; text-decoration: underline; }
.cat-tpl-vibrante .cat-chip { border-radius: 999px; }
.cat-tpl-vibrante .cat-chip.active { background: var(--cat-accent, var(--amber)); color: #fff; border-color: transparent; }
.cat-tpl-vibrante .cat-card { border-radius: 24px; border: 2px solid transparent; }
.cat-tpl-vibrante .cat-card:hover { border-color: var(--cat-accent, var(--amber)); }
.cat-tpl-vibrante .cat-card img, .cat-tpl-vibrante .cat-card-placeholder { height: 160px; border-radius: 22px 22px 0 0; }
.cat-tpl-vibrante .cat-card-placeholder { background: color-mix(in srgb, var(--cat-accent, var(--amber)) 20%, #fff); color: var(--cat-accent, var(--amber-dark)); }
.cat-tpl-vibrante .cat-price { color: var(--cat-accent, var(--amber-dark)); }

/* ---------- Tienda online (Fase 3): promociones, agotados y checkout ---------- */
.cat-badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.cat-badges span { font-size: 12.5px; background: rgba(127,127,127,.14); border: 1px solid rgba(127,127,127,.32); color: inherit; padding: 5px 11px; border-radius: 999px; }
.cat-card { position: relative; }
.cat-promo-badge { position: absolute; top: 10px; left: 10px; z-index: 1; background: #06B6D4; color: #fff; font-weight: 800; font-size: 12px; padding: 4px 9px; border-radius: 999px; box-shadow: 0 6px 14px -6px rgba(6,182,212,.7); }
.cat-price-old { font-size: 12.5px; color: #8A939C; font-weight: 500; margin-left: 6px; }
.cat-card.is-soldout img, .cat-card.is-soldout .cat-card-placeholder { filter: grayscale(1); opacity: .55; }
.cat-soldout { margin-top: 10px; font-size: 12.5px; font-weight: 700; color: #8A939C; text-transform: uppercase; letter-spacing: .06em; }
.cat-cart-panel { max-height: 88vh; overflow-y: auto; }
.cat-checkout { display: grid; gap: 12px; }
.cat-checkout label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.cat-checkout small { font-weight: 400; color: #8A939C; }
.cat-checkout input[type="text"], .cat-checkout input:not([type]), .cat-checkout input[type="email"] {
    font: inherit; font-weight: 400; padding: 11px 12px; border: 1px solid #DCDFE3; border-radius: 10px; background: #fff;
}
.cat-checkout input:focus { outline: none; border-color: var(--cat-accent, var(--amber)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cat-accent, var(--amber)) 25%, transparent); }
.cat-checkout fieldset { border: 1px solid #E5E7EB; border-radius: 12px; padding: 10px 12px; margin: 0; display: grid; gap: 6px; }
.cat-checkout legend { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #8A939C; padding: 0 4px; }
.cat-checkout .cat-radio { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.cat-note { font-size: 12.5px; color: #5B6672; margin: -4px 0 0; }
.cat-error { color: #C0392B; font-size: 13.5px; min-height: 1em; }
.cat-link-btn { background: none; border: none; color: #5B6672; font: inherit; font-size: 13.5px; text-decoration: underline; cursor: pointer; padding: 8px; width: 100%; }

/* Seguimiento del pedido */
.track-wrap { max-width: 560px; margin: 0 auto; padding: 24px 16px 60px; }
.track-card { background: #fff; border-radius: 18px; padding: 22px; border: 1px solid var(--paper-line); margin-bottom: 14px; }
.track-head { text-align: center; }
.track-head h1 { font-family: var(--font-display); font-size: 26px; margin: 6px 0; letter-spacing: -0.03em; }
.track-num { font-family: var(--font-mono); font-size: 13px; color: #8A939C; }
.track-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 18px 0 6px; }
.track-steps div { text-align: center; font-size: 11px; color: #8A939C; }
.track-steps div::before { content: ""; display: block; height: 6px; border-radius: 999px; background: #EEF0F2; margin-bottom: 6px; }
.track-steps div.done { color: var(--ink-2); font-weight: 600; }
.track-steps div.done::before { background: var(--cat-accent, var(--amber)); }
.track-pay { padding: 12px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; text-align: center; }
.track-pay.ok { background: rgba(45,212,167,.14); color: #13906F; }
.track-pay.wait { background: rgba(37,99,235,.14); color: #92650B; }
.track-pay.fail { background: #FBE9E9; color: #C0392B; }
.cat-cart-panel button.cat-order-btn { width: 100%; border: 0; cursor: pointer; font: inherit; font-weight: 700; padding: 13px; }
.cat-cart-panel button.cat-order-btn:disabled { opacity: .6; cursor: progress; }

/* Barras de desplazamiento ocultas (se sigue desplazando normal). */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }
