@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;700;800&family=JetBrains+Mono:wght@700&display=swap');

:root {
    --bg: #FBFAF7; --surface: #FFFFFF; --ink: #1B2430; --ink-muted: #5C6672; --border: #E7E3D9;
    --accent: #0B6E4F; --accent-ink: #FFFFFF; --accent-soft: #E3F1EA;
    --amber: #FFB300; --danger: #D64550; --danger-soft: #FBE7E8;
    --radius-lg: 20px; --radius-md: 14px; --radius-sm: 10px; --touch-min: 52px;
    --shadow-card: 0 2px 10px rgba(27,36,48,.06); --shadow-float: 0 8px 24px rgba(27,36,48,.16);
    --font-display: 'Manrope', system-ui, sans-serif; --font-mono: 'JetBrains Mono', monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-display); -webkit-tap-highlight-color: transparent; }
body { padding-bottom: 90px; }
h1,h2,h3 { font-weight: 800; margin: 0; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; }
img { max-width: 100%; }

.store-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.store-header__brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; }
.store-header__logo { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; background: var(--muted-soft, #eee); }
.store-status { font-size: 11.5px; font-weight: 800; padding: 5px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.store-status--cerrado { background: var(--danger-soft); color: var(--danger); }

.store-page { max-width: 640px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 22px; }

.closed-banner { background: var(--danger-soft); color: var(--danger); padding: 14px 16px; border-radius: var(--radius-md); font-size: 13.5px; font-weight: 700; text-align: center; }

.search-bar { display: flex; align-items: center; gap: 10px; min-height: var(--touch-min); padding: 0 16px; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-md); }
.search-bar input { flex: 1; border: none; outline: none; background: transparent; font-size: 16px; }

.section-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); margin: 0 0 10px 2px; }

.hscroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }

.mini-card { flex-shrink: 0; width: 128px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-card); }
.mini-card__photo { width: 100%; aspect-ratio: 1; object-fit: cover; background: #eee; display: block; }
.mini-card__body { padding: 8px 10px 10px; }
.mini-card__nombre { font-size: 12px; font-weight: 700; line-height: 1.25; height: 30px; overflow: hidden; }
.mini-card__precio { font-family: var(--font-mono); font-weight: 800; font-size: 13px; color: var(--accent); margin-top: 4px; }
.mini-card__add { width: 100%; min-height: 34px; margin-top: 6px; border-radius: 8px; border: none; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 13px; }

.repetir-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--accent); color: #fff; padding: 16px; border-radius: var(--radius-lg); }
.repetir-banner__text { font-weight: 800; font-size: 14.5px; }
.repetir-banner__sub { font-size: 12px; opacity: .85; margin-top: 2px; }
.repetir-banner button { background: #fff; color: var(--accent); border: none; padding: 10px 16px; border-radius: 999px; font-weight: 800; font-size: 13px; }

.category-grid-pub { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.category-tile { position: relative; aspect-ratio: 4/3; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); }
.category-tile img { width: 100%; height: 100%; object-fit: cover; }
.category-tile__overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.55), transparent 60%); display: flex; align-items: flex-end; padding: 12px; }
.category-tile__nombre { color: #fff; font-weight: 800; font-size: 14.5px; }
.category-tile__conteo { color: rgba(255,255,255,.85); font-size: 11px; font-weight: 600; }

.product-grid-pub { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.pp-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); }
.pp-card.is-agotado { opacity: .6; }
.pp-card__photo-wrap { position: relative; width: 100%; aspect-ratio: 1; background: #eee; }
.pp-card__photo-wrap img { width: 100%; height: 100%; object-fit: cover; }
.pp-card__badge { position: absolute; top: 8px; left: 8px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 6px; }
.pp-card__body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.pp-card__nombre { font-size: 13.5px; font-weight: 700; line-height: 1.25; min-height: 34px; }
.pp-card__precio { font-family: var(--font-mono); font-weight: 800; color: var(--accent); font-size: 16px; }
.pp-card__precio-old { font-size: 11px; color: var(--ink-muted); text-decoration: line-through; margin-left: 4px; }

.qty-control { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; background: var(--accent-soft); border-radius: 10px; padding: 4px; }
.qty-control button { width: 32px; height: 32px; border-radius: 8px; border: none; background: var(--surface); color: var(--accent); font-weight: 800; font-size: 16px; box-shadow: var(--shadow-card); }
.qty-control span { font-weight: 800; font-size: 14px; font-family: var(--font-mono); }
.pp-add-btn { width: 100%; min-height: 38px; margin-top: 6px; border-radius: 10px; border: none; background: var(--accent); color: #fff; font-weight: 800; font-size: 13px; }
.pp-add-btn:disabled { background: var(--border); color: var(--ink-muted); }

.cart-bar { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 0 18px; background: var(--ink); color: #fff; border-radius: 999px; box-shadow: var(--shadow-float); }
.cart-bar__info { font-weight: 800; font-size: 14px; }
.cart-bar__sub { font-size: 11.5px; opacity: .8; }
.cart-bar__total { font-family: var(--font-mono); font-weight: 800; font-size: 15px; }

.empty-store { text-align: center; padding: 50px 20px; color: var(--ink-muted); font-size: 13.5px; }

/* Checkout */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; color: var(--ink-muted); }
.field input, .field select, .field textarea { min-height: var(--touch-min); padding: 0 16px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 16px; background: var(--surface); color: var(--ink); }
.field textarea { padding: 12px 16px; min-height: 80px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }

.checkout-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.checkout-total-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.checkout-total-row.grand { font-weight: 800; font-size: 17px; padding-top: 10px; border-top: 1px solid var(--border); margin-top: 6px; }

.btn-primary { width: 100%; min-height: var(--touch-min); border-radius: var(--radius-sm); border: none; background: var(--accent); color: #fff; font-weight: 800; font-size: 15.5px; }
.btn-primary:disabled { background: var(--border); color: var(--ink-muted); }

.confirmacion-card { text-align: center; padding: 30px 20px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.confirmacion-icon { font-size: 48px; }
.confirmacion-estado { display: inline-block; margin-top: 14px; padding: 8px 16px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 13px; }

@media (min-width: 640px) {
    .product-grid-pub, .category-grid-pub { grid-template-columns: repeat(3, 1fr); }
}
