/* ============================================================
   MOTÚNICO — Design System
   "Estilo que impone"
   ============================================================ */

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

/* ─── CSS CUSTOM PROPERTIES ─────────────────────────────────── */
:root {
  /* Colors */
  --bg-base:        #0e0e0e;
  --bg-surface:     #161616;
  --bg-card:        #1a1a1a;
  --bg-overlay:     rgba(14, 14, 14, 0.92);

  --text-primary:   #F5F5F7;
  --text-secondary: #C8C8CC;
  --text-muted:     #6E6E73;
  --text-dim:       #3D3D42;

  --accent:         #8EE53F;
  --accent-dim:     rgba(142, 229, 63, 0.15);
  --accent-glow:    rgba(142, 229, 63, 0.35);
  --accent-hover:   #a8f050;

  --danger:         #FF453A;
  --danger-dim:     rgba(255, 69, 58, 0.15);
  --warning:        #FFD60A;
  --success:        #30D158;

  --border:         rgba(255, 255, 255, 0.07);
  --border-accent:  rgba(142, 229, 63, 0.4);
  --border-card:    rgba(255, 255, 255, 0.05);

  --chrome:         linear-gradient(135deg, #c8c8cc 0%, #f5f5f7 40%, #a1a1a6 60%, #f5f5f7 100%);
  --carbon:         repeating-linear-gradient(
                      45deg,
                      transparent,
                      transparent 2px,
                      rgba(255,255,255,0.015) 2px,
                      rgba(255,255,255,0.015) 4px
                    );

  /* Typography */
  --font-display:   'Orbitron', monospace;
  --font-brand:     'Syne', sans-serif;
  --font-body:      'Inter', sans-serif;

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radii */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:    0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg:    0 8px 40px rgba(0,0,0,0.6);
  --shadow-accent: 0 0 20px var(--accent-glow), 0 4px 24px rgba(0,0,0,0.5);
  --shadow-card-hover: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px var(--border-accent);

  /* Transitions */
  --transition-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base:   250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:   400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── RESET & BASE ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: #0b0b0c;
  background-image: 
    linear-gradient(45deg, #111 25%, transparent 25%), 
    linear-gradient(-45deg, #111 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #111 75%), 
    linear-gradient(-45deg, transparent 75%, #111 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
  color: #f5f5f7;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* Ambient Occlusion / Neon Glows */
body::before, body::after {
  content: '';
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.12;
  z-index: -1;
  pointer-events: none;
}
body::before {
  background: radial-gradient(circle, #8EE53F 0%, transparent 70%);
  top: -150px;
  left: -150px;
}
body::after {
  background: radial-gradient(circle, #8EE53F 0%, transparent 70%);
  bottom: -150px;
  right: -150px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: var(--font-body);
  border: none;
  outline: none;
  background: none;
}

input, select, textarea {
  font-family: var(--font-body);
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
}

ul, ol { list-style: none; }

/* ─── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ─── LOADER OVERLAY ─────────────────────────────────────────── */
#loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

#loader-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-logo-container {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid #8EE53F;
  box-shadow: 0 0 20px rgba(142, 229, 63, 0.5);
  overflow: hidden;
  margin-bottom: var(--space-4);
  animation: pulse-loader 2s infinite ease-in-out;
  background: #000;
}

.loader-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes pulse-loader {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 15px rgba(142, 229, 63, 0.4);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 30px rgba(142, 229, 63, 0.8), 0 0 50px rgba(142, 229, 63, 0.3);
  }
}

.loader-spinner {
  width: 56px;
  height: 56px;
  position: relative;
}

.loader-spinner::before,
.loader-spinner::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.loader-spinner::before {
  border: 2px solid var(--border);
}

.loader-spinner::after {
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse-dot 0.8s ease-in-out infinite alternate;
}

@keyframes pulse-dot {
  from { transform: translate(-50%, -50%) scale(0.6); opacity: 0.6; }
  to   { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

.loader-text {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ─── APP SHELL ──────────────────────────────────────────────── */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── TOPBAR / NAVIGATION ───────────────────────────────────── */
#topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(20, 20, 20, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0 var(--space-6);
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.brand-logo-container {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid #8EE53F;
  box-shadow: 0 0 10px rgba(142, 229, 63, 0.4);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  transition: all var(--transition-base);
}

.topbar-brand:hover .brand-logo-container {
  box-shadow: 0 0 18px rgba(142, 229, 63, 0.8);
  transform: scale(1.05);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-text-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-name-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  background: var(--chrome);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto;
  animation: shimmer 4s infinite;
  line-height: 1.1;
}

.brand-tagline {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 1px;
  display: none;
}

@media (min-width: 640px) { .brand-tagline { display: block; } }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Search bar */
.search-wrapper {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.search-input {
  width: 100%;
  height: 42px;
  background: rgba(15, 15, 18, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0 44px 0 var(--space-4);
  font-size: 0.875rem;
  color: var(--text-primary);
  backdrop-filter: blur(5px);
  transition: all var(--transition-base);
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
  border-color: #8EE53F;
  box-shadow: 0 0 15px rgba(142, 229, 63, 0.4);
  background: rgba(22, 22, 26, 0.85);
}

.search-icon {
  position: absolute;
  right: 14px;
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 18px;
  height: 18px;
  transition: color var(--transition-base);
}

/* Nav buttons */
.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-base);
  position: relative;
  flex-shrink: 0;
}

.btn-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 12px var(--accent-dim);
}

.btn-icon .badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--accent);
  color: var(--bg-base);
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btn-nav {
  height: 36px;
  padding: 0 var(--space-4);
  background: rgba(20, 20, 24, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn-nav:hover {
  border-color: #8EE53F;
  color: #8EE53F;
  background: rgba(142, 229, 63, 0.05);
}

.btn-nav.active {
  background: rgba(142, 229, 63, 0.15);
  border-color: #8EE53F;
  color: #8EE53F;
}

.btn-nav svg { flex-shrink: 0; }

/* ─── PRIMARY BUTTON ─────────────────────────────────────────── */
.btn-primary {
  height: 44px;
  padding: 0 var(--space-6);
  background: linear-gradient(135deg, #8EE53F 0%, #76c72c 100%);
  color: #0b0b0c;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  position: relative;
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  transition: all var(--transition-spring);
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-accent);
  transform: translateY(-1px);
}

.btn-primary:hover::after { opacity: 1; }
.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
  background: var(--text-dim);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-secondary {
  height: 40px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  transition: all var(--transition-base);
}

.btn-secondary:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #ff6b63;
  box-shadow: 0 0 16px rgba(255, 69, 58, 0.4);
}

/* ─── MAIN CONTENT ───────────────────────────────────────────── */
#main-content {
  flex: 1;
  padding: var(--space-6);
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ─── SECTION HEADER ─────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.section-title {
  font-family: var(--font-brand);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.section-title .accent-line {
  display: inline-block;
  width: 6px;
  height: 1.3em;
  background: linear-gradient(to bottom, #8EE53F 0%, rgba(142, 229, 63, 0) 100%);
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(142, 229, 63, 0.6);
  animation: led-flicker 2s infinite alternate ease-in-out;
}

@keyframes led-flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(142, 229, 63, 0.8));
  }
  20%, 24%, 55% {
    opacity: 0.6;
    filter: drop-shadow(0 0 1px rgba(142, 229, 63, 0.1));
  }
}

/* ─── FILTER CHIPS ───────────────────────────────────────────── */
.filter-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}

.filter-chip {
  height: 32px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-base);
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-chip.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 8px var(--accent-dim);
}

/* ─── NOVEDADES CAROUSEL ─────────────────────────────────────── */
.novedades-section {
  margin-bottom: var(--space-10);
}

.novedades-scroll {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -ms-overflow-style: none;
  scrollbar-width: none;
  padding-bottom: var(--space-2);
}

.novedades-scroll::-webkit-scrollbar { display: none; }

.novedad-card {
  flex: 0 0 260px;
  scroll-snap-align: start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  transition: transform var(--transition-spring), box-shadow var(--transition-base);
  cursor: pointer;
}

.novedad-card:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: var(--shadow-card-hover);
}

.novedad-badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  background: var(--accent);
  color: var(--bg-base);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  z-index: 2;
  box-shadow: 0 0 10px var(--accent-glow);
}

.novedad-img-wrap {
  height: 150px;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.novedad-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

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

.novedad-img-placeholder {
  color: var(--text-dim);
  opacity: 0.5;
}

.novedad-info {
  padding: var(--space-3) var(--space-4);
}

.novedad-nombre {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.3;
  margin-bottom: var(--space-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.novedad-precio {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.novedad-codigo {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-display);
  letter-spacing: 0.08em;
}

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

/* ─── PRODUCT CARD ───────────────────────────────────────────── */
.product-card {
  background: rgba(22, 22, 26, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-spring), box-shadow var(--transition-base), border-color var(--transition-base);
  position: relative;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-5px);
  border-color: #8EE53F;
  box-shadow: 0 0 15px rgba(142, 229, 63, 0.25), 0 8px 30px rgba(0, 0, 0, 0.75);
}

.product-card.agotado {
  opacity: 0.8;
}

.product-card.agotado:hover {
  transform: translateY(-5px);
  border-color: #FF453A;
  box-shadow: 0 0 15px rgba(255, 69, 58, 0.25), 0 8px 30px rgba(0, 0, 0, 0.75);
}

/* Image area */
.card-img-wrap {
  height: 180px;
  background: #0e0e10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Out of stock diagonal ribbon */
.out-of-stock-ribbon {
  position: absolute;
  top: 18px;
  right: -32px;
  background: linear-gradient(135deg, #7a0909 0%, #d32f2f 50%, #4a0404 100%);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 35px;
  transform: rotate(45deg);
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

.card-img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-dim);
}

.card-img-placeholder svg { opacity: 0.3; }
.card-img-placeholder span {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Badges */
.card-badges {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  right: var(--space-3);
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}

.badge-agotado {
  background: rgba(255, 69, 58, 0.2);
  border: 1px solid rgba(255, 69, 58, 0.5);
  color: #ff6b63;
}

.badge-new {
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  box-shadow: 0 0 8px var(--accent-dim);
}

.badge-admin {
  background: rgba(255, 214, 10, 0.15);
  border: 1px solid rgba(255, 214, 10, 0.4);
  color: var(--warning);
}

/* Card body */
.card-body {
  padding: var(--space-4);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.card-codigo {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-transform: uppercase;
}

.card-nombre {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.card-unidad {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.card-existencia {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.card-existencia.low {
  color: var(--warning);
}

/* Pricing */
.card-pricing {
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.price-mayor {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.price-mayor span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.price-minimo-admin {
  font-size: 0.75rem;
  color: var(--warning);
  margin-top: var(--space-1);
  font-weight: 500;
}

/* Card footer */
.card-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--space-2);
}

.btn-add-cart {
  flex: 1;
  height: 38px;
  background: rgba(22, 22, 26, 0.8);
  border: 1px solid rgba(142, 229, 63, 0.3);
  color: #8EE53F;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  transition: all var(--transition-spring);
}

.btn-add-cart:hover {
  background: linear-gradient(135deg, #8EE53F 0%, #76c72c 100%);
  color: #0b0b0c;
  box-shadow: 0 0 15px rgba(142, 229, 63, 0.4);
  transform: scale(1.03);
}

.btn-add-cart:disabled {
  background: #222;
  border-color: rgba(255, 255, 255, 0.05);
  color: #444;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ─── EMPTY STATE ────────────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-16) var(--space-8);
  text-align: center;
}

/* Empty State Logo container */
.empty-state-logo-container {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2px solid #8EE53F;
  box-shadow: 0 0 15px rgba(142, 229, 63, 0.3);
  overflow: hidden;
  margin-bottom: var(--space-2);
  animation: pulse-loader 2.5s infinite ease-in-out;
  background: #000;
}

.empty-state-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.empty-state svg { opacity: 0.2; }

.empty-state h3 {
  font-family: var(--font-brand);
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ─── CART VIEW ──────────────────────────────────────────────── */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  max-width: 900px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .cart-layout {
    grid-template-columns: 1fr 320px;
  }
}

.cart-header {
  margin-bottom: var(--space-6);
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cart-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: var(--space-4);
  align-items: center;
  transition: border-color var(--transition-base);
}

.cart-item:hover { border-color: rgba(255,255,255,0.12); }

.cart-item-img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  overflow: hidden;
  flex-shrink: 0;
}

.cart-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-info {
  min-width: 0;
}

.cart-item-codigo {
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  margin-bottom: var(--space-1);
}

.cart-item-nombre {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.qty-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.qty-display {
  min-width: 28px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.cart-item-price {
  text-align: right;
  flex-shrink: 0;
}

.cart-item-subtotal {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cart-item-unit-price {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.btn-remove-item {
  margin-top: var(--space-2);
  color: var(--danger);
  font-size: 0.72rem;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-remove-item:hover { opacity: 1; }

/* Cart summary */
.cart-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: sticky;
  top: 80px;
  height: fit-content;
}

.cart-summary-title {
  font-family: var(--font-brand);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.summary-total {
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.summary-total-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.summary-total-amount {
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.whatsapp-btn {
  background: linear-gradient(135deg, #25D366 0%, #1ebd54 100%);
  color: #fff;
  height: 48px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  transition: all var(--transition-spring);
}

.whatsapp-btn:hover {
  background: linear-gradient(135deg, #2ae06d 0%, #20c35a 100%);
  box-shadow: 0 0 20px rgba(37, 211, 102, 0.5);
  transform: translateY(-1px);
}

.cart-empty {
  text-align: center;
  padding: var(--space-16) var(--space-8);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

/* ─── LOGIN VIEW ─────────────────────────────────────────────── */
.login-wrapper {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-10) var(--space-8);
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 180px;
  height: 180px;
  background: var(--accent-dim);
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}

.login-card-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.login-card-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  background: var(--chrome);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto;
  animation: shimmer 4s infinite;
}

.login-card-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.form-input {
  height: 48px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 var(--space-4);
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: all var(--transition-base);
  width: 100%;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-input::placeholder { color: var(--text-dim); }

.login-error {
  background: var(--danger-dim);
  border: 1px solid rgba(255,69,58,0.4);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: 0.8rem;
  color: var(--danger);
  display: none;
}

.login-error.show { display: block; }

/* ─── ADMIN PANEL ────────────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-6);
  min-height: calc(100vh - 64px - 48px);
}

@media (max-width: 768px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
}

.admin-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  height: fit-content;
  position: sticky;
  top: 80px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-base);
  border: 1px solid transparent;
}

.admin-nav-item:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.admin-nav-item.active {
  background: var(--accent-dim);
  border-color: var(--border-accent);
  color: var(--accent);
}

.admin-nav-item svg { flex-shrink: 0; }

.admin-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Admin panels */
.admin-panel {
  display: none;
  flex-direction: column;
  gap: var(--space-6);
}

.admin-panel.active { display: flex; }

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}

.admin-card-title {
  font-family: var(--font-brand);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.admin-card-title svg { color: var(--accent); }

/* Drop zone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.dropzone svg { color: var(--text-dim); transition: color var(--transition-base); }
.dropzone:hover svg,
.dropzone.dragover svg { color: var(--accent); }

.dropzone h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.dropzone p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Upload progress */
.upload-progress {
  display: none;
}

.upload-progress.show {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.progress-bar-wrap {
  height: 4px;
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
  box-shadow: 0 0 8px var(--accent-glow);
}

.upload-status {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Preview table */
.preview-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.preview-table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.preview-table td {
  padding: var(--space-3) var(--space-4);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.preview-table tr:last-child td { border-bottom: none; }

.preview-table tr {
  background: rgba(22, 22, 26, 0.4);
  transition: all var(--transition-fast);
}
.preview-table tr:nth-child(even) {
  background: rgba(15, 15, 18, 0.6);
}
.preview-table tr:hover td {
  background: rgba(142, 229, 63, 0.06) !important;
  color: #ffffff;
}
.preview-table tr:hover td:first-child {
  box-shadow: inset 4px 0 0 0 #8EE53F;
}

.preview-table .col-precio { color: var(--accent); font-weight: 600; }
.preview-table .col-minimo { color: var(--warning); }
.preview-table .col-codigo { font-family: var(--font-display); font-size: 0.65rem; letter-spacing: 0.1em; color: var(--accent); }

/* Pending images list */
.pending-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.pending-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-4);
  align-items: center;
  transition: border-color var(--transition-base);
}

.pending-item:hover { border-color: rgba(255,255,255,0.1); }

.pending-item-info {
  min-width: 0;
}

.pending-codigo {
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.pending-nombre {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pending-url-form {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.pending-url-input {
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 var(--space-3);
  font-size: 0.8rem;
  color: var(--text-primary);
  min-width: 200px;
  max-width: 300px;
  transition: all var(--transition-base);
}

.pending-url-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.btn-save-img {
  height: 36px;
  padding: 0 var(--space-4);
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition-spring);
}

.btn-save-img:hover {
  background: var(--accent);
  color: var(--bg-base);
  box-shadow: 0 0 10px var(--accent-dim);
}

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-4);
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: all var(--transition-base);
}

.stat-card:hover {
  border-color: rgba(255,255,255,0.1);
  transform: translateY(-2px);
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: var(--space-1);
}

.stat-value {
  font-family: var(--font-body);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Inventory table */
.inventory-wrap {
  overflow-x: auto;
}

.inventory-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.inventory-table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.inventory-table td {
  padding: var(--space-3) var(--space-4);
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}

.inventory-table tr {
  background: rgba(22, 22, 26, 0.4);
  transition: all var(--transition-fast);
}
.inventory-table tr:nth-child(even) {
  background: rgba(15, 15, 18, 0.6);
}
.inventory-table tr:hover td {
  background: rgba(142, 229, 63, 0.06) !important;
  color: #ffffff;
}
.inventory-table tr:hover td:first-child {
  box-shadow: inset 4px 0 0 0 #8EE53F;
}

.inv-codigo {
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.inv-precio-mayor { color: var(--text-primary); font-weight: 600; }
.inv-precio-min { color: var(--warning); font-weight: 500; }
.inv-existencia { font-weight: 600; }
.inv-existencia.zero { color: var(--danger); }
.inv-existencia.low { color: var(--warning); }

.inv-img-thumb {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  overflow: hidden;
}

.inv-img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inv-no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}

/* WhatsApp number config */
.config-row {
  display: flex;
  gap: var(--space-3);
  align-items: flex-end;
}

.config-row .form-group { flex: 1; }

/* ─── TOAST NOTIFICATIONS ─────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 280px;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  transform: translateX(120%);
  transition: transform var(--transition-spring);
  pointer-events: auto;
}

.toast.show { transform: translateX(0); }
.toast.hide { transform: translateX(120%); }

.toast-icon { flex-shrink: 0; }
.toast-text { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.4; }

.toast.success { border-color: rgba(48, 209, 88, 0.4); }
.toast.success .toast-icon { color: var(--success); }

.toast.error { border-color: rgba(255,69,58,0.4); }
.toast.error .toast-icon { color: var(--danger); }

.toast.info { border-color: var(--border-accent); }
.toast.info .toast-icon { color: var(--accent); }

/* ─── MOBILE SEARCH TOGGLE ──────────────────────────────────── */
@media (max-width: 640px) {
  .search-wrapper { display: none; }
  .search-wrapper.mobile-open { display: block; position: absolute; top: 64px; left: 0; right: 0; padding: var(--space-3) var(--space-4); background: var(--bg-base); border-bottom: 1px solid var(--border); z-index: 99; max-width: 100%; }
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  #main-content { padding: var(--space-4); }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-3); }
  .card-img-wrap { height: 130px; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .pending-url-form { flex-direction: column; align-items: stretch; }
  .pending-url-input { max-width: 100%; min-width: 0; }
  .config-row { flex-direction: column; }
}

/* ─── ANIMATIONS ─────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.animate-fadeInUp {
  animation: fadeInUp 0.4s var(--transition-spring) both;
}

.animate-fadeIn {
  animation: fadeIn 0.3s ease both;
}

/* Stagger children */
.products-grid > *:nth-child(1)  { animation-delay: 0ms; }
.products-grid > *:nth-child(2)  { animation-delay: 40ms; }
.products-grid > *:nth-child(3)  { animation-delay: 80ms; }
.products-grid > *:nth-child(4)  { animation-delay: 120ms; }
.products-grid > *:nth-child(5)  { animation-delay: 160ms; }
.products-grid > *:nth-child(6)  { animation-delay: 200ms; }
.products-grid > *:nth-child(7)  { animation-delay: 240ms; }
.products-grid > *:nth-child(8)  { animation-delay: 280ms; }
.products-grid > *:nth-child(n+9) { animation-delay: 320ms; }

/* Accent glow pulse */
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 8px var(--accent-glow); }
  50%       { box-shadow: 0 0 18px var(--accent-glow), 0 0 40px var(--accent-dim); }
}

.glow-pulse { animation: glow-pulse 2.5s ease-in-out infinite; }

/* ─── UTILITY CLASSES ─────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.text-accent { color: var(--accent); }
.text-muted  { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.fw-700 { font-weight: 700; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
