/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body   { font-family: 'Segoe UI', system-ui, sans-serif; background: #f0f4f8; color: #1e293b; }
a      { text-decoration: none; color: inherit; }
.oculto { display: none !important; }

/* ── Header ─────────────────────────────────────────── */
.header {
  background: #1d4ed8; color: #fff;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
}
.logo          { display: flex; align-items: center; gap: 10px; }
.logo-icon     { font-size: 28px; }
.logo-nombre   { font-size: 17px; font-weight: 700; line-height: 1.2; }
.logo-sub      { font-size: 11px; opacity: .8; }

.btn-carrito {
  background: rgba(255,255,255,.15); border: 1.5px solid rgba(255,255,255,.4);
  color: #fff; padding: 8px 16px; border-radius: 99px;
  font-size: 15px; cursor: pointer; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  transition: background .2s;
}
.btn-carrito:hover { background: rgba(255,255,255,.25); }
.btn-carrito.bounce { animation: bounce .4s; }
@keyframes bounce {
  0%,100% { transform: scale(1) }
  40%     { transform: scale(1.2) }
  70%     { transform: scale(.92) }
}
#carrito-count {
  background: #fbbf24; color: #1e293b;
  border-radius: 99px; padding: 1px 7px; font-size: 13px; font-weight: 700;
}

.btn-volver-tienda {
  background: rgba(255,255,255,.15); border: 1.5px solid rgba(255,255,255,.4);
  color: #fff; padding: 7px 14px; border-radius: 99px; font-size: 13px; font-weight: 600;
  transition: background .2s;
}
.btn-volver-tienda:hover { background: rgba(255,255,255,.25); }

/* ── Hero ────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #3b82f6 100%);
  color: #fff; text-align: center; padding: 64px 20px;
}
.hero-inner h1 {
  font-size: clamp(1.6rem, 5vw, 2.6rem); font-weight: 800; margin-bottom: 12px;
}
.hero-inner h1 span { color: #fbbf24; }
.hero-inner p  { font-size: 1rem; opacity: .9; margin-bottom: 28px; line-height: 1.6; }
.hero-inner button {
  background: #fbbf24; color: #1e293b; border: none;
  padding: 13px 32px; border-radius: 99px; font-size: 1rem;
  font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  transition: transform .15s, box-shadow .15s;
}
.hero-inner button:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.2); }

/* ── Categorías ──────────────────────────────────────── */
.categorias-bar {
  background: #fff; border-bottom: 1px solid #e2e8f0;
  position: sticky; top: 57px; z-index: 90;
}
.cats-inner {
  display: flex; gap: 8px; padding: 10px 16px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.cats-inner::-webkit-scrollbar { display: none; }
.cat-btn {
  background: #f1f5f9; border: 1.5px solid #e2e8f0;
  color: #475569; padding: 6px 14px; border-radius: 99px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: all .2s;
}
.cat-btn:hover, .cat-btn.activo {
  background: #1d4ed8; color: #fff; border-color: #1d4ed8;
}

/* ── Catálogo grid ───────────────────────────────────── */
.catalogo { padding: 24px 16px; max-width: 1100px; margin: 0 auto; }
.catalogo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}
.prod-card {
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,.07);
  cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.prod-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.prod-img-wrap {
  position: relative; aspect-ratio: 1; overflow: hidden; background: #f1f5f9;
}
.prod-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.prod-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center; font-size: 40px;
}
.badge-dest {
  position: absolute; top: 8px; right: 8px;
  background: #fbbf24; color: #1e293b;
  padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700;
}
.prod-info  { padding: 10px 12px 12px; }
.prod-cat   { font-size: 10px; font-weight: 700; color: #3b82f6; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 3px; }
.prod-nombre { font-size: 14px; font-weight: 700; color: #1e293b; margin-bottom: 5px; line-height: 1.3; }
.prod-precio { font-size: 13px; color: #1d4ed8; font-weight: 600; margin-bottom: 8px; }
.btn-ver {
  width: 100%; background: #1d4ed8; color: #fff; border: none;
  padding: 7px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.btn-ver:hover { background: #1e40af; }

/* ── Carrito drawer ──────────────────────────────────── */
.carrito-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  z-index: 200; opacity: 0; pointer-events: none; transition: opacity .25s;
}
.carrito-overlay.activo { opacity: 1; pointer-events: all; }
.carrito-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(380px, 100vw); background: #fff; z-index: 201;
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .3s;
  box-shadow: -4px 0 24px rgba(0,0,0,.15);
}
.carrito-drawer.abierto { transform: translateX(0); }
.carrito-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px; font-size: 16px; font-weight: 700;
  border-bottom: 1px solid #e2e8f0; color: #1e293b;
}
.carrito-header button {
  background: none; border: none; font-size: 18px;
  cursor: pointer; color: #64748b; padding: 4px;
}
.carrito-items { flex: 1; overflow-y: auto; padding: 12px; }
.carrito-vacio { text-align: center; padding: 48px 20px; color: #94a3b8; font-size: 15px; }
.carrito-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid #f1f5f9;
}
.ci-info   { flex: 1; min-width: 0; }
.ci-nombre { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-precio { font-size: 12px; color: #64748b; }
.ci-controles { display: flex; align-items: center; gap: 4px; }
.ci-controles button {
  width: 26px; height: 26px; border-radius: 50%;
  background: #f1f5f9; border: none; font-size: 16px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.ci-controles span { font-size: 14px; font-weight: 700; min-width: 22px; text-align: center; }
.ci-eliminar { background: #fee2e2 !important; color: #dc2626; }
.ci-subtotal { font-size: 14px; font-weight: 700; color: #1d4ed8; min-width: 70px; text-align: right; }
.carrito-footer { padding: 16px 18px; border-top: 1px solid #e2e8f0; background: #f8fafc; }
.carrito-total  { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.carrito-total b { color: #1d4ed8; }
.btn-checkout {
  width: 100%; background: #1d4ed8; color: #fff; border: none;
  padding: 13px; border-radius: 10px; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: background .15s;
}
.btn-checkout:hover { background: #1e40af; }

/* ── Modal producto ──────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 300;
}
.modal-prod {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: #fff; border-radius: 18px;
  width: min(480px, 95vw); max-height: 90vh; overflow-y: auto;
  z-index: 301; padding-bottom: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal-prod-cerrar {
  position: absolute; top: 12px; right: 12px;
  background: rgba(0,0,0,.25); border: none; color: #fff;
  width: 32px; height: 32px; border-radius: 50%; font-size: 14px; cursor: pointer; z-index: 1;
}
.modal-prod img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 18px 18px 0 0; }
.mp-info       { padding: 18px 20px 0; }
.mp-cat        { font-size: 11px; font-weight: 700; color: #3b82f6; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.mp-info h2    { font-size: 20px; font-weight: 800; color: #1e293b; margin-bottom: 8px; }
.mp-info p     { font-size: 14px; color: #475569; line-height: 1.6; margin-bottom: 12px; }
.mp-precio     { font-size: 22px; font-weight: 800; color: #1d4ed8; margin-bottom: 16px; }
.mp-cantidad   { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.mp-cantidad button {
  width: 36px; height: 36px; border-radius: 50%;
  background: #f1f5f9; border: none; font-size: 20px; cursor: pointer; font-weight: 700;
}
.mp-cantidad span { font-size: 20px; font-weight: 700; min-width: 30px; text-align: center; }
.btn-agregar {
  width: 100%; background: #16a34a; color: #fff; border: none;
  padding: 13px; border-radius: 10px; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: background .15s;
}
.btn-agregar:hover  { background: #15803d; }
.btn-agregar:disabled { background: #94a3b8; cursor: not-allowed; }

/* ── Footer ──────────────────────────────────────────── */
.footer {
  text-align: center; padding: 28px 16px;
  background: #1e293b; color: #94a3b8; font-size: 13px; line-height: 2;
}

/* ── Checkout ────────────────────────────────────────── */
.checkout-wrap {
  max-width: 960px; margin: 24px auto; padding: 0 16px;
  display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start;
}
@media (max-width: 720px) {
  .checkout-wrap { grid-template-columns: 1fr; }
}
.checkout-card {
  background: #fff; border-radius: 14px;
  padding: 22px 20px; margin-bottom: 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,.07);
}
.checkout-titulo { font-size: 16px; font-weight: 700; color: #1e293b; margin-bottom: 16px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #475569; margin-bottom: 5px; }
.form-group input,
.form-group textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
  border-radius: 8px; font-size: 14px; color: #1e293b;
  outline: none; transition: border-color .2s; background: #f8fafc;
  font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus { border-color: #3b82f6; background: #fff; }
.form-group textarea { min-height: 72px; resize: vertical; }
.pago-opciones { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pago-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border: 2px solid #e2e8f0;
  border-radius: 10px; cursor: pointer; flex: 1; min-width: 90px;
  transition: all .2s; background: #f8fafc;
}
.pago-opt input { display: none; }
.pago-opt:has(input:checked),
.pago-opt.seleccionado { border-color: #1d4ed8; background: #eff6ff; }
.pago-icon { font-size: 18px; }
.info-pago-box {
  background: #eff6ff; border: 1.5px solid #bfdbfe;
  border-radius: 8px; padding: 10px 14px; font-size: 14px;
  color: #1e40af; display: none;
}
.resumen-card { position: sticky; top: 80px; }
.resumen-item {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 8px 0; border-bottom: 1px solid #f1f5f9;
}
.ri-info    { flex: 1; }
.ri-nombre  { font-size: 14px; font-weight: 600; color: #1e293b; }
.ri-det     { font-size: 12px; color: #64748b; }
.ri-sub     { font-size: 14px; font-weight: 700; color: #1d4ed8; white-space: nowrap; margin-left: 10px; }
.resumen-total {
  display: flex; justify-content: space-between;
  padding: 12px 0; font-size: 16px; font-weight: 700; color: #1e293b;
  border-top: 2px solid #1d4ed8; margin-top: 6px;
}
.resumen-total b { color: #1d4ed8; font-size: 18px; }
.alerta-err {
  background: #fee2e2; color: #dc2626; border: 1.5px solid #fca5a5;
  border-radius: 8px; padding: 10px 14px; font-size: 14px; margin-bottom: 12px;
}
.btn-confirmar {
  width: 100%; background: #16a34a; color: #fff; border: none;
  padding: 14px; border-radius: 10px; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: background .15s; margin-top: 8px;
}
.btn-confirmar:hover     { background: #15803d; }
.btn-confirmar:disabled  { background: #94a3b8; cursor: not-allowed; }

/* ── Éxito ───────────────────────────────────────────── */
.exito-screen {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  z-index: 500; display: flex; align-items: center; justify-content: center;
}
.exito-card {
  background: #fff; border-radius: 20px; padding: 40px 30px;
  max-width: 440px; width: 92%; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.exito-icon     { font-size: 64px; margin-bottom: 12px; }
.exito-card h2  { font-size: 22px; font-weight: 800; color: #16a34a; margin-bottom: 8px; }
.exito-numero   { font-size: 15px; color: #475569; margin-bottom: 10px; font-weight: 600; }
.exito-card p   { font-size: 14px; color: #64748b; margin-bottom: 24px; line-height: 1.6; }
.exito-acciones { display: flex; flex-direction: column; gap: 10px; }
.btn-wa-confirm {
  background: #16a34a; color: #fff; border: none;
  padding: 13px; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer;
}
.btn-seguir {
  display: block; padding: 12px; border-radius: 10px;
  background: #f1f5f9; color: #475569; font-size: 15px; font-weight: 600; text-align: center;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 400px) {
  .catalogo-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hero          { padding: 40px 16px; }
}
