
:root{
  --orange:#f97316;--orange2:#ea580c;--ink:#111827;--muted:#6b7280;
  --bg:#fff7ed;--card:#fff;--line:#fed7aa;--green:#15803d;--red:#b91c1c;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:linear-gradient(#fff7ed,#fff);color:var(--ink)}
button,input{font:inherit}
.header{position:sticky;top:0;z-index:20;background:rgba(255,255,255,.96);backdrop-filter:blur(10px);border-bottom:1px solid var(--line)}
.header-inner{max-width:1200px;margin:auto;padding:12px 14px}
.brand-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.brand{display:flex;align-items:center;gap:10px;min-width:0}
.logo{width:48px;height:48px;border-radius:50%;background:var(--orange);display:grid;place-items:center;color:#fff;font-size:26px;box-shadow:0 5px 16px #fb923c66}
.brand h1{font-size:20px;margin:0;line-height:1.05}
.brand small{color:var(--muted);font-weight:800}
.local-badge{background:#111827;color:#fff;padding:8px 10px;border-radius:999px;font-size:12px;font-weight:900;white-space:nowrap}
.search{margin-top:10px;display:flex;gap:8px}
.search input{width:100%;border:1px solid #fdba74;border-radius:14px;padding:12px 14px;background:#fff;outline:none;font-size:16px}
.search input:focus{border-color:var(--orange);box-shadow:0 0 0 3px #fed7aa}
.catalog-tabs,.cats{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding:10px 0 2px}
.catalog-tabs::-webkit-scrollbar,.cats::-webkit-scrollbar{display:none}
.chip{border:1px solid #fdba74;background:#fff;color:#7c2d12;padding:9px 13px;border-radius:999px;font-weight:900;white-space:nowrap;cursor:pointer}
.chip.on{background:var(--orange);border-color:var(--orange);color:#fff}
main{max-width:1200px;margin:auto;padding:14px}
.hero{background:linear-gradient(135deg,#111827,#292524);color:#fff;border-radius:20px;padding:16px 18px;margin-bottom:12px;box-shadow:0 10px 25px #11182722}
.hero b{color:#fdba74}
.hero-title{font-size:22px;font-weight:1000}
.hero-sub{font-size:13px;color:#e5e7eb;margin-top:5px}
.summary{font-size:13px;color:var(--muted);font-weight:800;margin:10px 2px}
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.card{background:var(--card);border:1px solid #ffedd5;border-radius:17px;overflow:hidden;box-shadow:0 4px 14px #9a34120b;display:flex;flex-direction:column;min-width:0}
.media{aspect-ratio:4/3;background:linear-gradient(145deg,#ffedd5,#fff7ed);display:grid;place-items:center;overflow:hidden;position:relative}
.media img{width:100%;height:100%;object-fit:cover}
.placeholder{font-size:54px}
.code{position:absolute;left:8px;top:8px;background:#111827dd;color:#fff;padding:4px 7px;border-radius:999px;font-size:10px;font-weight:900}
.body{padding:11px;display:flex;flex-direction:column;gap:6px;flex:1}
.name{font-size:16px;font-weight:1000;line-height:1.15;text-transform:uppercase}
.detail{font-size:12px;color:var(--muted);line-height:1.3;min-height:30px}
.price-row{display:flex;align-items:end;justify-content:space-between;gap:8px;margin-top:auto;padding-top:4px}
.price{font-size:21px;font-weight:1000;color:var(--orange2)}
.old{font-size:12px;text-decoration:line-through;color:#9ca3af}
.badge{font-size:10px;padding:5px 7px;border-radius:999px;background:#dcfce7;color:#166534;font-weight:900}
.empty{padding:35px 16px;text-align:center;color:var(--muted);font-weight:800}
.footer{max-width:1200px;margin:25px auto 0;padding:20px 14px 38px;text-align:center;color:var(--muted);font-size:12px}
.local-picker{position:fixed;inset:0;background:#111827dd;z-index:50;display:grid;place-items:center;padding:18px}
.local-box{width:min(500px,100%);background:#fff;border-radius:22px;padding:20px}
.local-box h2{margin:0 0 5px}
.local-list{display:grid;gap:8px;margin-top:15px}
.local-btn{border:0;border-radius:14px;background:#fff7ed;padding:14px;text-align:left;font-weight:1000;cursor:pointer;border:1px solid #fed7aa}
.hidden{display:none!important}
.offline{display:none;position:fixed;bottom:12px;left:50%;transform:translateX(-50%);z-index:40;background:#111827;color:#fff;border-radius:999px;padding:8px 13px;font-size:12px;font-weight:900}
.offline.show{display:block}
@media(min-width:720px){.grid{grid-template-columns:repeat(3,minmax(0,1fr))}.brand h1{font-size:24px}.card .name{font-size:17px}}
@media(min-width:1020px){.grid{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* ===== V2 · CAMBIO DE LOCAL + CARRITO LOCAL ===== */
.header-actions{display:flex;align-items:center;gap:8px}
.local-change{border:1px solid #fdba74;background:#fff7ed;color:#9a3412;padding:8px 11px;border-radius:999px;font-size:12px;font-weight:950;cursor:pointer}
.add-btn{width:100%;border:0;border-radius:11px;background:#f97316;color:#fff;padding:10px 12px;font-weight:1000;cursor:pointer;margin-top:8px}
.add-btn:active{transform:scale(.99)}
.cart-fab{position:fixed;right:14px;bottom:14px;z-index:35;border:0;border-radius:999px;background:#111827;color:#fff;padding:13px 16px;font-weight:1000;box-shadow:0 10px 30px #11182755;cursor:pointer}
.cart-count{display:inline-grid;place-items:center;min-width:25px;height:25px;margin-left:6px;padding:0 7px;border-radius:999px;background:#f97316;color:#fff}
.cart-overlay{position:fixed;inset:0;background:#111827aa;z-index:70;display:flex;align-items:flex-end;justify-content:center}
.cart-panel{width:min(700px,100%);max-height:88vh;background:#fff;border-radius:22px 22px 0 0;padding:16px;overflow:auto;box-shadow:0 -15px 45px #0003}
.cart-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.cart-top h2{margin:0}
.icon-btn{border:0;background:#f3f4f6;border-radius:999px;width:40px;height:40px;font-size:20px;cursor:pointer}
.cart-list{display:flex;flex-direction:column;gap:9px;margin:15px 0}
.cart-item{display:grid;grid-template-columns:1fr auto;gap:10px;padding:11px;border:1px solid #ffedd5;border-radius:14px;background:#fffaf5}
.cart-item-name{font-weight:950;text-transform:uppercase}
.cart-item-meta{font-size:12px;color:#6b7280;margin-top:3px}
.qty-row{display:flex;align-items:center;gap:7px;justify-content:flex-end}
.qty-btn{border:0;background:#111827;color:#fff;width:32px;height:32px;border-radius:9px;font-weight:1000;cursor:pointer}
.qty-num{min-width:28px;text-align:center;font-weight:1000}
.remove-btn{border:0;background:#fee2e2;color:#991b1b;border-radius:9px;padding:7px 9px;font-weight:900;cursor:pointer}
.cart-total{display:flex;align-items:center;justify-content:space-between;border-top:2px solid #fed7aa;padding-top:13px;font-size:22px;font-weight:1000}
.cart-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:12px}
.cart-actions button{border:0;border-radius:13px;padding:12px;font-weight:1000;cursor:pointer}
.clear-cart{background:#fee2e2;color:#991b1b}
.next-send{background:#16a34a;color:#fff;opacity:.55;cursor:not-allowed!important}
.cart-note{margin-top:10px;padding:10px;border-radius:12px;background:#f0fdf4;color:#166534;font-size:12px;font-weight:800}
.local-picker .local-current{font-size:12px;color:#9a3412;font-weight:900;margin-top:6px}
@media(max-width:520px){.brand-row{align-items:flex-start}.header-actions{flex-direction:column;align-items:flex-end}.cart-actions{grid-template-columns:1fr}}

/* V3: personalización + cobertura 10 km */
.custom-overlay{position:fixed;inset:0;background:#111827b8;z-index:90;display:flex;align-items:flex-end;justify-content:center}
.custom-panel{width:min(760px,100%);max-height:92vh;background:#fff;border-radius:24px 24px 0 0;padding:16px;overflow:auto;box-shadow:0 -18px 50px #0004}
.custom-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;position:sticky;top:-16px;background:#fff;padding:14px 0 10px;z-index:2;border-bottom:1px solid #ffedd5}
.custom-title{font-size:21px;font-weight:1000;text-transform:uppercase}.custom-price{font-size:19px;font-weight:1000;color:#ea580c;margin-top:4px}
.option-groups{display:flex;flex-direction:column;gap:12px;margin-top:12px}.option-group{border:1px solid #fed7aa;border-radius:16px;padding:12px;background:#fffaf5}
.option-group-title{font-weight:1000;font-size:15px;line-height:1.2}.option-group-meta{font-size:11px;color:#92400e;font-weight:850;margin-top:3px}
.option-list{display:flex;flex-direction:column;gap:7px;margin-top:10px}.option-choice{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center;border:1px solid #e5e7eb;border-radius:12px;padding:10px;background:#fff}
.option-choice.on{border-color:#f97316;background:#fff7ed;box-shadow:0 0 0 2px #fed7aa}.option-name{font-weight:900;text-transform:uppercase}
.option-extra{font-size:11px;color:#15803d;font-weight:900;margin-top:2px}.option-select-btn{border:0;border-radius:10px;padding:8px 10px;background:#111827;color:#fff;font-weight:950;cursor:pointer}
.option-choice.on .option-select-btn{background:#f97316}.option-qty{display:flex;align-items:center;gap:6px}.option-qty button{border:0;border-radius:9px;width:32px;height:32px;background:#111827;color:#fff;font-weight:1000;cursor:pointer}
.option-qty span{min-width:25px;text-align:center;font-weight:1000}.custom-note{margin-top:13px}.custom-note label{font-size:12px;font-weight:950;color:#374151}
.custom-note textarea{width:100%;min-height:74px;border:1px solid #fdba74;border-radius:12px;padding:10px;margin-top:5px;resize:vertical}
.custom-total{display:flex;justify-content:space-between;align-items:center;font-size:21px;font-weight:1000;margin-top:13px;padding-top:12px;border-top:2px solid #fed7aa}
.custom-add{width:100%;margin-top:10px;border:0;border-radius:13px;padding:13px;background:#16a34a;color:#fff;font-weight:1000;font-size:16px;cursor:pointer}
.custom-empty-options{padding:10px;border-radius:12px;background:#f9fafb;color:#6b7280;font-size:12px;font-weight:800}
.cart-item-options{margin-top:5px;font-size:11px;color:#7c2d12;line-height:1.4;font-weight:800}.cart-item-note{margin-top:4px;font-size:11px;color:#6b7280;font-style:italic}
.location-box{margin-top:13px;border:1px solid #bfdbfe;background:#eff6ff;border-radius:15px;padding:12px}.location-title{font-weight:1000;color:#1e3a8a}
.location-help{font-size:12px;color:#475569;margin-top:4px;line-height:1.35}.location-btn{width:100%;margin-top:9px;border:0;border-radius:12px;padding:11px;background:#2563eb;color:#fff;font-weight:1000;cursor:pointer}
.location-status{margin-top:9px;padding:9px;border-radius:11px;font-size:12px;font-weight:900}.location-status.ok{background:#dcfce7;color:#166534}.location-status.bad{background:#fee2e2;color:#991b1b}.location-status.wait{background:#fef3c7;color:#92400e}
.send-order{background:#16a34a!important;color:#fff}.send-order[disabled]{opacity:.45!important;cursor:not-allowed!important}
.distance-badge{display:inline-block;margin-top:4px;padding:4px 7px;border-radius:999px;background:#dbeafe;color:#1e40af;font-size:10px;font-weight:950}

/* V3.1: hacer evidente y táctil la personalización */
.card[data-product]{cursor:pointer}
.card[data-product]:active{transform:scale(.995)}
.option-count-badge{display:inline-block;margin-top:6px;padding:5px 8px;border-radius:999px;background:#fff7ed;border:1px solid #fdba74;color:#9a3412;font-size:10px;font-weight:1000}
.add-btn.has-options{background:#16a34a}
.custom-tip{margin-top:8px;padding:8px 10px;border-radius:11px;background:#ecfdf5;color:#166534;font-size:11px;font-weight:850}
.gps-progress{margin-top:8px;font-size:12px;font-weight:900;color:#1e3a8a}


/* ===== V4.9 · TARJETAS DE PRODUCTO ESTILO APK ===== */
.apk-product-card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:17px;
  box-shadow:0 4px 12px #11182714;
}
.apk-product-card .body{
  padding:12px;
  gap:8px;
}
.apk-product-card .name{
  font-size:20px;
  line-height:1.08;
  text-transform:none;
  font-weight:1000;
}
.apk-product-card .detail{
  min-height:36px;
  font-size:15px;
  line-height:1.25;
  color:#6b7280;
}
.apk-price-row{
  margin-top:auto;
  padding-top:8px;
  display:flex;
  align-items:end;
  justify-content:space-between;
}
.apk-product-card .price{
  color:#f15a37;
  font-size:28px;
  line-height:1;
  font-weight:1000;
}
.apk-product-card .old{
  font-size:13px;
}
.apk-card-action{
  width:100%;
}
.apk-add-btn{
  width:100%;
  min-height:54px;
  border:0;
  border-radius:999px;
  background:#ff6338;
  color:#fff;
  font-size:20px;
  font-weight:1000;
  cursor:pointer;
  box-shadow:none;
}
.apk-add-btn span{
  font-size:30px;
  font-weight:400;
  vertical-align:-2px;
}
.apk-inline-qty{
  min-height:54px;
  display:grid;
  grid-template-columns:52px 1fr 52px;
  align-items:center;
  gap:7px;
  padding:4px;
  border:3px solid #ff6338;
  border-radius:999px;
  background:#fff;
}
.apk-qty-btn{
  width:46px;
  height:46px;
  border:0;
  border-radius:50%;
  background:#ff6338;
  color:#fff;
  font-size:32px;
  line-height:1;
  font-weight:500;
  cursor:pointer;
}
.apk-qty-num{
  text-align:center;
  font-size:25px;
  font-weight:1000;
  color:#111827;
}
.apk-stock{
  margin-top:1px;
  font-size:14px;
  color:#6b7280;
}
.apk-product-card:active{
  transform:none!important;
}
.apk-product-card .media{
  background:#f3e2cc;
}
@media(max-width:719px){
  .grid{gap:10px}
  .apk-product-card .name{font-size:18px}
  .apk-product-card .detail{font-size:14px}
  .apk-product-card .price{font-size:26px}
  .apk-add-btn{font-size:18px;min-height:52px}
  .apk-inline-qty{min-height:52px;grid-template-columns:48px 1fr 48px}
  .apk-qty-btn{width:44px;height:44px;font-size:30px}
}
