/* ═══════════════════════════════════════════
   Digital Codes — style.css
   Sólo estilos JS-driven y páginas no migradas.
   El diseño visual usa Tailwind CDN (header.php).
   ═══════════════════════════════════════════ */

/* ── Variables compartidas ── */
:root {
  --brand:    #052e16;
  --sky:      #15803d;
  --cyan:     #166534;
  --white:    #ffffff;
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --transition: .18s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ── Container (páginas no migradas) ── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ═══════════════════════════════════════════
   HERO SLIDER (clases JS-driven)
   ═══════════════════════════════════════════ */
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .7s ease;
}
.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
}
.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  border: none;
  cursor: pointer;
  transition: all .3s;
  padding: 0;
}
.hero-dot.active {
  width: 20px;
  border-radius: 4px;
  background: #fff;
}

/* ═══════════════════════════════════════════
   CURRENCY SELECT
   ═══════════════════════════════════════════ */
.cur-select {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  color: #15803d;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
  transition: border-color .15s, box-shadow .15s;
}
.cur-select:hover  { border-color: #15803d; }
.cur-select:focus  { border-color: #15803d; box-shadow: 0 0 0 3px rgba(21,128,61,.15); }

/* ═══════════════════════════════════════════
   MOBILE MENU (JS-driven)
   ═══════════════════════════════════════════ */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s;
}
.mobile-overlay.open { opacity: 1; pointer-events: auto; }

.mobile-menu {
  position: fixed;
  left: -100%;
  top: 0;
  width: 270px;
  height: 100%;
  background: #fff;
  z-index: 100;
  box-shadow: 4px 0 32px rgba(0,0,0,.15);
  transition: left .28s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
}
.mobile-menu.open { left: 0; }
.mobile-menu-head {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
}
.mobile-close {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border: none;
  background: #f1f5f9;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
}
.mobile-nav {
  display: flex;
  flex-direction: column;
  padding: .75rem;
  flex: 1;
}
.mobile-link {
  padding: .75rem 1rem;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  transition: background .15s;
}
.mobile-link:hover { background: #f0fdf4; color: #15803d; }
.mobile-currency {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid #f1f5f9;
  font-size: 12px;
  color: #94a3b8;
}
/* mobile-currency active state is handled via inline styles in JS */

/* ═══════════════════════════════════════════
   CART DRAWER (JS-driven)
   ═══════════════════════════════════════════ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  right: -440px;
  top: 0;
  width: 380px;
  max-width: 100vw;
  height: 100%;
  background: #fff;
  z-index: 100;
  box-shadow: -4px 0 32px rgba(0,0,0,.15);
  transition: right .28s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
}
.cart-drawer.open { right: 0; }

.cart-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.125rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}
.cart-drawer-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 15px;
  font-weight: 800;
  color: #0c2340;
}
.drawer-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f1f5f9;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
}
.drawer-close:hover { background: #e2e8f0; }
.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}
.cart-drawer-foot {
  padding: 1rem 1.25rem;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  flex-shrink: 0;
}

/* Cart items (rendered by app.js) */
.cart-item {
  display: flex;
  gap: .625rem;
  align-items: flex-start;
  padding: .75rem 0;
  border-bottom: 1px solid #f8fafc;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.cart-item-icon img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: .25rem;
}
.cart-item-price { font-size: 13px; font-weight: 800; color: #16a34a; }
.cart-item-controls {
  display: flex;
  align-items: center;
  gap: .375rem;
  flex-shrink: 0;
}
.cart-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: .25rem;
  border-radius: 4px;
  display: flex;
}
.cart-item-remove:hover { color: #ef4444; background: #fef2f2; }

.qty-btn {
  width: 22px;
  height: 22px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  line-height: 1;
  padding: 0;
}
.qty-btn:hover { background: #e2e8f0; }
.qty-val { font-size: 13px; font-weight: 700; min-width: 18px; text-align: center; }

/* Empty cart */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: #94a3b8;
  text-align: center;
  gap: .75rem;
}
.cart-empty p { font-size: 13px; }

/* ═══════════════════════════════════════════
   COUPON & TOTALS
   ═══════════════════════════════════════════ */
.coupon-row { display: flex; gap: .5rem; }
.coupon-inp {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: .5rem .75rem;
  font-size: 13px;
  outline: none;
  font-family: inherit;
  background: #fff;
}
.coupon-inp:focus { border-color: #15803d; box-shadow: 0 0 0 3px rgba(21,128,61,.1); }
.coupon-btn {
  background: #052e16;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .5rem .875rem;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.coupon-btn:hover { background: #16a34a; }
.coupon-msg { font-size: 12px; color: #64748b; }
.coupon-ok  { color: #16a34a !important; }
.coupon-err { color: #dc2626 !important; }

.cart-summary { display: flex; flex-direction: column; gap: .25rem; }
.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #475569;
}
.total-row {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  padding-top: .5rem;
  border-top: 1px solid #e2e8f0;
  margin-top: .25rem;
}

/* ── Checkout buttons ── */
.btn-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .75rem;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}
.btn-checkout:hover { background: #15803d; }
.btn-wa-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .625rem;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.btn-wa-cart:hover { background: #16a34a; }

/* ─── Btn-cart (add to cart — JS feedback) ─── */
.btn-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  width: 100%;
  background: #ffffff;
  color: #1e293b;
  border: 1.5px solid rgba(0,0,0,.08);
  border-radius: 12px;
  padding: .625rem;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, transform .15s, box-shadow .15s;
  margin-top: auto;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  -webkit-tap-highlight-color: transparent;
}
.btn-cart:hover { background: #f1f5f9; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.btn-cart:active { background: #f0fdf4; transform: scale(.97); }

/* Price elements (updated by app.js) */
.price-display { font-weight: 800; color: #16a34a; }
.old-price     { color: #94a3b8; }

/* ═══════════════════════════════════════════
   WA FLOAT BUTTON
   ═══════════════════════════════════════════ */
.wa-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 52px;
  height: 52px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 16px rgba(37,211,102,.4);
  z-index: 50;
  transition: transform .2s, box-shadow .2s;
}
.wa-float:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(37,211,102,.5); }

/* ═══════════════════════════════════════════
   PAYMENT MODAL
   ═══════════════════════════════════════════ */
.payment-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.payment-modal-overlay.open { display: flex; }
.payment-modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.payment-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border: none;
  background: #f1f5f9;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}
.payment-modal-close:hover { background: #e2e8f0; }

/* ═══════════════════════════════════════════
   CART PAGE (carrito.php — aún no migrado)
   ═══════════════════════════════════════════ */
.cart-page { padding: 2rem 0 3rem; }
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) { .cart-layout { grid-template-columns: 1fr; } }

.cart-list-card, .order-summary-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
  overflow: hidden;
}
.cart-list-head, .order-summary-head {
  padding: 1rem 1.5rem;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}
.cart-list-body { padding: 0 1.5rem; }
.order-summary-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Cart page items (rendered by app.js) */
.cart-page-item {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.cart-page-item:last-child { border-bottom: none; }
.cart-page-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cart-page-info { flex: 1; min-width: 0; }
.cart-page-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: .25rem;
}
.cart-page-price { font-size: 14px; font-weight: 800; color: #16a34a; }

.payment-methods { display: flex; flex-direction: column; gap: .5rem; }
.payment-method-btn {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color .15s, background .15s;
  width: 100%;
}
.payment-method-btn:hover { border-color: #15803d; background: #f0fdf4; }
.payment-method-btn.selected { border-color: #15803d; background: #f0fdf4; }
.pay-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.empty-cart-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem 1rem;
  color: #94a3b8;
  text-align: center;
  gap: 1rem;
}
.empty-cart-state h2 { font-size: 1.25rem; color: #334155; }
.empty-cart-state p  { font-size: 14px; }

/* ═══════════════════════════════════════════
   BREADCRUMB (páginas internas)
   ═══════════════════════════════════════════ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .375rem;
  font-size: 13px;
  color: #94a3b8;
  padding: 1rem 0 .75rem;
}
.breadcrumb a { color: #94a3b8; }
.breadcrumb a:hover { color: #0ea5e9; }
.breadcrumb-sep { color: #cbd5e1; }
.breadcrumb-current { color: #475569; font-weight: 600; }

/* ═══════════════════════════════════════════
   BADGES (usado en funciones PHP y carrito)
   ═══════════════════════════════════════════ */
.badge {
  position: absolute;
  top: .5rem;
  left: .5rem;
  z-index: 10;
  font-size: 9px;
  font-weight: 800;
  border-radius: 99px;
  padding: .2rem .5rem;
  letter-spacing: .04em;
}
.badge-hot  { background: #fbbf24; color: #78350f; }
.badge-new  { background: #10b981; color: #fff; }
.badge-sale { background: #ef4444; color: #fff; }
