/* Diseño de la tienda del cliente */

/* barra de aviso */
.announce {
  background: var(--navy); color: #fff; font-weight: 600; font-size: .9rem; padding: 8px 0;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .12); overflow: hidden;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; }

/* cartel en movimiento: el texto corre de derecha a izquierda */
.marquee { overflow: hidden; }
.marquee-track { display: flex; width: max-content; animation: marquee var(--marquee-duration, 40s) linear infinite; }
.marquee-group { display: flex; flex-shrink: 0; align-items: center; }
.marquee-msg { white-space: nowrap; }
.marquee-sep { padding: 0 2.2rem; color: #8fb2ee; }
.announce:hover .marquee-track, .announce.paused .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* si la persona pidió "reducir movimiento", el cartel queda quieto */
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; width: auto; justify-content: center; }
  .marquee-group { flex-wrap: wrap; justify-content: center; padding: 0 16px; }
  .marquee-group ~ .marquee-group { display: none; }
}

/* encabezado */
.site-header { background: #fff; position: sticky; top: 0; z-index: 30; box-shadow: 0 1px 0 var(--border); }
.header-main {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; padding-top: 14px; padding-bottom: 14px;
}
.hamburger { display: none; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo-img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: #fff; }
.logo-text {
  display: flex; flex-direction: column; line-height: 1; text-transform: uppercase; font-style: italic;
  font-weight: 700; color: var(--navy); white-space: nowrap; letter-spacing: -.01em; font-size: 1.15rem;
}
.logo-text b { color: var(--primary); font-size: 1.5rem; font-weight: 700; }
.logo-text small {
  font-style: normal; font-size: .62rem; letter-spacing: .12em; color: var(--brand); margin-top: 4px; font-weight: 600;
}

.search {
  display: flex; align-items: center; border: 1px solid #d5dbdf; border-radius: 12px; background: #fff;
  max-width: 640px; width: 100%; justify-self: center; overflow: hidden;
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--primary-soft); }
.search input { flex: 1; border: 0; font: inherit; padding: 11px 16px; outline: none; min-width: 0; background: transparent; }
.search button { border: 0; background: none; padding: 0 14px; cursor: pointer; color: var(--text); display: flex; }

.cart-btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px; background: none; border: 0;
  cursor: pointer; font: inherit; color: var(--text); padding: 4px;
}
.cart-btn svg.i { width: 30px; height: 30px; }
.cart-badge {
  position: absolute; top: -4px; left: 20px; min-width: 20px; height: 20px; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: .75rem; font-weight: 700; display: grid; place-items: center; padding: 0 5px;
}
.cart-sum { text-align: left; line-height: 1.15; }
.cart-sum small { display: block; color: var(--muted); font-size: .75rem; }
.cart-sum strong { font-size: .95rem; }

.catnav { border-top: 1px solid var(--border); }
.catnav .container { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.catnav a {
  background: none; border: 0; font: inherit; font-weight: 500; padding: 11px 14px; cursor: pointer;
  white-space: nowrap; color: var(--text); border-bottom: 2px solid transparent;
}
.catnav a:hover { color: var(--primary); }
.catnav a.active { color: var(--primary); border-bottom-color: var(--brand); font-weight: 600; }

@media (max-width: 860px) {
  .header-main { grid-template-columns: auto 1fr auto; gap: 8px 12px; padding-top: 10px; padding-bottom: 12px; }
  .hamburger { display: inline-flex; color: var(--text); }
  .hamburger svg.i { width: 28px; height: 28px; }
  .logo { justify-self: center; }
  .logo-img { width: 44px; height: 44px; }
  .logo-text { font-size: .92rem; }
  .logo-text b { font-size: 1.15rem; }
  .logo-text small { display: none; }
  .search { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .cart-sum { display: none; }
  .catnav { display: none; }
}

/* menú lateral de categorías (celular) */
.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-list a {
  width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border);
  font: inherit; padding: 14px 4px; cursor: pointer; display: flex; justify-content: space-between;
}
.menu-list a.active { color: var(--primary); font-weight: 600; }

/* banner destacado */
.hero { margin-top: 20px; position: relative; }
.hero-track { position: relative; border-radius: 16px; overflow: hidden; background: var(--navy); min-height: 340px; }
.slide {
  position: absolute; inset: 0; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center;
  gap: 24px; padding: 32px 56px; opacity: 0; transition: opacity .5s ease; pointer-events: none;
  background: radial-gradient(circle at 75% 50%, #1d5fc4 0%, #0a3a7e 45%, #0d2749 80%); color: #fff;
}
.slide.active { opacity: 1; pointer-events: auto; }
.slide-pill {
  display: inline-block; background: #fff; color: var(--primary); font-weight: 700; font-size: .85rem;
  padding: 4px 12px; border-radius: 999px; margin-bottom: 14px;
}
.slide h2 { font-size: clamp(1.6rem, 3.4vw, 2.8rem); font-weight: 700; text-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.slide-price { font-size: 1.5rem; font-weight: 700; margin: 14px 0 20px; }
.slide-price del { font-size: 1rem; opacity: .7; font-weight: 400; margin-right: 8px; }
.slide .btn { background: #fff; color: var(--navy); border-color: #fff; padding: 11px 22px; }
.slide .btn:hover { background: var(--primary-soft); }
.slide-img { height: 290px; display: grid; place-items: center; }
.slide-img img {
  max-height: 290px; max-width: 100%; width: auto; height: auto; object-fit: contain; border-radius: 12px; background: #fff;
  padding: 8px; box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
}
.hero-welcome { position: static; opacity: 1; grid-template-columns: 1fr; text-align: center; min-height: 260px; }
.dots {
  display: flex; gap: 8px; justify-content: center; margin: -16px auto 0; position: relative; z-index: 2;
  background: #fff; width: fit-content; padding: 7px 12px; border-radius: 999px; box-shadow: var(--shadow);
}
.dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; background: #cfd6da; cursor: pointer; padding: 0; }
.dots button.active { background: var(--brand); }
.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, .9); cursor: pointer; display: grid; place-items: center; color: var(--text);
}
.hero-arrow.prev { left: 12px; }
.hero-arrow.next { right: 12px; }
@media (max-width: 700px) {
  .hero { margin-top: 14px; }
  .hero-track { min-height: 420px; }
  .slide { grid-template-columns: 1fr; padding: 20px 20px 36px; text-align: center; gap: 12px; align-content: center; }
  .slide h2 { font-size: 1.45rem; }
  .slide-img { height: 180px; order: -1; }
  .slide-img img { max-height: 180px; }
  .slide-price { margin: 8px 0 14px; }
  .hero-arrow { display: none; }
}

/* beneficios */
.perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 28px; }
.perk { display: flex; gap: 12px; align-items: center; background: var(--bg-soft); border-radius: var(--radius); padding: 14px 16px; }
.perk-icon { width: 42px; height: 42px; border-radius: 50%; background: #fff; color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.perk strong { display: block; font-size: .95rem; }
.perk span { color: var(--muted); font-size: .85rem; }
@media (max-width: 760px) {
  .perks { gap: 8px; margin-top: 22px; }
  .perk { flex-direction: column; text-align: center; padding: 10px 6px; gap: 6px; }
  .perk-icon { width: 36px; height: 36px; }
  .perk strong { font-size: .78rem; line-height: 1.2; }
  .perk div span { display: none; }
}
.grid .empty { grid-column: 1 / -1; }

/* secciones */
.section { margin-top: 36px; }
.section-head {
  border-bottom: 2px solid var(--primary); padding-bottom: 10px; margin-bottom: 18px; text-align: center;
}
.section-head h2 { color: var(--navy); text-transform: uppercase; font-style: italic; letter-spacing: -.01em; font-size: 1.35rem; font-weight: 700; }
/* enlace debajo del título, alineado a la izquierda */
.section-link { display: inline-block; color: var(--text); font-weight: 500; text-decoration: none; margin: -6px 0 16px; }
.section-link:hover { color: var(--primary); text-decoration: underline; }
.sort { font: inherit; padding: 7px 10px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.catalog-tools { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.result-info { color: var(--muted); font-size: .9rem; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 18px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.rail .pcard { scroll-snap-align: start; }
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rail { grid-auto-columns: 70%; gap: 10px; }
}

/* tarjeta de producto */
.pcard {
  border: 1px solid var(--border); border-radius: 14px; padding: 12px; background: #fff;
  display: flex; flex-direction: column; gap: 8px; transition: box-shadow .2s, transform .2s;
}
.pcard:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.pcard-media { position: relative; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: #fff; cursor: pointer; }
.pcard-media img { width: 100%; height: 100%; object-fit: contain; transition: transform .3s; }
.pcard:hover .pcard-media img { transform: scale(1.04); }
.pcard-media { display: block; }
.pcard-media img.alt { position: absolute; inset: 0; opacity: 0; transition: opacity .3s, transform .3s; background: #fff; }
@media (hover: hover) { .pcard:hover .pcard-media img.alt { opacity: 1; } }
.pcard-title a { color: inherit; text-decoration: none; }
.pcard-media .noimg { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); background: var(--bg-soft); font-size: .85rem; }
.pcard-badges { position: absolute; top: 6px; left: 6px; display: flex; flex-direction: column; gap: 4px; z-index: 1; }
.tag { font-size: .78rem; font-weight: 700; padding: 4px 9px; border-radius: 8px; color: #fff; width: fit-content; }
.tag.sale { background: var(--accent); }
.tag.out { background: #343a40; }
.tag.low { background: #fff4e0; color: #8a5a00; }
.pcard-cat { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.pcard-title { font-size: 1rem; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.pcard-title a:hover { color: var(--primary); }
a.pcard-cat { text-decoration: none; }
a.pcard-cat:hover { color: var(--primary); }
.price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.price-row del { color: var(--muted); font-size: .9rem; }
.price-row strong { font-size: 1.2rem; font-weight: 700; }
.price-row strong.sale { color: var(--accent); }
.btn-add {
  width: 100%; border: 0; border-radius: 12px; background: var(--primary); color: #fff; font: inherit;
  font-weight: 600; padding: 11px 10px; cursor: pointer; margin-top: 4px;
}
.btn-add:hover { background: var(--primary-dark); }
.btn-add:disabled { background: #ced4da; cursor: not-allowed; }
.in-cart { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; }
.in-cart .qty { flex: 1; justify-content: space-between; }
.in-cart small { color: var(--primary); font-weight: 600; font-size: .8rem; }
@media (max-width: 560px) {
  .pcard { padding: 8px; }
  .pcard-title { font-size: .9rem; }
  .price-row strong { font-size: 1.05rem; }
  .btn-add { padding: 10px 6px; font-size: .9rem; }
}


/* pie de página */
.site-footer { background: var(--navy); color: #c9d4e6; margin-top: 56px; padding: 40px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 28px; }
.site-footer h3 { color: #fff; font-size: 1rem; margin-bottom: 12px; }
.site-footer p { margin: 0 0 8px; display: flex; gap: 8px; align-items: flex-start; font-size: .92rem; }
.site-footer svg.i { width: 18px; height: 18px; margin-top: 2px; color: #8fb2ee; }
.site-footer a { color: #fff; }
.site-footer .logo-img { width: 96px; height: 96px; box-shadow: 0 0 0 4px rgba(255, 255, 255, .15); }
.site-footer .logo-text, .site-footer .logo-text b { color: #fff; }
.site-footer .logo-text small { color: #8fb2ee; display: block; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 32px; padding: 14px 0; font-size: .85rem; color: #8b9bb8; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 20px; } }

/* botón flotante de WhatsApp */
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 35; width: 60px; height: 60px; border-radius: 50%;
  background: var(--whatsapp); display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}
.wa-float svg { width: 32px; height: 32px; fill: #fff; }
.wa-float:hover { transform: scale(1.06); }

/* menús con enlaces */
.catnav a {
  font: inherit; font-weight: 500; padding: 11px 14px; white-space: nowrap; color: var(--text);
  border-bottom: 2px solid transparent; text-decoration: none;
}
.menu-list a {
  display: flex; justify-content: space-between; border-bottom: 1px solid var(--border);
  padding: 14px 4px; text-decoration: none; color: var(--text);
}
.line-name { color: var(--text); text-decoration: none; }
.line-name:hover { color: var(--primary); }

/* ---------- página de producto ---------- */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .88rem; color: var(--muted); margin: 18px 0 16px; }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current] { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.product-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px; align-items: start; }

.gallery { position: sticky; top: 150px; }
.gallery-main { position: relative; border: 1px solid var(--border); border-radius: 16px; background: #fff; overflow: hidden; }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 1 / 1; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide { flex: 0 0 100%; scroll-snap-align: center; border: 0; background: #fff; padding: 0; cursor: zoom-in; }
.gallery-slide img { width: 100%; height: 100%; object-fit: contain; }
.gallery-empty { aspect-ratio: 1 / 1; display: grid; place-items: center; color: var(--muted); background: var(--bg-soft); }
.g-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border); background: rgba(255, 255, 255, .95); display: grid; place-items: center;
  cursor: pointer; color: var(--navy); box-shadow: var(--shadow);
}
.g-arrow:hover { background: var(--primary-soft); }
.g-arrow.prev { left: 12px; }
.g-arrow.next { right: 12px; }
.g-count {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); background: rgba(13, 39, 73, .8);
  color: #fff; font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
}
.g-zoom { position: absolute; top: 12px; right: 12px; color: var(--muted); pointer-events: none; }
.g-tag { position: absolute; top: 12px; left: 12px; font-size: .9rem; }

.thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.thumb {
  flex: 0 0 76px; height: 76px; border: 2px solid var(--border); border-radius: 10px; background: #fff;
  padding: 3px; cursor: pointer; opacity: .75;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb:hover { opacity: 1; }
.thumb.active { border-color: var(--primary); opacity: 1; }

.buybox { display: flex; flex-direction: column; gap: 14px; }
.buybox h1 { font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 700; color: var(--navy); line-height: 1.2; }
.price-row.big strong { font-size: 2rem; }
.price-row.big del { font-size: 1.05rem; }
.saving { display: inline-block; background: #fdecec; color: var(--accent); font-weight: 600; font-size: .88rem; padding: 3px 10px; border-radius: 8px; margin-top: 6px; }
#buyBox { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--bg-soft); border-radius: 14px; }
.stock-ok { color: #1e7e34; font-weight: 600; font-size: .95rem; }
.stock-out { color: var(--danger); font-weight: 600; font-size: .95rem; }
.in-cart-note { font-size: .9rem; }
.buy-row { display: flex; gap: 10px; align-items: stretch; }
.buy-row .qty button { height: 46px; width: 42px; }
.buy-row .btn-add { margin: 0; flex: 1; font-size: 1rem; }
.btn-buy {
  width: 100%; border: 2px solid var(--primary); border-radius: 12px; background: #fff; color: var(--primary);
  font: inherit; font-weight: 700; padding: 11px; cursor: pointer;
}
.btn-buy:hover { background: var(--primary-soft); }
.consult { display: inline-flex; gap: 8px; align-items: center; color: var(--whatsapp-btn); font-weight: 600; text-decoration: none; width: fit-content; }
.consult svg { width: 20px; height: 20px; fill: currentColor; }
.consult:hover { text-decoration: underline; }
.buy-perks { list-style: none; margin: 4px 0 0; padding: 14px 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.buy-perks li { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--muted); }
.buy-perks svg.i { color: var(--primary); width: 20px; height: 20px; margin-top: 1px; }
.buy-perks strong { color: var(--text); display: block; }
.share-btn { display: inline-flex; gap: 8px; align-items: center; background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0; width: fit-content; }
.share-btn svg.i { width: 18px; height: 18px; }
.share-btn:hover { color: var(--primary); }

.description .desc-text { white-space: pre-line; color: #3a4558; max-width: 860px; font-size: 1rem; line-height: 1.65; }
.not-found { text-align: center; padding: 64px 16px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.not-found h1 { color: var(--navy); font-size: 1.5rem; }

@media (max-width: 860px) {
  .product-layout { grid-template-columns: 1fr; gap: 20px; }
  .gallery { position: static; }
  .g-arrow { display: none; }
  .thumb { flex-basis: 62px; height: 62px; }
  .breadcrumb { margin: 12px 0; }
}

/* foto ampliada */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(8, 18, 34, .92); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: 92vw; max-height: 86vh; object-fit: contain; background: #fff; border-radius: 10px; }
.lb-close, .lb-arrow {
  position: fixed; border: 0; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer;
  width: 48px; height: 48px; border-radius: 50%; font-size: 1.6rem; display: grid; place-items: center;
}
.lb-close { top: 16px; right: 16px; font-size: 1.2rem; }
.lb-arrow { top: 50%; transform: translateY(-50%); font-size: 2rem; }
.lb-arrow.prev { left: 16px; }
.lb-arrow.next { right: 16px; }
.lb-close:hover, .lb-arrow:hover { background: rgba(255, 255, 255, .28); }
.lb-count { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); color: #fff; font-weight: 600; }

/* ---------- pedido: ciudad, delivery y factura ---------- */
.form-group { display: flex; flex-direction: column; gap: 14px; }
.combo { position: relative; }
.combo input { font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; width: 100%; background: #fff; }
.combo input:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; margin: 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
  max-height: 240px; overflow-y: auto; font-weight: 400;
}
.combo-list li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.combo-list li:hover, .combo-list li.active { background: var(--primary-soft); }
.combo-list li[aria-selected="true"] { font-weight: 600; color: var(--primary); }
.combo-list li.other { border-top: 1px solid var(--border); margin-top: 2px; }
.combo-list li small { color: var(--muted); font-weight: 400; }
.combo-price { color: var(--muted); white-space: nowrap; font-size: .9rem; }
.combo-empty { padding: 9px 10px; color: var(--muted); font-size: .88rem; cursor: default; }
.invoice-check { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: 500 !important; }
.invoice-check:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.sum-row { display: flex; justify-content: space-between; color: var(--muted); font-size: .95rem; margin-bottom: -4px; }
