/* =========================================================
   PLANTILLA #5 · COMERCIO LOCAL, BOUTIQUES, FERRETERÍAS Y CATÁLOGO
   Estilo "mercado en línea": barra amarilla, fondo gris, tarjetas
   blancas densas, filtros laterales y carrito en cajón lateral.
   ========================================================= */
@font-face { font-family: "Mk"; font-weight: 400; font-display: swap; src: url("../assets/fonts/sans-regular.woff2") format("woff2"); }
@font-face { font-family: "Mk"; font-weight: 700; font-display: swap; src: url("../assets/fonts/sans-bold.woff2") format("woff2"); }

:root {
  --yellow: #ffe600;
  --bg: #ebebeb;
  --card: #fff;
  --text: #333;
  --muted: #666;
  --line: #e6e6e6;
  --blue: #2967c6;
  --blue-d: #2968c8;
  --green: #008641;
  --red: #d73632;
  --wa: #25d366;
  --r: 6px;
  --sh: 0 1px 2px rgba(0,0,0,.2);
  --f: "Mk", Arial, Helvetica, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.4 var(--f); -webkit-tap-highlight-color: transparent; }
body.lock { overflow: hidden; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img, svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- header ---------- */
.hd { background: var(--yellow); position: sticky; top: 0; z-index: 40; box-shadow: var(--sh); }
.hd__top { max-width: 1200px; margin: 0 auto; padding: 10px 14px 6px; display: grid; grid-template-columns: auto 1fr auto; gap: 10px 14px; align-items: center; }
.hd__logo { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; }
.hd__logo img { width: 40px; height: 40px; border-radius: 6px; }
.hd__logo span { display: none; font-size: 1.15rem; letter-spacing: -.3px; }
.srch { grid-column: 1 / -1; grid-row: 2; display: flex; background: #fff; border-radius: 2px; box-shadow: var(--sh); }
.srch input { flex: 1; min-width: 0; border: 0; padding: 12px 14px; font-size: 16px; background: transparent; outline: 0; }
.srch button { border: 0; background: none; padding: 0 14px; border-left: 1px solid var(--line); color: #666; }
.srch button:hover { color: var(--blue); }
.hd__promo { display: none; font-size: .8rem; color: #555; text-align: right; line-height: 1.2; }
.hd__cart { position: relative; justify-self: end; background: none; border: 0; padding: 6px; color: var(--text); }
.hd__n { position: absolute; top: -2px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font-size: .75rem; font-weight: 700; display: grid; place-items: center; }
.hd__n.bump { animation: bump .35s; }
@keyframes bump { 40% { transform: scale(1.4); } }
.hd__nav { max-width: 1200px; margin: 0 auto; display: flex; gap: 2px; overflow-x: auto; padding: 0 8px; scrollbar-width: none; }
.hd__nav::-webkit-scrollbar { display: none; }
.hd__nav button { flex: none; background: none; border: 0; padding: 9px 12px 10px; font-size: .88rem; color: #444; border-bottom: 3px solid transparent; white-space: nowrap; }
.hd__nav button:hover { color: #000; }
.hd__nav button[aria-current="true"] { border-color: var(--text); font-weight: 700; color: #000; }

/* ---------- banners ---------- */
.banners { max-width: 1200px; margin: 12px auto 0; position: relative; overflow: hidden; }
.bn { display: none; min-height: 150px; padding: 22px 22px 34px; color: #fff; position: relative; align-items: center; justify-content: space-between; gap: 12px; animation: bin .5s; }
.bn.on { display: flex; }
@keyframes bin { from { opacity: 0; } }
.bn h2 { font-size: clamp(1.4rem, 5vw, 2.4rem); line-height: 1.05; letter-spacing: -.5px; }
.bn p { margin-top: 6px; opacity: .92; max-width: 26em; }
.bn button { margin-top: 12px; background: #fff; color: var(--text); border: 0; padding: 10px 18px; border-radius: var(--r); font-weight: 700; }
.bn__a { width: clamp(90px, 22vw, 190px); flex: none; }
.dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.dots button { width: 9px; height: 9px; border-radius: 50%; border: 0; background: rgba(255,255,255,.5); padding: 0; }
.dots button.on { background: #fff; width: 22px; border-radius: 5px; }
.trust { max-width: 1200px; margin: 10px auto 0; display: flex; gap: 10px; overflow-x: auto; padding: 0 12px; scrollbar-width: none; }
.trust span { flex: none; background: #fff; box-shadow: var(--sh); padding: 8px 14px; border-radius: var(--r); font-size: .85rem; display: flex; gap: 8px; align-items: center; }
.trust b { color: var(--green); }

/* ---------- layout ---------- */
.lay { max-width: 1200px; margin: 12px auto 0; padding: 0 10px 30px; display: block; }
.flt { position: fixed; inset: 0 22% 0 0; z-index: 70; background: #fff; transform: translateX(-102%); transition: transform .3s; display: flex; flex-direction: column; max-width: 340px; }
.flt.open { transform: none; }
.flt__h { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 1.1rem; }
.flt__h button { border: 0; background: none; font-size: 1.2rem; }
.flt__b { flex: 1; overflow-y: auto; padding: 4px 16px 16px; }
.flt__f { padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); }
.flt section { padding: 14px 0; border-bottom: 1px solid var(--line); }
.flt h3 { font-size: .95rem; margin-bottom: 8px; }
#fCats button { display: flex; width: 100%; justify-content: space-between; background: none; border: 0; padding: 6px 0; text-align: left; color: #555; font-size: .92rem; }
#fCats button:hover { color: var(--blue); }
#fCats button[aria-current="true"] { color: #000; font-weight: 700; }
#fCats small { color: var(--muted); }
.rd, .ck { display: flex; align-items: center; gap: 9px; padding: 5px 0; cursor: pointer; font-size: .92rem; }
.rng { display: flex; gap: 6px; align-items: center; }
.rng input { width: 100%; min-width: 0; border: 1px solid #ccc; border-radius: 4px; padding: 9px 8px; font-size: 16px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.presets button { background: #f3f3f3; border: 0; padding: 6px 10px; border-radius: 4px; font-size: .82rem; }
.presets button:hover, .presets button[aria-pressed="true"] { background: var(--blue); color: #fff; }
.lnk { background: none; border: 0; color: var(--blue); padding: 12px 0 0; font-size: .9rem; }
.lnk:hover { text-decoration: underline; }
.btn { background: var(--blue); color: #fff; border: 0; border-radius: var(--r); padding: 12px 18px; font-weight: 700; width: 100%; transition: background .15s; }
.btn:hover { background: var(--blue-d); }
.btn--ghost { background: #fff; color: var(--blue); box-shadow: var(--sh); width: auto; padding: 10px 14px; }
.btn--ghost:hover { background: #f5f9ff; }
.btn--wa { background: var(--wa); color: #06260f; font-size: 1.02rem; padding: 14px; }
.btn--wa:hover { background: #1fbe5c; }
.btn:disabled { opacity: .5; pointer-events: none; }

.res { min-width: 0; }
.bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 2px 10px; }
.bar > div { flex: 1; min-width: 160px; }
.bar h1 { font-size: 1.25rem; }
.bar p { font-size: .85rem; color: var(--muted); }
.srt { display: none; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); }
.srt select { border: 1px solid #ccc; background: #fff; padding: 8px; border-radius: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chips button { background: #fff; border: 1px solid #ccc; border-radius: 16px; padding: 5px 12px; font-size: .82rem; }
.chips button::after { content: " ✕"; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.empty { grid-column: 1 / -1; background: #fff; padding: 40px 20px; text-align: center; border-radius: var(--r); color: var(--muted); box-shadow: var(--sh); }
.empty b { display: block; color: var(--text); font-size: 1.1rem; margin-bottom: 6px; }

.pc { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); display: flex; flex-direction: column; overflow: hidden; position: relative; transition: box-shadow .2s, transform .2s; animation: pin .35s both; animation-delay: calc(var(--i, 0) * 30ms); }
@keyframes pin { from { opacity: 0; transform: translateY(10px); } }
.pc:hover { box-shadow: 0 4px 14px rgba(0,0,0,.22); transform: translateY(-2px); }
.pc__i { display: block; width: 100%; background: #fff; border: 0; border-bottom: 1px solid var(--line); padding: 14px; aspect-ratio: 1 / 1; }
.pc__i svg { width: 100%; height: 100%; transition: transform .3s; }
.pc:hover .pc__i svg { transform: scale(1.06); }
.pc__dsc { position: absolute; top: 8px; left: 8px; background: var(--green); color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 6px; border-radius: 3px; }
.pc__b { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; gap: 3px; }
.pc__old { color: var(--muted); font-size: .8rem; text-decoration: line-through; min-height: 1.1em; }
.pc__p { font-size: 1.45rem; letter-spacing: -.5px; }
.pc__p sup { font-size: .55em; }
.pc__n { font-size: .88rem; line-height: 1.25; color: #444; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-align: left; background: none; border: 0; padding: 0; }
.pc__n:hover { color: var(--blue); }
.pc__s { font-size: .78rem; font-weight: 700; color: var(--green); }
.pc__s.ped { color: #a66400; }
.pc__s.low { color: var(--red); }
.pc__add { margin-top: auto; padding-top: 8px; }
.pc__add button { width: 100%; background: #e8f0fe; color: var(--blue); border: 0; padding: 10px; border-radius: 4px; font-weight: 700; font-size: .88rem; transition: background .15s, color .15s; }
.pc__add button:hover { background: var(--blue); color: #fff; }

.ft { background: #fff; margin-top: 10px; border-top: 1px solid var(--line); }
.ft__in { max-width: 1200px; margin: 0 auto; padding: 24px 14px 8px; display: grid; gap: 18px; font-size: .9rem; color: #555; }
.ft b { display: block; color: var(--text); margin-bottom: 4px; }
.ft ol { list-style: decimal inside; }
.ft__s { text-align: center; padding: 10px 14px 24px; font-size: .78rem; color: var(--muted); }

/* ---------- detalle ---------- */
.mod { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.55); display: grid; place-items: end center; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.mod__box { position: relative; background: #fff; width: 100%; max-width: 860px; max-height: 94dvh; overflow-y: auto; border-radius: 10px 10px 0 0; display: grid; animation: up .3s; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.mod__x { position: absolute; top: 10px; right: 10px; z-index: 2; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #fff; box-shadow: var(--sh); font-size: 1rem; }
.mod__img { background: #fafafa; padding: 24px; display: grid; place-items: center; }
.mod__img svg { width: min(70%, 320px); height: auto; }
.mod__info { padding: 20px 20px 24px; display: grid; gap: 12px; align-content: start; }
.mod__info h2 { font-size: 1.35rem; line-height: 1.2; }
.mod__info .pc__p { font-size: 2rem; }
.mod__info p { color: #555; }
.opt h3 { font-size: .85rem; margin-bottom: 6px; }
.opt div { display: flex; flex-wrap: wrap; gap: 6px; }
.opt label { position: relative; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span { display: block; min-width: 44px; text-align: center; padding: 8px 12px; border: 1px solid #ccc; border-radius: 4px; cursor: pointer; font-size: .9rem; }
.opt input:checked + span { border-color: var(--blue); background: #e8f0fe; color: var(--blue); font-weight: 700; }
.opt input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.qty { display: inline-flex; align-items: center; border: 1px solid #ccc; border-radius: 4px; }
.qty button { width: 38px; height: 38px; border: 0; background: none; font-size: 1.2rem; }
.qty button:hover { background: #f3f3f3; }
.qty span { min-width: 34px; text-align: center; font-weight: 700; }
.mod__row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.mod__row .btn { flex: 1; min-width: 160px; }
.note { font-size: .85rem; color: var(--muted); }

/* ---------- carrito ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.cart { position: fixed; top: 0; right: 0; bottom: 0; width: min(100%, 430px); background: #fff; z-index: 80; display: flex; flex-direction: column; transform: translateX(104%); transition: transform .3s cubic-bezier(.2,.8,.2,1), visibility .3s; visibility: hidden; box-shadow: -4px 0 18px rgba(0,0,0,.2); }
.cart.open { transform: none; visibility: visible; }
.cart__h { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--yellow); }
.cart__h h2 { font-size: 1.15rem; }
.cart__h button { border: 0; background: none; font-size: 1.2rem; }
.cart__b { flex: 1; overflow-y: auto; padding: 0 16px 16px; overscroll-behavior: contain; }
.lines li { display: grid; grid-template-columns: 62px 1fr auto; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; animation: pin .3s; }
.lines .im { background: #fafafa; border: 1px solid var(--line); border-radius: 4px; padding: 4px; }
.lines h3 { font-size: .9rem; line-height: 1.25; font-weight: 400; }
.lines small { color: var(--muted); display: block; font-size: .78rem; }
.lines .qty { margin-top: 6px; } .lines .qty button { width: 30px; height: 30px; font-size: 1rem; } .lines .qty span { min-width: 26px; font-size: .9rem; }
.lines b { font-size: 1rem; white-space: nowrap; }
.lines .rm { display: block; margin-top: 6px; background: none; border: 0; color: var(--blue); font-size: .8rem; padding: 0; text-align: right; width: 100%; }
.vacio { text-align: center; color: var(--muted); padding: 50px 10px; }
.fs { border: 0; margin: 16px 0 0; padding: 0; }
.fs legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
.eo { display: block; position: relative; margin-bottom: 8px; }
.eo input { position: absolute; opacity: 0; pointer-events: none; }
.eo > span { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; border: 1px solid #ccc; border-radius: var(--r); padding: 10px 12px; cursor: pointer; }
.eo b { font-size: .92rem; } .eo small { grid-column: 1; color: var(--muted); font-size: .8rem; } .eo em { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-style: normal; font-weight: 700; color: var(--green); font-size: .9rem; }
.eo input:checked + span { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); background: #f5f9ff; }
.eo input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.fl { display: block; margin-top: 12px; }
.fl > span { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 4px; }
.fl em { font-style: normal; }
.fl input { width: 100%; border: 1px solid #ccc; border-radius: 4px; padding: 11px 10px; font-size: 16px; }
.fl input:focus { border-color: var(--blue); outline: 0; box-shadow: 0 0 0 2px rgba(52,131,250,.2); }
.fl .bad { border-color: var(--red); }
.err { background: #fdecea; color: var(--red); padding: 9px 12px; border-radius: 4px; margin-top: 12px; font-size: .9rem; font-weight: 700; }
.cart__f { padding: 12px 16px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); box-shadow: 0 -4px 10px rgba(0,0,0,.06); }
.tot > div { display: flex; justify-content: space-between; padding: 2px 0; color: #555; font-size: .92rem; }
.tot dt, .tot dd { margin: 0; }
.tot__t { color: var(--text) !important; font-size: 1.25rem !important; font-weight: 700; padding-top: 6px !important; }
.free { background: #e6f7ee; color: #067a3c; padding: 8px 10px; border-radius: 4px; font-size: .84rem; margin: 8px 0; }
.cart__f .btn { margin-top: 8px; }
.cart__f .lnk { display: block; margin: 0 auto; }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 14px); background: #333; color: #fff; padding: 11px 16px; border-radius: var(--r); font-size: .9rem; opacity: 0; pointer-events: none; transition: .25s; z-index: 120; max-width: 92vw; display: flex; gap: 12px; align-items: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { background: none; border: 0; color: #ffe600; font-weight: 700; padding: 0; }

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .hd__logo span { display: block; }
  .mod { place-items: center; padding: 20px; }
  .mod__box { grid-template-columns: 1fr 1fr; border-radius: 8px; }
  .srt { display: flex; }
  .ft__in { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 960px) {
  .hd__top { grid-template-columns: auto minmax(300px, 1fr) auto auto; padding: 12px 14px 8px; }
  .srch { grid-column: auto; grid-row: auto; }
  .hd__promo { display: block; }
  .lay { display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start; }
  .flt { position: sticky; top: 112px; inset: auto; transform: none; max-width: none; z-index: 1; background: transparent; max-height: calc(100vh - 124px); }
  .flt__h, .flt__f { display: none; }
  .flt__b { background: #fff; border-radius: var(--r); box-shadow: var(--sh); padding: 4px 16px 14px; }
  .btn--ghost { display: none; }
  .grid { grid-template-columns: repeat(4, 1fr); }
  .scrim.fl { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
.hd__logo { min-width: 0; } .hd__logo span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.05rem; }
.bn__a--img{width:clamp(150px,42%,440px);align-self:stretch;margin:-22px -22px -34px 0}.bn__a--img img{width:100%;height:100%;object-fit:cover}
