/* Italomat — hoja de estilos única. Mobile-first. */
:root {
  --red: #c8102e;
  --red-d: #a30d25;
  --ink: #1b1e24;
  --ink-2: #3a3f4a;
  --mute: #6b7280;
  --line: #e3e0db;
  --bg: #ffffff;
  --tint: #f5f3ef;
  --dark: #15171c;
  --amber: #f2a900;
  --wa: #1faa59;
  --wa-d: #178a47;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 22, 28, .06), 0 6px 18px rgba(20, 22, 28, .08);
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-h: "Barlow Condensed", "Arial Narrow", "Barlow", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.no-scroll { overflow: hidden; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red-d); }
h1, h2, h3 { font-family: var(--font-h); font-weight: 700; line-height: 1.08; letter-spacing: .01em; margin: 0 0 .5em; text-transform: uppercase; color: var(--ink); }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

.wrap { width: min(1200px, 100% - 40px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 200; }
.skip:focus { left: 8px; top: 8px; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: 0 1.4rem; border: 0; border-radius: var(--radius);
  background: var(--red); color: #fff; font: 700 1.05rem/1 var(--font-h); letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; transition: background .15s, transform .15s;
}
.btn:hover { background: var(--red-d); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn--sm { min-height: 42px; padding: 0 1rem; font-size: 1rem; flex: 1; }
.btn--light { background: #fff; color: var(--red); }
.btn--light:hover { background: var(--tint); color: var(--red-d); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn--ghost:hover { background: var(--tint); color: var(--ink); }
.btn--wa { background: var(--wa); width: 100%; min-height: 54px; font-size: 1.15rem; }
.btn--wa:hover { background: var(--wa-d); }
.btn.is-done { background: var(--wa); }
.iconbtn { display: inline-flex; align-items: center; gap: .5rem; background: none; border: 0; color: var(--ink); cursor: pointer; padding: .5rem; border-radius: 8px; font: inherit; }
.iconbtn:hover { background: var(--tint); }
.linkbtn { background: none; border: 0; color: var(--mute); text-decoration: underline; cursor: pointer; font: inherit; font-size: .9rem; padding: .5rem 0; width: 100%; }

/* ---------- Barra superior + header ---------- */
.topbar { background: var(--dark); color: #d9dbe0; font-size: .85rem; }
.topbar__in { display: flex; justify-content: space-between; gap: 1rem; padding-block: .45rem; flex-wrap: wrap; }
.topbar a { color: #fff; text-decoration: none; margin-left: 1.2rem; }
.topbar a:hover { text-decoration: underline; }
.topbar__links { display: flex; flex-wrap: wrap; }
@media (max-width: 720px) { .topbar__in > span:first-child { display: none; } .topbar__in { justify-content: center; } .topbar a { margin: 0 .7rem; } }

.head { position: sticky; top: 0; z-index: 60; background: #fff; border-bottom: 1px solid var(--line); transition: box-shadow .2s; }
.head.is-stuck { box-shadow: 0 4px 18px rgba(20, 22, 28, .1); }
.head__in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .6rem; }
.brand img { width: 190px; height: auto; }
.nav { display: flex; gap: .2rem; }
.nav a { padding: .6rem .9rem; font: 600 1.05rem/1 var(--font-h); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); text-decoration: none; border-radius: 8px; position: relative; }
.nav a:hover { background: var(--tint); color: var(--ink); }
.nav a.is-active { color: var(--red); }
.nav a.is-active::after { content: ""; position: absolute; left: .9rem; right: .9rem; bottom: .1rem; height: 3px; background: var(--red); border-radius: 2px; }
.head__tools { display: flex; align-items: center; gap: .3rem; }
.cartbtn { position: relative; font: 600 1rem/1 var(--font-h); letter-spacing: .06em; text-transform: uppercase; background: var(--tint); padding: .65rem .9rem; }
.cartbtn__count { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--red); color: #fff; font: 700 .8rem/22px var(--font); text-align: center; }
.burger { display: none; width: 44px; height: 44px; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.burger span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }

.searchbar { background: var(--tint); border-top: 1px solid var(--line); }
.searchbar__in { display: flex; gap: .5rem; padding-block: .6rem; }
.searchbar input { flex: 1; min-width: 0; height: 44px; padding: 0 1rem; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; background: #fff; }
.searchbar button { height: 44px; padding: 0 1.2rem; border: 0; border-radius: var(--radius); background: var(--ink); color: #fff; font: 700 1rem/1 var(--font-h); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.searchbar button:hover { background: #000; }

@media (max-width: 920px) {
  .burger { display: inline-flex; }
  .brand img { width: 150px; }
  .cartbtn__label { display: none; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; background: #fff; border-bottom: 1px solid var(--line); padding: .5rem 20px 1rem; display: none; box-shadow: 0 12px 24px rgba(20, 22, 28, .1); }
  .nav.is-open { display: flex; }
  .nav a { padding: .9rem .6rem; }
  .nav a.is-active::after { display: none; }
  .searchbar { position: relative; z-index: 1; }
}

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; background: #222 var(--hero) center/cover no-repeat; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(15, 17, 22, .92) 0%, rgba(15, 17, 22, .72) 48%, rgba(15, 17, 22, .25) 100%); }
.hero__in { padding-block: clamp(3rem, 9vw, 7rem); }
.hero__in > * { max-width: 40rem; }
.hero h1 { color: #fff; margin-bottom: .35em; }
.hero__lead { font-size: 1.2rem; color: #e7e8ec; max-width: 34em; }
.eyebrow { display: inline-block; font: 700 .95rem/1 var(--font-h); letter-spacing: .18em; text-transform: uppercase; color: var(--amber); margin-bottom: 1rem; }
.hero__search { display: flex; gap: .5rem; margin-top: 1.6rem; background: #fff; padding: .45rem; border-radius: 14px; box-shadow: var(--shadow); }
.hero__search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 .9rem; font: inherit; font-size: 1.05rem; color: var(--ink); height: 50px; }
.hero__search input:focus { outline: none; }
.hero__search:focus-within { box-shadow: 0 0 0 3px var(--amber), var(--shadow); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.1rem 0 0; }
.chips a { padding: .35rem .85rem; border-radius: 999px; background: rgba(255, 255, 255, .14); color: #fff; text-decoration: none; font-size: .95rem; border: 1px solid rgba(255, 255, 255, .25); }
.chips a:hover { background: #fff; color: var(--ink); }
@media (max-width: 520px) { .hero__search { flex-direction: column; } .hero__search .btn { width: 100%; } .hero__search input { height: 48px; } }

/* ---------- Secciones ---------- */
.sec { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.sec--tight { padding-block: clamp(1.5rem, 3vw, 2.5rem) clamp(2.5rem, 5vw, 4rem); }
.sec--tint { background: var(--tint); }
.sec--dark { background: var(--dark); color: #e7e8ec; }
.sec--dark h2 { color: #fff; }
.sec__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.sec__head h2 { margin: 0; position: relative; padding-bottom: .5rem; }
.sec__head h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 56px; height: 4px; background: var(--red); border-radius: 2px; }
.more { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; text-decoration: none; }
.more:hover { gap: .65rem; }

.pagehead { background: var(--tint); border-bottom: 1px solid var(--line); padding-block: .8rem .9rem; }
.pagehead--slim { padding-block: .9rem; }
.pagehead h1 { margin: .15rem 0 .05em; font-size: clamp(1.6rem, 3.2vw, 2.1rem); }
.pagehead__sub { margin: 0; color: var(--mute); font-size: .95rem; }
.crumbs { font-size: .9rem; color: var(--mute); }
.crumbs a { color: var(--mute); text-decoration: none; }
.crumbs a:hover { color: var(--red); text-decoration: underline; }

/* ---------- Rubros / tiles ---------- */
.rubros { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.rubro { display: flex; flex-direction: column; gap: .25rem; padding: 1.3rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s, border-color .15s; }
.rubro .ico { color: var(--red); margin-bottom: .5rem; }
.rubro:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--red); color: var(--ink); }
.rubro__name { font: 700 1.35rem/1.1 var(--font-h); text-transform: uppercase; letter-spacing: .02em; }
.rubro__n { color: var(--mute); font-size: .9rem; }
@media (max-width: 560px) { .rubros { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; } .rubro { padding: 1rem; } .rubro__name { font-size: 1.15rem; } }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.tile { position: relative; display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3; background: #ddd; color: #fff; text-decoration: none; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(15, 17, 22, .85)); }
.tile span { position: absolute; left: 1rem; right: 1rem; bottom: .9rem; z-index: 1; font: 700 1.4rem/1.05 var(--font-h); text-transform: uppercase; letter-spacing: .02em; }
.tile:hover { color: #fff; }
.tile:hover img { transform: scale(1.06); }

/* ---------- Servicios ---------- */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.2rem; }
.service { padding: 1.6rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.sec--tint .service { background: #fff; }
.service .ico { color: #fff; background: var(--red); padding: .7rem; width: 56px; height: 56px; border-radius: 12px; margin-bottom: 1rem; }
.service h2, .service h3 { margin-bottom: .35em; font-size: 1.45rem; }
.service p { margin: 0; color: var(--ink-2); }

/* ---------- Nosotros ---------- */
.about__in { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.about p { color: #c9ccd3; }
.about .btn { margin-top: .6rem; }
.about__facts { list-style: none; display: grid; gap: 1rem; }
.about__facts li { display: flex; flex-direction: column; padding: 1.1rem 1.3rem; border-left: 4px solid var(--red); background: rgba(255, 255, 255, .05); border-radius: 0 var(--radius) var(--radius) 0; }
.about__facts strong { font: 800 2.2rem/1 var(--font-h); text-transform: uppercase; color: #fff; }
.about__facts span { color: #b9bdc6; }
@media (max-width: 820px) { .about__in { grid-template-columns: 1fr; } }

.prose { max-width: 820px; }
.lead { font-size: 1.25rem; color: var(--ink-2); }
.timeline { list-style: none; margin: 2rem 0; border-left: 3px solid var(--line); padding-left: 1.6rem; display: grid; gap: 1.4rem; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: calc(-1.6rem - 9px); top: .35rem; width: 15px; height: 15px; background: var(--red); border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--red); }
.timeline strong { font: 700 1.5rem/1 var(--font-h); text-transform: uppercase; color: var(--red); display: block; margin-bottom: .2rem; }
.timeline p { margin: 0; }

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.split__img { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--tint); }
.split__img img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }

/* ---------- Obras ---------- */
.obras { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.4rem; }
.obra { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.obra img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.obra__body { padding: 1.3rem; }
.obra__body h2 { font-size: 1.6rem; margin-bottom: .3em; }
.obra__loc { display: flex; align-items: center; gap: .3rem; color: var(--red); font: 700 .9rem/1 var(--font-h); letter-spacing: .12em; text-transform: uppercase; margin-bottom: .5rem; }
.obra__body p:last-child { margin: 0; color: var(--ink-2); }

/* ---------- Marcas ---------- */
.brands { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .8rem; }
.brands li { display: grid; place-items: center; height: 92px; padding: .8rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.brands img { max-height: 64px; width: auto; max-width: 100%; object-fit: contain; filter: grayscale(1); opacity: .75; transition: filter .2s, opacity .2s; }
.brands li:hover img { filter: none; opacity: 1; }

/* ---------- CTA ---------- */
.cta { background: var(--red); color: #fff; padding-block: clamp(2rem, 5vw, 3.2rem); }
.cta__in { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; flex-wrap: wrap; }
.cta h2 { color: #fff; margin-bottom: .2em; }
.cta p { margin: 0; color: #ffe1e6; max-width: 40em; }

/* ---------- Catalogo ---------- */
.catalog { display: grid; grid-template-columns: 240px 1fr; gap: 2rem; align-items: start; }
.filters { position: sticky; top: 150px; }
.filters__title { font-size: 1.2rem; margin-bottom: .6rem; color: var(--mute); }
.filters ul { list-style: none; display: grid; gap: 2px; }
.filters a { display: flex; justify-content: space-between; gap: .5rem; padding: .55rem .8rem; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; }
.filters a small { color: var(--mute); font-size: .85rem; align-self: center; }
.filters a:hover { background: var(--tint); }
.filters a.is-on { background: var(--red); color: #fff; }
.filters a.is-on small { color: #ffd5db; }
@media (max-width: 860px) {
  .catalog { grid-template-columns: 1fr; gap: 1rem; }
  .filters { position: static; }
  .filters__title { display: none; }
  .filters ul { display: flex; overflow-x: auto; gap: .5rem; padding-bottom: .4rem; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .filters a { white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; }
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 1rem; }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
@media (max-width: 480px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; } }

.pcard { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.pcard:hover { box-shadow: var(--shadow); border-color: #d2cec7; }
.pcard__img { display: block; position: relative; aspect-ratio: 4/3; background: var(--tint); overflow: hidden; }
.pcard__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.noimg { display: grid; place-items: center; width: 100%; height: 100%; color: #bdb7ac; }
.noimg--lg { aspect-ratio: 4/3; gap: .4rem; align-content: center; justify-items: center; }
.noimg--lg small { font-size: .9rem; }
.pcard__body { display: flex; flex-direction: column; gap: .3rem; padding: .85rem; flex: 1; }
.pcard__code { margin: 0; font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard__name { margin: 0; font: 600 1.02rem/1.25 var(--font); text-transform: none; letter-spacing: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.75em; }
.pcard__name a { color: var(--ink); text-decoration: none; }
.pcard__name a:hover { color: var(--red); }
.pcard__price { margin: .1rem 0 .4rem; font: 700 1.25rem/1 var(--font-h); color: var(--ink); }
.ask { font: 600 .95rem/1 var(--font); color: var(--mute); }
.pcard__buy { display: flex; gap: .5rem; margin-top: auto; align-items: stretch; }
.pcard__buy--lg { margin-top: 1.4rem; }
.pcard__buy--lg .btn { flex: 1; min-height: 52px; }

.qty { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.qty button { width: 34px; border: 0; background: var(--tint); font-size: 1.2rem; cursor: pointer; color: var(--ink); }
.qty button:hover { background: #e9e5de; }
.qty input { width: 46px; text-align: center; border: 0; font: 600 1rem var(--font); -moz-appearance: textfield; background: #fff; min-width: 0; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty--sm button { width: 30px; }
.qty--sm input { width: 40px; font-size: .95rem; }

.pager { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-top: 2rem; }
.pager a, .pager span { min-width: 42px; height: 42px; padding: 0 .8rem; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 500; }
.pager a:hover { background: var(--tint); }
.pager .is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager span:not(.is-on) { border-color: transparent; }

.empty { text-align: center; padding: 3rem 1rem; max-width: 560px; margin: 0 auto; }
.empty p { color: var(--mute); }
.notice { padding: 1rem 1.2rem; border-radius: var(--radius); background: var(--tint); }
.notice--err { background: #fde8eb; color: #7a0c1e; }

/* ---------- Detalle ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.detail__media { background: var(--tint); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.detail__media img { width: 100%; aspect-ratio: 4/3; object-fit: contain; mix-blend-mode: multiply; }
.detail h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); text-transform: none; letter-spacing: 0; }
.detail__price { font: 700 2rem/1 var(--font-h); margin: .6rem 0 1rem; }
.detail__desc { color: var(--ink-2); }
.detail__cats { display: flex; flex-wrap: wrap; gap: .4rem; }
.detail__cats a { padding: .25rem .75rem; border-radius: 999px; background: var(--tint); color: var(--ink-2); text-decoration: none; font-size: .9rem; border: 1px solid var(--line); }
.detail__cats a:hover { border-color: var(--red); color: var(--red); }
.detail__hint { margin-top: 1rem; font-size: .92rem; color: var(--mute); }
@media (max-width: 800px) { .detail { grid-template-columns: 1fr; } }

/* ---------- Contacto / formularios ---------- */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }
.infolist { list-style: none; display: grid; gap: 1.2rem; margin-bottom: 1.6rem; }
.infolist li { display: flex; gap: 1rem; }
.infolist .ico { flex: none; color: var(--red); margin-top: .2rem; }
.infolist h2 { font-size: 1.2rem; margin: 0 0 .2em; }
.infolist p { margin: 0; color: var(--ink-2); }
.map { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16/10; background: var(--tint); }
.map iframe { width: 100%; height: 100%; border: 0; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); }
.form { display: grid; gap: 1rem; }
.form h2 { margin: 0; }
label { display: block; font-weight: 600; font-size: .95rem; }
label > input, label > textarea { display: block; margin-top: .3rem; font-weight: 400; }
.opt { font-weight: 400; color: var(--mute); }
.req { color: var(--red); }
input[type="text"], input[type="email"], input[type="tel"], textarea {
  width: 100%; padding: .7rem .85rem; border: 1px solid #cfcac2; border-radius: 8px; background: #fff; font: 400 1rem var(--font); color: var(--ink);
}
textarea { resize: vertical; min-height: 96px; }
input:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(200, 16, 46, .15); }
.form__msg { margin: 0; padding: .8rem 1rem; border-radius: 8px; font-weight: 500; }
.form__msg.is-ok { background: #e4f6ec; color: #0e5a30; }
.form__msg.is-err { background: #fde8eb; color: #7a0c1e; }

/* ---------- Footer ---------- */
.foot { background: var(--dark); color: #c3c6ce; margin-top: 0; }
.foot__grid { display: grid; grid-template-columns: 1.4fr 1.2fr 1.2fr .8fr; gap: 2rem; padding-block: 3rem; }
.foot h3 { color: #fff; font-size: 1.15rem; letter-spacing: .08em; margin-bottom: .7rem; }
.foot p { margin: 0 0 .4rem; }
.foot a { color: #fff; }
.foot__logo { filter: brightness(0) invert(1); margin-bottom: 1rem; }
.foot__links { list-style: none; display: grid; gap: .3rem; }
.foot__links a { text-decoration: none; color: #c3c6ce; }
.foot__links a:hover { color: #fff; text-decoration: underline; }
.foot__legal { border-top: 1px solid rgba(255, 255, 255, .1); padding-block: 1rem; font-size: .88rem; color: #8b909b; }
@media (max-width: 860px) { .foot__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot__grid { grid-template-columns: 1fr; padding-block: 2.2rem; } }

/* ---------- WhatsApp flotante ---------- */
.wafab { position: fixed; right: 18px; bottom: 18px; z-index: 50; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: var(--wa); color: #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, .28); transition: transform .15s; }
.wafab:hover { background: var(--wa-d); color: #fff; transform: scale(1.06); }

/* ---------- Drawer del carrito ---------- */
.drawer-bg { position: fixed; inset: 0; z-index: 90; background: rgba(15, 17, 22, .55); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 100; width: min(440px, 100%); background: #fff; display: flex; flex-direction: column; transform: translateX(100%); visibility: hidden; transition: transform .28s ease, visibility 0s .28s; box-shadow: -10px 0 40px rgba(0, 0, 0, .2); outline: none; }
.drawer.is-open { transform: none; visibility: visible; transition: transform .28s ease; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.drawer__head h2 { margin: 0; font-size: 1.6rem; }
.drawer__body { flex: 1; overflow-y: auto; padding: 1rem 1.2rem 1.4rem; display: flex; flex-direction: column; gap: 1rem; }
.cart-empty { text-align: center; padding: 2.5rem 0; color: var(--mute); }
.cart-list { list-style: none; display: grid; gap: .2rem; }
.cart-item { display: grid; grid-template-columns: 56px 1fr; gap: .2rem .8rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.cart-item__thumb { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--tint); }
.cart-item__thumb img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.cart-thumb--empty { display: block; width: 100%; height: 100%; background: var(--tint); }
.cart-item__name { margin: 0; font-weight: 600; line-height: 1.25; }
.cart-item__code { margin: 0; font-size: .75rem; color: var(--mute); text-transform: uppercase; letter-spacing: .05em; }
.cart-item__ctrl { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; margin-top: .3rem; }
.cart-item__rm { background: none; border: 0; color: var(--mute); text-decoration: underline; cursor: pointer; font: inherit; font-size: .88rem; padding: .3rem; }
.cart-item__rm:hover { color: var(--red); }
.cart-form { display: grid; gap: .9rem; margin-top: .4rem; padding-top: 1rem; border-top: 2px solid var(--ink); }
.cart-note { margin: 0; font-size: .92rem; color: var(--ink-2); background: var(--tint); padding: .8rem; border-radius: 8px; }
.cart-error { margin: 0; padding: .7rem .9rem; border-radius: 8px; background: #fde8eb; color: #7a0c1e; font-weight: 500; }
.cart-done { text-align: center; padding: 1rem; background: #e4f6ec; border-radius: var(--radius); display: grid; gap: .6rem; }
.cart-done h3 { margin: 0; color: #0e5a30; }
.cart-done p { margin: 0; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 120; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 1rem; background: var(--ink); color: #fff; padding: .75rem 1.1rem; border-radius: 999px; box-shadow: var(--shadow); transition: transform .25s, opacity .25s; max-width: calc(100% - 32px); }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast button { background: none; border: 0; color: var(--amber); font: 700 1rem var(--font-h); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Imagen ilustrativa (producto sin foto propia) ---------- */
.is-ghost { opacity: .45; object-fit: cover !important; mix-blend-mode: normal !important; filter: saturate(.7); }
.ghost-tag { position: absolute; left: 8px; bottom: 8px; padding: .15rem .55rem; border-radius: 999px; background: rgba(21, 23, 28, .72); color: #fff; font-size: .72rem; line-height: 1.4; letter-spacing: .02em; }
.detail__ghost { position: relative; }
.detail__ghost img { width: 100%; aspect-ratio: 4/3; }
.detail__ghost .ghost-tag { left: 12px; bottom: 12px; font-size: .8rem; padding: .25rem .7rem; }
.pricenote { margin: 0 0 1rem; font-size: .9rem; color: var(--mute); }
.pcard__price { color: var(--red); }

/* ---------- Anti desborde horizontal (movil) ---------- */
html, body { overflow-x: clip; }
.catalog, .catalog__main, .filters { min-width: 0; }
@media (max-width: 860px) {
  .catalog { grid-template-columns: minmax(0, 1fr); }
  .filters ul { max-width: 100%; }
}

/* ---------- Tarjetas: cantidad y boton ---------- */
.qty { flex: none; }
/* Tarjetas: cantidad arriba, boton abajo (a todo el ancho de la card) */
.pcard__buy { flex-direction: column; gap: .4rem; }
.pcard__buy .qty { width: 100%; }
.pcard__buy .qty input { flex: 1; width: auto; min-width: 0; }
.pcard__buy .qty button { width: 44px; min-height: 40px; }
.pcard__buy .btn { width: 100%; flex: none; }
.pcard__buy--lg { flex-direction: row; }
.pcard__buy--lg .qty { width: auto; }
.pcard__buy--lg .qty button { width: 40px; }
.pcard__buy--lg .qty input { width: 52px; flex: none; }
.pcard__buy--lg .btn { width: auto; flex: 1; }
@media (max-width: 480px) {
  .pcard__body { padding: .7rem; }
}

/* ---------- Selector de rubros en celular (reemplaza la fila deslizable) ---------- */
.rubro-pick { display: none; }
@media (max-width: 860px) {
  .filters { display: none; }
  .rubro-pick { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
  .rubro-pick summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 54px; padding: .5rem 1rem; cursor: pointer; font-weight: 600; }
  .rubro-pick summary::-webkit-details-marker { display: none; }
  .rubro-pick summary > span { display: flex; flex-direction: column; line-height: 1.2; }
  .rubro-pick summary small { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); font-weight: 500; }
  .rubro-pick summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg) translateY(-3px); transition: transform .2s; flex: none; }
  .rubro-pick[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
  .rubro-pick[open] summary { border-bottom: 1px solid var(--line); }
  .rubro-pick__list { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding: .7rem; background: var(--tint); }
  .rubro-pick__list a { display: flex; align-items: center; min-height: 44px; padding: .4rem .8rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; }
  .rubro-pick__list a.is-on { background: var(--red); border-color: var(--red); color: #fff; }
}

/* ---------- Aviso "Agregado" en celular: barra de una linea sobre el boton de WhatsApp ---------- */
.toast span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast button { flex: none; white-space: nowrap; }
@media (max-width: 600px) {
  .toast { left: 12px; right: 12px; bottom: 92px; width: auto; max-width: none; justify-content: space-between; border-radius: 12px; padding: .8rem 1rem; transform: translateY(16px); }
  .toast.is-on { transform: none; }
}

/* ---------- Aviso al agregar: verde de confirmacion, una linea ---------- */
.toast { background: #14803c; color: #fff; font-weight: 600; gap: .7rem; }
.toast--warn { background: #b45309; }
.toast__ic { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .22); font-size: .8rem; line-height: 1; }
.toast__msg { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast button { flex: none; color: #fff; background: rgba(255, 255, 255, .2); padding: .4rem .8rem; border-radius: 8px; font: 700 .95rem/1 var(--font-h); letter-spacing: .05em; }
.toast button:hover { background: rgba(255, 255, 255, .32); }
@media (max-width: 600px) { .toast { padding: .65rem .8rem; } }
