/* ============================================================
   StreamStore - Catálogo Público
   Paleta: Negro profundo + Violeta eléctrico + Blanco frío
   ============================================================ */

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

:root {
  --bg:        #0a0a0f;
  --surface:   #13131c;
  --card:      #1a1a28;
  --border:    #2a2a3d;
  --violet:    #7c3aed;
  --violet-lo: #7c3aed22;
  --violet-hi: #a855f7;
  --green:     #22c55e;
  --red:       #ef4444;
  --yellow:    #eab308;
  --text:      #f0f0f8;
  --muted:     #8888aa;
  --white:     #ffffff;
  --currency:  "Bs.";
  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 4px 24px #0007;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── HEADER ─────────────────────────────────────────────── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
}
.logo span { color: var(--violet-hi); }

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

/* ── CART ICON ───────────────────────────────────────────── */
.cart-btn {
  background: var(--violet-lo);
  border: 1px solid var(--violet);
  color: var(--text);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s, transform 0.1s;
  position: relative;
}
.cart-btn:hover { background: var(--violet); transform: translateY(-1px); }
.cart-count {
  background: var(--violet-hi);
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.cart-count.hidden { display: none; }

/* ── HERO ────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--bg) 0%, #1a0a35 50%, var(--bg) 100%);
  padding: 80px 24px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, #7c3aed33 0%, transparent 70%);
  pointer-events: none;
}

.hero-label {
  display: inline-block;
  background: var(--violet-lo);
  border: 1px solid var(--violet);
  color: var(--violet-hi);
  font-size: 0.75rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--violet-hi), #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 auto 32px;
}

/* ── SEARCH ──────────────────────────────────────────────── */
.search-bar {
  max-width: 420px;
  margin: 0 auto;
  position: relative;
}

.search-bar input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px 12px 44px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}
.search-bar input:focus { border-color: var(--violet); }
.search-bar input::placeholder { color: var(--muted); }
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1rem;
}

/* ── MAIN CONTENT ────────────────────────────────────────── */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--white);
}

.products-count {
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 20px;
}

/* ── PRODUCT GRID ────────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

/* ── PRODUCT CARD ────────────────────────────────────────── */
.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--violet);
  box-shadow: 0 8px 32px #7c3aed22;
}

.card-image {
  background: var(--surface);
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.card-image img {
  max-width: 120px;
  max-height: 100px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px #0008);
}
.card-image .placeholder-icon {
  font-size: 3.5rem;
  opacity: 0.3;
}

.stock-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.7rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.04em;
}
.stock-badge.available { background: #22c55e22; color: var(--green); border: 1px solid #22c55e44; }
.stock-badge.low       { background: #eab30822; color: var(--yellow); border: 1px solid #eab30844; }
.stock-badge.out       { background: #ef444422; color: var(--red); border: 1px solid #ef444444; }

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 12px;
}

.card-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
}

.card-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}

/* ── PLANES ──────────────────────────────────────────────── */
.plans-label {
  font-size: 0.72rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 6px;
}

.plans-list { display: flex; flex-direction: column; gap: 6px; }

.plan-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.plan-item:hover { border-color: var(--violet); background: var(--violet-lo); }
.plan-item.selected { border-color: var(--violet); background: var(--violet-lo); }

.plan-info { display: flex; flex-direction: column; gap: 1px; }
.plan-name { font-size: 0.82rem; font-weight: 500; color: var(--text); }
.plan-duration { font-size: 0.72rem; color: var(--muted); }
.plan-price {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--violet-hi);
}

/* ── CARD ACTIONS ────────────────────────────────────────── */
.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.btn-primary {
  background: var(--violet);
  color: #fff;
  flex: 1;
}
.btn-primary:hover { background: var(--violet-hi); transform: translateY(-1px); }
.btn-primary:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; transform: none; }

.btn-whatsapp {
  background: #25d36622;
  border: 1px solid #25d36644;
  color: #25d366;
  width: 40px;
  padding: 10px;
  flex-shrink: 0;
}
.btn-whatsapp:hover { background: #25d366; color: #fff; }

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state p { font-size: 0.9rem; }

/* ── CART SIDEBAR ────────────────────────────────────────── */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: #000a;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.cart-overlay.open { opacity: 1; pointer-events: all; }

.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}
.cart-sidebar.open { transform: translateX(0); }

.cart-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cart-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}
.cart-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.3rem;
  padding: 4px;
  transition: color 0.15s;
}
.cart-close:hover { color: var(--text); }

.cart-items { flex: 1; overflow-y: auto; padding: 16px 24px; display: flex; flex-direction: column; gap: 12px; }

.cart-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.cart-item-info { flex: 1; }
.cart-item-name { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 0.88rem; }
.cart-item-plan { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.cart-item-price { font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: var(--violet-hi); font-size: 0.9rem; }
.cart-item-remove { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.9rem; padding: 2px; transition: color 0.15s; }
.cart-item-remove:hover { color: var(--red); }

.cart-empty-msg { text-align: center; color: var(--muted); padding: 40px 0; font-size: 0.88rem; }
.cart-empty-msg .icon { font-size: 2.5rem; display: block; margin-bottom: 12px; opacity: 0.4; }

.cart-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-total-label { font-size: 0.85rem; color: var(--muted); }
.cart-total-price { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.2rem; color: var(--white); }

.btn-checkout {
  background: var(--violet);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
.btn-checkout:hover { background: var(--violet-hi); }

/* ── MODAL PAGO ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: #000b;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: scale(1); }

.modal-header {
  padding: 24px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}
.modal-close { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.3rem; }
.modal-close:hover { color: var(--text); }

.modal-body { padding: 24px; }

.qr-section {
  text-align: center;
  margin-bottom: 24px;
}
.qr-section p { font-size: 0.85rem; color: var(--muted); margin-bottom: 16px; }
.qr-img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 8px;
}
.qr-placeholder {
  width: 180px;
  height: 180px;
  background: var(--card);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0 auto;
}

.order-summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
}
.order-summary h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.order-line { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 6px; }
.order-line-total {
  display: flex;
  justify-content: space-between;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}
.form-group input, .form-group textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.88rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.15s;
  resize: vertical;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--violet); }

.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.upload-area:hover { border-color: var(--violet); background: var(--violet-lo); }
.upload-area.has-file { border-color: var(--green); background: #22c55e11; }
.upload-area input { display: none; }
.upload-area .up-icon { font-size: 2rem; margin-bottom: 8px; }
.upload-area p { font-size: 0.82rem; color: var(--muted); }
.upload-area p strong { color: var(--violet-hi); }

.btn-send-order {
  width: 100%;
  background: #25d366;
  border: none;
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-send-order:hover { background: #1da851; }

/* ── FOOTER ──────────────────────────────────────────────── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero { padding: 48px 16px 40px; }
  .products-grid { grid-template-columns: 1fr; gap: 16px; }
  main { padding: 32px 16px 60px; }
  .cart-sidebar { width: 100vw; }
}
