/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── TOKENS ────────────────────────────────────────────────── */
:root {
  --bg:        #0D0D0D;
  --lime:      #C8FF00;
  --coral:     #FF4D2E;
  --sky:       #00C2FF;
  --violet:    #8B5CF6;
  --pink:      #FF2D78;
  --amber:     #FFAA00;
  --white:     #F5F5F0;
  --surface:   #161616;
  --border:    #2A2A2A;
  --muted:     #666;
  --wpp:       #25D366;
  --color-bg: #F5EFE6;          /* fondo claro cálido */
  --color-surface: #FFFFFF;
  --doradofuerte: #C9922A;
  --doradoliviano: #F0B942;
  --color-text: #2E2E2E;
  --color-text-light: #6B6B6B;

  --color-accent: #C89B7B;      /* detalle elegante */

  --font-disp: 'Syne', sans-serif;
  --font-body: 'Bricolage Grotesque', sans-serif;

  /* per-category accent — cycled in JS via data-accent */
  --accent: var(--lime);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 300;
  overflow-x: hidden;
  cursor: default;
}

/* ── NOISE OVERLAY ─────────────────────────────────────────── */
.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: .028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 128px;
}

/* ── HEADER ────────────────────────────────────────────────── */
header {
  position: relative;
  z-index: 2;
  width: 100%;
  background: transparent;
  border-bottom: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
  /* esto lo saca del flujo normal del hero y lo pega arriba */
  position: absolute;
  top: 0;
  left: 0;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo { 
  display: flex; align-items: center; gap: .8rem;
}

.logo-mark {
  width: 38px; height: 38px;
  background: var(--doradoliviano);
  color: #000;
  font-family: var(--font-disp);
  font-weight: 800;
  font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}

.logo-text { display: flex; flex-direction: column; line-height: 1; }
.l1 {
  font-family: var(--font-disp);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--white);
}
.l2 {
  font-size: .62rem;
  letter-spacing: .3em;
  color: var(--muted);
  text-transform: uppercase;
}

.wpp-pill {
  display: flex; align-items: center; gap: .5rem;
  background: var(--wpp);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 600;
  padding: .55rem 1.2rem;
  border-radius: 99px;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 0 0 0 rgba(37,211,102,0);
}
.wpp-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(37,211,102,.4);
}

/* ── HERO ──────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 4rem 0;
  overflow: hidden;
  background-size: cover;
  background-position: 80% center;
  background-repeat: no-repeat;
  background-color: #111;
  image-rendering: high-quality;
  
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0,0,0,.85) 0%,
    rgba(0,0,0,.5) 45%,
    rgba(0,0,0,0) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: left;
  padding: 2rem 3rem 4rem;
  max-width: 60%;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.05rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: white;
  z-index: 2;
  animation: bounce 2s ease-in-out infinite;
  text-align: center;
}

.scroll-sub {
  display: block;
  font-size: .65rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  margin-top: .3rem;
}

h1 {
  font-family: var(--font-disp);
  font-weight: 800;
  line-height: .95;
  letter-spacing: -.02em;
}

.line1 {
  display: block;
  font-size: clamp(1.2rem, 1vw, 3rem);
  color: var(--doradofuerte);
  font-weight: 700;
  animation: fadeUp .6s .1s ease both;
}

.line2 {
  display: block;
  font-size: clamp(1.8rem, 2.5vw, 3rem);
  color: white;
  animation: fadeUp .6s .2s ease both;
  margin-bottom: 0.5rem;
}

.hero-content p:first-of-type {
  font-size: .85rem;
  color: var(--doradoliviano);
  line-height: 1.8;
  font-weight: 700;
  animation: fadeUp .6s .4s ease both;
  margin-bottom: 1rem;
}

.hero-slogan {
  margin-top: 1rem;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--doradofuerte);
  line-height: 1.4;
  font-weight: 700;
}

.hero-slogan strong {
  color: var(--white);
  font-weight: 700;
}

.hero-features {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding-top: 1.2rem;
}

.hero-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  font-size: .72rem;
  font-weight: 600;
  text-align: center;
  color: white;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.hf-icon {
  font-size: 1.4rem;
}

@keyframes bounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(6px); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── MOBILE ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hero {
    background-position: center;
    justify-content: center;
    min-height: 100svh;
    padding: 5rem 0 3rem;
  }
    .line2 {
    font-size: 1.6rem;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .hero-content {
    max-width: 100%;
    padding: 2rem 1rem;
  }
  .hero-overlay {
    background: linear-gradient(
      to bottom,
      rgba(0,0,0,.6) 0%,
      rgba(0,0,0,.85) 100%
    );
  }
  .hero-features {
    gap: 1rem;
  }
  .hero-feature {
    font-size: .62rem;
  }
}
/* ── FILTERS BAR ───────────────────────────────────────────── */
.filters-bar {
  position:static;
  top: 64px;
  z-index: 400;
  background: rgba(13,13,13,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.filters-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .55rem 1rem;
  flex: 0 0 220px;
  transition: border-color .2s;
}
.search-box:focus-within { border-color: var(--amber); }

.search-box span {
  font-size: 1.2rem;
  color: var(--muted);
  line-height: 1;
}

#buscador {
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-family: var(--font-body);
  font-size: .88rem;
  width: 100%;
}
#buscador::placeholder { color: var(--muted); }

.pills { display: flex; gap: .45rem; flex-wrap: wrap; }

.pill {
  padding: .45rem 1.1rem;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 400;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
}
.pill:hover { border-color: var(--doradoliviano); color: var(--doradoliviano); }
.pill.active {
  background: var(--doradofuerte);
  border-color: var(--doradofuerte);
  color: #000;
  font-weight: 700;
}

/* ── MAIN / GRID ───────────────────────────────────────────── */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

.grid-header {
  margin-bottom: 1.5rem;
}

#count-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--white);
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.3rem;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}

/* ── CARD ──────────────────────────────────────────────────── */
.card {
  background: #FDFAF6;
  display: flex;
  border-radius: 16px;
  border: 3px solid #C9922A80;;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: filter .3s cubic-bezier(.4, 0, .2, 1), border-color .3s;
  animation: cardIn .4s ease both;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.08));
}

.card:hover {
  border-color: #C9922A;
  filter: 
    drop-shadow(0 20px 40px rgba(0,0,0,.18))
    drop-shadow(0 4px 12px rgba(201,146,42,.25))
    drop-shadow(0 0 1px #C9922A);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #F0B942, #C9922A);;
  opacity: 0;
  transition: opacity .3s;
  z-index: 3;
}

.card:hover::before {
  opacity: 1;
}

@keyframes cardIn {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}

.card-topbar { display: none; }

/* foto del producto */
.card-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #EAE7E2 ;
  position: relative;
  flex-shrink: 0;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
}


.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;

  transition: transform .4s ease;
}
.card:hover .card-photo img { transform: scale(1.05); }

.card-photo::after {
  content: attr(data-fallback);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  opacity: 0;
  transition: opacity .2s;
}
.card-photo.img-error::after { opacity: 1; }

/* BADGE */
.card-badge {
  position: absolute;
  top: .8rem;
  left: .8rem;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .3rem .7rem;
  border-radius: 6px;
  z-index: 2;
}
.card-badge.mas-vendido { background: black; color: white; }
.card-badge.oferta      { background: black; color: white; }
.card-badge.nuevo       { background: black; color: white; }
.card-badge.ultimos     { background: black; color: white;}

.card-inner {
  padding: 1.1rem 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  flex: 1;
}

.card-name {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: #111;
}

.card-name::after {
  content: '';
  display: block;
  width: 32px;
  height: 2px;
  background: #111;
  margin-top: .5rem;
}

.card-bottom {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.card-price {
  display: flex;
  flex-direction: column;
}

.price-num {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 1.6rem;
  color: #111;
  line-height: 1;
}

.price-unit {
  font-size: .62rem;
  color: var(--muted);
  margin-top: .25rem;
  text-transform: uppercase;
  letter-spacing: .1em;
}



/* ── EMPTY ─────────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 5rem 0;
}
.empty-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.empty p { color: var(--muted); font-size: .95rem; }

/* ── FOOTER ────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  text-align: center;
}

.footer-inner { max-width: 600px; margin: 0 auto; }

.footer-logo {
  font-family: var(--font-disp);
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--coral), var(--sky), var(--lime));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: .8rem;
}

.footer-links { margin-bottom: .6rem; }
.footer-links a {
  color: var(--wpp);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
}
.footer-links a:hover { text-decoration: underline; }

footer p {
  font-size: .75rem;
  color: var(--muted);
  line-height: 1.8;
}

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 600px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── QUANTITY CONTROL ────────────────────────────────────────── */
.card-actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.card-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.qty-control {
  display: flex;
  align-items: center;
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.15));
  transition: filter .3s;
}

.qty-control:hover {
  filter: 
    drop-shadow(0 4px 12px rgba(201,146,42,.35))
    drop-shadow(0 0 1px #C9922A);
}

.qty-btn {
  width: 32px;
  height: 34px;
  background: #1a1a1a;
  border: none;
  color: var(--white);
  font-size: 1rem;
  cursor: pointer;
  transition: background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-btn:hover { background: #2a2a2a; }

.qty-input {
  width: 42px;
  height: 34px;
  background: #111;
  border: none;
  border-left: 1px solid #333;
  border-right: 1px solid #333;
  color: var(--white);
  font-family: var(--font-body);
  font-size: .85rem;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.add-btn {
  width: 100%;
  padding: .75rem;
  background: #222;
  color: white;
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  filter: drop-shadow(0 2px 6px rgba(240,185,66,.2));
  transition: filter .3s, transform .2s;
}
.add-btn:hover {
  background: var(--doradofuerte);
  color: #000;
  filter: 
    drop-shadow(0 6px 16px rgba(240,185,66,.4))
    drop-shadow(0 0 1px #F0B942);
  transform: translateY(-2px);
}
.add-btn.added { background: #25D366; color: #fff; }
/* ── CARRITO FLOTANTE ────────────────────────────────────────── */
.carrito-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(680px, 100%);
  background: #111;
  border: 1px solid #2a2a2a;
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  z-index: 1000;
  box-shadow: 0 -8px 40px rgba(0,0,0,.6);
  /* oculto por defecto */
  translate: 0 100%;
  transition: translate .35s cubic-bezier(.4,0,.2,1);
}
 
.carrito-bar.visible {
  translate: 0 0;
}
 
.carrito-bar.expanded .carrito-body {
  max-height: 340px;
}
 
.carrito-bar.expanded .carrito-chevron {
  transform: rotate(180deg);
}
 
.carrito-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.carrito-bar.expanded .carrito-header {
  border-bottom-color: var(--border);
}
 
.carrito-header-left {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-family: var(--font-disp);
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
}
 
.carrito-badge {
  background: var(--lime);
  color: #000;
  font-family: var(--font-body);
  font-size: .7rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: 99px;
  min-width: 20px;
  text-align: center;
}
 
.carrito-chevron {
  font-size: .75rem;
  color: var(--muted);
  transition: transform .3s;
}
 
.carrito-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s cubic-bezier(.4,0,.2,1);
}
 
.carrito-lista {
  padding: .8rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-height: 200px;
  overflow-y: auto;
}
 
.carrito-item {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: .8rem;
  font-size: .82rem;
  padding: .4rem 0;
  border-bottom: 1px solid var(--border);
}
.carrito-item:last-child { border-bottom: none; }
 
.ci-nombre { color: var(--white); }
.ci-cant   { color: var(--muted); white-space: nowrap; }
.ci-precio { color: var(--lime); font-weight: 600; white-space: nowrap; }
 
.ci-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: .75rem;
  padding: .2rem .4rem;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.ci-remove:hover { color: var(--coral); background: rgba(255,77,46,.1); }
 
.carrito-footer {
  padding: .8rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
 
.carrito-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .85rem;
  color: var(--muted);
}
 
.carrito-total {
  font-family: var(--font-disp);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
}
 
.carrito-wpp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .85rem;
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s, transform .15s;
}
.carrito-wpp-btn:hover { opacity: .9; transform: translateY(-1px); }

.descuento-bar-wrap {
  margin-bottom: .5rem;
}

.desc-info {
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: .4rem;
}
.desc-info strong { color: var(--white); }

.desc-ok {
  color: var(--lime);
  font-weight: 600;
}
.desc-ok strong { color: var(--lime); }

.desc-track {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.desc-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--lime), #88ff00);
  border-radius: 99px;
  transition: width .4s ease;
}

/* ── CONFETI & DESCUENTO NOTIF ──────────────────────────────── */
.descuento-notif {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: linear-gradient(135deg, white, white);
  color: #000;
  font-family: var(--font-disp);
  font-size: 1.1rem;
  font-weight: 700;
  padding: .9rem 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(201,146,42,.5);
  z-index: 9999;
  opacity: 0;
  transition: opacity .4s, transform .4s;
  pointer-events: none;
  white-space: nowrap;
}
.descuento-notif.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.desc-ahorro {
  font-size: .78rem;
  color: var(--lime);
  text-align: right;
  margin-top: .2rem;
}

@keyframes confetiFall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.ci-sinpromo {
  font-size: .68rem;
  color: #FF4D2E;
  padding: 0 0 .4rem .2rem;
  margin-top: -.3rem;
}

@keyframes badgeBounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4); }
  70%  { transform: scale(.9); }
  100% { transform: scale(1); }
}

.carrito-badge.bump {
  animation: badgeBounce .4s ease;
}