@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Baloo+2:wght@500;600;700;800&display=swap');

:root {
  --green: #1aa05a;        /* verde header (marca) */
  --green-dark: #15894c;
  --navy: #2b3a52;         /* texto oscuro azulado de la marca */
  --blue: #3B9BE8;         /* celeste links */
  --blue-band: #4aa3e8;    /* banda celeste secciones */
  --amber: #f5a623;
  --coral: #ff6b5d;
  --cream: #ffffff;
  --soft: #f4f8fb;
  --ink: #2b3a52;
  --muted: #7b8794;
  --line: #e6edf2;
  --ok: #1aa05a;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 14px;
  --shadow: 0 6px 22px rgba(43,58,82,.10);
  --font-display: 'Baloo 2', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

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

/* Header */
header.topbar {
  position: sticky; top: 0; z-index: 50;
  background: #fff; color: var(--ink);
  box-shadow: 0 2px 12px rgba(43,58,82,.06);
}
.topbar-green { background: var(--green); color: #fff; font-size: 14px; font-weight: 600; }
.topbar-green .container { display: flex; justify-content: flex-end; gap: 16px; height: 40px; align-items: center; }
.topbar-green a { opacity: .95; }
.topbar .container { display: flex; align-items: center; gap: 24px; height: 84px; }
.logo { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -.3px; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.logo .ele { font-size: 34px; line-height: 1; }
.logo .logo-img { height: 40px; width: auto; display: block; }
.logo span { color: var(--green); }
.search-box { margin-left: auto; display: flex; align-items: center; background: var(--soft); border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 18px; min-width: 280px; }
.search-box input { border: none; background: none; flex: 1; padding: 8px 0; }
.search-box input:focus { outline: none; }
.search-box button { background: var(--blue); color: #fff; border: none; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; }
nav.main { display: flex; gap: 22px; align-items: center; font-weight: 700; }
nav.main a { color: var(--blue); transition: color .2s; }
nav.main a:hover { color: var(--green); }
.cart-btn { position: relative; cursor: pointer; border: 1.5px solid var(--blue); color: var(--blue); border-radius: 999px; padding: 9px 18px; font-weight: 700; }
.cart-count {
  position: absolute; top: -8px; right: -10px;
  background: var(--coral); color: #fff; font-size: 11px;
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700;
}
/* barra de categorias */
.catbar { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.catbar .container { display: flex; gap: 26px; height: 52px; align-items: center; font-weight: 700; overflow-x: auto; }
.catbar a { color: var(--blue); white-space: nowrap; }
.catbar a:hover { color: var(--green); }
/* banda promo navy */
.promo-band { background: var(--navy); color: #fff; text-align: center; padding: 11px; font-weight: 600; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--green); color: #fff;
  border: none; border-radius: 999px; padding: 11px 22px;
  font-family: var(--font-body); font-weight: 800; font-size: 15px;
  cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(26,160,90,.30); background: var(--green-dark); }
.btn.blue { background: var(--blue); }
.btn.blue:hover { box-shadow: 0 6px 18px rgba(59,155,232,.30); background: #2f8fd8; }
.btn.amber { background: var(--amber); color: #fff; }
.btn.ghost { background: transparent; border: 1.5px solid currentColor; color: var(--blue); }
.btn.ghost:hover { background: var(--soft); box-shadow: none; }
.btn.sm { padding: 8px 16px; font-size: 13px; }
.btn.full { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* Grid de productos */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.card {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .2s; display: flex; flex-direction: column;
  position: relative;
}
.card:hover { transform: translateY(-4px); }
.card .fav {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.85); backdrop-filter: blur(2px);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  font-size: 18px; line-height: 1; display: grid; place-items: center;
  color: var(--coral); transition: transform .15s, background .15s;
}
.card .fav:hover { transform: scale(1.12); background: #fff; }
.card .fav.on { background: #fff; }
.card .thumb {
  aspect-ratio: 1/1; background: #fff; border-bottom: 1px solid var(--line);
  display: grid; place-items: center; font-size: 56px; color: var(--blue); padding: 14px;
}
.card .thumb img { width: 100%; height: 100%; object-fit: contain; }
.card .body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--ink); }
.card .price { font-family: var(--font-display); font-weight: 800; font-size: 21px; color: var(--ink); }
.card .price-ef { color: var(--green); font-size: 13px; font-weight: 700; }
.card .meta { font-size: 12px; color: var(--muted); margin-top: auto; }
.tag {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .4px;
}
.tag.camino { background: #fef3c7; color: var(--warn); }
.tag.reservado { background: #fee2e2; color: var(--bad); }
.tag.venta { background: #dcfce7; color: var(--ok); }
.tag.pendiente { background: #e0e7ff; color: var(--blue); }

/* Secciones */
section.block { padding: 56px 0; }
.section-title { font-family: var(--font-display); font-size: 34px; font-weight: 900; margin-bottom: 6px; letter-spacing: -.5px; }
.section-sub { color: var(--muted); margin-bottom: 28px; }

/* Hero por defecto */
.hero { padding: 80px 0; text-align: center; }
.hero h1 { font-family: var(--font-display); font-size: clamp(36px,6vw,68px); font-weight: 900; line-height: 1.05; letter-spacing: -1.5px; }
.hero p { font-size: 20px; opacity: .85; margin: 18px 0 30px; }

/* Modal */
.modal-bg {
  position: fixed; inset: 0; background: rgba(11,30,58,.55);
  display: none; place-items: center; z-index: 100; padding: 20px;
}
.modal-bg.open { display: grid; }
.modal {
  background: #fff; border-radius: 20px; padding: 28px;
  max-width: 520px; width: 100%; max-height: 90vh; overflow: auto;
}
.modal h2 { font-family: var(--font-display); font-size: 26px; margin-bottom: 16px; }
label { display: block; font-weight: 500; font-size: 14px; margin: 12px 0 5px; }
input, select, textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--line);
  border-radius: 10px; font-family: var(--font-body); font-size: 15px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); }
textarea { resize: vertical; min-height: 80px; }

/* Cart drawer */
.drawer {
  position: fixed; top: 0; right: -420px; width: 400px; max-width: 90vw; height: 100vh;
  background: #fff; box-shadow: -8px 0 30px rgba(0,0,0,.2); z-index: 90;
  transition: right .3s; display: flex; flex-direction: column; padding: 24px;
}
.drawer.open { right: 0; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.drawer h2 { font-family: var(--font-display); font-size: 24px; margin: 0; }
.drawer-close { background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink, #333); padding: 4px 10px; border-radius: 8px; }
.drawer-close:hover { background: var(--soft, #f0f0f0); }
.cart-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-item .t { flex: 1; }

.flash {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 13px 22px; border-radius: 12px;
  z-index: 200; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none;
}
.flash.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

footer { background: var(--blue-band); color: #fff; padding: 44px 0; margin-top: 60px; }
footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 30px; }
footer h4 { font-family: var(--font-display); font-size: 18px; margin-bottom: 10px; }
footer a { display: block; opacity: .92; margin-bottom: 5px; font-size: 14px; color: #fff; }
/* Footer Ilusoft (crédito) */
.footer-ilusoft { flex-basis: 100%; width: 100%; text-align: center; padding: 18px 0 0; margin-top: 16px; border-top: 1px solid rgba(255,255,255,.2); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.85); }
.footer-ilusoft a { display: inline; opacity: 1; margin: 0 0 0 6px; color: #fff; font-weight: 700; border-bottom: 1px solid transparent; transition: border-color .2s; }
.footer-ilusoft a:hover { border-bottom-color: #fff; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.chip { padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--line); cursor: pointer; background: #fff; font-weight: 500; font-size: 14px; }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }

@media (max-width: 860px) {
  nav.main { gap: 14px; font-size: 14px; overflow-x: auto; max-width: 100%; }
  nav.main .hide-mobile { display: none; }

  /* Header: logo + buscador + carrito acomodados */
  .topbar .container {
    flex-wrap: wrap; height: auto; gap: 12px;
    padding-top: 12px; padding-bottom: 12px; align-items: center;
  }
  .logo { font-size: 19px; }
  .logo .logo-img { height: 34px; }
  /* buscador full-width abajo */
  .search-box { order: 3; margin-left: 0; min-width: 0; width: 100%; flex-basis: 100%; }
  .cart-btn { margin-left: auto; }

  .hero { padding: 48px 0; }
  .hero h1 { word-break: break-word; overflow-wrap: anywhere; hyphens: auto; }
  .hero p { font-size: 17px; }

  .section-title { font-size: 26px; }
  section.block { padding: 36px 0; }

  /* Footer apila columnas */
  footer .container { flex-direction: column; gap: 22px; }
}

@media (max-width: 600px) {
  .container { padding: 0 14px; }

  /* Grid de productos: que no quede demasiado angosto */
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }

  /* Catbar: scroll horizontal comodo */
  .catbar .container { gap: 18px; height: 48px; }

  /* Modales: padding y scroll en pantallas chicas */
  .modal-bg { padding: 12px; }
  .modal { padding: 20px; max-height: 92vh; border-radius: 16px; }
  .modal h2 { font-size: 22px; }

  /* Cart drawer */
  .drawer { width: 90vw; padding: 18px; }

  /* Boton flotante WhatsApp un poco mas chico y mas alto, que no tape el footer/carrito */
  #waFloat { width: 52px !important; height: 52px !important; font-size: 24px !important; right: 14px !important; bottom: 14px !important; }
  /* Con el carrito abierto, ocultar el flotante para que no tape el checkout */
  .drawer.open ~ #waFloat { display: none !important; }
}
