@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Sistema de Diseño ───────────────────────────── */
:root {
  --bg:           #07080f; /* Negro espacial profundo */
  --bg-panel:     #0d0f19; /* Gris oscuro para paneles */
  --bg-card:      #121526; /* Fondo de tarjetas */
  --bg-input:     #171b30; /* Fondo de campos de texto */
  --border:       rgba(255, 255, 255, 0.05);
  --border-light: rgba(255, 255, 255, 0.12);
  --border-gold:  rgba(217, 119, 6, 0.3);
  
  /* Paleta cromática */
  --text:         #f3f4f6; /* Blanco grisáceo */
  --text-muted:   #9ca3af; /* Gris secundario */
  --text-dim:     #6b7280; /* Gris terciario */
  
  --gold:         #d97706; /* Dorado Iluminación */
  --gold-light:   #f59e0b; /* Dorado Brillante */
  --gold-glow:    rgba(217, 119, 6, 0.2);
  
  --success:      #10b981;
  --success-glow: rgba(16, 185, 129, 0.15);
  --danger:       #ef4444;
  --danger-glow:  rgba(239, 68, 68, 0.15);
  
  /* Utilidades visuales */
  --font-h:       'Outfit', sans-serif;
  --font-b:       'Inter', sans-serif;
  --r:            16px;
  --r-sm:         10px;
  --t:            all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow:       0 12px 40px rgba(0, 0, 0, 0.6);
  --shadow-gold:  0 10px 30px rgba(217, 119, 6, 0.15);
}

/* ── Reset General ────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-b);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; transition: var(--t); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
img { max-width: 100%; height: auto; display: block; }

/* Scrollbar Premium */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-panel); border-radius: 4px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ── Estructura de Navegación (Header) ─────────────── */
.store-header {
  background: rgba(7, 8, 15, 0.85);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--t);
}
.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-h);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.5px;
  color: var(--text);
}
.logo span { color: var(--gold-light); }
.logo-img { height: 35px; width: auto; filter: drop-shadow(0 0 6px var(--gold-glow)); }

.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  padding: 0.3rem 0;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link::after {
  content: '';
  position: absolute; bottom: 0; left: 0; width: 0; height: 2px;
  background: var(--gold); transition: var(--t);
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 1.5rem; }
.cart-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  transition: var(--t);
  font-size: 1.2rem;
}
.cart-trigger:hover {
  background: var(--bg-card);
  border-color: var(--gold-light);
  transform: scale(1.05);
}
.cart-count {
  position: absolute; top: -4px; right: -4px;
  background: var(--gold-light); color: #000;
  font-size: 0.72rem; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ── Hero Banner (Inicio) ────────────────────────── */
.hero {
  position: relative;
  padding: 8rem 2rem 6rem;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, var(--gold-glow) 0%, transparent 60%);
  overflow: hidden;
}
.hero-title {
  font-family: var(--font-h);
  font-size: 3.8rem;
  font-weight: 800;
  line-height: 1.1;
  max-width: 800px;
  margin: 0 auto 1.5rem;
  letter-spacing: -1px;
}
.hero-title span {
  background: linear-gradient(135deg, var(--gold-light), #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}
.hero-buttons { display: flex; align-items: center; justify-content: center; gap: 1rem; }

/* ── Botones Premium ──────────────────────────────── */
.btn-store {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.8rem 1.8rem;
  border-radius: var(--r-sm);
  font-weight: 600; font-size: 0.95rem;
  transition: var(--t);
  border: 1px solid transparent;
}
.btn-store.primary {
  background: var(--gold); color: #000;
  box-shadow: var(--shadow-gold);
}
.btn-store.primary:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(217, 119, 6, 0.3);
}
.btn-store.secondary {
  background: var(--bg-panel); color: var(--text);
  border-color: var(--border-light);
}
.btn-store.secondary:hover {
  background: var(--bg-card);
  border-color: var(--gold);
}
.btn-store.danger {
  background: var(--danger-glow); color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-store.danger:hover {
  background: var(--danger); color: #fff;
  transform: translateY(-1px);
}
.btn-store:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Contenido de Páginas ────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}
.page-heading {
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
}
.page-title {
  font-family: var(--font-h);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.page-subtitle { color: var(--text-muted); font-size: 0.9rem; }

/* ── Grilla de Categorías ─────────────────────────── */
.category-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  margin-bottom: 4rem;
}
.category-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 1.2rem;
  text-align: center;
  transition: var(--t);
  cursor: pointer;
}
.category-card:hover, .category-card.active {
  background: var(--bg-card);
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: var(--shadow-gold);
}
.category-icon { font-size: 2.2rem; margin-bottom: 0.8rem; display: block; }
.category-name { font-weight: 600; font-size: 0.85rem; color: var(--text); }

/* ── Catálogo y Tarjetas de Productos ────────────── */
.store-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2.5rem;
}
.filters-sidebar {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.5rem;
  height: fit-content;
  position: sticky; top: 100px;
}
.filter-title { font-family: var(--font-h); font-weight: 600; font-size: 1rem; margin-bottom: 1.2rem; display: flex; align-items: center; gap: 0.5rem; }
.filter-group { margin-bottom: 1.8rem; }
.filter-group-title { font-size: 0.8rem; text-transform: uppercase; font-weight: 700; color: var(--text-muted); margin-bottom: 0.8rem; letter-spacing: 0.5px; }

.search-box { position: relative; margin-bottom: 1.5rem; }
.search-box input {
  width: 100%; padding: 0.75rem 1rem 0.75rem 2.5rem;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text); outline: none; transition: var(--t);
}
.search-box input:focus { border-color: var(--gold); }
.search-box i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-dim); }

.filter-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.filter-item {
  font-size: 0.88rem; color: var(--text-muted); cursor: pointer; padding: 0.4rem 0.6rem; border-radius: 6px; transition: var(--t);
}
.filter-item:hover { color: var(--text); background: rgba(255,255,255,0.02); }
.filter-item.active { color: var(--gold-light); background: var(--gold-glow); font-weight: 600; }

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--t);
  position: relative;
}
.product-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-gold);
  box-shadow: var(--shadow);
}
.prod-img-wrap {
  width: 100%; height: 200px;
  background: #181c33;
  overflow: hidden; position: relative;
}
.product-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: var(--t);
}
.product-card:hover img { transform: scale(1.05); }

.stock-tag {
  position: absolute; top: 12px; left: 12px;
  padding: 0.2rem 0.6rem; border-radius: 20px;
  font-size: 0.7rem; font-weight: 700;
  z-index: 10;
}
.stock-tag.in-stock { background: var(--success-glow); color: var(--success); }
.stock-tag.low-stock { background: var(--gold-glow); color: var(--gold-light); }
.stock-tag.out-stock { background: var(--danger-glow); color: var(--danger); }

.prod-body { padding: 1.2rem; display: flex; flex-direction: column; flex: 1; }
.prod-category { font-size: 0.72rem; text-transform: uppercase; color: var(--text-dim); font-weight: 600; margin-bottom: 0.3rem; }
.prod-name { font-family: var(--font-h); font-weight: 600; font-size: 0.98rem; margin-bottom: 0.5rem; color: var(--text); line-height: 1.3; }
.prod-specs { font-size: 0.78rem; color: var(--text-muted); margin-bottom: auto; display: flex; flex-direction: column; gap: 0.1rem; }
.prod-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 1.2rem; }
.prod-price { font-family: var(--font-h); font-weight: 700; font-size: 1.2rem; color: var(--gold-light); }
.btn-add-quick {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gold-glow); color: var(--gold-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 600; transition: var(--t);
}
.btn-add-quick:hover { background: var(--gold); color: #000; }

/* Paginación */
.pagination { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 3rem; }
.page-btn {
  width: 38px; height: 38px; border-radius: var(--r-sm);
  background: var(--bg-panel); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.88rem; transition: var(--t);
}
.page-btn:hover, .page-btn.active { background: var(--gold); color: #000; border-color: var(--gold); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; background: var(--bg-panel) !important; color: var(--text-dim) !important; }

/* ── Detalle de Producto ─────────────────────────── */
.product-detail-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; margin-bottom: 3rem; }
.detail-image-wrap {
  width: 100%; min-height: 400px; max-height: 500px;
  background: var(--bg-panel); border-radius: var(--r);
  overflow: hidden; border: 1px solid var(--border);
}
.detail-image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { display: flex; flex-direction: column; justify-content: center; }
.detail-name { font-family: var(--font-h); font-size: 2.4rem; font-weight: 800; margin-bottom: 0.6rem; line-height: 1.2; }
.detail-price { font-family: var(--font-h); font-size: 2rem; font-weight: 700; color: var(--gold-light); margin-bottom: 1.5rem; }
.detail-description { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 2rem; }
.detail-specs-list {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 1.5rem; border-radius: var(--r-sm); margin-bottom: 2.5rem;
}
.spec-item span:first-child { display: block; font-size: 0.72rem; text-transform: uppercase; color: var(--text-dim); font-weight: 600; }
.spec-item span:last-child { font-weight: 500; font-size: 0.92rem; color: var(--text); }
.detail-actions { display: flex; align-items: center; gap: 1.5rem; }
.qty-selector {
  display: flex; align-items: center;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--r-sm); height: 46px; overflow: hidden;
}
.qty-btn { width: 40px; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 600; transition: var(--t); }
.qty-btn:hover { background: var(--bg-card); }
.qty-input { width: 45px; height: 100%; background: none; border: none; text-align: center; font-weight: 700; outline: none; }

/* ── Carrito y Resumen de Compra ──────────────────── */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 3rem; }
.cart-items-list { display: flex; flex-direction: column; gap: 1.2rem; }
.cart-item {
  display: flex; align-items: center; gap: 1.5rem;
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 1.2rem; border-radius: var(--r);
}
.cart-item-img { width: 70px; height: 70px; border-radius: var(--r-sm); object-fit: cover; background: var(--bg-input); }
.cart-item-info { flex: 1; }
.cart-item-name { font-family: var(--font-h); font-weight: 600; font-size: 0.98rem; margin-bottom: 0.2rem; }
.cart-item-sku { font-size: 0.75rem; color: var(--text-dim); font-family: monospace; }
.cart-item-price { font-family: var(--font-h); font-weight: 700; font-size: 1.1rem; color: var(--gold-light); margin-top: 0.4rem; }
.cart-item-remove { color: var(--text-dim); transition: var(--t); font-size: 1.1rem; padding: 0.5rem; }
.cart-item-remove:hover { color: var(--danger); }

.summary-panel {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--r); padding: 1.8rem; height: fit-content;
}
.summary-title { font-family: var(--font-h); font-weight: 700; font-size: 1.2rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 0.8rem; }
.summary-row { display: flex; justify-content: space-between; font-size: 0.88rem; color: var(--text-muted); margin-bottom: 0.8rem; }
.summary-row.total { color: var(--text); font-weight: 700; font-size: 1.2rem; border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 1.2rem; margin-bottom: 1.8rem; }
.summary-row.total span:last-child { color: var(--gold-light); }

/* ── Checkout y Formularios ───────────────────────── */
.checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: 3rem; }
.checkout-form-panel { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--r); padding: 2rem; }
.form-section-title { font-family: var(--font-h); font-weight: 600; font-size: 1.1rem; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.5rem; color: var(--text); border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.form-section-title span { color: var(--gold-light); }
.form-section { margin-bottom: 2.5rem; }

.form-group { margin-bottom: 1.2rem; }
.form-label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.form-control {
  width: 100%; padding: 0.75rem 1rem; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text); outline: none; transition: var(--t);
}
.form-control:focus { border-color: var(--gold); }
.form-control::placeholder { color: var(--text-dim); }
select.form-control option { background: var(--bg-panel); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.billing-toggle-wrap {
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 1rem 1.4rem; border-radius: var(--r-sm); margin-bottom: 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.toggle-control { display: flex; align-items: center; gap: 0.8rem; font-weight: 500; cursor: pointer; }
.toggle-control input { width: 18px; height: 18px; accent-color: var(--gold-light); }

.payment-options { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.8rem; margin-bottom: 1.5rem; }
.payment-option-card {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 1rem; text-align: center; cursor: pointer; transition: var(--t);
}
.payment-option-card:hover { border-color: var(--border-light); }
.payment-option-card.active { border-color: var(--gold); background: var(--gold-glow); }
.pay-icon { font-size: 1.8rem; display: block; margin-bottom: 0.4rem; }
.pay-name { font-weight: 600; font-size: 0.78rem; }

/* Tarjeta Mockup */
.mockup-card-form {
  background: rgba(255,255,255,0.02); border: 1px dashed var(--border-light);
  padding: 1.2rem; border-radius: var(--r-sm); margin-top: 1rem;
}

/* ── Portal de Facturación ────────────────────────── */
.invoicing-box {
  max-width: 600px; margin: 0 auto;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--r); padding: 2.5rem;
}
.invoicing-success-panel {
  background: var(--bg-card); border: 1px solid var(--border-gold);
  border-radius: var(--r); padding: 2rem; text-align: center;
  box-shadow: var(--shadow-gold);
}
.inv-success-icon { font-size: 3rem; color: var(--gold-light); margin-bottom: 1rem; display: block; }
.inv-success-title { font-family: var(--font-h); font-size: 1.4rem; font-weight: 700; margin-bottom: 0.5rem; }
.inv-success-subtitle { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 1.8rem; }
.download-buttons { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 1.5rem; }

/* ── Footer ───────────────────────────────────────── */
.store-footer {
  background: #04050a; border-top: 1px solid var(--border);
  padding: 4rem 2rem 2rem; color: var(--text-muted); font-size: 0.88rem;
  margin-top: 6rem;
}
.footer-container { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 4rem; margin-bottom: 3rem; }
.footer-title { font-family: var(--font-h); font-weight: 700; font-size: 1.1rem; color: var(--text); margin-bottom: 1.2rem; }
.footer-text { margin-bottom: 1rem; line-height: 1.5; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.03); padding-top: 1.8rem; display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; }

/* ── Modales / Overlays ───────────────────────────── */
.store-modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px);
  z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 1rem;
  opacity: 0; pointer-events: none; transition: var(--t);
}
.store-modal-overlay.open { opacity: 1; pointer-events: all; }
.store-modal {
  background: var(--bg-panel); border: 1px solid var(--border-light);
  border-radius: var(--r); width: 100%; max-width: 480px;
  overflow: hidden; transform: translateY(20px); transition: var(--t);
  box-shadow: var(--shadow);
}
.store-modal-overlay.open .store-modal { transform: translateY(0); }
.store-modal-header { padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.store-modal-title { font-family: var(--font-h); font-weight: 700; font-size: 1.1rem; }
.store-modal-body { padding: 1.5rem; max-height: 60vh; overflow-y: auto; }
.store-modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.6rem; }

/* ── Spinner de Carga ──────────────────────────────── */
.store-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border); border-top-color: var(--gold);
  border-radius: 50%; animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 4rem 1rem; color: var(--text-muted); }
.empty-state-icon { font-size: 3rem; margin-bottom: 0.8rem; opacity: 0.5; }
.empty-state-title { font-family: var(--font-h); font-size: 1.1rem; font-weight: 600; margin-bottom: 0.3rem; color: var(--text); }

/* ── Media Queries (Responsividad) ─────────────────── */
@media (max-width: 992px) {
  .store-layout { grid-template-columns: 1fr; }
  .filters-sidebar { position: static; width: 100%; margin-bottom: 2rem; }
  .product-detail-layout { grid-template-columns: 1fr; gap: 2.5rem; }
  .cart-layout, .checkout-layout { grid-template-columns: 1fr; gap: 2.5rem; }
}
@media (max-width: 768px) {
  .hero-title { font-size: 2.5rem; }
  .nav-links { display: none; } /* En una app real, haríamos un menú hamburguesa */
  .footer-container { grid-template-columns: 1fr; gap: 2.5rem; }
  .payment-options { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
}
