/* ═══════════════════════════════════════════════════════════
   DELGON Panificados — catálogo público (minimalista)
   ═══════════════════════════════════════════════════════════ */

/* ─── Nav ─── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,248,243,0.9);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.nav.is-scrolled { border-bottom-color: var(--border); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.nav__brand { display: flex; align-items: center; gap: 10px; color: var(--crust); }
.nav__brand img { height: 32px; width: auto; }

.cart-btn {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: #fff; border: none; border-radius: 999px;
  padding: 9px 16px; font-weight: 600; font-size: 14px; transition: opacity .2s ease;
}
.cart-btn:hover { opacity: .88; }
.cart-btn svg { width: 17px; height: 17px; }
.cart-count {
  position: absolute; top: -7px; right: -7px;
  min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--crust); color: #fff; border: 2px solid var(--bg);
  border-radius: 999px; font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}

/* ─── Portada / Hero ─── */
.hero {
  position: relative; overflow: hidden; color: #fff; text-align: center;
  min-height: min(68vh, 600px); display: grid; place-items: center;
}
.hero__bg { position: absolute; inset: 0; background: var(--bg-2) center/cover no-repeat; }
.hero__scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(28,24,19,0.42) 0%, rgba(28,24,19,0.5) 100%); }
.hero__inner { position: relative; z-index: 2; padding: clamp(64px, 11vh, 110px) 0; }
.hero__logo { height: clamp(46px, 8vw, 62px); color: #fff; margin: 0 auto 18px; opacity: .96; }
.hero__eyebrow { color: rgba(255,255,255,0.82); }
.hero__title { color: #fff; font-weight: 400; font-size: clamp(36px, 6.5vw, 64px); }
.hero__title .hl { font-style: italic; color: #EBD3B0; }
.hero__sub { color: rgba(255,255,255,0.88); max-width: 520px; margin: 16px auto 28px; font-size: clamp(15px, 2.2vw, 18px); font-weight: 400; }
.hero__cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn--light { background: #fff; color: var(--ink); }
.btn--light:hover { background: #fff; opacity: .9; }
.btn--outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,0.55); }
.btn--outline-light:hover { background: rgba(255,255,255,0.12); border-color: #fff; }

/* El hero aparece YA con animación CSS (no espera a ningún JS) */
.hero .reveal { opacity: 1; transform: none; animation: heroIn .5s ease both; }
.hero__eyebrow { animation-delay: .04s; }
.hero__title { animation-delay: .10s; }
.hero__sub { animation-delay: .18s; }
.hero__cta { animation-delay: .26s; }
@keyframes heroIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hero .reveal { animation: none; } }

/* ─── Franja de confianza (ticker rotativo) ─── */
.strip { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); overflow: hidden; }
.strip__track { display: flex; align-items: center; width: max-content; padding: 11px 0; animation: strip-scroll 26s linear infinite; }
.strip:hover .strip__track { animation-play-state: paused; }
.strip__item { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; font-weight: 600; white-space: nowrap; }
.strip__item svg { width: 17px; height: 17px; color: var(--crust); flex-shrink: 0; }
.strip__dot { color: var(--gold); font-weight: 800; margin: 0 24px; }
@keyframes strip-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .strip__track { animation: none; } }

/* ─── Catálogo ─── */
.catalog { padding: clamp(40px, 6vw, 64px) 0 clamp(56px, 8vw, 84px); }
.catalog__head { text-align: center; margin-bottom: clamp(22px, 4vw, 34px); }
.catalog__title { font-size: clamp(26px, 4.5vw, 38px); margin-top: 8px; }
.catalog__sub { color: var(--ink-2); font-size: 15px; max-width: 520px; margin: 10px auto 0; }

.cats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 auto clamp(26px, 5vw, 40px); }
.chip {
  padding: 8px 16px; border-radius: 999px;
  background: transparent; border: 1.5px solid var(--border);
  color: var(--ink-2); font-weight: 600; font-size: 13.5px; transition: all .18s ease;
}
.chip:hover { border-color: var(--crust); color: var(--crust); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: var(--gap); }

.card {
  background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px var(--shadow); border-color: #e2dac9; }
.card__media { position: relative; aspect-ratio: 1/1; background: var(--bg-2); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card__media img { transform: scale(1.03); }
.card.is-agotado .card__media img { filter: grayscale(0.55) brightness(0.95); }

/* Etiquetas (chicas y sobrias) */
.badges { position: absolute; top: 9px; left: 9px; display: flex; flex-wrap: wrap; gap: 5px; max-width: calc(100% - 18px); z-index: 2; }
.badge { padding: 4px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

.card__body { padding: 15px 15px 17px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__marca { margin: 0 0 -2px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.card__title { font-size: 19px; font-weight: 500; }
.card__desc { margin: 0; color: var(--ink-2); font-size: 13.5px; flex: 1; line-height: 1.5; }

.card__price { font-family: var(--sans); margin: 2px 0; }
.card__price-now { font-weight: 700; font-size: 18px; color: var(--ink); }
.card__price-old { text-decoration: line-through; color: var(--muted); font-size: 13.5px; margin-right: 5px; }
.card__price-unit { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.card__price--consult { color: var(--muted); font-size: 13.5px; font-weight: 500; }

.btn--add { background: var(--crust); color: #fff; width: 100%; margin-top: 6px; }
.btn--add:hover { background: var(--crust-d); }
.btn--add.is-added { background: var(--wa); }

/* Contador en la tarjeta */
.card__actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.card__actions .btn--add { flex: 1; margin-top: 0; padding-left: 14px; padding-right: 14px; }
.stepper { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: 999px; flex-shrink: 0; }
.stepper__b { width: 30px; height: 34px; border: none; background: transparent; font-size: 17px; line-height: 1; color: var(--ink-2); border-radius: 999px; }
.stepper__b:hover { color: var(--crust); }
.stepper__n { min-width: 22px; text-align: center; font-weight: 700; font-size: 14px; color: var(--ink); }

/* ─── Mobile: 2 productos por fila ─── */
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card__body { padding: 12px 12px 14px; gap: 5px; }
  .card__title { font-size: 16px; }
  .card__desc { font-size: 12.5px; }
  .card__marca { font-size: 9.5px; }
  .badge { font-size: 9px; padding: 3px 7px; }
  .card__price-now { font-size: 16px; }
  /* contador + botón apilados para que entren en la tarjeta angosta */
  .card__actions { flex-direction: column; align-items: stretch; gap: 8px; }
  .stepper { width: 100%; justify-content: space-between; }
}
.btn--out { background: var(--bg-2); color: var(--muted); width: 100%; margin-top: 6px; border: 1px solid var(--border); border-radius: 999px; padding: 12px 22px; font-weight: 600; font-size: 15px; cursor: not-allowed; }

.empty { text-align: center; color: var(--muted); padding: 56px 20px; font-size: 16px; grid-column: 1 / -1; }
.demo-banner {
  background: var(--gold-l); color: var(--crust-d); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 16px; margin: 0 auto clamp(20px, 4vw, 30px);
  font-size: 13px; text-align: center; max-width: 720px;
}

/* ─── Formularios públicos (mayorista + carrito) ─── */
.frm-field { margin-bottom: 11px; }
.frm-field > label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 5px; }
.frm-field .req { color: var(--out); }
.frm-field input, .frm-field select, .frm-field textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: 14px; color: var(--ink); background: #fff;
}
.frm-field input:focus, .frm-field select:focus, .frm-field textarea:focus { outline: none; border-color: var(--crust); }
.frm-field textarea { min-height: 64px; resize: vertical; }
.frm-field.is-error input, .frm-field.is-error select { border-color: var(--out); background: #fdf3f1; }

/* Control segmentado (Particular / Empresa) */
.seg { display: flex; gap: 8px; }
.seg label { flex: 1; position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 10px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); transition: all .15s ease; }
.seg input:checked + span { background: var(--crust); color: #fff; border-color: var(--crust); }

.frm-error { background: #fdf3f1; color: var(--out); border-radius: 10px; padding: 9px 12px; font-size: 13px; margin: 4px 0 10px; }

/* ─── Mayorista ─── */
.mayorista { background: var(--bg-2); border-top: 1px solid var(--border); padding: clamp(48px, 7vw, 84px) 0; }
.mayorista__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 60px); align-items: start; }
@media (max-width: 760px) { .mayorista__grid { grid-template-columns: 1fr; } }
.mayorista__title { font-size: clamp(26px, 4vw, 38px); margin-top: 8px; }
.mayorista__text { color: var(--ink-2); font-size: 15.5px; margin: 14px 0 0; max-width: 420px; }
.mayorista__card { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(20px, 3vw, 28px); }
.mayorista__ok { background: #edf6ee; color: #2c6b3f; border-radius: 10px; padding: 12px 14px; font-size: 14px; }

/* ─── Carrito (drawer) ─── */
/* Contenedor fijo del tamaño de la pantalla que recorta el cajón fuera de vista
   (evita el espacio blanco en iOS por el off-canvas) */
.cart-portal { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 80; }
.cart-overlay { position: absolute; inset: 0; background: rgba(28,24,19,0.45); opacity: 0; visibility: hidden; transition: opacity .25s ease; pointer-events: auto; }
.cart-overlay.is-open { opacity: 1; visibility: visible; }
.cart-drawer {
  position: absolute; top: 0; right: 0; height: 100%; width: min(430px, 94vw);
  background: var(--bg); box-shadow: -14px 0 44px rgba(0,0,0,0.16);
  transform: translateX(100%); transition: transform .28s ease; z-index: 2;
  display: flex; flex-direction: column; pointer-events: auto;
}
.cart-drawer.is-open { transform: none; }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.cart-head h2 { font-size: 21px; font-weight: 500; }
.cart-close { background: none; border: none; font-size: 21px; line-height: 1; color: var(--ink-2); padding: 4px; }
.cart-body { flex: 1; overflow-y: auto; padding: 6px 20px 16px; }
.cart-empty { text-align: center; color: var(--muted); padding: 52px 12px; }

.citem { display: flex; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--border); }
.citem__img { width: 54px; height: 54px; border-radius: 9px; object-fit: cover; background: var(--bg-2); flex-shrink: 0; }
.citem__info { flex: 1; min-width: 0; }
.citem__name { font-weight: 600; font-size: 14px; }
.citem__price { color: var(--muted); font-size: 12.5px; }
.citem__sub { color: var(--ink); font-weight: 600; font-size: 13px; margin-top: 1px; }
.qty { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.qty__b { width: 26px; height: 26px; border-radius: 7px; border: 1.5px solid var(--border); background: #fff; font-size: 15px; font-weight: 700; line-height: 1; color: var(--ink-2); }
.qty__b:hover { border-color: var(--crust); color: var(--crust); }
.qty__n { min-width: 18px; text-align: center; font-weight: 700; font-size: 14px; }
.citem__del { background: none; border: none; color: var(--muted); font-size: 13px; padding: 4px; flex-shrink: 0; }
.citem__del:hover { color: var(--out); }

.cart-section-label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }

.cart-foot { border-top: 1px solid var(--border); padding: 14px 20px 18px; background: var(--paper); }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 0 12px; font-family: var(--serif); }
.cart-total span { color: var(--ink-2); }
.cart-total b { font-size: 23px; color: var(--ink); font-weight: 600; }
.cart-send { width: 100%; }
.cart-note { color: var(--muted); font-size: 11.5px; text-align: center; margin: 9px 0 0; }

/* ─── Footer ─── */
.footer { background: var(--ink); color: #e6ddd0; padding: clamp(40px, 6vw, 58px) 0 26px; }
.footer__grid { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; align-items: flex-start; }
.footer__brand img { color: #e6ddd0; height: 42px; }
.footer__tagline { color: #b0a593; font-size: 14px; max-width: 280px; margin-top: 12px; }
.footer__links { display: flex; flex-direction: column; gap: 9px; }
.footer__link { display: inline-flex; align-items: center; gap: 9px; color: #e6ddd0; font-size: 14px; }
.footer__link svg { width: 16px; height: 16px; }
.footer__link:hover { color: #fff; }
.footer__legal { margin-top: 32px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.1); color: #93897a; font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; align-items: center; }
.footer__legal a { color: #b0a593; }
.footer__legal a:hover { color: #fff; }
.footer__legal-links { display: flex; gap: 16px; }

/* ─── WhatsApp flotante ─── */
.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--wa); color: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(37,211,102,0.4); transition: transform .18s ease;
}
.wa-float:hover { transform: scale(1.05); }
.wa-float svg { width: 27px; height: 27px; }
