/* ============================================================
   MARIMAR COSTURA CREATIVA — DESIGN TOKENS v3
   Estética: fondo blanco, pastel como acento, trazos finos tipo
   lápiz, banderines como motivo. Minimal, claro y fresco.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400..700&family=Instrument+Sans:ital,wght@0,400..600;1,400..600&family=Shantell+Sans:wght@500;700&display=swap');

:root {
  /* fondos */
  --cream: #FFFFFF;
  --cream-2: #FAF8F6;
  --white: #FFFFFF;

  /* tinta — grafito suave, no negro puro */
  --ink: #37342F;
  --ink-soft: #8A847C;

  /* pastel — versión clara (fondos, chips, banderines) */
  --coral: #FFDCE4;
  --turquoise: #D4EEF0;
  --mustard: #FFEFC7;
  --lilac: #EAE0FB;
  --mint: #DCF5E9;

  /* pastel — versión "deep" para texto/iconos con contraste */
  --coral-deep: #EF7D9B;
  --turquoise-deep: #5DAEB8;
  --mustard-deep: #EFB13B;
  --lilac-deep: #A98BDE;
  --mint-deep: #4FBE93;

  /* superficies */
  --paper: #FFFFFF;
  --line: rgba(55, 52, 47, 0.16);
  --line-soft: rgba(55, 52, 47, 0.10);

  /* tipografía */
  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body: 'Instrument Sans', sans-serif;
  --font-hand: 'Shantell Sans', cursive;

  --radius-lg: 26px;
  --radius-md: 16px;
  --radius-sm: 10px;

  --shadow-soft: 0 6px 18px rgba(55, 52, 47, 0.06);
  --shadow-lift: 0 12px 28px rgba(55, 52, 47, 0.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { max-width: 100%; }
body { overflow-x: hidden; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 0.4em;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; color: var(--ink-soft); }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 2.5px solid var(--coral-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   FIRMA: trazo de lápiz — líneas finas discontinuas
   ============================================================ */

.stitch-rule {
  border: none;
  height: 0;
  border-top: 1.5px dashed var(--line);
  margin: 0;
}

.stitch-underline {
  position: relative;
  display: inline-block;
}
.stitch-underline::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background-image: linear-gradient(90deg, currentColor 60%, transparent 0%);
  background-size: 10px 2px;
  background-repeat: repeat-x;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s ease;
}
.stitch-underline:hover::after,
.stitch-underline:focus-visible::after {
  transform: scaleX(1);
}

/* botones — línea fina, relleno pastel deep en hover */
.btn {
  --pad-x: 26px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px var(--pad-x);
  border-radius: 999px;
  cursor: pointer;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  transition: transform 0.2s ease, background 0.25s ease, color 0.25s ease, box-shadow .25s ease, border-color .25s ease;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover { background: var(--coral-deep); border-color: var(--coral-deep); }

.btn-coral { background: var(--coral-deep); border-color: var(--coral-deep); color: var(--white); }
.btn-coral:hover { background: var(--ink); border-color: var(--ink); }

.btn-whatsapp { background: #25D366; border-color: #25D366; color: var(--white); }
.btn-whatsapp:hover { background: #1DA851; border-color: #1DA851; }

.btn-mp { background: #009EE3; border-color: #009EE3; color: var(--white); }
.btn-mp:hover { background: #0086C3; border-color: #0086C3; }

.btn-outline { background: transparent; }
.btn-outline:hover { background: var(--ink); color: var(--paper); }

.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* etiqueta manuscrita, trazo de marcador suave */
.tag-hand {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--coral-deep);
  transform: rotate(-2deg);
  display: inline-block;
}

/* ============================================================
   BANDERINES — motivo decorativo (divisor)
   ============================================================ */

.bunting {
  position: relative;
  padding: 6px 0 30px;
  overflow: hidden;
}
.bunting-string {
  position: absolute;
  top: 6px; left: 0; right: 0;
  border-top: 1.5px dashed var(--line);
}
.bunting-flags {
  position: relative;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 6px;
}
.flag {
  width: 22px; height: 30px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform: translateY(-1px) rotate(0deg);
}
.flag:nth-child(5n+1) { background: var(--coral-deep); }
.flag:nth-child(5n+2) { background: var(--turquoise-deep); }
.flag:nth-child(5n+3) { background: var(--mustard-deep); }
.flag:nth-child(5n+4) { background: var(--lilac-deep); }
.flag:nth-child(5n+5) { background: var(--mint-deep); }
.flag:nth-child(odd) { transform: translateY(-1px) rotate(-3deg); }
.flag:nth-child(even) { transform: translateY(2px) rotate(3deg); }

/* ============================================================
   HEADER / NAV
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1.5px dashed var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-shrink: 0;
}
.logo-main {
  font-family: var(--font-hand);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--coral-deep);
}
.logo-sub {
  font-family: var(--font-body);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0; padding: 0;
  font-weight: 600;
  font-size: 0.94rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  transition: transform 0.2s ease, background 0.2s ease, border-color .2s ease;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { transform: translateY(-2px); background: var(--mustard); border-color: var(--mustard-deep); }

.cart-badge {
  position: absolute;
  top: -6px; right: -6px;
  background: var(--coral-deep);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 700;
  min-width: 20px; height: 20px;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--cream);
}

.nav-toggle {
  display: none;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  border-radius: 50%;
  width: 44px; height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle svg { width: 19px; height: 19px; }

@media (max-width: 860px) {
  .nav-links {
    position: fixed;
    inset: 0 0 0 auto;
    top: 73px;
    height: calc(100vh - 73px);
    height: calc(100dvh - 73px);
    width: min(78vw, 320px);
    background: var(--cream-2);
    opacity: 1;
    flex-direction: column;
    padding: 32px 28px;
    gap: 22px;
    font-size: 1.1rem;
    transform: translateX(100%);
    transition: transform 0.35s ease;
    box-shadow: var(--shadow-lift);
    z-index: 60;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-toggle { display: inline-flex; }
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  padding: 52px 0 20px;
  position: relative;
}

.hero-grid {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  font-family: var(--font-hand);
  font-size: 1.25rem;
  color: var(--turquoise-deep);
  transform: rotate(-2deg);
  display: inline-block;
  margin-bottom: 6px;
}

.hero h1 {
  font-size: clamp(2.1rem, 7vw, 3.2rem);
  font-weight: 600;
}
.hero h1 em {
  font-style: normal;
  color: var(--coral-deep);
  position: relative;
}

.hero p.lead {
  font-size: 1.08rem;
  max-width: 46ch;
  margin-left: auto;
  margin-right: auto;
}

.hero-ctas {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}
.hero-badge {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  border: 1.5px dashed var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  white-space: nowrap;
}

/* ============================================================
   RUBROS (categorías)
   ============================================================ */

.section { padding: 50px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }

.rubros-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .rubros-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .rubros-grid { grid-template-columns: repeat(2, 1fr); } }

.rubro-card {
  background: var(--paper);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  border: 1.5px solid var(--line);
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color .25s ease;
}
.rubro-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); border-color: var(--ink); }
.rubro-card .icon-wrap {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.rubro-card .icon-wrap svg { width: 28px; height: 28px; }
.rubro-card h3 { font-size: 1rem; margin: 0; font-weight: 600; }

.rubro-card[data-rubro="bordados"] .icon-wrap { background: var(--coral); color: var(--coral-deep); }
.rubro-card[data-rubro="reutilizables"] .icon-wrap { background: var(--mint); color: var(--mint-deep); }
.rubro-card[data-rubro="juegos"] .icon-wrap { background: var(--mustard); color: var(--mustard-deep); }
.rubro-card[data-rubro="accesorios"] .icon-wrap { background: var(--lilac); color: var(--lilac-deep); }
.rubro-card[data-rubro="varios"] .icon-wrap { background: var(--turquoise); color: var(--turquoise-deep); }

/* ============================================================
   OFERTAS — cinta con scroll horizontal
   ============================================================ */

.ofertas-section { background: var(--cream-2); position: relative; }
.ofertas-scroll {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
}

/* ============================================================
   PRODUCT CARD
   ============================================================ */

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

.product-card {
  background: var(--paper);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--line);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color .25s ease;
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); border-color: var(--ink); }

.product-media {
  aspect-ratio: 4 / 3.2;
  position: relative;
  overflow: hidden;
  border-bottom: 1.5px dashed var(--line);
  background: var(--cream-2);
}
.ph-swatch {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.ph-icon { width: 32%; color: var(--white); opacity: 0.95; }
.ph-icon svg { width: 100%; height: 100%; }

.oferta-flag {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--coral-deep);
  color: var(--white);
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 3px 14px 5px;
  border-radius: 999px;
  transform: rotate(-5deg);
  box-shadow: 0 3px 8px rgba(0,0,0,0.10);
}

.product-info {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.product-rubro-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  font-weight: 700;
}
.product-info h3 {
  font-size: 1rem;
  margin: 0;
  font-weight: 600;
}
.product-desc {
  font-size: 0.85rem;
  margin: 0;
  color: var(--ink-soft);
  flex: 1;
}
.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}
.price { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.price-old { text-decoration: line-through; color: var(--ink-soft); font-size: 0.85rem; }

.add-btn {
  margin-top: 10px;
  width: 100%;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: transparent;
  padding: 10px 16px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, border-color .2s ease;
}
.add-btn svg { width: 16px; height: 16px; }
.add-btn:hover { background: var(--ink); color: var(--paper); }
.add-btn:active { transform: scale(0.97); }
.add-btn.added { background: var(--mint-deep); border-color: var(--mint-deep); color: var(--white); }

/* ============================================================
   FILTROS (catálogo)
   ============================================================ */

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}
.filter-chip {
  border: 1.5px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 9px 20px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color .2s ease;
}
.filter-chip.active,
.filter-chip:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  background: var(--cream-2);
  color: var(--ink);
  padding: 12px 0 26px;
  margin-top: 50px;
  position: relative;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.site-footer .logo-main { color: var(--coral-deep); }
.site-footer .logo-sub { color: var(--ink-soft); }
.site-footer p { color: var(--ink-soft); }
.site-footer h4 {
  font-family: var(--font-body);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--mustard-deep);
  margin-bottom: 14px;
  font-weight: 700;
}
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-links a:hover { color: var(--coral-deep); }
.footer-bottom {
  border-top: 1.5px dashed var(--line);
  padding-top: 20px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }

/* ============================================================
   PÁGINA DE CARRITO / CHECKOUT
   ============================================================ */

.cart-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 36px;
  align-items: flex-start;
}
@media (max-width: 900px) { .cart-layout { grid-template-columns: 1fr; } }

.cart-list { display: flex; flex-direction: column; gap: 16px; }

.cart-item {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
}
.cart-item .ph-swatch { border-radius: var(--radius-sm); aspect-ratio: 1; }
.cart-item .ph-icon { width: 44%; }

.cart-item-info h3 { font-size: 0.98rem; margin: 0 0 4px; font-weight: 600; }
.cart-item-info .product-rubro-label { display: block; margin-bottom: 4px; }

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.qty-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.qty-btn:hover { background: var(--mustard); }
.qty-value { min-width: 22px; text-align: center; font-weight: 700; }

.cart-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  justify-self: end;
}
.remove-link {
  font-size: 0.78rem;
  color: var(--coral-deep);
  font-weight: 700;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.remove-link:hover { text-decoration: underline; }

.empty-cart {
  text-align: center;
  padding: 60px 20px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-lg);
}
.empty-cart .ph-icon-lg { width: 80px; margin: 0 auto 16px; color: var(--coral-deep); }

/* resumen / checkout */
.summary-card {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  position: sticky;
  top: 100px;
  box-shadow: var(--shadow-soft);
}
.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.summary-row.total {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  border-top: 1.5px dashed var(--line);
  padding-top: 14px;
  margin-top: 14px;
}

.envio-note {
  background: var(--turquoise);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.82rem;
  color: var(--ink);
  margin: 14px 0 18px;
  border-left: 3px solid var(--turquoise-deep);
}

.field {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 0.82rem;
  font-weight: 700;
}
.field input,
.field textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--ink);
  transition: border-color 0.2s ease;
}
.field input:focus,
.field textarea:focus {
  border-color: var(--coral-deep);
  outline: none;
}
.field .error-msg {
  font-size: 0.76rem;
  color: var(--coral-deep);
  min-height: 1em;
}
.field.invalid input,
.field.invalid textarea { border-color: var(--coral-deep); }

.checkout-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }

/* ============================================================
   PÁGINA "COMPRA REALIZADA"
   ============================================================ */

.gracias-wrap {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding: 60px 24px 90px;
}
.gracias-stamp {
  width: 110px;
  margin: 0 auto 18px;
  color: var(--coral-deep);
}
.gracias-order {
  background: var(--paper);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: left;
  margin: 26px 0 30px;
}
.gracias-order .order-id {
  font-family: var(--font-hand);
  font-size: 1.25rem;
  color: var(--turquoise-deep);
  margin-bottom: 10px;
}
.gracias-order ul { list-style: none; padding: 0; margin: 0 0 12px; }
.gracias-order li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.92rem;
}
.gracias-cta { display: flex; flex-direction: column; gap: 12px; }

/* utilidades */
.mt-lg { margin-top: 32px; }
.text-center { text-align: center; }
