/* ============================================================
   SHOP — catálogo, producto, carrito, checkout
   Reutiliza variables y utilidades de styles.css (:root, .container,
   .btn-primary, .btn-ghost, .section-label, #navbar, footer).
   ============================================================ */

/* ---- Página con navbar fijo: compensar padding-top ---- */
.shop-page {
  padding-top: 5.5rem;
  min-height: 100vh;
}

/* ---- Fondo liso en catálogo y detalle de producto (la imagen de fondo del
   home queda mal repetida en estas páginas) ---- */
body.flat-bg::before {
  background: var(--black);
}

.shop-header {
  padding: 3rem 0 2rem;
  text-align: center;
}

.shop-header h1 {
  font-family: var(--font-condensed);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.shop-header h1 span { color: var(--blue); }

.shop-header p {
  color: var(--gray-3);
  margin-top: 0.6rem;
}

/* ---- Cart icon in nav ---- */
.cart-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cart-btn svg { width: 24px; height: 24px; }

.cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--blue);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ---- Filtros / buscador ---- */
.shop-toolbar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.shop-search {
  flex: 1;
  min-width: 220px;
  background: var(--dark-2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 0.8rem 1.1rem;
  color: var(--white);
  font-family: var(--font);
  font-size: 0.95rem;
}

.shop-search:focus { outline: none; border-color: var(--blue); }

.shop-filters {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.filter-chip {
  background: var(--dark-2);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--gray-2);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
}

.filter-chip:hover { color: var(--white); border-color: rgba(255,255,255,0.3); }

.filter-chip.active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

/* ---- Grid de productos ---- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.product-card {
  background: var(--dark-2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease-out-expo), border-color 0.3s;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(30,136,229,0.4);
}

.product-card-img {
  aspect-ratio: 1 / 1;
  background: var(--dark-3);
  position: relative;
  overflow: hidden;
}

.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.product-card:hover .product-card-img img { transform: scale(1.06); }

.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--blue);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
}

.product-badge--stock {
  background: rgba(10,10,10,0.75);
  top: auto;
  bottom: 10px;
  left: 10px;
}

.product-card--sinstock .product-card-img img { opacity: 0.5; }

.product-card-body {
  padding: 1.1rem 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.product-cat {
  font-size: 0.72rem;
  color: var(--blue-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.product-name {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.product-name a { color: var(--white); }
.product-name a:hover { color: var(--blue-light); }

.product-price {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--font-condensed);
  font-size: 1.3rem;
  font-weight: 900;
}

.product-price s {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--gray-4);
}

.product-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.btn-add {
  flex: 1;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 6px;
  padding: 0.7rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.25s;
  text-transform: uppercase;
}

.btn-add:hover { background: var(--blue-light); }

.btn-add:disabled {
  background: var(--dark-4);
  color: var(--gray-3);
  cursor: not-allowed;
}

.shop-empty {
  text-align: center;
  padding: 5rem 1rem;
  color: var(--gray-3);
}

.shop-empty h3 { color: var(--white); margin-bottom: 0.6rem; font-family: var(--font-condensed); font-size: 1.6rem; text-transform: uppercase; }

/* ---- Carrito lateral (drawer) ---- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1400;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
}

.cart-overlay.active { opacity: 1; visibility: visible; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100%;
  background: var(--dark);
  z-index: 1500;
  transform: translateX(100%);
  transition: transform 0.4s var(--ease-out-expo);
  display: flex;
  flex-direction: column;
}

.cart-drawer.open { transform: translateX(0); }

.cart-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.cart-drawer-head h3 { font-family: var(--font-condensed); text-transform: uppercase; font-size: 1.3rem; }

.cart-close {
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.cart-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}

.cart-item-img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--dark-3);
  flex-shrink: 0;
}

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 0.9rem; font-weight: 600; }
.cart-item-price { font-size: 0.85rem; color: var(--gray-3); margin-top: 2px; }

.cart-item-remove {
  background: none;
  border: none;
  color: var(--gray-4);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
}

.cart-item-remove:hover { color: #e53935; }

.cart-empty {
  color: var(--gray-3);
  text-align: center;
  padding: 3rem 1rem;
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.cart-subtotal-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

/* ---- Página de producto ---- */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  padding: 2rem 0 5rem;
  align-items: start;
}

.pd-gallery-main {
  aspect-ratio: 1 / 1;
  background: var(--dark-2);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0.8rem;
}

.pd-gallery-main img { width: 100%; height: 100%; object-fit: cover; }

.pd-gallery-thumbs {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.pd-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: all 0.2s;
}

.pd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pd-thumb.active, .pd-thumb:hover { opacity: 1; border-color: var(--blue); }

.pd-cat { color: var(--blue-light); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.pd-name { font-family: var(--font-condensed); font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 900; text-transform: uppercase; margin: 0.6rem 0 1rem; line-height: 1.05; }
.pd-price { font-family: var(--font-condensed); font-size: 2rem; font-weight: 900; display: flex; align-items: baseline; gap: 0.7rem; margin-bottom: 1.2rem; }
.pd-price s { font-size: 1.1rem; color: var(--gray-4); font-weight: 400; }
.pd-desc { color: var(--gray-2); line-height: 1.75; margin-bottom: 1.8rem; }
.pd-stock { font-size: 0.85rem; color: var(--gray-3); margin-bottom: 1.5rem; }
.pd-stock strong { color: var(--blue-light); }

.pd-qty-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.qty-selector {
  display: flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  overflow: hidden;
}

.qty-btn {
  background: var(--dark-2);
  border: none;
  color: var(--white);
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
  cursor: pointer;
}

.qty-btn:hover { background: var(--dark-4); }

.qty-val { width: 44px; text-align: center; font-weight: 700; }

.pd-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ---- Checkout ---- */
.checkout-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
  padding: 2rem 0 5rem;
  align-items: start;
}

.checkout-form-section, .order-summary {
  background: var(--dark-2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.checkout-form-section h3, .order-summary h2 {
  font-family: var(--font-condensed);
  text-transform: uppercase;
  font-size: 1.3rem;
  margin-bottom: 1.3rem;
  letter-spacing: 0.02em;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-row.full { grid-template-columns: 1fr; }

.form-group-shop { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group-shop label { font-size: 0.8rem; color: var(--gray-3); font-weight: 600; }

.form-group-shop input,
.form-group-shop select,
.form-group-shop textarea {
  background: var(--dark-3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--white);
  font-family: var(--font);
  font-size: 0.95rem;
}

.form-group-shop input:focus,
.form-group-shop select:focus,
.form-group-shop textarea:focus { outline: none; border-color: var(--blue); }

.form-group-shop input.error,
.form-group-shop select.error { border-color: #e53935; }

.checkout-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-3);
  margin: 1.5rem 0 1rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.checkout-section-title:first-child { margin-top: 0; padding-top: 0; border-top: none; }

.payment-methods { display: flex; flex-direction: column; gap: 0.8rem; }

.payment-option {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.payment-option:hover { border-color: rgba(255,255,255,0.3); }
.payment-option--selected { border-color: var(--blue); background: rgba(30,136,229,0.08); }

.transferencia-info {
  margin-top: 1rem;
  background: var(--dark-3);
  border-radius: 8px;
  padding: 1.2rem;
}

.transferencia-aviso {
  background: rgba(255, 193, 7, 0.12);
  border: 1px solid rgba(255, 193, 7, 0.35);
  color: #ffc107;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.transferencia-dato { font-size: 0.95rem; margin-bottom: 0.4rem; }

.btn-wsp-comprobante {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.8rem 1.5rem;
  font-weight: 700;
  margin-top: 1rem;
  cursor: pointer;
}

.order-items-list { display: flex; flex-direction: column; gap: 0.9rem; margin-bottom: 1.3rem; max-height: 280px; overflow-y: auto; }

.order-item { display: flex; gap: 0.8rem; align-items: center; }
.order-item img { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--dark-3); }
.order-item-name { font-size: 0.85rem; font-weight: 600; }
.order-item-meta { font-size: 0.78rem; color: var(--gray-3); }
.order-item-price { margin-left: auto; font-size: 0.85rem; font-weight: 700; white-space: nowrap; }

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
  color: var(--gray-2);
  padding: 0.5rem 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.summary-row.total {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--white);
  font-family: var(--font-condensed);
}

.envio-badge { font-size: 0.8rem; padding: 3px 9px; border-radius: 6px; }
.envio-badge.gratis { background: rgba(30,136,229,0.15); color: var(--blue-light); }
.envio-badge.calculando { color: var(--gray-4); }

.cupon-row { display: flex; gap: 0.6rem; margin: 1rem 0; }
.cupon-row input { flex: 1; }

.checkout-error {
  display: none;
  background: rgba(229, 57, 53, 0.12);
  border: 1px solid rgba(229, 57, 53, 0.4);
  color: #ff6b6b;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.checkbox-label-shop {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--gray-2);
  cursor: pointer;
  margin-bottom: 1rem;
}

/* ---- Página de estado (éxito/fallo/pendiente) ---- */
.status-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 1.5rem 4rem;
}

.status-icon {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.8rem;
}

.status-icon svg { width: 44px; height: 44px; }

.status-icon--success { background: rgba(30,136,229,0.15); color: var(--blue-light); }
.status-icon--error { background: rgba(229,57,53,0.15); color: #ff6b6b; }
.status-icon--pending { background: rgba(255,193,7,0.15); color: #ffc107; }

.status-page h1 { font-family: var(--font-condensed); font-size: clamp(2rem, 4vw, 2.8rem); text-transform: uppercase; margin-bottom: 1rem; }
.status-page p { color: var(--gray-2); max-width: 460px; margin: 0 auto 2rem; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .product-detail, .checkout-layout { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 1rem; }
  .cart-drawer { width: 100%; }
}
