/* ==========================================================================
   NetMD Store — Retrowave Design System
   ========================================================================== */

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

:root {
  /* Color tokens */
  --bg-void:      #0d0618;
  --bg-deep:      #1a0b2e;
  --bg-panel:     #241242;
  --neon-magenta: #ff2e97;
  --neon-cyan:    #00f0ff;
  --neon-violet:  #7b2ff7;
  --sunset-orange:#ff6b35;
  --sunset-gold:  #ffd166;
  --text-hi:      #f5ecff;
  --text-mid:     #b8a8d9;
  --line:         rgba(255, 46, 151, 0.25);

  /* Type */
  --font-display: 'Audiowide', 'Rajdhani', sans-serif;
  --font-body: 'Rajdhani', sans-serif;

  --radius: 6px;
  --header-h: 84px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-void);
  color: var(--text-hi);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- Ambient grid background (signature element) ---------- */
.grid-horizon {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 70% 45% at 50% 18%, rgba(255,107,53,0.35), rgba(255,46,151,0.12) 45%, transparent 70%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-void) 55%, var(--bg-void) 100%);
}

.grid-horizon::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 55%;
  background-image:
    repeating-linear-gradient(90deg, var(--neon-violet) 0 1.5px, transparent 1.5px calc(100% / 24)),
    repeating-linear-gradient(0deg, var(--neon-cyan) 0 1.5px, transparent 1.5px 40px);
  background-size: 100% 100%, 100% 100%;
  opacity: 0.35;
  transform: perspective(300px) rotateX(60deg);
  transform-origin: bottom;
  mask-image: linear-gradient(180deg, transparent, black 25%);
  animation: gridScroll 6s linear infinite;
}

@keyframes gridScroll {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 0 0, 0 40px; }
}

.sun {
  position: absolute;
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--sunset-gold) 0%, var(--sunset-orange) 45%, var(--neon-magenta) 100%);
  box-shadow: 0 0 90px rgba(255,107,53,0.55), 0 0 160px rgba(255,46,151,0.35);
  z-index: -1;
  overflow: hidden;
}
.sun::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, var(--bg-void) 0 6px, transparent 6px 16px);
  opacity: 0.9;
  top: 45%;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
  padding: 0 clamp(20px, 5vw, 64px);
  background: rgba(13, 6, 24, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--text-hi);
  white-space: nowrap;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.brand span { color: var(--neon-cyan); text-shadow: 0 0 12px rgba(0,240,255,0.6); }

.main-nav {
  display: flex;
  gap: 28px;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 14px;
}
.main-nav a {
  position: relative;
  padding: 6px 2px;
  color: var(--text-mid);
  transition: color 0.2s ease;
}
.main-nav a:hover, .main-nav a.active { color: var(--neon-cyan); }
.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
}

.header-actions { display: flex; align-items: center; gap: 18px; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  min-width: 220px;
}
.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-hi);
  font-family: var(--font-body);
  font-size: 14px;
  width: 100%;
}
.search-box input::placeholder { color: var(--text-mid); }
.search-box svg { flex-shrink: 0; stroke: var(--text-mid); }

.cart-icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255,46,151,0.06);
  cursor: pointer;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.cart-icon-btn:hover { border-color: var(--neon-magenta); box-shadow: 0 0 16px rgba(255,46,151,0.5); }
.cart-icon-btn svg { stroke: var(--text-hi); }
.cart-count {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--neon-magenta);
  color: #1a0b2e;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 10px var(--neon-magenta);
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(60px, 10vw, 120px) clamp(20px, 5vw, 64px) 80px;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}
.hero .eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 4px;
  font-size: 13px;
  color: var(--neon-cyan);
  margin-bottom: 18px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(38px, 7vw, 74px);
  line-height: 1.05;
  margin: 0 0 20px;
  color: var(--text-hi);
  text-shadow: 0 0 24px rgba(123,47,247,0.6), 0 0 60px rgba(255,46,151,0.35);
}
.hero h1 em {
  font-style: normal;
  color: var(--neon-magenta);
}
.hero p.lede {
  font-size: 19px;
  color: var(--text-mid);
  max-width: 560px;
  margin: 0 auto 40px;
}

.hero-search {
  max-width: 520px;
  margin: 0 auto 48px;
}
.hero-search .search-box { min-width: 100%; padding: 14px 22px; }
.hero-search input { font-size: 16px; }

/* ---------- Category cards ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  max-width: 900px;
  margin: 0 auto;
}
@media (max-width: 640px) { .cat-grid { grid-template-columns: 1fr; } }

.cat-card {
  position: relative;
  padding: 36px 28px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(123,47,247,0.14), rgba(13,6,24,0.5));
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.cat-card:hover {
  transform: translateY(-4px);
  border-color: var(--neon-cyan);
  box-shadow: 0 10px 40px rgba(0,240,255,0.25);
}
.cat-card .tag {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--sunset-gold);
}
.cat-card h2 {
  font-family: var(--font-display);
  font-size: 26px;
  margin: 10px 0 8px;
}
.cat-card p { color: var(--text-mid); margin: 0 0 22px; font-size: 15px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 14px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-primary {
  background: linear-gradient(90deg, var(--neon-magenta), var(--neon-violet));
  color: #fff;
  box-shadow: 0 0 20px rgba(255,46,151,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 28px rgba(255,46,151,0.6); }
.btn-outline {
  background: transparent;
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}
.btn-outline:hover { background: rgba(0,240,255,0.1); box-shadow: 0 0 16px rgba(0,240,255,0.35); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn-block { width: 100%; }

/* ---------- Catalog pages ---------- */
.page-head {
  padding: 56px clamp(20px, 5vw, 64px) 24px;
  max-width: 1100px;
  margin: 0 auto;
}
.breadcrumb { font-size: 13px; color: var(--text-mid); margin-bottom: 14px; letter-spacing: 0.5px; text-transform: uppercase; }
.breadcrumb a:hover { color: var(--neon-cyan); }
.page-head h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 46px);
  margin: 0 0 10px;
}
.page-head .badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  margin-bottom: 14px;
}
.badge.nuevo { color: var(--neon-cyan); border-color: var(--neon-cyan); }
.badge.usado { color: var(--sunset-gold); border-color: var(--sunset-gold); }
.page-head p { color: var(--text-mid); max-width: 640px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 64px) 100px;
}

.product-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-panel);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.product-card:hover { border-color: var(--neon-magenta); box-shadow: 0 12px 40px rgba(255,46,151,0.2); }

.product-media {
  aspect-ratio: 4 / 3;
  background: radial-gradient(circle at 50% 40%, rgba(255,255,255,0.06), transparent 70%), var(--bg-deep);
  display: grid;
  place-items: center;
  padding: 20px;
  position: relative;
}
.product-media img { max-height: 100%; width: auto; margin: 0 auto; filter: drop-shadow(0 10px 24px rgba(0,0,0,0.5)); }
.product-media .condition-chip {
  position: absolute;
  top: 14px; left: 14px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.condition-chip.nuevo { background: rgba(0,240,255,0.15); color: var(--neon-cyan); border: 1px solid var(--neon-cyan); }
.condition-chip.usado { background: rgba(255,209,102,0.15); color: var(--sunset-gold); border: 1px solid var(--sunset-gold); }

.product-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.product-body h3 { font-family: var(--font-display); font-size: 18px; margin: 0; line-height: 1.35; }
.product-body .spec { font-size: 13px; color: var(--text-mid); }
.product-price { font-family: var(--font-body); font-weight: 700; font-size: 22px; color: var(--text-hi); margin-top: 4px; }
.product-price small { font-size: 13px; color: var(--text-mid); font-weight: 500; }

.qty-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: auto; padding-top: 6px; }
.stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.stepper button {
  width: 34px; height: 34px;
  background: none;
  border: none;
  color: var(--text-hi);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.stepper button:hover { background: rgba(255,255,255,0.06); }
.stepper input {
  width: 36px;
  text-align: center;
  background: none;
  border: none;
  color: var(--text-hi);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
}
.add-cart-btn {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--neon-magenta);
  background: rgba(255,46,151,0.1);
  color: var(--neon-magenta);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  flex-shrink: 0;
}
.add-cart-btn:hover { background: var(--neon-magenta); color: #fff; transform: scale(1.06); }
.add-cart-btn.added { background: var(--neon-cyan); border-color: var(--neon-cyan); color: #0d0618; }

/* ---------- Cart drawer ---------- */
.cart-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: min(400px, 92vw);
  background: var(--bg-deep);
  border-left: 1px solid var(--line);
  z-index: 91;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -10px 0 40px rgba(0,0,0,0.5);
}
.cart-drawer.open { transform: translateX(0); }

.cart-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}
.cart-drawer-head h2 { font-family: var(--font-display); font-size: 18px; margin: 0; }
.cart-drawer-head button { background: none; border: none; color: var(--text-mid); font-size: 22px; cursor: pointer; }

.cart-items { flex: 1; overflow-y: auto; padding: 12px 24px; }
.cart-item {
  display: flex; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cart-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; }
.cart-item-info { flex: 1; }
.cart-item-info h4 { margin: 0 0 4px; font-size: 14px; font-family: var(--font-body); font-weight: 700; }
.cart-item-info .meta { font-size: 12px; color: var(--text-mid); }
.cart-item-actions { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.cart-item-actions button { background: none; border: 1px solid var(--line); color: var(--text-hi); width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 13px; }
.cart-item-remove { margin-left: auto; background: none; border: none; color: var(--neon-magenta); font-size: 12px; cursor: pointer; text-transform: uppercase; letter-spacing: 0.5px; }
.cart-item-price { font-weight: 700; font-size: 14px; white-space: nowrap; }

.cart-empty { text-align: center; color: var(--text-mid); padding: 60px 20px; font-size: 14px; }

.cart-drawer-foot { padding: 20px 24px 26px; border-top: 1px solid var(--line); }
.cart-total-row { display: flex; justify-content: space-between; font-family: var(--font-body); font-weight: 700; font-size: 17px; margin-bottom: 16px; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 40px clamp(20px, 5vw, 64px);
  text-align: center;
  color: var(--text-mid);
  font-size: 13px;
  border-top: 1px solid var(--line);
}
.site-footer .foot-brand { color: var(--neon-cyan); font-family: var(--font-display); font-size: 14px; margin-bottom: 6px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-panel);
  border: 1px solid var(--neon-cyan);
  color: var(--text-hi);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 0 20px rgba(0,240,255,0.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Cart page ---------- */
.cart-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 56px clamp(20px,5vw,64px) 100px;
}
.cart-page h1 { font-family: var(--font-display); font-size: clamp(28px,5vw,40px); margin-bottom: 30px; }
.cart-line {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.cart-line img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; }
.cart-line-info { flex: 1; }
.cart-line-info h3 { margin: 0 0 4px; font-family: var(--font-body); font-size: 16px; }
.cart-summary { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 24px; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--text-mid); font-size: 15px; }
.summary-row.total { color: var(--text-hi); font-weight: 700; font-size: 20px; margin-top: 14px; }
.checkout-form { margin-top: 30px; display: grid; gap: 14px; }
.checkout-form label { font-size: 13px; color: var(--text-mid); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; display: block; }
.checkout-form input,
.checkout-form select,
.checkout-form textarea {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text-hi);
  font-family: var(--font-body);
  font-size: 15px;
}
.checkout-form textarea { resize: vertical; min-height: 70px; }
.checkout-form select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23b8a8d9' stroke-width='2'><path d='M4 6l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.checkout-form select option { background: var(--bg-panel); color: var(--text-hi); }
.checkout-form input:focus, .checkout-form select:focus, .checkout-form textarea:focus,
.search-box input:focus, .stepper input:focus { outline: 2px solid var(--neon-cyan); outline-offset: 2px; }

.form-section-title {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--neon-cyan);
  margin: 8px 0 -2px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.checkout-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.checkout-form .form-row.thirds {
  grid-template-columns: 1fr 1fr 1fr;
}
@media (max-width: 560px) {
  .checkout-form .form-row,
  .checkout-form .form-row.thirds { grid-template-columns: 1fr; }
}
.field-hint { font-size: 12px; color: var(--text-mid); margin-top: -8px; }
.checkout-status { margin-top: 16px; font-size: 14px; color: var(--text-mid); min-height: 20px; }

/* Focus visibility for all interactive elements */
a:focus-visible, button:focus-visible { outline: 2px solid var(--neon-cyan); outline-offset: 2px; }
