/* ============================================================
   Tienda de barrio — hoja de estilos única
   ============================================================ */

:root {
    --ink: #1c1917;
    --ink-2: #44403c;
    --muted: #78716c;
    --line: #e7e5e4;
    --line-2: #d6d3d1;
    --bg: #fafaf9;
    --card: #ffffff;
    --green: #166534;
    --green-dark: #14532d;
    --green-soft: #dcfce7;
    --green-line: #bbf7d0;
    --amber: #f59e0b;
    --amber-dark: #b45309;
    --amber-soft: #fef3c7;
    --blue: #1d4ed8;
    --blue-soft: #dbeafe;
    --red: #b91c1c;
    --red-soft: #fee2e2;
    --radius: 16px;
    --shadow: 0 1px 2px rgba(28, 25, 23, .05), 0 8px 24px rgba(28, 25, 23, .05);
    --shadow-lg: 0 24px 60px rgba(28, 25, 23, .14);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
    font-size: 16px;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.02em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
small { font-size: 12px; }

.container { width: min(1140px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Botones ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 16px; border-radius: 11px; border: 1px solid var(--line-2);
    background: #fff; color: var(--ink); font-weight: 700; font-size: 14px;
    cursor: pointer; transition: .15s ease; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-amber { background: var(--amber); border-color: var(--amber); color: #422006; }
.btn-amber:hover { background: #fbbf24; border-color: #fbbf24; }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: #fca5a5; }
.btn-danger-strong { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger-strong:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: #f5f5f4; border-color: transparent; }
.btn-sm { padding: 7px 11px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 14px 22px; font-size: 16px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Formularios ---------- */
label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
input[type="text"], input[type="search"], input[type="password"], input[type="tel"],
input[type="number"], input[type="date"], input[type="email"], input[type="file"],
select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px;
    background: #fff; font-size: 15px; transition: .15s ease;
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid #86efac; outline-offset: 1px; border-color: #22c55e;
}
textarea { min-height: 90px; resize: vertical; }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.45; }
.check-line { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.check-line input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green); flex: 0 0 auto; }
.input-error { border-color: #f87171 !important; background: #fff7f7; }

/* ---------- Avisos ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 11px; font-size: 14px; margin-bottom: 14px; }
.flash.is-success { background: var(--green-soft); border: 1px solid var(--green-line); color: #14532d; }
.flash.is-error { background: var(--red-soft); border: 1px solid #fecaca; color: #7f1d1d; }
.flash.is-info { background: var(--blue-soft); border: 1px solid #bfdbfe; color: #1e3a8a; }
.flash.is-warning { background: var(--amber-soft); border: 1px solid #fde68a; color: #78350f; }

.badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px;
    border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.5;
    background: #f5f5f4; color: var(--ink-2); border: 1px solid var(--line);
}
.badge.is-pendiente { background: var(--amber-soft); border-color: #fde68a; color: #92400e; }
.badge.is-confirmado { background: var(--blue-soft); border-color: #bfdbfe; color: #1e40af; }
.badge.is-listo { background: #e0e7ff; border-color: #c7d2fe; color: #3730a3; }
.badge.is-entregado { background: var(--green-soft); border-color: var(--green-line); color: #166534; }
.badge.is-cancelado { background: #f5f5f4; border-color: var(--line-2); color: #57534e; }
.badge.is-bajo { background: var(--amber-soft); border-color: #fde68a; color: #92400e; }
.badge.is-agotado { background: var(--red-soft); border-color: #fecaca; color: #991b1b; }
.badge.is-ok { background: var(--green-soft); border-color: var(--green-line); color: #166534; }

/* ============================================================
   TIENDA PÚBLICA
   ============================================================ */

.site-header {
    position: sticky; top: 0; z-index: 40;
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 18px; height: 70px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
    width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto;
    background: linear-gradient(145deg, var(--green), #15803d);
    color: #fff; display: grid; place-items: center; font-size: 20px; font-weight: 800;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header-search { flex: 1; max-width: 460px; position: relative; }
.header-search input {
    padding-left: 40px; border-radius: 999px; background: #f5f5f4; border-color: transparent;
}
.header-search input:focus { background: #fff; }
.header-search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.header-link { padding: 8px 10px; border-radius: 9px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.header-link:hover { background: #f5f5f4; }
.cart-link {
    position: relative; display: inline-flex; align-items: center; gap: 8px;
    background: var(--green); color: #fff; padding: 9px 14px; border-radius: 999px;
    font-weight: 700; font-size: 14px;
}
.cart-link:hover { background: var(--green-dark); }
.cart-count {
    min-width: 21px; height: 21px; padding: 0 6px; border-radius: 999px;
    background: var(--amber); color: #422006; display: grid; place-items: center;
    font-size: 12px; font-weight: 800;
}
.cart-count[data-empty="1"] { display: none; }

.store-closed {
    background: #422006; color: #fef3c7; text-align: center; font-size: 13px;
    padding: 8px 16px; font-weight: 600;
}

/* Hero */
.hero { padding: 34px 0 18px; }
.hero-card {
    position: relative; overflow: hidden; border-radius: 24px; padding: 42px 44px;
    background:
        radial-gradient(700px 300px at 85% 20%, rgba(245, 158, 11, .28), transparent 65%),
        linear-gradient(135deg, #14532d, #166534 55%, #15803d);
    color: #fff; box-shadow: var(--shadow-lg);
}
.hero-card::after {
    content: ""; position: absolute; right: -80px; bottom: -120px; width: 320px; height: 320px;
    border-radius: 50%; border: 38px solid rgba(255, 255, 255, .07);
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.5fr .9fr; gap: 34px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: #bbf7d0; margin-bottom: 14px; }
.hero h1 { font-size: clamp(30px, 4.2vw, 48px); line-height: 1.04; letter-spacing: -.035em; max-width: 14ch; }
.hero p { color: #dcfce7; font-size: 16px; margin-top: 14px; max-width: 46ch; line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero-actions .btn { border-color: rgba(255, 255, 255, .25); }
.hero-actions .btn-amber { border-color: var(--amber); }
.hero-actions .btn-ghost { color: #ecfdf5; }
.hero-actions .btn-ghost:hover { background: rgba(255, 255, 255, .1); }
.hero-side { display: grid; gap: 10px; }
.hero-note {
    background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 14px; padding: 13px 15px; backdrop-filter: blur(4px);
}
.hero-note strong { display: block; font-size: 14px; margin-bottom: 1px; }
.hero-note span { font-size: 12px; color: #dcfce7; line-height: 1.4; }

/* Secciones */
.section { padding: 28px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-head h2 { font-size: 23px; }
.section-head p { color: var(--muted); font-size: 14px; margin-top: 3px; }
.section-head a { font-size: 14px; font-weight: 700; color: var(--green); }

/* Categorías */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 10px; }
.cat-chip {
    display: flex; align-items: center; gap: 11px; padding: 13px 14px; background: #fff;
    border: 1px solid var(--line); border-radius: 13px; transition: .15s ease; min-width: 0;
}
.cat-chip:hover { border-color: var(--green-line); background: #f0fdf4; transform: translateY(-1px); }
.cat-emoji {
    width: 38px; height: 38px; border-radius: 11px; background: var(--green-soft);
    display: grid; place-items: center; font-size: 19px; flex: 0 0 auto;
}
.cat-chip strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-chip small { color: var(--muted); font-size: 12px; }

/* Productos */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.product-card {
    background: #fff; border: 1px solid var(--line); border-radius: 15px; overflow: hidden;
    display: flex; flex-direction: column; transition: .18s ease;
}
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--line-2); }
.product-media {
    position: relative; aspect-ratio: 1 / 1; background:
        radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .85) 0 24%, transparent 25%),
        linear-gradient(145deg, #f0fdf4, #dcfce7);
    display: grid; place-items: center; overflow: hidden;
}
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: .3s ease; }
.product-card:hover .product-media img { transform: scale(1.035); }
.product-initial {
    width: 74px; height: 74px; border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(20, 83, 45, .09);
    font-size: 34px; font-weight: 800; color: var(--green);
    letter-spacing: -.04em; box-shadow: 0 4px 14px rgba(20, 83, 45, .06);
}
.product-media .badge { position: absolute; top: 9px; left: 9px; box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.product-body { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.product-cat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--green); }
.product-name { font-size: 14px; font-weight: 700; line-height: 1.3; }
.product-name a:hover { color: var(--green); }
.product-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.price { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.price small { font-weight: 600; color: var(--muted); font-size: 11px; }
.btn-add {
    width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--green-line);
    background: var(--green-soft); color: var(--green-dark); font-size: 19px; font-weight: 800;
    display: grid; place-items: center; cursor: pointer; transition: .15s ease; flex: 0 0 auto;
}
.btn-add:hover { background: var(--green); color: #fff; border-color: var(--green); }
.btn-add:disabled { background: #f5f5f4; border-color: var(--line); color: #a8a29e; cursor: not-allowed; }

/* Catálogo */
.catalog-head { padding: 28px 0 8px; }
.catalog-head h1 { font-size: 30px; }
.catalog-toolbar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 14px 0 20px; border-bottom: 1px solid var(--line); margin-bottom: 20px;
}
.toolbar-search { flex: 1 1 260px; min-width: 220px; }
.toolbar-search form { display: flex; gap: 8px; }
.toolbar-search input { border-radius: 10px; }
.toolbar-select { width: auto; min-width: 165px; }
.filter-chip { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 700; background: #fff; }
.filter-chip.is-active { background: var(--green); border-color: var(--green); color: #fff; }
.catalog-layout { display: grid; grid-template-columns: 210px 1fr; gap: 26px; align-items: start; }
.catalog-side { position: sticky; top: 88px; }
.side-block { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.side-block h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 9px; }
.side-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px; border-radius: 8px; font-size: 14px; }
.side-link:hover { background: #f5f5f4; }
.side-link.is-active { background: var(--green-soft); color: var(--green-dark); font-weight: 700; }
.side-link small { color: var(--muted); font-size: 11px; }
.catalog-count { font-size: 13px; color: var(--muted); margin-bottom: 12px; }

/* Paginación */
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 28px 0 10px; font-size: 13px; color: var(--muted); }
.pagination a { font-weight: 700; color: var(--green); padding: 6px 10px; border-radius: 8px; }
.pagination a:hover { background: var(--green-soft); }

/* Producto detalle */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 32px 0; align-items: start; }
.detail-media { border-radius: 20px; overflow: hidden; background: linear-gradient(145deg, #f5f5f4, #e7e5e4); aspect-ratio: 1 / 1; display: grid; place-items: center; }
.detail-media img { width: 100%; height: 100%; object-fit: cover; }
.detail-media .product-initial { font-size: 90px; }
.detail-info h1 { font-size: clamp(25px, 3.5vw, 36px); margin: 8px 0 12px; }
.detail-price { font-size: 32px; font-weight: 800; letter-spacing: -.03em; margin: 10px 0 4px; }
.detail-info .description { color: var(--ink-2); font-size: 15px; line-height: 1.65; margin: 14px 0 20px; white-space: pre-line; }
.detail-meta { display: flex; gap: 9px; flex-wrap: wrap; margin: 12px 0 20px; }
.buy-row { display: flex; gap: 10px; align-items: stretch; margin-top: 18px; }
.qty-control { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 11px; overflow: hidden; background: #fff; }
.qty-control button { width: 38px; height: 42px; border: 0; background: transparent; font-size: 18px; cursor: pointer; color: var(--ink-2); }
.qty-control button:hover { background: #f5f5f4; }
.qty-control input { width: 54px; height: 42px; border: 0; text-align: center; font-weight: 700; padding: 0; -moz-appearance: textfield; }
.qty-control input::-webkit-outer-spin-button, .qty-control input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.detail-notes { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 9px; }
.detail-note { display: flex; gap: 10px; font-size: 13px; color: var(--muted); }
.detail-note b { color: var(--ink-2); }

/* Carrito */
.cart-layout { display: grid; grid-template-columns: 1.6fr .9fr; gap: 26px; align-items: start; padding: 28px 0 50px; }
.cart-list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cart-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.cart-row:last-child { border-bottom: 0; }
.cart-thumb { width: 64px; height: 64px; border-radius: 11px; background: linear-gradient(145deg, #f5f5f4, #e7e5e4); display: grid; place-items: center; overflow: hidden; font-weight: 800; color: #a8a29e; font-size: 22px; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-name { font-weight: 700; font-size: 14px; line-height: 1.3; }
.cart-name a:hover { color: var(--green); }
.cart-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cart-controls { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
.cart-controls .qty-control button { width: 30px; height: 32px; font-size: 15px; }
.cart-controls .qty-control input { width: 42px; height: 32px; font-size: 13px; }
.cart-remove { background: none; border: 0; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; padding: 4px; }
.cart-remove:hover { color: var(--red); }
.cart-line-total { font-weight: 800; font-size: 15px; white-space: nowrap; }

.summary {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px; position: sticky; top: 88px;
}
.summary h3 { font-size: 16px; margin-bottom: 14px; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 6px 0; color: var(--ink-2); }
.summary-row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-size: 19px; font-weight: 800; color: var(--ink); }
.summary-note { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.45; }
.summary .btn { margin-top: 14px; }
.summary-list { margin: 0 0 12px; padding: 0; list-style: none; max-height: 300px; overflow: auto; }
.summary-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 5px 0; color: var(--ink-2); }
.summary-list li span:first-child { min-width: 0; }

.empty-state { text-align: center; padding: 60px 24px; background: #fff; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty-state .emoji { font-size: 40px; margin-bottom: 10px; }
.empty-state h3 { font-size: 19px; margin-bottom: 5px; }
.empty-state p { color: var(--muted); font-size: 14px; max-width: 40ch; margin: 0 auto 18px; }

/* Checkout */
.checkout-layout { display: grid; grid-template-columns: 1.35fr .9fr; gap: 26px; align-items: start; padding: 28px 0 50px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h2 { font-size: 18px; margin-bottom: 16px; }
.panel + .panel { margin-top: 16px; }
.radio-cards { display: grid; gap: 10px; }
.radio-card { position: relative; display: block; cursor: pointer; margin: 0; }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card .inner {
    display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px;
    border: 1px solid var(--line-2); border-radius: 12px; transition: .15s ease; background: #fff;
}
.radio-card input:checked + .inner { border-color: var(--green); background: #f0fdf4; box-shadow: 0 0 0 1px var(--green); }
.radio-card .icon { font-size: 20px; line-height: 1; }
.radio-card strong { display: block; font-size: 14px; }
.radio-card small { color: var(--muted); font-size: 12px; line-height: 1.4; display: block; margin-top: 2px; }
.pay-methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.pay-methods .radio-card .inner { padding: 10px 12px; }
.hidden { display: none !important; }

/* Pedido confirmado */
.order-wrap { max-width: 820px; margin: 0 auto; padding: 34px 0 60px; }
.order-hero { text-align: center; padding: 24px 0 20px; }
.order-check { width: 58px; height: 58px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-size: 28px; margin: 0 auto 12px; }
.order-hero h1 { font-size: 30px; }
.order-hero p { color: var(--muted); margin-top: 6px; }
.order-code { display: inline-block; margin-top: 12px; padding: 6px 14px; background: #fff; border: 1px dashed var(--line-2); border-radius: 999px; font-weight: 800; letter-spacing: .08em; }
.timeline { display: flex; gap: 0; margin: 26px 0 10px; }
.timeline-step { flex: 1; text-align: center; position: relative; font-size: 11px; font-weight: 700; color: #a8a29e; }
.timeline-step::before { content: ""; display: block; width: 14px; height: 14px; border-radius: 50%; background: #e7e5e4; margin: 0 auto 7px; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.timeline-step::after { content: ""; position: absolute; top: 6px; left: 50%; width: 100%; height: 2px; background: var(--line); z-index: -1; }
.timeline-step:last-child::after { display: none; }
.timeline-step.is-done { color: var(--green); }
.timeline-step.is-done::before { background: var(--green); box-shadow: 0 0 0 1px var(--green); }
.timeline-step.is-done::after { background: var(--green-line); }
.order-grid { display: grid; grid-template-columns: 1.4fr .8fr; gap: 16px; margin-top: 20px; }
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 6px 0; font-size: 14px; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { text-align: right; font-weight: 600; }
.order-items { width: 100%; border-collapse: collapse; }
.order-items td { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.order-items tr:last-child td { border-bottom: 0; }
.order-items td:last-child { text-align: right; font-weight: 700; white-space: nowrap; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: #fff; margin-top: 30px; padding: 30px 0; }
.footer-grid { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-brand { max-width: 320px; }
.footer-brand p { color: var(--muted); font-size: 13px; margin-top: 8px; }
.footer-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 8px; }
.footer-col a, .footer-col span { display: block; font-size: 13px; color: var(--ink-2); padding: 3px 0; }
.footer-col a:hover { color: var(--green); }
.footer-bottom { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }

/* Toast */
.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: grid; gap: 8px; }
.toast {
    background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 11px;
    font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg);
    animation: toast-in .2s ease;
}
.toast.is-error { background: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ============================================================
   PANEL DE ADMINISTRACIÓN
   ============================================================ */

body.admin { background: #f5f5f4; }
.admin-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 242px; flex: 0 0 242px; background: #fff; border-right: 1px solid var(--line);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 50;
}
.sidebar .brand { padding: 18px 16px; border-bottom: 1px solid var(--line); }
.sidebar-nav { padding: 10px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 10px; text-transform: uppercase; letter-spacing: .09em; color: #a8a29e; font-weight: 800; padding: 12px 10px 5px; }
.nav-item {
    display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 9px;
    font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 1px;
}
.nav-item:hover { background: #f5f5f4; color: var(--ink); }
.nav-item.is-active { background: var(--green-soft); color: var(--green-dark); }
.nav-item .ico { width: 20px; text-align: center; font-size: 15px; }
.nav-item .count {
    margin-left: auto; background: var(--amber); color: #422006; font-size: 11px;
    font-weight: 800; padding: 1px 7px; border-radius: 999px;
}
.sidebar-foot { padding: 12px; border-top: 1px solid var(--line); }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 10px; background: #fafaf9; margin-bottom: 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: 0 0 auto; }
.user-chip strong { display: block; font-size: 13px; }
.user-chip small { display: block; color: var(--muted); font-size: 11px; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    height: 62px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px;
    padding: 0 22px; position: sticky; top: 0; z-index: 40;
}
.topbar h1 { font-size: 18px; letter-spacing: -.02em; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.menu-toggle { display: none; border: 1px solid var(--line); background: #fff; border-radius: 9px; width: 36px; height: 36px; cursor: pointer; }
.content { padding: 22px; max-width: 1240px; width: 100%; margin: 0 auto; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; }
.stat-card .label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat-card .value { font-size: 25px; font-weight: 800; letter-spacing: -.03em; margin-top: 5px; }
.stat-card .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-card.is-green { background: linear-gradient(145deg, #14532d, #166534); border-color: var(--green-dark); color: #fff; }
.stat-card.is-green .label, .stat-card.is-green .sub { color: #bbf7d0; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; align-items: start; }
.grid-2-eq { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 15px; }
.card-head a { font-size: 12px; font-weight: 700; color: var(--green); }
.card-body { padding: 14px 16px; }
.card-body.p0 { padding: 0; }

.mini-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list .main { min-width: 0; }
.mini-list .main strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-list .main small { color: var(--muted); font-size: 11px; }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 130px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; height: 100%; }
.bar-stack { width: 100%; max-width: 34px; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; border-radius: 6px 6px 0 0; overflow: hidden; background: #f5f5f4; }
.bar-pos { background: var(--green); width: 100%; }
.bar-online { background: var(--amber); width: 100%; }
.bar-label { font-size: 10px; color: var(--muted); white-space: nowrap; }
.legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); margin-top: 10px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 4px; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafaf9; white-space: nowrap; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fcfcfb; }
.data-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table .actions { display: flex; gap: 5px; justify-content: flex-end; }
.table-prod { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.thumb { width: 38px; height: 38px; border-radius: 9px; background: linear-gradient(145deg, #f5f5f4, #e7e5e4); display: grid; place-items: center; overflow: hidden; font-size: 14px; font-weight: 800; color: #a8a29e; flex: 0 0 auto; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.table-prod strong { display: block; font-size: 13px; line-height: 1.25; }
.table-prod small { color: var(--muted); font-size: 11px; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; min-width: 160px; }
.toolbar input, .toolbar select { padding: 8px 10px; font-size: 13px; border-radius: 9px; }

.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.pill-tab { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.pill-tab:hover { border-color: var(--muted); }
.pill-tab.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill-tab .n { opacity: .65; margin-left: 4px; font-size: 11px; }

/* POS */
.pos { display: grid; grid-template-columns: 1fr 390px; gap: 14px; align-items: start; }
.pos-catalog { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; min-height: 70vh; }
.pos-search { position: relative; margin-bottom: 12px; }
.pos-search input { padding: 13px 14px; font-size: 16px; border-radius: 11px; background: #fafaf9; }
.pos-search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 10px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 2px 5px; background: #fff; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
.pos-item { display: flex; flex-direction: column; gap: 3px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 11px; cursor: pointer; transition: .13s ease; }
.pos-item:hover { border-color: var(--green); background: #f0fdf4; }
.pos-item .name { font-weight: 700; font-size: 13px; line-height: 1.25; }
.pos-item .meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 4px; }
.pos-item .price { font-size: 14px; }
.pos-item .stock { font-size: 10px; color: var(--muted); }
.pos-item .stock.is-low { color: var(--red); font-weight: 700; }
.pos-empty { padding: 30px 12px; text-align: center; color: var(--muted); font-size: 13px; grid-column: 1 / -1; }

.pos-cart { background: #fff; border: 1px solid var(--line); border-radius: 14px; position: sticky; top: 76px; display: flex; flex-direction: column; max-height: calc(100vh - 96px); }
.pos-cart-head { display: flex; justify-content: space-between; align-items: center; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.pos-cart-head strong { font-size: 15px; }
.pos-lines { overflow-y: auto; flex: 1; min-height: 120px; }
.pos-line { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.pos-line .top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; }
.pos-line .top button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; }
.pos-line .top button:hover { color: var(--red); }
.pos-line .bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; }
.pos-line .qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.pos-line .qty button { width: 26px; height: 26px; border: 0; background: #fafaf9; cursor: pointer; font-size: 14px; }
.pos-line .qty span { min-width: 30px; text-align: center; font-size: 12px; font-weight: 700; }
.pos-line .line-total { font-size: 13px; font-weight: 800; }
.pos-totals { padding: 12px 15px; border-top: 1px solid var(--line); }
.pos-total-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; color: var(--ink-2); }
.pos-total-row.big { font-size: 22px; font-weight: 800; color: var(--ink); padding-top: 8px; margin-top: 5px; border-top: 1px solid var(--line); }
.pos-pay { padding: 0 15px 12px; display: grid; gap: 8px; }
.pos-pay label { margin-bottom: 0; }
.pos-pay .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pos-pay input, .pos-pay select { padding: 8px 10px; font-size: 13px; }
.pos-charge { margin: 0 15px 15px; }
.pos-discount { display: flex; gap: 6px; align-items: center; }
.pos-discount input { text-align: right; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(28, 25, 23, .55); z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal { background: #fff; border-radius: 18px; width: min(430px, 100%); padding: 26px; text-align: center; box-shadow: var(--shadow-lg); }
.modal .big-check { width: 54px; height: 54px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-size: 27px; margin: 0 auto 12px; }
.modal h3 { font-size: 21px; }
.modal p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.modal .amount { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin: 10px 0 2px; }
.modal .change { font-size: 14px; color: var(--green); font-weight: 700; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
    radial-gradient(800px 400px at 15% 0%, #dcfce7, transparent 65%),
    radial-gradient(700px 350px at 100% 10%, #fef3c7, transparent 60%), #fafaf9; }
.login-card { width: min(400px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: var(--shadow-lg); }
.login-card .brand { justify-content: center; margin-bottom: 18px; }
.login-card h1 { font-size: 23px; text-align: center; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin: 4px 0 20px; }
.login-foot { text-align: center; margin-top: 16px; font-size: 12px; color: var(--muted); }

/* Ajustes */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.settings-grid .full { grid-column: 1 / -1; }
.form-section { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.form-section:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.form-section h3 { font-size: 14px; margin-bottom: 10px; }
.logo-preview { display: flex; align-items: center; gap: 12px; }
.logo-preview .brand-mark { width: 54px; height: 54px; font-size: 24px; }
.danger-zone { border: 1px solid #fecaca; background: #fff7f7; border-radius: 12px; padding: 14px; }

/* Tickets */
.ticket-page { background: #e7e5e4; min-height: 100vh; padding: 20px; display: grid; place-items: start center; }
.ticket {
    width: 80mm; background: #fff; padding: 8mm 6mm; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 11px; color: #000; box-shadow: 0 10px 30px rgba(0,0,0,.15);
}
.ticket h2 { text-align: center; font-size: 15px; margin-bottom: 2px; letter-spacing: 0; }
.ticket .center { text-align: center; }
.ticket .muted { color: #444; }
.ticket hr { border: 0; border-top: 1px dashed #777; margin: 6px 0; }
.ticket table { width: 100%; border-collapse: collapse; }
.ticket td { padding: 2px 0; vertical-align: top; }
.ticket .r { text-align: right; white-space: nowrap; }
.ticket .total { font-size: 14px; font-weight: 800; }
.ticket-actions { margin-top: 16px; display: flex; gap: 8px; }
@media print {
    body.ticket-print { background: #fff; }
    .ticket-page { background: #fff; padding: 0; display: block; }
    .ticket { box-shadow: none; width: auto; padding: 0; }
    .no-print { display: none !important; }
    @page { margin: 4mm; }
}

/* Responsive */
@media (max-width: 1000px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2, .grid-2-eq { grid-template-columns: 1fr; }
    .pos { grid-template-columns: 1fr; }
    .pos-cart { position: static; max-height: none; }
    .pos-lines { max-height: 40vh; }
    .catalog-layout { grid-template-columns: 1fr; }
    .catalog-side { position: static; }
    .sidebar { width: 210px; flex-basis: 210px; }
}

@media (max-width: 820px) {
    .header-inner { height: 62px; gap: 10px; }
    .header-search { display: none; }
    .brand-sub { display: none; }
    .header-link { display: none; }
    .hero-card { padding: 30px 24px; }
    .hero-grid { grid-template-columns: 1fr; gap: 20px; }
    .hero-side { grid-template-columns: 1fr 1fr; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-detail { grid-template-columns: 1fr; gap: 22px; }
    .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
    .summary { position: static; }
    .order-grid { grid-template-columns: 1fr; }
    .field-row, .field-row-3 { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
    .pay-methods { grid-template-columns: 1fr; }

    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%);
        transition: .2s ease; box-shadow: var(--shadow-lg); flex-basis: 260px;
    }
    .sidebar.is-open { transform: translateX(0); }
    .menu-toggle { display: grid; place-items: center; }
    .content { padding: 16px; }
    .topbar { padding: 0 16px; height: 58px; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .stat-card .value { font-size: 21px; }
    .topbar h1 { font-size: 16px; }
    .footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }
    .footer-brand { grid-column: 1 / -1; max-width: none; }
}

@media (max-width: 520px) {
    .container { width: calc(100% - 24px); }
    .hero-card { padding: 26px 20px; border-radius: 18px; }
    .hero h1 { font-size: 31px; }
    .hero-side { grid-template-columns: 1fr; }
    .hero-actions .btn { width: 100%; }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .product-body { padding: 10px; }
    .price { font-size: 15px; }
    .btn-add { width: 31px; height: 31px; font-size: 17px; }
    .section { padding: 20px 0; }
    .section-head h2 { font-size: 20px; }
    .cart-row { grid-template-columns: 52px 1fr; }
    .cart-thumb { width: 52px; height: 52px; }
    .cart-line-total { grid-column: 2; text-align: right; margin-top: -6px; }
    .timeline-step { font-size: 9px; }
    .stat-grid { grid-template-columns: 1fr; }
    .modal-actions { grid-template-columns: 1fr; }
    .page-head h2 { font-size: 19px; }
    .data-table { font-size: 12px; }
    .footer-grid { grid-template-columns: 1fr; }
}

.mobile-search { display: none; }
@media (max-width: 820px) { .mobile-search { display: block !important; } }

/* ============================================================
   MÓVIL — usabilidad para adultos mayores
   Principios: objetivos táctiles grandes (48 px o más), texto
   legible, navegación fija con iconos + palabras, confirmaciones
   claras, menos pasos y ayudas visuales. No cambia escritorio.
   ============================================================ */

:root { --touch: 48px; }

.skip-link { display: none; }
.skip-link:focus {
    display: block; position: fixed; top: 10px; left: 10px; z-index: 200;
    background: #fff; color: var(--ink); padding: 12px 16px;
    border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 800;
}
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

.mobile-nav,
.mobile-cats,
.mobile-total-bar,
.mobile-buy-spacer { display: none; }

.btn-add-label { display: none; }
.btn-add-plus { display: inline; }
.info-grid { grid-template-columns: repeat(3, 1fr); }

/* Guía de compra: misma estructura en escritorio y móvil */
.howto { padding: 34px 0 8px; }
.howto-head { margin-bottom: 16px; }
.howto-head h2 { font-size: 28px; }
.howto-head p { color: var(--muted); font-size: 15px; margin-top: 4px; }
.howto-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.howto-step {
    display: grid; grid-template-columns: 44px 34px 1fr; grid-template-rows: auto auto;
    column-gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line);
    border-radius: 16px; padding: 18px;
}
.howto-num {
    grid-row: 1 / 3; width: 44px; height: 44px; border-radius: 50%;
    background: var(--green); color: #fff; display: grid; place-items: center;
    font-size: 20px; font-weight: 800;
}
.howto-icon { grid-row: 1 / 3; display: grid; place-items: center; font-size: 24px; }
.howto-step strong { grid-column: 3; font-size: 18px; }
.howto-step p { grid-column: 3; color: var(--ink-2); font-size: 15px; line-height: 1.45; }

.detail-media .product-initial {
    width: 160px; height: 160px; font-size: 84px; background: var(--green-soft);
}

@media (max-width: 820px) {
    body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); font-size: 17px; }
    body.admin { padding-bottom: 0; }
    .container { width: calc(100% - 24px); }

    /* Encabezado: menos ruido y búsqueda con botón visible */
    .site-header { position: static; }
    .header-inner { height: 58px; gap: 8px; }
    .brand-mark { width: 44px; height: 44px; border-radius: 13px; font-size: 22px; }
    .brand-name { font-size: 18px; }
    .brand-sub { display: none; }
    .header-actions { gap: 6px; }
    .header-link { display: none; }
    .cart-link { min-height: 44px; padding: 10px 14px; font-size: 15px; }
    .header-search { display: none; }

    .mobile-search { display: flex !important; gap: 8px; padding-bottom: 8px; }
    .mobile-search input { flex: 1; min-width: 0; min-height: 48px; font-size: 17px; border-radius: 12px; }
    .mobile-search .btn { flex: 0 0 auto; min-height: 48px; min-width: 92px; font-size: 16px; }
    body.page-catalog .mobile-search,
    body.page-cart .mobile-search,
    body.page-order .mobile-search { display: none !important; }

    /* Botones y campos grandes */
    .btn { min-height: 48px; padding: 12px 18px; font-size: 16px; border-radius: 12px; touch-action: manipulation; }
    .btn:hover { transform: none; }
    .btn-sm { min-height: 42px; padding: 9px 13px; font-size: 14px; }
    .btn-lg { min-height: 56px; font-size: 18px; }
    .btn-block { width: 100%; }
    .btn-add {
        width: 100%; height: 48px; border-radius: 12px; font-size: 16px;
        display: inline-flex; align-items: center; justify-content: center; gap: 6px;
        background: var(--green); border-color: var(--green); color: #fff; font-weight: 800;
    }
    .btn-add:disabled { background: #e7e5e4; border-color: #e7e5e4; color: #78716c; }
    .btn-add-plus { display: inline; }
    .btn-add-label { display: inline; }

    label { font-size: 15px; }
    input[type="text"], input[type="search"], input[type="password"], input[type="tel"],
    input[type="number"], input[type="date"], input[type="email"], input[type="file"],
    select, textarea {
        font-size: 17px; min-height: 52px; padding: 12px 14px; border-radius: 12px;
    }
    textarea { min-height: 110px; }
    .hint { font-size: 14px; }
    .small { font-size: 14px; }
    .muted { color: var(--ink-2); }

    /* Portada */
    .hero { padding: 16px 0 6px; }
    .hero-card { padding: 24px 18px; border-radius: 18px; }
    .hero h1 { font-size: 34px; max-width: none; }
    .hero p { font-size: 17px; line-height: 1.5; }
    .hero-side { display: none; }
    .hero-actions { gap: 10px; margin-top: 18px; }
    .hero-actions .btn { width: 100%; min-height: 56px; font-size: 18px; }
    .eyebrow { font-size: 13px; }

    /* Guía visual de 3 pasos */
    .howto { padding: 18px 0 6px; }
    .howto-head { text-align: center; margin-bottom: 12px; }
    .howto-head h2 { font-size: 24px; }
    .howto-head p { font-size: 15px; }
    .howto-grid { grid-template-columns: 1fr; gap: 10px; }
    .howto-step { grid-template-columns: 44px 34px 1fr; padding: 14px 16px; border-radius: 16px; }
    .howto-step strong { font-size: 18px; }
    .howto-step p { font-size: 15px; }

    /* Categorías */
    .cat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .cat-chip { min-height: 72px; padding: 12px; border-radius: 14px; }
    .cat-chip:hover { transform: none; }
    .cat-emoji { width: 46px; height: 46px; font-size: 24px; border-radius: 13px; }
    .cat-chip strong { font-size: 16px; white-space: normal; line-height: 1.2; }
    .cat-chip small { font-size: 13px; }
    .info-grid { grid-template-columns: 1fr; }
    .section { padding: 22px 0; }
    .section-head { align-items: flex-start; }
    .section-head h2 { font-size: 24px; }
    .section-head p { font-size: 15px; }
    .section-head a { font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; }

    /* Productos: una tarjeta grande por fila y botón Agregar visible */
    .product-grid { grid-template-columns: 1fr; gap: 12px; }
    .product-card { flex-direction: row; align-items: stretch; border-radius: 18px; }
    .product-card:hover { transform: none; box-shadow: none; }
    .product-media { width: 116px; flex: 0 0 116px; aspect-ratio: auto; min-height: 116px; }
    .product-initial { width: 68px; height: 68px; font-size: 38px; }
    .product-body { padding: 12px 14px; gap: 6px; }
    .product-cat { font-size: 12px; }
    .product-name { font-size: 18px; line-height: 1.25; }
    .price { font-size: 21px; }
    .price small { font-size: 13px; }
    .product-bottom { flex-wrap: wrap; gap: 8px; padding-top: 6px; }
    .product-bottom .btn-add { flex: 1 1 100%; }
    .product-media .badge { top: 8px; left: 8px; font-size: 12px; padding: 4px 8px; }

    /* Catálogo */
    .mobile-cats {
        display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0 8px;
    }
    .mobile-cat {
        flex: 0 0 auto; min-height: 48px; display: inline-flex; align-items: center;
        padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line-2);
        background: #fff; font-size: 15px; font-weight: 800; color: var(--ink-2);
    }
    .mobile-cat.is-active { background: var(--green); border-color: var(--green); color: #fff; }
    .catalog-side { display: none; } /* se reemplaza por la fila de categorías */
    .catalog-head { padding: 18px 0 4px; }
    .catalog-head h1 { font-size: 28px; }
    .catalog-toolbar { gap: 10px; padding: 10px 0 14px; }
    .toolbar-search { flex: 1 1 100%; min-width: 0; }
    .toolbar-search form { display: flex; gap: 8px; }
    .toolbar-search .btn { min-width: 92px; }
    .toolbar-select { width: 100%; min-width: 0; }
    .filter-chip { min-height: 44px; display: inline-flex; align-items: center; font-size: 14px; }
    .catalog-layout { gap: 0; }
    .catalog-count { font-size: 14px; }
    .pagination { font-size: 15px; gap: 10px; }
    .pagination a { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 14px; border: 1px solid var(--line); }

    /* Detalle: barra de compra siempre visible */
    .product-detail { gap: 18px; padding: 18px 0 0; }
    .detail-media { aspect-ratio: 4 / 3; max-height: 340px; background: #fff; }
    .detail-media img { object-fit: contain; }
    .detail-media .product-initial { width: 180px; height: 180px; font-size: 96px; }
    .detail-info h1 { font-size: 30px; }
    .detail-price { font-size: 38px; }
    .detail-info .description { font-size: 16px; }
    .detail-meta .badge { font-size: 13px; padding: 5px 10px; }
    .buy-row {
        position: fixed; left: 0; right: 0; bottom: calc(76px + env(safe-area-inset-bottom));
        z-index: 55; display: flex; gap: 8px; align-items: center; margin: 0;
        padding: 10px 12px; background: #fff; border-top: 1px solid var(--line);
        box-shadow: 0 -8px 24px rgba(28, 25, 23, .08);
    }
    .buy-row .qty-control { flex: 0 0 auto; height: 54px; }
    .buy-row .qty-control button { width: 48px; height: 54px; font-size: 24px; }
    .buy-row .qty-control input { width: 48px; height: 54px; font-size: 18px; }
    .buy-row .btn { flex: 1; min-height: 54px; font-size: 17px; }
    .mobile-buy-spacer { display: block; height: 96px; }
    .detail-notes { gap: 12px; margin-top: 18px; }
    .detail-note { font-size: 15px; }

    /* Carrito */
    .cart-layout { padding: 18px 0 110px; gap: 16px; }
    .cart-row { grid-template-columns: 76px 1fr; gap: 12px; padding: 14px; }
    .cart-thumb { width: 76px; height: 76px; border-radius: 14px; font-size: 30px; background: var(--green-soft); }
    .cart-thumb-emoji { font-size: 34px; line-height: 1; }
    .cart-name { font-size: 17px; }
    .cart-sub { font-size: 14px; }
    .cart-controls { gap: 12px; margin-top: 10px; }
    .cart-controls .qty-control button { width: 46px; height: 46px; font-size: 20px; }
    .cart-controls .qty-control input { width: 52px; height: 46px; font-size: 17px; }
    .cart-remove { min-height: 46px; padding: 8px 10px; font-size: 15px; color: var(--red); background: var(--red-soft); border-radius: 10px; }
    .cart-line-total { grid-column: 2; text-align: right; font-size: 20px; margin-top: -4px; }
    .summary { padding: 18px; }
    .summary h3 { font-size: 19px; }
    .summary-row { font-size: 16px; }
    .summary-row.total { font-size: 22px; }
    .summary-list li { font-size: 15px; }
    .summary-note { font-size: 14px; }
    .summary-total,
    .summary-checkout,
    #checkout-submit { display: none; }

    /* Confirmar pedido */
    .checkout-layout { padding: 18px 0 110px; gap: 16px; }
    .panel { padding: 18px; border-radius: 18px; }
    .panel h2 { font-size: 21px; }
    .radio-card .inner { padding: 16px; min-height: 68px; border-width: 2px; border-radius: 14px; }
    .radio-card strong { font-size: 17px; }
    .radio-card small { font-size: 14px; }
    .radio-card .icon { font-size: 26px; }
    .pay-methods { grid-template-columns: 1fr; gap: 10px; }
    .pay-methods .radio-card .inner { padding: 14px 16px; min-height: 60px; }
    .field { margin-bottom: 16px; }
    .field-row { grid-template-columns: 1fr; }

    /* Pedido confirmado */
    .order-wrap { padding: 20px 0 40px; }
    .order-check { width: 72px; height: 72px; font-size: 34px; }
    .order-hero h1 { font-size: 32px; }
    .order-hero p { font-size: 17px; }
    .order-code { font-size: 22px; padding: 10px 18px; letter-spacing: .12em; }
    .timeline { flex-direction: column; gap: 10px; margin: 20px 0 6px; }
    .timeline-step { display: flex; align-items: center; gap: 10px; font-size: 15px; text-align: left; }
    .timeline-step::before { margin: 0; flex: 0 0 auto; width: 18px; height: 18px; }
    .timeline-step::after { display: none; }
    .order-grid { gap: 14px; }
    .order-items td { font-size: 16px; padding: 12px 0; }
    .kv { font-size: 16px; }

    /* Pie simplificado: marca y contacto grande */
    .site-footer { padding: 22px 0; margin-top: 20px; }
    .footer-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
    .footer-brand p { font-size: 15px; }
    .footer-col h4 { font-size: 13px; }
    .footer-col a, .footer-col span { font-size: 15px; padding: 6px 0; }
    .footer-col:nth-child(2), .footer-col:nth-child(3) { display: none; }
    .footer-bottom { font-size: 13px; }
    .footer-contact {
        display: inline-flex !important; align-items: center; justify-content: center;
        min-height: 50px; padding: 12px 16px !important; border-radius: 12px;
        background: var(--green); color: #fff !important; font-weight: 800; margin-top: 6px;
    }

    /* Navegación inferior fija: iconos + palabras */
    .mobile-nav {
        display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
        background: #fff; border-top: 1px solid var(--line);
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
        box-shadow: 0 -8px 24px rgba(28, 25, 23, .07);
    }
    .mobile-nav-item {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        min-height: 58px; border-radius: 12px; font-size: 12px; font-weight: 800;
        color: var(--ink-2); position: relative; text-align: center; touch-action: manipulation;
    }
    .mobile-nav-icon { font-size: 23px; line-height: 1; position: relative; }
    .mobile-nav-item.is-active { color: var(--green-dark); background: var(--green-soft); }
    .mobile-nav-badge {
        position: absolute; top: -6px; right: -14px; min-width: 19px; height: 19px;
        padding: 0 5px; border-radius: 999px; background: var(--amber); color: #422006;
        font-size: 11px; font-weight: 900; display: grid; place-items: center; border: 2px solid #fff;
    }
    .mobile-nav-badge[data-empty="1"] { display: none; }

    /* Barra fija de total (carrito / confirmar) */
    .mobile-total-bar {
        position: fixed; left: 0; right: 0; bottom: calc(76px + env(safe-area-inset-bottom));
        z-index: 60; display: flex; align-items: center; gap: 12px;
        background: #fff; border-top: 1px solid var(--line); padding: 10px 12px;
        box-shadow: 0 -8px 24px rgba(28, 25, 23, .08);
    }
    .mobile-total-bar[hidden] { display: none !important; }
    .mobile-total-info { display: flex; flex-direction: column; min-width: 92px; }
    .mobile-total-info span { font-size: 13px; color: var(--ink-2); font-weight: 700; }
    .mobile-total-info strong { font-size: 22px; font-weight: 900; line-height: 1.1; }
    .mobile-total-bar .btn { flex: 1; min-height: 54px; font-size: 17px; }

    /* Avisos por encima de las barras */
    .flash { font-size: 15px; padding: 14px; }
    .toast-wrap { left: 12px; right: 12px; bottom: calc(90px + env(safe-area-inset-bottom)); }
    body.page-product .toast-wrap,
    body.page-cart .toast-wrap { bottom: calc(164px + env(safe-area-inset-bottom)); }
    .toast { font-size: 15px; text-align: center; }

    /* Panel: controles táctiles y POS utilizable en tableta */
    body.admin .btn { min-height: 46px; }
    .menu-toggle { width: 44px; height: 44px; font-size: 20px; }
    .nav-item { min-height: 48px; font-size: 15px; }
    .topbar { height: 60px; }
    .topbar h1 { font-size: 17px; }
    .stat-card { padding: 14px; }
    .stat-card .value { font-size: 23px; }
    .pos-item { padding: 14px; }
    .pos-item .name { font-size: 15px; }
    .pos-item .price { font-size: 16px; }
    .pos-line .qty button { width: 40px; height: 40px; font-size: 18px; }
    .pos-line .qty span { min-width: 36px; font-size: 15px; }
    .pos-pay .row { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .header-inner { height: 54px; }
    .brand-mark { width: 42px; height: 42px; }
    .brand-name { font-size: 17px; }
    .hero h1 { font-size: 31px; }
    .product-media { width: 104px; flex-basis: 104px; min-height: 104px; }
    .product-initial { width: 64px; height: 64px; font-size: 36px; }
    .product-name { font-size: 17px; }
    .price { font-size: 20px; }
    .mobile-nav-item { font-size: 11px; }
    .mobile-nav-icon { font-size: 21px; }
    .mobile-total-info strong { font-size: 20px; }
    .mobile-total-bar .btn { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
