/* =====================================================================
   MercadoVivo — Tema premium e-commerce
   Paleta cálida y profunda · Tipografía: Inter · Iconos: Bootstrap Icons
   ===================================================================== */

:root {
  --bg: #f5f3ef;
  --surface: #ffffff;
  --ink: #141311;
  --ink-soft: #3a3733;
  --muted: #7b7670;
  --line: #e3e0da;
  --primary: #141311;
  --primary-ink: #141311;
  --primary-soft: #efede9;
  --green: #2e7d5b;
  --green-soft: #eaf2ec;
  --navy: #141311;
  --gold: #bfa36f;
  --shadow-sm: 0 1px 1px rgba(20, 19, 17, 0.06);
  --shadow-lg: 0 18px 40px -18px rgba(20, 19, 17, 0.18);
  --radius: 12px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-family: 'Playfair Display', Georgia, serif; font-weight: 600; letter-spacing: -0.01em; margin: 0; line-height: 1.2; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- Barra superior ---------- */
.topbar { background: var(--surface); color: var(--muted); border-bottom: 1px solid var(--line); font-size: 12.5px; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; min-height: 34px; }
.topbar a { color: var(--ink); font-weight: 600; }
.topbar a:hover { color: var(--primary); }

/* ---------- Cabecera principal ---------- */
.masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1030;
}
.masthead .wrap { display: flex; align-items: center; gap: 28px; min-height: 72px; }

.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.4rem; letter-spacing: -0.02em; color: var(--ink); }
.brand-mark {
  width: 56px; height: 56px; border-radius: 12px;
  background: var(--surface); color: var(--ink);
  display: grid; place-items: center; font-size: 0.95rem;
  overflow: hidden; border: 1px solid var(--line);
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand .accent { color: var(--ink); font-weight: 800; }

.search-wrap { flex: 1; max-width: 520px; }
.search-wrap form { display: flex; }
.search-wrap input {
  flex: 1; padding: 12px 16px; min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px 0 0 10px;
  font-size: 0.92rem; background: var(--bg); color: var(--ink);
  outline: none; transition: border-color 0.15s, background 0.15s;
}
.search-wrap input:focus { border-color: var(--ink); background: #fff; }
.search-wrap button {
  padding: 0 20px; border: 0; cursor: pointer;
  border-radius: 0 10px 10px 0;
  background: var(--surface); color: var(--ink); font-size: 1.05rem; border: 1px solid var(--line); border-left: 0;
}
.search-wrap button:hover { background: var(--primary-soft); color: var(--ink); }

.action-group { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn {
  position: relative; cursor: pointer;
  background: none; border: 1px solid var(--line);
  border-radius: 10px; width: 44px; height: 44px;
  display: grid; place-items: center; color: var(--ink);
  font-size: 1.2rem; transition: all 0.15s;
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }
.badge-count {
  position: absolute; top: -4px; right: -4px;
  background: var(--ink); color: #fff;
  font-size: 0.68rem; font-weight: 700;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 50%; display: none;
  align-items: center; justify-content: center;
}
.text-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 11px;
  font-weight: 600; font-size: 0.9rem;
}
.text-cta.solid { background: var(--navy); color: #fff; }
.text-cta.solid:hover { background: #2a2420; }
.text-link { color: var(--muted); font-size: 0.9rem; font-weight: 500; }
.text-link:hover { color: var(--primary); }

/* ---------- Categorías ---------- */
.cat-nav { background: var(--surface); border-bottom: 1px solid var(--line); }
.cat-nav .wrap { display: flex; gap: 4px; overflow-x: auto; }
.cat-nav a {
  padding: 13px 17px; font-size: 0.9rem; font-weight: 500;
  color: var(--muted); border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.cat-nav a:hover { color: var(--ink); }
.cat-nav a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- Breadcrumb ---------- */
.crumb { padding-top: 22px; font-size: 0.85rem; color: var(--muted); }
.crumb b { color: var(--ink); font-weight: 600; }

/* ---------- Hero overlay (carousel index.html) ---------- */
.hero-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 50px 40px; background: linear-gradient(transparent, rgba(0,0,0,0.8)); color: #fff; }
.hero-overlay h1 { font-family: 'Playfair Display', serif; font-size: 2.6rem; margin: 8px 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.12; }
.hero-overlay h1 .accent { color: #e3d8c4; font-weight: 400; }
.hero-overlay p { font-size: 1rem; margin-bottom: 18px; opacity: 0.85; max-width: 520px; font-weight: 300; line-height: 1.55; }
.hero-overlay .kicker { background: rgba(255,255,255,0.08); color: #e3d8c4; padding: 5px 14px; border-radius: 20px; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; border: 1px solid rgba(255,255,255,0.12); }
.hero-overlay .btn-gold { background: #fff; color: #111; padding: 11px 26px; border-radius: 10px; text-decoration: none; font-weight: 500; font-size: 0.88rem; display: inline-block; letter-spacing: 0.01em; }
.hero-overlay .btn-gold:hover { background: #e0e0e0; }
.hero-dots { position: absolute; bottom: 20px; right: 30px; display: flex; gap: 8px; z-index: 10; }
.hero-dots .dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.45); cursor: pointer; transition: all 0.3s; }
.hero-dots .dot.active { background: #fff; width: 26px; border-radius: 5px; }
.hero-arrows { position: absolute; top: 50%; left: 0; right: 0; transform: translateY(-50%); display: flex; justify-content: space-between; padding: 0 18px; z-index: 10; }
.hero-arrows .arrow { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25); color: #fff; width: 40px; height: 40px; border-radius: 50%; font-size: 1.4rem; cursor: pointer; transition: all 0.2s; display: grid; place-items: center; backdrop-filter: blur(4px); }
.hero-arrows .arrow:hover { background: rgba(255,255,255,0.3); }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.hero-stats .hs-item { background: #fff; border-radius: 12px; padding: 18px; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,0.04); border: 1px solid var(--line); }
.hero-stats .hs-item b { display: block; font-size: 1.3rem; color: var(--ink); margin-bottom: 4px; font-weight: 700; }
.hero-stats .hs-item span { font-size: 0.8rem; color: var(--muted); }
@media (max-width: 768px) {
  .hero-visual { height: 380px; }
  .hero-overlay { padding: 30px 22px; }
  .hero-overlay h1 { font-size: 1.6rem; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Hero genérico ---------- */
.hero {
  border-radius: var(--radius-lg); overflow: hidden; position: relative;
  background: #13120f; color: #fff; margin-top: 24px; padding: 54px 50px;
}
.hero .kicker {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14);
  padding: 6px 14px; border-radius: 100px;
  font-size: 0.76rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: #e3d8c4;
}
.hero h1 { font-family: 'Playfair Display', serif; font-size: clamp(28px, 4vw, 44px); font-weight: 700; line-height: 1.12; margin: 18px 0 14px; max-width: 560px; letter-spacing: -0.02em; }
.hero h1 .accent { color: #e3d8c4; }
.hero p { color: #b5afa6; max-width: 480px; font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn-gold {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff; font-weight: 500; padding: 12px 24px; border-radius: 10px;
  font-size: 0.88rem; letter-spacing: 0.01em; transition: all 0.2s;
}
.btn-gold:hover { background: #2a2724; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid rgba(255,255,255,0.2); color: #fff;
  padding: 12px 22px; border-radius: 10px; font-weight: 500; font-size: 0.88rem; transition: all 0.2s;
}
.btn-ghost:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.35); }
.hero .stats { display: flex; flex-wrap: wrap; gap: 44px; margin-top: 48px; color: #b5afa6; }
.hero .stats b { display: block; font-size: 1.6rem; color: #fff; font-weight: 700; }

/* ---------- Secciones ---------- */
.section { padding: 54px 0 8px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.section-head h2 { font-size: 1.6rem; }
.section-head h2 .accent { color: var(--primary); font-style: normal; }
.section-head .sub { color: var(--muted); font-size: 0.95rem; margin-top: 5px; }
.section-head a.more { color: var(--primary); font-weight: 600; font-size: 0.9rem; }
.section-head a.more:hover { text-decoration: underline; }

/* ---------- Tarjetas de producto ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(20,19,17,0.08); }
.thumb {
  position: relative; aspect-ratio: 4 / 5;
  display: grid; place-items: center;
  background: #eceae6;
  overflow: hidden;
}
.thumb svg { width: 45%; height: 45%; color: #9aa2ab; }
.prod-foto {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease;
}
.prod-foto.error { display: none; }
.card:hover .prod-foto { transform: scale(1.03); }
.badge-row { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; }
.badge { font-size: 0.65rem; font-weight: 500; letter-spacing: 0.05em; padding: 4px 9px; border-radius: 6px; background: rgba(20,19,17,0.8); color: rgba(255,255,255,0.95); }
.badge.sale { background: var(--gold); color: #1a1404; }
.wish-btn { margin-left: auto; width: 32px; height: 32px; border: 1px solid rgba(0,0,0,0.08); border-radius: 50%; background: rgba(255,255,255,0.9); color: var(--muted); backdrop-filter: blur(6px); box-shadow: 0 1px 2px rgba(0,0,0,0.04); font-size: 0.85rem; cursor: pointer; display: grid; place-items: center; transition: all 0.2s; }
.wish-btn:hover { color: var(--ink); border-color: var(--ink); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.seller { font-size: 0.72rem; color: var(--muted); font-weight: 500; }
.card-body h3 { font-size: 0.88rem; font-weight: 500; line-height: 1.35; color: var(--ink); letter-spacing: -0.01em; }
.price-muted { color: var(--muted); font-size: 0.72rem; text-decoration: line-through; margin-right: 6px; }
.price { font-size: 1rem; font-weight: 600; color: var(--ink); }
.iva-note { font-size: 0.72rem; color: var(--muted); margin-left: 8px; font-weight: 400; }
.price-row { display: flex; align-items: baseline; margin-top: 5px; flex-wrap: wrap; gap: 4px; }
.stock {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.7rem; font-weight: 500; color: var(--green);
}
.stock .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }
.add-btn {
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 12px; padding: 9px 14px; border-radius: 8px;
  border: 1px solid var(--ink); background: var(--surface); color: var(--ink);
  font-weight: 500; font-size: 0.82rem; letter-spacing: 0.01em; transition: all 0.2s;
}
.add-btn:hover { background: var(--ink); color: #fff; }
.add-btn.added { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- Características ---------- */
.features { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); margin-top: 58px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; gap: 14px; align-items: flex-start; }
.feature .ficon { font-size: 1.4rem; color: var(--primary); width: 44px; height: 44px; flex-shrink: 0; border-radius: 10px; background: var(--primary-soft); display: grid; place-items: center; }
.feature h4 { font-size: 0.95rem; margin-bottom: 4px; }
.feature p { margin: 0; font-size: 0.85rem; color: var(--muted); }

/* ---------- Carrito (modal) ---------- */
.cart-pill {
  background: var(--primary); color: #fff;
  font-size: 0.72rem; font-weight: 700;
  min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
}
.cart-thumb { width: 62px; height: 62px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; flex-shrink: 0; }
.cart-thumb svg { width: 60%; height: 60%; }
.cart-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-item h5 { font-size: 0.92rem; }
.qty { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; }
.qty button { border: 0; background: none; cursor: pointer; font-size: 1rem; color: var(--muted); padding: 0 2px; }
.qty button:hover { color: var(--primary); }
.remove-btn { color: var(--muted); font-size: 0.82rem; }

/* ---------- Resumen del carrito (footer) ---------- */
.cart-summary {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 18px 20px 20px;
}
.sum-row {
  display: flex; justify-content: space-between;
  font-size: 0.88rem; color: var(--muted);
  padding: 4px 0;
}
.sum-row strong { color: var(--ink); font-weight: 700; }
.sum-row.total-row {
  border-top: 1px dashed var(--line);
  margin-top: 8px; padding-top: 12px;
  align-items: baseline;
}
.sum-row.total-row strong { font-size: 1.25rem; font-weight: 800; }
.sum-row small.note { color: #a54a2b; display: flex; align-items: center; gap: 6px; }
.btn-checkout {
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 14px; border-radius: 10px; border: 1px solid var(--ink);
  background: var(--surface); color: var(--ink); font-weight: 500; font-size: 0.9rem; margin-top: 14px;
  transition: all 0.2s; letter-spacing: 0.01em;
}
.btn-checkout:hover { background: var(--ink); color: #fff; }
.cart-actions { display: flex; gap: 10px; margin-top: 10px; }
.cart-trust {
  font-size: 0.78rem; color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px; margin: 12px 0;
}
.btn-ghost-line {
  flex: 1; cursor: pointer; padding: 10px; border-radius: 10px;
  border: 1px solid var(--line); background: none; color: var(--muted);
  font-weight: 600; font-size: 0.85rem;
}
.btn-ghost-line:hover { border-color: var(--primary); color: var(--primary); }
.btn-empty { flex: 1; cursor: pointer; padding: 10px; border-radius: 10px; border: 0; background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; font-size: 0.85rem; }
.btn-empty:hover { background: #f0dfd1; }

/* ---------- Planes ---------- */
.plans { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px; position: relative; display: flex; flex-direction: column; }
.plan.featured { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.plan-tag { position: absolute; top: -12px; left: 28px; background: var(--primary); color: #fff; font-size: 0.72rem; font-weight: 700; padding: 5px 12px; border-radius: 8px; }
.plan h3 { font-size: 1.05rem; }
.plan .psub { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }
.plan .pnum { font-size: 2.1rem; font-weight: 750; letter-spacing: -0.02em; margin: 18px 0 2px; }
.plan .pnum small { font-size: 0.85rem; color: var(--muted); font-weight: 400; }
.plan ul { list-style: none; padding: 0; margin: 20px 0 26px; flex: 1; }
.plan li { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 0.9rem; color: var(--ink-soft); }
.plan li .check { width: 20px; height: 20px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-size: 0.72rem; flex-shrink: 0; }
.btn-plan { display: block; width: 100%; text-align: center; padding: 13px; border-radius: 10px; font-weight: 700; font-size: 0.95rem; border: 1px solid var(--navy); color: var(--navy); background: none; cursor: pointer; transition: all 0.15s; }
.btn-plan:hover { background: var(--navy); color: #fff; }
.btn-plan.filled { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-plan.filled:hover { background: var(--primary-ink); }

/* ---------- Panel vendedor ---------- */
.sell-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 34px; margin-top: 26px; max-width: 620px; }
.sell-card h3 { font-size: 1.25rem; margin-bottom: 20px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 7px; }
.field input, .field select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 0.92rem; background: var(--bg);
  color: var(--ink); outline: none; font-family: inherit;
}
.field input:focus, .field select:focus { border-color: var(--primary); background: #fff; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.btn-submit { display: block; width: 100%; padding: 14px; border-radius: 10px; border: 0; background: var(--green); color: #fff; font-weight: 700; font-size: 1rem; cursor: pointer; margin-top: 6px; }
.btn-submit:hover { background: #256b4d; }
.alert-success { background: var(--green-soft); color: var(--green); border-radius: 10px; padding: 12px 14px; font-size: 0.9rem; margin-top: 14px; display: none; }

/* ---------- CTA / Footer ---------- */
.cta-band { border-radius: var(--radius-lg); overflow: hidden; background: #0f0e0c; color: #fff; padding: 56px 48px; margin-top: 58px; }
.cta-band h2 { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; }
.cta-band p { max-width: 520px; color: #b5afa6; margin: 12px 0 26px; font-weight: 300; }
.cta-band .btn-gold { display: inline-flex; }
.footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: 58px; padding: 48px 0 30px; font-size: 0.88rem; color: var(--muted); }
.footer .cols { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.footer h5 { color: var(--ink); font-size: 0.85rem; margin-bottom: 14px; font-weight: 600; letter-spacing: 0.02em; }
.footer a { color: var(--muted); display: block; padding: 3px 0; font-size: 0.85rem; transition: color 0.15s; }
.footer a:hover { color: var(--ink); }
.footer .bottom { border-top: 1px solid var(--line); margin-top: 36px; padding-top: 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 0.8rem; color: var(--muted); }

/* ---------- Icono inline ---------- */
.ic { display: inline-flex; align-items: center; justify-content: center; }
.ic svg { width: 1em; height: 1em; }

/* ---------- Modal propio (centrado, sin Bootstrap) ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1500;
  background: rgba(18, 15, 12, 0.55);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  width: 100%; max-width: 480px; max-height: 90vh;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.18s ease;
  font-size: 15px;
}
@keyframes modalIn { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-small { max-width: 400px; }
.mhead {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.m-title { font-size: 1.05rem; display: flex; align-items: center; gap: 10px; }
.modal-close { background: none; border: 0; cursor: pointer; font-size: 1.3rem; color: var(--muted); line-height: 1; padding: 4px; }
.modal-close:hover { color: var(--primary); }
.mbody { padding: 6px 20px 14px; overflow-y: auto; }
.mbody::-webkit-scrollbar { width: 8px; }
.mbody::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
.big-check { width: 64px; height: 64px; margin: 0 auto; font-size: 2.4rem; color: var(--green); display: grid; place-items: center; background: var(--green-soft); border-radius: 50%; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 10px;
  box-shadow: var(--shadow-lg); font-size: 0.9rem; opacity: 0;
  transition: all 0.3s ease; z-index: 1200; white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

@media (max-width: 720px) {
  .action-group .text-cta, .action-group .text-link { display: none; }
  .hero, .cta-band { padding: 34px 24px; }
  .hero .stats { gap: 26px; }
  .search-wrap { max-width: none; }
  .brand { font-size: 1.25rem; }
}