/* ============================================
   CSS VARIABLES & THEMES
   ============================================ */
:root {
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --shadow-xl: 0 16px 48px rgba(0,0,0,.15);
  --transition: .2s ease;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

[data-theme="light"] {
  --bg: #eef1f8;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --bg-hover: #f0f1f5;
  --bg-input: #f0f1f5;
  --border: #e2e4ea;
  --border-light: #eef0f4;
  --text: #1a1d26;
  --text-secondary: #6b7084;
  --text-muted: #9ca0b0;
  --primary: #e91e63;
  --primary-hover: #c2185b;
  --primary-light: rgba(233,30,99,.1);
  --primary-text: #ffffff;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: rgba(239,68,68,.1);
  --success: #22c55e;
  --success-light: rgba(34,197,94,.1);
  --warning: #f59e0b;
  --warning-light: rgba(245,158,11,.1);
  --star: #f59e0b;
  --hero-gradient: linear-gradient(135deg, #e91e63 0%, #9c27b0 100%);
  --header-bg: rgba(255,255,255,.8);
  --overlay: rgba(0,0,0,.45);
  --accent-gradient: linear-gradient(135deg, #e91e63, #9c27b0);
  --card-gradient: linear-gradient(145deg, #ffffff 0%, #fff5f8 100%);
  --sidebar-gradient: linear-gradient(180deg, #ffffff 0%, #fff0f3 100%);
  --chip-active-bg: linear-gradient(135deg, #e91e63, #9c27b0);
  --btn-gradient: linear-gradient(135deg, #e91e63, #9c27b0);
  --btn-gradient-hover: linear-gradient(135deg, #c2185b, #7b1fa2);
  --table-row-hover: linear-gradient(90deg, rgba(233,30,99,.03) 0%, rgba(156,39,176,.03) 100%);
  --stat-gradient-1: linear-gradient(135deg, #e91e63, #f06292);
  --stat-gradient-2: linear-gradient(135deg, #ff9800, #ff5722);
  --stat-gradient-3: linear-gradient(135deg, #4caf50, #00bcd4);
  --hero-accent: linear-gradient(135deg, #e91e63 0%, #9c27b0 50%, #f093fb 100%);
  --footer-gradient: linear-gradient(135deg, #fff5f8 0%, #fef0f4 100%);
  --toggle-off: #ef4444;
  --toggle-on: #22c55e;
  --toggle-knob: #ffffff;
}

[data-theme="dark"] {
  --bg: #0c0e1a;
  --bg-card: #161929;
  --bg-elevated: #1e2236;
  --bg-hover: #252a40;
  --bg-input: #1a1e30;
  --border: #2a2f48;
  --border-light: #222640;
  --text: #e8eaf0;
  --text-secondary: #9ca0b8;
  --text-muted: #6b7094;
  --primary: #f06292;
  --primary-hover: #ec407a;
  --primary-light: rgba(240,98,146,.12);
  --primary-text: #0c0e1a;
  --danger: #f87171;
  --danger-hover: #ef4444;
  --danger-light: rgba(248,113,113,.12);
  --success: #4ade80;
  --success-light: rgba(74,222,128,.12);
  --warning: #fbbf24;
  --warning-light: rgba(251,191,36,.12);
  --star: #fbbf24;
  --hero-gradient: linear-gradient(135deg, #1a0a15 0%, #4a1030 50%, #2d1520 100%);
  --header-bg: rgba(12,14,26,.88);
  --overlay: rgba(0,0,0,.65);
  --accent-gradient: linear-gradient(135deg, #f06292, #ce93d8);
  --card-gradient: linear-gradient(145deg, #161929 0%, #1c1525 100%);
  --sidebar-gradient: linear-gradient(180deg, #161929 0%, #1a1525 100%);
  --chip-active-bg: linear-gradient(135deg, #f06292, #ce93d8);
  --btn-gradient: linear-gradient(135deg, #f06292, #ce93d8);
  --btn-gradient-hover: linear-gradient(135deg, #ec407a, #ba68c8);
  --table-row-hover: linear-gradient(90deg, rgba(240,98,146,.05) 0%, rgba(206,147,216,.05) 100%);
  --stat-gradient-1: linear-gradient(135deg, #e91e63, #f06292);
  --stat-gradient-2: linear-gradient(135deg, #fbbf24, #f97316);
  --stat-gradient-3: linear-gradient(135deg, #4ade80, #22d3ee);
  --hero-accent: linear-gradient(135deg, #1a0a15 0%, #4a1030 40%, #9c27b0 100%);
  --footer-gradient: linear-gradient(135deg, #161929 0%, #0c0e1a 100%);
  --toggle-off: #dc2626;
  --toggle-on: #4ade80;
  --toggle-knob: #ffffff;
}

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

html { scroll-behavior: smooth; }

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

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

ul { list-style: none; }

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: var(--text);
}

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

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .9rem;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--btn-gradient);
  color: var(--primary-text);
  border: none;
}
.btn-primary:hover { background: var(--btn-gradient-hover); transform: translateY(-1px); }

.btn-outline {
  border: 1.5px solid var(--border);
  color: var(--text);
  background: var(--bg-card);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: var(--danger-hover); }

.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  position: relative;
  color: var(--text-secondary);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }

/* ============================================
   HEADER
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 250;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 1px 20px rgba(0,0,0,.06);
}

/* ======== TASA BCV BANNER ======== */
.bcv-banner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 7px 16px;
  background: linear-gradient(90deg, #e91e63, #9c27b0);
  color: #fff;
  font-size: .8rem;
}
.bcv-banner strong {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.bcv-fecha {
  opacity: .8;
  font-size: .72rem;
}
.price-bs {
  display: inline-block;
  margin-left: 6px;
  font-size: .74em;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}
.cart-total-bs {
  display: block;
  width: 100%;
  text-align: right;
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
}

.admin-badge {
  background: var(--warning-light);
  color: var(--warning);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.nav { flex: 1; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-item { position: relative; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: .9rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.nav-link:hover { background: var(--bg-hover); color: var(--text); }

/* Dropdown */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all .2s ease;
  z-index: 200;
}

.dropdown:hover .dropdown-menu,
.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  font-size: .88rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.dropdown-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.dropdown-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

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

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  height: 40px;
  transition: all var(--transition);
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.search-box input {
  border: none;
  background: none;
  outline: none;
  width: 200px;
  font-size: .88rem;
}
.search-box svg { color: var(--text-muted); flex-shrink: 0; }

.cart-btn { position: relative; }
.cart-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: white;
  font-size: .65rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0 4px;
  transform: scale(0);
  transition: transform .2s cubic-bezier(.68,-.55,.265,1.55);
}
.cart-badge.show { transform: scale(1); }

.admin-link { text-decoration: none; }

/* ============================================
   HERO CAROUSEL
   ============================================ */
.hero-carousel {
  position: relative;
  overflow: hidden;
}
.carousel-track {
  position: relative;
  width: 100%;
}
.carousel-slide {
  display: none;
  color: white;
  padding: 100px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: fadeSlide 0.6s ease;
  min-height: 420px;
}
.carousel-slide .hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.carousel-slide.active { display: block; }
@keyframes fadeSlide {
  from { opacity: 0; transform: scale(1.02); }
  to { opacity: 1; transform: scale(1); }
}
.carousel-slide .hero-content { max-width: 640px; margin: 0 auto; position: relative; z-index: 2; }
.carousel-slide h1 {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.carousel-slide p { font-size: 1.15rem; opacity: .9; margin-bottom: 32px; text-shadow: 0 1px 4px rgba(0,0,0,.25); }
.carousel-slide .btn-primary { background: white; color: #e91e63; }
.carousel-slide .btn-primary:hover { background: rgba(255,255,255,.9); transform: translateY(-2px); }
.carousel-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}
.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.6);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s;
  padding: 0;
}
.carousel-dot.active {
  background: white;
  border-color: white;
  transform: scale(1.2);
}
.carousel-dot:hover { border-color: white; }
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.15);
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 10;
  backdrop-filter: blur(4px);
}
.carousel-arrow:hover { background: rgba(255,255,255,.3); }
.carousel-prev { left: 16px; }
.carousel-next { right: 16px; }

/* ============================================
   FILTERS
   ============================================ */
.filters-bar {
  position: sticky;
  top: 64px;
  z-index: 150;
  background: var(--card-gradient);
  border-bottom: 1px solid var(--border-light);
  backdrop-filter: blur(10px);
}
.filters-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  overflow: visible;
}

.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.chip {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active {
  background: var(--chip-active-bg);
  color: var(--primary-text);
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(233,30,99,.25);
}

.category-dropdown {
  position: relative;
}
.category-dropdown .dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.category-dropdown .dropdown-menu {
  top: calc(100% + 10px);
  min-width: 190px;
}
.category-dropdown:hover .dropdown-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
}
.category-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Submenús de categorías (Ropa, Accesorios) */
.has-submenu {
  position: relative;
}
.has-submenu > .dropdown-item {
  justify-content: space-between;
  gap: 6px;
}
.has-submenu > .dropdown-item svg {
  width: 11px;
  height: 11px;
  transform: rotate(-90deg);
  opacity: .6;
  flex-shrink: 0;
}
.dropdown-submenu {
  position: absolute;
  left: 100%;
  top: 0;
  min-width: 185px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-8px);
  transition: all .2s ease;
  z-index: 210;
}
.has-submenu:hover .dropdown-submenu,
.has-submenu.open .dropdown-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.sort-select {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  color: var(--text-secondary);
}
.sort-select select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 6px 12px;
  outline: none;
  cursor: pointer;
}
.sort-select select:focus { border-color: var(--primary); }

/* ============================================
   PRODUCTS GRID
   ============================================ */
.main { min-height: 80vh; }

.products-section {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 24px;
}
.products-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--card-gradient);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .3s ease;
  cursor: pointer;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(233,30,99,.15), 0 4px 12px rgba(0,0,0,.08);
  border-color: var(--primary);
}

.product-image {
  position: relative;
  height: 220px;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  overflow: hidden;
}

.product-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.badge-sale { background: var(--danger); color: white; }
.badge-new { background: var(--success); color: white; }
.badge-featured { background: var(--star); color: #1a1d26; }

.product-soldout {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  z-index: 10;
  background: rgba(220, 38, 38, .88);
  color: #fff;
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 8px 28px;
  border-radius: 4px;
  pointer-events: none;
  box-shadow: 0 2px 12px rgba(220, 38, 38, .4);
}
.product-out .product-image {
  filter: grayscale(.5) brightness(.85);
}

.product-fav {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  color: var(--text-muted);
}
.product-fav:hover, .product-fav.active { color: var(--danger); }
.product-fav.active svg { fill: var(--danger); }

.product-info {
  padding: 16px;
}
.product-category {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--primary);
  margin-bottom: 6px;
}
.product-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.3;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.stars {
  display: flex;
  gap: 2px;
  color: var(--star);
}
.star { font-size: .85rem; }
.star.empty { color: var(--border); }
.rating-count { font-size: .78rem; color: var(--text-muted); }

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.product-price {
  font-size: 1.25rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.product-price-old {
  font-size: .85rem;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 8px;
}

.btn-add-cart {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--btn-gradient);
  color: var(--primary-text);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.btn-add-cart:hover { background: var(--btn-gradient-hover); transform: scale(1.08); }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state svg { margin: 0 auto 16px; opacity: .4; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: .9rem; }

/* ============================================
   CART SIDEBAR
   ============================================ */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transition: all .3s ease;
}
.cart-overlay.show { opacity: 1; visibility: visible; }

.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: var(--sidebar-gradient);
  z-index: 501;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow-xl);
}
.cart-sidebar.open { transform: translateX(0); }

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.cart-header h3 { font-size: 1.15rem; font-weight: 700; }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.cart-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}
.cart-item-image {
  width: 64px;
  height: 64px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: .88rem; font-weight: 600; margin-bottom: 4px; }
.cart-item-price { font-size: .85rem; color: var(--primary); font-weight: 600; }

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.qty-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-weight: 700;
  font-size: .85rem;
  transition: all var(--transition);
}
.qty-btn:hover { border-color: var(--primary); color: var(--primary); }
.cart-item-qty { font-size: .9rem; font-weight: 600; min-width: 20px; text-align: center; }

.cart-item-remove {
  color: var(--text-muted);
  transition: color var(--transition);
  align-self: flex-start;
  padding: 4px;
}
.cart-item-remove:hover { color: var(--danger); }

.cart-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--text-muted);
}
.cart-empty svg { margin: 0 auto 12px; opacity: .4; }

.cart-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
}
.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.cart-footer .btn + .btn { margin-top: 8px; }

/* ============================================
   PRODUCT MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal {
  background: var(--card-gradient);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
}
.modal-lg { max-width: 800px; }

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border-radius: 50%;
  transition: all var(--transition);
  color: var(--text-secondary);
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }

.modal-body { padding: 32px; }

.modal-product-image {
  height: 260px;
  background: var(--bg-input);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  margin-bottom: 24px;
}
.modal-product-category {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--primary);
  margin-bottom: 8px;
}
.modal-product-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.modal-product-desc {
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}
.modal-product-price {
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 24px;
}

.modal-rating-section {
  padding: 20px 0;
  border-top: 1px solid var(--border-light);
}
.modal-rating-section h4 { font-size: 1rem; font-weight: 600; margin-bottom: 12px; }

.rating-form {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}
.rating-form select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  outline: none;
}
.rating-form input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  outline: none;
}
.rating-form input:focus, .rating-form select:focus { border-color: var(--primary); }

.reviews-list { max-height: 200px; overflow-y: auto; }
.admin-content .reviews-list { max-height: none; overflow-y: visible; }
.review-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.review-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.review-author { font-weight: 600; font-size: .88rem; }
.review-date { font-size: .75rem; color: var(--text-muted); }
.review-stars { color: var(--star); font-size: .8rem; }
.review-text { font-size: .88rem; color: var(--text-secondary); }

/* ============================================
   TOASTS
   ============================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 700;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: .88rem;
  font-weight: 500;
  animation: slideInRight .3s ease, fadeOut .3s ease 2.7s forwards;
  max-width: 340px;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--primary); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
  to { opacity: 0; transform: translateY(8px); }
}

/* ============================================
   ADMIN LAYOUT
   ============================================ */
.admin-body { background: var(--bg); }
.admin-header { border-bottom: 1px solid var(--border); }

/* Notification dropdown */
.notif-wrapper { position: relative; }
.notif-btn { position: relative; }
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}
.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,.15);
  z-index: 1000;
}
.notif-dropdown.open { display: block; }
.notif-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
}
.notif-header h4 {
  margin: 0;
  font-size: .92rem;
  font-weight: 700;
  color: var(--text);
}
.notif-list { padding: 4px 0; }
.notif-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: .85rem;
}
.notif-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  transition: background .15s;
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
}
.notif-item-info { flex: 1; min-width: 0; }
.notif-item-name {
  font-size: .84rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-item-detail {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.notif-item-badge {
  font-size: .7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.notif-badge-low {
  background: var(--warning-light);
  color: var(--warning);
}
.notif-badge-out {
  background: var(--danger-light);
  color: var(--danger);
}

.admin-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  min-height: calc(100vh - 120px);
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-nav {
  background: var(--sidebar-gradient);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  text-align: left;
}
.admin-nav-item:hover { background: var(--bg-hover); color: var(--text); }
.admin-nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  position: relative;
}
.admin-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--accent-gradient);
  border-radius: 0 2px 2px 0;
}

.admin-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat-card {
  background: var(--card-gradient);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: .6;
}
.stat-number {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label {
  font-size: .78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.admin-content {
  background: var(--card-gradient);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.panel-header h2 { font-size: 1.3rem; font-weight: 700; }

.admin-search-input {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  background: var(--bg-card);
  color: var(--text);
  outline: none;
  min-width: 220px;
  transition: border-color var(--transition);
}
.admin-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(233,30,99,.12);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================
   ADMIN TABLE
   ============================================ */
.table-container {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.admin-table th {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.admin-table tr:hover td { background: var(--table-row-hover); }

.table-img {
  width: 44px;
  height: 44px;
  background: var(--bg-input);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.table-actions {
  display: flex;
  gap: 6px;
}

.table-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
}
.table-badge.in-stock { background: var(--success-light); color: var(--success); }
.table-badge.low-stock { background: var(--warning-light); color: var(--warning); }
.table-badge.out-of-stock { background: var(--danger-light); color: var(--danger); }

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--toggle-off);
  border-radius: 999px;
  transition: background .25s ease;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--toggle-knob);
  border-radius: 50%;
  transition: transform .25s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.toggle-switch input:checked + .toggle-slider { background: var(--toggle-on); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ============================================
   ADMIN FORM
   ============================================ */
.admin-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.admin-form .full-width { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  outline: none;
  transition: border-color var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-group textarea { resize: vertical; min-height: 80px; }

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* ============================================
   ADMIN REVIEWS
   ============================================ */
.admin-reviews-list .review-card {
  background: var(--card-gradient);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
}
.review-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 8px;
}
.review-card-product { font-size: .78rem; color: var(--primary); font-weight: 600; }
.review-card-stars { color: var(--star); }
.review-card-author { font-weight: 600; font-size: .88rem; }
.review-card-text { color: var(--text-secondary); font-size: .88rem; }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--footer-gradient);
  border-top: 1px solid var(--border-light);
  margin-top: 60px;
}
.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 48px 24px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
}
.footer-col h4 {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.footer-col p { font-size: .88rem; color: var(--text-secondary); }
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col li { font-size: .88rem; color: var(--text-secondary); }
.footer-col a:hover { color: var(--primary); }

/* ======== REDES SOCIALES ======== */
.social-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.social-links a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.social-links a:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-3px);
}
.footer-bottom {
  text-align: center;
  padding: 20px 24px;
  border-top: 1px solid var(--border-light);
  font-size: .82rem;
  color: var(--text-muted);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .nav { display: none; }
  .search-box input { width: 120px; }
  .hero h1, .carousel-slide h1 { font-size: 1.8rem; }
  .hero, .carousel-slide { padding: 48px 20px; }
  .carousel-arrow { width: 36px; height: 36px; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-form { grid-template-columns: 1fr; }
  .modal { margin: 12px; }
}

@media (max-width: 480px) {
  .products-grid { grid-template-columns: 1fr; }
  .search-box { display: none; }
}

/* ============================================
   AUTH FORMS
   ============================================ */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-switch {
  text-align: center;
  font-size: .85rem;
  color: var(--text-secondary);
  margin-top: 8px;
}
.auth-switch a {
  color: var(--primary);
  font-weight: 600;
}
.auth-switch a:hover { text-decoration: underline; }

/* ============================================
   USER SECTION
   ============================================ */
.user-section { display: flex; align-items: center; gap: 8px; }

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}

.user-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================
   LOGIN PAGE (admin.html)
   ============================================ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: var(--card-gradient);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gradient);
}

.login-card .logo {
  justify-content: center;
  margin-bottom: 8px;
}

.login-card h2 {
  text-align: center;
  margin-bottom: 4px;
}

.login-card .subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-size: .9rem;
}

/* ============================================
   ORDER HISTORY
   ============================================ */
.orders-section {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 24px;
}
.orders-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
}
.order-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.order-card-id { font-weight: 700; font-size: 1rem; }
.order-card-items {
  font-size: .88rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.order-card-total {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1rem;
}

/* ============================================
   IMAGE UPLOAD AREA
   ============================================ */
.img-upload-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.img-previews {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.img-preview-item {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--border);
}
.img-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.img-preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  background: var(--danger);
  color: white;
  border-radius: 50%;
  font-size: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform var(--transition);
}
.img-preview-remove:hover { transform: scale(1.15); }

.img-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-input);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: .85rem;
  cursor: pointer;
  transition: all var(--transition);
  width: fit-content;
}
.img-upload-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* ============================================
   PRODUCT GALLERY (Modal)
   ============================================ */
.modal-product-gallery {
  margin-bottom: 24px;
}

.gallery-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gallery-main {
  width: 100%;
  height: 320px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-input);
}
.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .2s ease;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
}

.gallery-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-xs);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  opacity: .6;
}
.gallery-thumb:hover { opacity: .85; }
.gallery-thumb.active {
  border-color: var(--primary);
  opacity: 1;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 32px auto 16px;
  flex-wrap: wrap;
}
.pag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-card);
  color: var(--text);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.pag-btn:hover:not(:disabled):not(.active) {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
}
.pag-btn.active {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}
.pag-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.pag-dots {
  color: var(--text-muted);
  font-size: .85rem;
  padding: 0 4px;
}
.pag-info {
  color: var(--text-muted);
  font-size: .82rem;
  margin-left: 12px;
}

/* ============================================
   PRELOADER
   ============================================ */
.preloader {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
}
.preloader.active {
  display: flex;
}
.preloader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.preloader p {
  color: var(--text-muted);
  font-size: .9rem;
  margin: 0;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
