/* =============================================
   VARIABLES & RESET
   ============================================= */
:root {
  --black: #0a0a0a;
  --white: #f5f4f0;
  --accent: #e63329;
  --accent2: #ff6b35;
  --gray: #8a8a8a;
  --light: #ececea;
  --card: #ffffff;
  --border: #e0dfd9;
  --success: #22c55e;
  --shadow: 0 4px 24px rgba(0,0,0,0.09);
  --radius: 12px;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--black);
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-body); }
input, textarea, select { font-family: var(--font-body); }

/* =============================================
   BUTTONS
   ============================================= */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 28px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: background .2s, transform .15s;
  letter-spacing: 0.02em;
}
.btn-primary:hover { background: #c42820; transform: translateY(-1px); }
.btn-primary.btn-full { width: 100%; }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--black);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: opacity .2s;
}
.btn-secondary:hover { opacity: 0.8; }

.btn-outline {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  color: var(--black);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: 50px;
  border: 2px solid var(--black);
  cursor: pointer;
  transition: all .2s;
}
.btn-outline:hover { background: var(--black); color: #fff; }

/* =============================================
   HEADER
   ============================================= */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245,244,240,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.05em;
  color: var(--black);
}
.logo span { color: var(--accent); }
.nav { display: flex; gap: 28px; }
.nav-link {
  font-size: 0.9rem; font-weight: 500; color: var(--gray);
  transition: color .2s;
  text-transform: capitalize;
}
.nav-link:hover, .nav-link.active { color: var(--black); }
.nav-item { position: relative; }
.nav-arrow { font-size: .65rem; margin-left: 2px; display: inline-block; }
.nav-dropdown {
  display: none;
  position: absolute; top: 100%; left: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow); padding: 8px; min-width: 180px; z-index: 50;
}
.nav-dropdown a {
  display: block; padding: 8px 12px; font-size: .88rem;
  color: var(--gray); border-radius: 6px; white-space: nowrap;
  text-transform: capitalize;
}
.nav-dropdown a:hover { background: var(--light); color: var(--black); }
.nav-item.open .nav-dropdown { display: block; }

.header-actions { display: flex; align-items: center; gap: 16px; }
.filter-chip { text-transform: capitalize; }

.cart-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--black);
  color: #fff;
  transition: background .2s;
}
.cart-btn:hover { background: var(--accent); }
.cart-count {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* =============================================
   HERO
   ============================================= */
.hero {
  position: relative;
  min-height: 500px;
  display: flex; align-items: center;
  overflow: hidden;
  padding: 80px 24px;
}
.hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #2d1a1a 100%);
  z-index: 0;
}
.hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(230,51,41,0.3) 0%, transparent 60%);
}
.hero-content {
  position: relative; z-index: 1;
  max-width: 1200px; margin: 0 auto; width: 100%;
}
.hero-eyebrow {
  font-size: 0.85rem; font-weight: 500;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 16px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 8vw, 7rem);
  line-height: 0.95;
  color: #fff;
  margin-bottom: 36px;
}

/* =============================================
   DISCOUNT BANNER
   ============================================= */
.discount-banner {
  background: var(--accent);
  color: #fff;
  text-align: center;
  padding: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

/* =============================================
   COUPON
   ============================================= */
.coupon-section {
  background: var(--light);
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
}
.coupon-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: 0.9rem; font-weight: 500;
}
.coupon-input-wrap { display: flex; gap: 8px; }
.coupon-input {
  padding: 9px 16px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-size: 0.9rem;
  outline: none;
  background: #fff;
  transition: border .2s;
  width: 200px;
}
.coupon-input:focus { border-color: var(--black); }
.coupon-msg { font-size: 0.85rem; font-weight: 500; }
.coupon-msg.ok { color: var(--success); }
.coupon-msg.err { color: var(--accent); }

/* =============================================
   PRODUCTS
   ============================================= */
.products-section {
  max-width: 1200px; margin: 0 auto;
  padding: 60px 24px;
}
.section-header { margin-bottom: 40px; }
.section-title {
  font-family: var(--font-display);
  font-size: 3rem;
  letter-spacing: 0.03em;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.product-img {
  width: 100%; height: 240px; object-fit: contain;   /* foto completa, sin recortar */
  background: #fff;
}
.product-img-placeholder {
  width: 100%; height: 240px;
  background: linear-gradient(135deg, #e8e8e4, #d0cfc8);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
}

.product-info { padding: 18px; }
.product-title {
  font-weight: 600; font-size: 1rem;
  margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.product-desc {
  font-size: 0.82rem; color: var(--gray);
  margin-bottom: 14px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

.product-price-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.product-price { font-weight: 700; font-size: 1.2rem; }
.product-original-price {
  font-size: 0.9rem; color: var(--gray);
  text-decoration: line-through;
}
.product-discount-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem; font-weight: 700;
  padding: 2px 8px;
  border-radius: 50px;
}
.product-stock { font-size: 0.78rem; color: var(--gray); margin-bottom: 14px; }
.product-stock.low { color: #f97316; }
.product-stock.out { color: var(--accent); }

.product-card-actions { display: flex; gap: 8px; }

/* =============================================
   CART SIDEBAR
   ============================================= */
.cart-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  backdrop-filter: blur(2px);
}
.cart-overlay.open { display: block; }

.cart-sidebar {
  position: fixed; top: 0; right: -420px;
  width: 420px; max-width: 95vw;
  height: 100vh;
  background: var(--white);
  z-index: 201;
  display: flex; flex-direction: column;
  box-shadow: -4px 0 32px rgba(0,0,0,0.12);
  transition: right .3s cubic-bezier(.4,0,.2,1);
  transform: translateZ(0);              /* ← agregar */
  -webkit-backface-visibility: hidden;   /* ← agregar */
}
.cart-sidebar.open { right: 0; }

.cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.cart-header h3 { font-size: 1.2rem; font-weight: 700; }

.close-btn {
  font-size: 1.1rem; color: var(--gray);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background .2s, color .2s;
}
.close-btn:hover { background: var(--light); color: var(--black); }

.cart-items { flex: 1; overflow-y: auto; padding: 16px 24px; }

.cart-item {
  display: flex; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.cart-item-img {
  width: 64px; height: 64px;
  border-radius: 8px; object-fit: contain;
  background: #fff; border: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.cart-item-price { font-size: 0.85rem; color: var(--gray); margin-bottom: 8px; }
.cart-item-qty {
  display: flex; align-items: center; gap: 10px;
}
.qty-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--light);
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  transition: background .2s;
}
.qty-btn:hover { background: var(--border); }
.qty-val { font-weight: 600; font-size: 0.9rem; min-width: 20px; text-align: center; }
.qty-input {
  width: 46px; height: 28px; text-align: center;
  font-weight: 600; font-size: .9rem; font-family: var(--font-body);
  border: 1.5px solid var(--border); border-radius: 8px; background: #fff;
  outline: none; padding: 0;
}
.qty-input:focus { border-color: var(--black); }
.cart-item-remove {
  color: var(--gray); font-size: 0.8rem;
  cursor: pointer; transition: color .2s;
  flex-shrink: 0;
}
.cart-item-remove:hover { color: var(--accent); }

.cart-empty {
  text-align: center; padding: 60px 0;
  color: var(--gray);
}
.cart-empty svg { margin: 0 auto 16px; opacity: 0.3; }

.cart-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  background: var(--white);
}
.cart-subtotal, .cart-discount-row, .cart-total {
  display: flex; justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 8px;
}
.cart-total { font-weight: 700; font-size: 1.1rem; margin-bottom: 16px; }
.discount-amt { color: var(--success); font-weight: 600; }
.cart-footer { max-height: 60vh; overflow-y: auto; padding: 14px 24px 16px; }
.cart-footer .cart-total { margin-bottom: 6px; }
.cart-detail[hidden] { display: none; }
.cart-detail { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--border); }
.cart-detail-toggle {
  display: block; width: 100%; background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: .82rem; font-weight: 600;
  color: var(--gray); padding: 4px 0 12px; text-align: center;
}
.cart-detail-toggle:hover { color: var(--black); }
.cart-detail-toggle .chev { display: inline-block; transition: transform .2s; }
.cart-detail-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.cart-total-neto { font-size: 1.2rem; margin-bottom: 4px; }

/* =============================================
   MODAL PRODUCTO
   ============================================= */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
}
.modal-overlay.open { display: block; }

.product-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 860px; max-width: 95vw;
  height: min(620px, 90vh);          /* alto fijo: la ventana no scrollea, solo la descripción */
  background: var(--white);
  border-radius: var(--radius);
  z-index: 301;
  overflow: hidden;
  opacity: 0;
  transition: transform .25s, opacity .25s;
  pointer-events: none;
}
.product-modal.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.modal-close {
  position: absolute; top: 16px; right: 16px; z-index: 5;
}
.modal-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
}

/* Columna izquierda: foto (fija, centrada) + precio/stock/botón (fijos abajo) */
.modal-left {
  display: flex; flex-direction: column;
  min-height: 0; background: #fff;
  border-right: 1px solid var(--border);
}
.modal-imgs { position: relative; flex: 1; min-height: 0; background: #fff; }
.modal-main-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;               /* foto completa, centrada, sin recortar */
  background: #fff;
}
.modal-buy {
  flex: none; padding: 16px 22px 20px;
  border-top: 1px solid var(--border); background: #fff;
}
.modal-buy .modal-price-row { margin-bottom: 8px; flex-wrap: wrap; }
.modal-buy .product-stock { margin-bottom: 14px !important; }

/* Columna derecha: título + descripción (lo único que scrollea) */
.modal-details {
  min-height: 0; overflow-y: auto;
  padding: 36px 32px 28px;
}
.modal-title {
  font-family: var(--font-display); font-size: 1.8rem; line-height: 1.05;
  margin-bottom: 14px; padding-right: 36px;   /* lugar para la ✕ */
}
.modal-desc {
  font-size: 0.9rem; color: var(--gray); line-height: 1.6;
  margin-bottom: 8px; overflow-wrap: anywhere;
}
.modal-desc.clamped {                /* colapsada: un párrafo corto que entra sin scroll */
  display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 8; overflow: hidden;
}
.modal-desc:not(.clamped) { white-space: pre-line; }   /* expandida: respeta los saltos de línea */
.modal-more {
  background: none; border: none; padding: 0; margin-bottom: 16px;
  color: var(--accent); font-weight: 700; font-size: .85rem; cursor: pointer;
  font-family: inherit;
}
.modal-more:hover { text-decoration: underline; }
.modal-price-row { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.modal-price { font-size: 1.8rem; font-weight: 700; }

/* =============================================
   WHATSAPP BUTTON
   ============================================= */
.whatsapp-btn {
  position: fixed; bottom: 28px; right: 28px;
  z-index: 150;
  background: #25d366;
  color: #fff;
  width: 58px; height: 58px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,0.5);
  transition: transform .2s, box-shadow .2s;
}
.whatsapp-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(37,211,102,0.65);
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  background: var(--black);
  color: var(--gray);
  text-align: center;
  padding: 24px;
  font-size: 0.85rem;
  margin-top: 60px;
}

/* =============================================
   CHECKOUT PAGE
   ============================================= */
.checkout-page {
  max-width: 900px; margin: 0 auto;
  padding: 60px 24px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
}
.checkout-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  margin-bottom: 32px;
  grid-column: 1 / -1;
}

.checkout-form { }
.form-section-title {
  font-weight: 700; font-size: 1rem;
  margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 2px solid var(--black);
  letter-spacing: 0.05em; text-transform: uppercase;
  font-size: 0.85rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 16px;
}
.form-group label { font-size: 0.82rem; font-weight: 600; color: var(--gray); text-transform: uppercase; letter-spacing: 0.05em; }
.form-group input, .form-group select, .form-group textarea {
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border .2s;
  background: #fff;
  color: var(--black);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--black);
}

.checkout-summary {
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  height: fit-content;
  position: sticky; top: 80px;
  align-self: start;
  display: flex; flex-direction: column;
}
.checkout-summary > * { flex-shrink: 0; }
.checkout-summary .summary-items {
  max-height: clamp(150px, calc(100vh - 400px), 420px);
  overflow-y: auto; padding-right: 6px; margin-right: -6px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.22) transparent;
}
.checkout-summary.detail-open .summary-items { max-height: clamp(130px, calc(100vh - 500px), 380px); }
.checkout-summary .summary-items::-webkit-scrollbar { width: 6px; }
.checkout-summary .summary-items::-webkit-scrollbar-track { background: transparent; }
.checkout-summary .summary-items::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 6px; }
.checkout-summary .summary-items::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.34); }
.checkout-summary .iva-item-desglose { background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); }
.checkout-summary .iva-toggle-btn { background: rgba(255,255,255,.12); color: rgba(255,255,255,.85); border-color: rgba(255,255,255,.22); }
.checkout-summary .iva-toggle-btn:hover { background: #fff; color: var(--black); }
.summary-detail[hidden] { display: none; }
.summary-detail { margin-top: 2px; }
.summary-badges { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 0; }
.summary-badges span { background: rgba(255,255,255,.13); color: #fff; font-size: .75rem; padding: 4px 10px; border-radius: 50px; }
.summary-more {
  display: block; width: 100%; background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.65); font-family: var(--font-body); font-size: .8rem; font-weight: 600;
  padding: 12px 0 0; text-align: center;
}
.summary-more:hover { color: #fff; }
.summary-more .chev { display: inline-block; transition: transform .2s; }
.summary-more[aria-expanded="true"] .chev { transform: rotate(180deg); }
.back-link { font-size: .9rem; color: var(--gray); font-weight: 500; transition: color .2s; }
.back-link:hover { color: var(--black); }
.pay-box { margin-top: 16px; }
.pay-box .mp-btn { margin-top: 0; }
.pay-box .mp-secure { color: var(--gray); }
.summary-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 20px; }
.summary-head h3 { margin: 0 !important; }
.summary-dl { display: flex; align-items: center; gap: 6px; }
.summary-dl-label { font-size: .7rem; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: .05em; }
.summary-dl-btn {
  background: rgba(255,255,255,.13); color: #fff; border: 1px solid rgba(255,255,255,.25);
  border-radius: 50px; padding: 4px 11px; font-size: .74rem; font-weight: 600;
  cursor: pointer; font-family: var(--font-body); transition: background .15s, color .15s;
}
.summary-dl-btn:hover { background: #fff; color: var(--black); }
.summary-dl-btn:disabled { opacity: .6; cursor: wait; }
.summary-item-img {
  width: 44px; height: 44px; border-radius: 8px; flex-shrink: 0;
  object-fit: contain; background: #fff;
}
.summary-item-noimg { display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.checkout-summary h3 {
  font-family: var(--font-display);
  font-size: 1.6rem; margin-bottom: 20px;
}
.summary-items { margin-bottom: 20px; }
.summary-item {
  display: flex; justify-content: space-between;
  font-size: 0.88rem; padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  gap: 12px;
}
.summary-item-name { flex: 1; }
.summary-divider { height: 1px; background: rgba(255,255,255,0.2); margin: 12px 0; }
.summary-row {
  display: flex; justify-content: space-between;
  font-size: 0.9rem; margin-bottom: 8px;
}
.summary-total {
  display: flex; justify-content: space-between;
  font-size: 1.1rem; font-weight: 700; margin-top: 12px;
}
.summary-discount { color: #4ade80; }

.mp-btn {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  background: #009ee3;
  color: #fff;
  font-weight: 700; font-size: 1rem;
  padding: 16px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  width: 100%;
  margin-top: 20px;
  transition: background .2s, transform .15s;
  letter-spacing: 0.02em;
}
.mp-btn:hover { background: #007bbf; transform: translateY(-1px); }
.mp-btn svg { flex-shrink: 0; }

.mp-secure { font-size: 0.75rem; color: rgba(255,255,255,0.5); text-align: center; margin-top: 10px; }

/* =============================================
   ADMIN PAGE
   ============================================= */
.admin-layout {
  display: flex; min-height: 100vh;
}
.admin-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--black);
  color: var(--white);
  padding: 0;
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-logo {
  padding: 24px 20px;
  font-family: var(--font-display);
  font-size: 1.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.admin-logo span { color: var(--accent); }
.admin-nav { padding: 16px 0; }
.admin-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  font-size: 0.9rem; font-weight: 500;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all .2s;
}
.admin-nav-item:hover, .admin-nav-item.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.admin-nav-item svg { flex-shrink: 0; }

.admin-main {
  flex: 1;
  background: var(--white);
  overflow-x: hidden;
}
.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.admin-topbar h1 { font-size: 1.3rem; font-weight: 700; }
.admin-content { padding: 32px; }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px; margin-bottom: 40px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-label { font-size: 0.78rem; color: var(--gray); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.stat-value { font-size: 1.8rem; font-weight: 700; }
.stat-value.accent { color: var(--accent); }

.admin-table-wrap { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 32px; }
.admin-table-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.admin-table-header h2 { font-size: 1.05rem; font-weight: 700; }

table { width: 100%; border-collapse: collapse; }
th {
  background: var(--light);
  text-align: left; padding: 12px 16px;
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--gray);
}
td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 0.9rem; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafaf8; }

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.72rem; font-weight: 700;
}
.badge-green { background: #dcfce7; color: #166534; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-yellow { background: #fef9c3; color: #92400e; }

.icon-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s;
  color: var(--gray);
}
.icon-btn:hover { background: var(--light); color: var(--black); }
.icon-btn.danger:hover { background: #fee2e2; color: var(--accent); }

/* MODAL ADMIN */
.admin-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 400;
}
.admin-modal-overlay.open { display: flex; align-items: center; justify-content: center; }

.admin-modal {
  background: #fff;
  border-radius: var(--radius);
  width: 600px; max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
}
.admin-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px;
}
.admin-modal-header h2 { font-size: 1.3rem; font-weight: 700; }

/* DISCOUNT SECTION */
.discounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.discount-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.discount-code {
  font-family: monospace; font-size: 1.1rem; font-weight: 700;
  background: var(--light); padding: 6px 12px;
  border-radius: 6px; display: inline-block; margin-bottom: 8px;
}
.discount-info { font-size: 0.85rem; color: var(--gray); }

/* WA CONFIG */
.config-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  max-width: 500px;
}
.config-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; }

/* =============================================
   TABS
   ============================================= */
.admin-tabs {
  display: none;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .product-modal { height: 92vh; }
  .modal-content { display: flex; flex-direction: column; }
  .modal-left { flex: none; border-right: none; border-bottom: 1px solid var(--border); }
  .modal-imgs { flex: none; height: 30vh; }           /* foto fija arriba */
  .modal-buy { padding: 12px 16px 14px; }              /* precio/stock/botón fijos bajo la foto */
  .modal-price { font-size: 1.5rem; }
  .modal-details { flex: 1; padding: 16px 18px 20px; } /* solo esto scrollea */
  .modal-title { font-size: 1.4rem; }
  .modal-desc.clamped { -webkit-line-clamp: 4; }

  .checkout-page {
    grid-template-columns: 1fr;
    padding: 30px 16px;
  }
  .checkout-title { font-size: 2rem; }
  .checkout-summary { position: static; }
  .checkout-summary .summary-items, .checkout-summary.detail-open .summary-items { max-height: 40vh; }
  .form-row { grid-template-columns: 1fr; }

  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: relative; }
  .admin-nav { display: flex; flex-wrap: wrap; padding: 8px; }
  .admin-nav-item { padding: 8px 12px; }

  .hero-title { font-size: 3rem; }
}

/* =============================================
   MENÚ MOBILE (hamburguesa)
   ============================================= */
.mobile-menu-btn {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--black);
  flex-shrink: 0;
}
.mobile-header-actions { display: none; }
.mobile-search-btn {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  border-radius: 8px; color: var(--black);
  background: none; border: none; flex-shrink: 0; cursor: pointer;
}
.mobile-search-bar {
  display: none;
  position: fixed; top: 64px; left: 0; right: 0;
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 10px 16px; z-index: 149;
}
.cart-btn-text { display: none; }

.header-right {
  display: flex;
  align-items: center;
  gap: 28px;
}

@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }
  .mobile-header-actions { display: flex; align-items: center; gap: 4px; }
  .mobile-search-btn {
    display: flex; width: 40px; height: 40px;
    align-items: center; justify-content: center;
    border-radius: 8px; color: var(--black);
    background: none; border: none; flex-shrink: 0; cursor: pointer;
  }

  .header-right {
    display: none;
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    box-shadow: 0 12px 24px rgba(0,0,0,.1);
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 16px;
    z-index: 150;
  }
  .header-right.open { display: flex; }

  .nav { display: flex; flex-direction: column; gap: 2px; align-items: stretch; }
  .nav-link { display: block; width: 100%; box-sizing: border-box; text-align: left; padding: 12px 8px; font-size: 1rem; border-bottom: 1px solid var(--border); }
  .nav-item { width: 100%; }
  .nav-dropdown { display: none; position: static; box-shadow: none; border: none; margin-left: 12px; padding: 0; }
  .nav-item.open .nav-dropdown { display: block; }
  .nav-dropdown a { padding: 10px 12px; border-bottom: 1px solid var(--border); border-radius: 0; }

  .header-actions { flex-direction: column; align-items: stretch; gap: 12px; }
  .search-wrap { max-width: none; }

  #authButtons { flex-direction: column; align-items: stretch !important; gap: 8px !important; }
  .auth-link { justify-content: center; width: 100%; }

  .cart-btn {
    width: 100%; height: auto; border-radius: 50px;
    padding: 12px 20px; gap: 8px;
    justify-content: center;
  }
  .cart-btn-text { display: inline; font-weight: 600; font-size: .9rem; }
  .cart-count { position: static; margin-left: 4px; }

  /* Buscador flotante fuera del ☰ */
  .mobile-search-bar.open { display: block; }
  .mobile-search-bar .search-wrap { max-width: none; }
}

/* ===== MULTI-FOTOS: tarjeta ===== */
.product-img-wrap { position: relative; }
.product-img-dots {
  position: absolute; bottom: 10px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 5px;
  pointer-events: none;
}
.product-img-dots .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.55);
  transition: background .2s, transform .2s;
}
.product-img-dots .dot.active { background: #fff; transform: scale(1.2); }

/* ===== MULTI-FOTOS: modal ===== */
.modal-carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.9); border: none;
  font-size: 1.4rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--black); box-shadow: 0 2px 8px rgba(0,0,0,.15);
  transition: background .15s;
}
.modal-carousel-arrow:hover { background: #fff; }
.modal-carousel-arrow.prev { left: 12px; }
.modal-carousel-arrow.next { right: 12px; }
.modal-carousel-dots {
  position: absolute; bottom: 14px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 6px;
}
.modal-carousel-dots .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,.6); cursor: pointer;
  transition: background .2s, transform .2s;
}
.modal-carousel-dots .dot.active { background: #fff; transform: scale(1.25); }