/* ============ Chilenayana — paleta de maracuyá ============ */
:root {
  --skin: #2f5d3a;      /* verde principal */
  --skin-2: #3f7449;
  --pulp: #f4c542;       /* amarillo maracuyá */
  --pulp-2: #dda900;
  --chile: #c93b2f;      /* chile */
  --paper: #fffdf5;      /* crema */
  --tint: #f5f0dc;
  --ink: #243026;
  --muted: #667064;
  --line: #ded9c7;
  --wa: #1c9b4f;
  --radius: 14px;
  --font-head: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Figtree', 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .5em; color: var(--skin); }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -.02em; }
h2, .h2 { font-family: var(--font-head); font-size: clamp(1.6rem, 3.5vw, 2.2rem); font-weight: 700; letter-spacing: -.01em; color: var(--skin); margin: 0 0 .4em; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--pulp); outline-offset: 2px; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 680px; }
.section { padding: 56px 0; }
.section.alt { background: var(--tint); }
.section-title { max-width: 560px; margin-bottom: 32px; }
.section-title p { color: var(--muted); margin: 0; }
.center { text-align: center; }
.mt { margin-top: 36px; }
.note { font-size: .9rem; color: var(--muted); margin: 14px 0 0; }

/* ============ Botones ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 24px; border: 2px solid transparent; border-radius: 999px;
  font: 700 1rem var(--font-body); text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--pulp); color: var(--skin); }
.btn-primary:hover { background: var(--pulp-2); }
.btn-ghost { background: transparent; color: var(--skin); border-color: var(--skin); }
.btn-ghost:hover { background: var(--skin); color: #fff; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.6); }
.hero .btn-ghost:hover { background: #fff; color: var(--skin); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: #167f40; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .6; cursor: wait; }
.link-btn { background: none; border: 0; padding: 0 0 0 8px; color: var(--skin-2); font: 600 .9rem var(--font-body); text-decoration: underline; cursor: pointer; }
.link-btn.danger { color: var(--chile); padding: 0; }

/* ============ Cabecera ============ */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--skin); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font: 800 1.35rem var(--font-head); letter-spacing: -.01em; }
.logo img { height: 36px; width: auto; }
.navlinks { display: flex; align-items: center; gap: 6px; }
.navlinks a { color: #e9def2; text-decoration: none; font-weight: 600; padding: 8px 14px; border-radius: 999px; }
.navlinks a:hover, .navlinks a.active { color: #fff; background: rgba(255,255,255,.12); }
.navlinks a.cart-pill { background: var(--pulp); color: var(--skin); margin-left: 6px; }
.navlinks a.cart-pill:hover { background: var(--pulp-2); }
.cart-count { display: inline-block; min-width: 22px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--skin); color: #fff; font-size: .8rem; text-align: center; }
.cart-count.has-items { background: var(--chile); }
.menu-btn { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.menu-btn span { display: block; width: 24px; height: 2px; background: #fff; margin: 5px 0; }

/* ============ Hero ============ */
.hero { background: var(--skin); color: #fff; padding: 56px 0; overflow: hidden; }
.hero h1 { color: #fff; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero-copy p { font-size: 1.1rem; color: #e9def2; max-width: 460px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-visual { display: flex; justify-content: center; }
.hero-visual img { max-height: 380px; width: auto; object-fit: contain; }
.hero-visual:empty, .hero-visual:not(:has(img)) { display: none; }

/* ============ Franja de datos ============ */
.strip { background: var(--pulp); color: var(--skin); }
.strip-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding-top: 18px; padding-bottom: 18px; }
.strip-grid div { display: flex; flex-direction: column; line-height: 1.3; }
.strip-grid b { font-weight: 700; }
.strip-grid span { font-size: .88rem; opacity: .85; }

/* ============ Productos ============ */
.products { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; max-width: 860px; }
.product-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.product-img {
  position: relative; aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--pulp) 0%, #f08a24 55%, var(--chile) 100%);
  display: flex; align-items: center; justify-content: center;
}
.product-img::after { content: '🌶'; font-size: 3.5rem; position: absolute; z-index: 0; }
.product-img img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; z-index: 2; top: 12px; left: 12px; background: var(--skin); color: #fff; font-size: .8rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.product-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.product-body p { color: var(--muted); }
.heat { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.heat i { width: 14px; height: 14px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--line); }
.heat i.on { background: var(--chile); }
.heat small { margin-left: 8px; color: var(--muted); font-size: .85rem; }
.price { font: 800 1.4rem var(--font-head); color: var(--skin); margin-top: auto; padding-bottom: 14px; }
.price small { font: 500 .9rem var(--font-body); color: var(--muted); }
.buy-row { display: flex; align-items: center; gap: 12px; }
.buy-row .btn { flex: 1; padding: 12px 16px; }

/* Contador + / − */
.stepper { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: 999px; background: #fff; }
.stepper button { width: 40px; height: 40px; border: 0; background: none; font: 700 1.3rem var(--font-body); color: var(--skin); cursor: pointer; border-radius: 50%; }
.stepper button:hover { background: var(--tint); }
.stepper .qty-val { min-width: 32px; text-align: center; font-weight: 700; }

/* ============ Pasos ============ */
.steps { list-style: none; counter-reset: paso; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.steps li { counter-increment: paso; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.steps li::before { content: counter(paso); display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--skin); color: var(--pulp); font: 800 1rem var(--font-head); margin-bottom: 12px; }
.steps p { color: var(--muted); margin: 0; }

/* ============ Nosotros ============ */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.about-copy p { color: var(--muted); }
.about-visual img { width: 100%; max-height: 380px; object-fit: cover; border-radius: var(--radius); }
.about-visual:not(:has(img)) { display: none; }
.about-grid:has(.about-visual:not(:has(img))) { grid-template-columns: 1fr; max-width: 620px; }

/* ============ Paneles, líneas ============ */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.line { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line.total { font-size: 1.15rem; font-weight: 800; border-bottom: 0; border-top: 2px solid var(--skin); margin-top: 6px; padding-top: 14px; color: var(--skin); }

/* ============ Carrito ============ */
.cart-layout, .checkout-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; align-items: start; margin-top: 20px; }
.cart-items { display: flex; flex-direction: column; gap: 14px; }
.cart-row { display: grid; grid-template-columns: 72px 1fr auto auto; gap: 8px 16px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.cart-thumb { width: 72px; height: 72px; border-radius: 10px; overflow: hidden; background: linear-gradient(135deg, var(--pulp), var(--chile)); }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-info h3 { margin: 0; font-size: 1rem; }
.cart-info p { margin: 0; color: var(--muted); font-size: .9rem; }
.cart-line-total { font-weight: 800; min-width: 90px; text-align: right; }
.cart-row .link-btn { grid-column: 4; justify-self: end; }
.cart-summary { position: sticky; top: 84px; }
.cart-summary .btn { margin-top: 16px; }
.empty { text-align: center; padding: 40px 20px; }
.empty p { color: var(--muted); }

/* ============ Formulario ============ */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 12px 14px; font: 500 1rem var(--font-body); color: var(--ink);
  background: #fff; border: 2px solid var(--line); border-radius: 10px;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--skin-2); }
.field input:user-invalid { border-color: var(--chile); }
.status { margin-top: 14px; font-weight: 600; }
.status.error { color: var(--chile); }

/* ============ Confirmación ============ */
.confirm h3 { margin-top: 28px; }
.ok-mark { width: 56px; height: 56px; margin: 0 0 12px; border-radius: 50%; background: var(--wa); color: #fff; font-size: 1.8rem; display: flex; align-items: center; justify-content: center; }
.code { font-family: var(--font-head); background: var(--pulp); color: var(--skin); padding: 2px 10px; border-radius: 8px; white-space: nowrap; }
.bank { background: var(--tint); border-radius: 10px; padding: 8px 16px; margin-bottom: 8px; }
.bank .line { border-color: var(--line); }

/* ============ Pie ============ */
.site-footer { background: var(--skin); color: #d9cbe6; padding: 44px 0 0; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 32px; }
.footer-grid strong { display: block; color: #fff; margin-bottom: 10px; font-family: var(--font-head); }
.footer-brand { font-size: 1.3rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { color: var(--pulp); }
.copyright { margin-top: 32px; padding: 18px 20px; border-top: 1px solid rgba(255,255,255,.15); font-size: .88rem; }

/* ============ Aviso flotante ============ */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--skin); color: #fff; padding: 12px 22px; border-radius: 999px;
  font-weight: 600; box-shadow: 0 8px 24px rgba(34,19,41,.3);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: 92vw; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ Móvil ============ */
@media (max-width: 860px) {
  .hero-grid, .about-grid, .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
  .hero { padding: 40px 0; }
  .hero-visual img { max-height: 260px; }
  .strip-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
}
@media (max-width: 720px) {
  .menu-btn { display: block; }
  .navlinks { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--skin); padding: 8px 20px 20px; gap: 4px; }
  body.nav-open .navlinks { display: flex; }
  .navlinks a.cart-pill { margin: 6px 0 0; text-align: center; }
  .products { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .cart-row { grid-template-columns: 60px 1fr auto; }
  .cart-thumb { width: 60px; height: 60px; }
  .cart-info { grid-column: 2 / 4; }
  .cart-row .stepper { grid-column: 1 / 3; justify-self: start; }
  .cart-line-total { grid-column: 3; }
  .cart-row .link-btn { grid-column: 1 / 4; justify-self: start; }
  .section { padding: 40px 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}


/* ============ Mayoreo ============ */
.wholesale-note {
  margin: 10px 0 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--tint);
  color: var(--skin);
  font-weight: 700;
  font-size: .9rem;
}
.wholesale-note.show { display: block; }
.wholesale-product-note {
  color: var(--skin);
  font-size: .88rem;
  font-weight: 700;
  margin-top: -6px;
  margin-bottom: 12px;
}
