/* ============================================================
   TechZone — Electrónica y Tecnología
   styles.css — Mobile-first, CSS custom properties
   ============================================================ */

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

:root {
  --bg: #f0f2f5;
  --white: #ffffff;
  --primary: #0066ff;
  --primary-dark: #0052cc;
  --secondary: #111827;
  --accent: #00c853;
  --sale: #e53935;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --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,.15);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: .2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; object-fit: cover; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul { list-style: none; }
input, select { font-family: inherit; }

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  background: var(--secondary);
  color: rgba(255,255,255,.85);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 16px;
  text-align: center;
  position: relative;
  z-index: 100;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.topbar-sep { opacity: .4; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  background: var(--white);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 200;
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-logo i { font-size: 20px; }

.nav-search {
  flex: 1;
  max-width: 600px;
  position: relative;
  display: none;
}
.nav-search .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}
.nav-search input {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 50px;
  padding: 10px 110px 10px 40px;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
  background: var(--bg);
}
.nav-search input:focus { border-color: var(--primary); background: var(--white); }
.search-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary);
  color: var(--white);
  border-radius: 50px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition);
}
.search-btn:hover { background: var(--primary-dark); }

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: 500;
  display: none;
  max-height: 360px;
  overflow-y: auto;
}
.search-results.open { display: block; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--transition);
}
.search-result-item:hover { background: var(--bg); }
.search-result-item img { width: 44px; height: 44px; border-radius: 6px; flex-shrink: 0; }
.search-result-info { flex: 1; }
.search-result-info strong { display: block; font-size: 13px; }
.search-result-info span { font-size: 12px; color: var(--text-muted); }
.search-result-price { font-size: 13px; font-weight: 700; color: var(--primary); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
  position: relative;
}
.nav-action-btn i { font-size: 18px; }
.nav-action-btn:hover { color: var(--primary); background: #f0f7ff; }
.action-label { display: none; }
.badge {
  position: absolute;
  top: 2px;
  right: 4px;
  background: var(--sale);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  border-radius: 50px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}
.badge:empty, .badge[data-count="0"] { display: none; }

#searchToggle { display: flex; }

/* Search mobile bar */
.search-mobile {
  display: none;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--border);
  background: var(--white);
}
.search-mobile.open { display: block; }
.search-mobile-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 50px;
  padding: 8px 14px;
}
.search-mobile-inner i { color: var(--text-muted); }
.search-mobile-inner input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  outline: none;
}
.close-search { color: var(--text-muted); padding: 4px; }

/* ============================================================
   MEGA MENU
   ============================================================ */
.megamenu {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 68px;
  z-index: 190;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.megamenu-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
}
.megamenu-list {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: none;
}
.megamenu-list::-webkit-scrollbar { display: none; }
.megamenu-item { position: relative; flex-shrink: 0; }
.megamenu-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
  border-bottom: 2px solid transparent;
  background: none;
}
.megamenu-btn .arrow { font-size: 10px; transition: transform var(--transition); }
.megamenu-item:hover .megamenu-btn,
.megamenu-item.open .megamenu-btn {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.megamenu-item.open .megamenu-btn .arrow { transform: rotate(180deg); }

.megamenu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 999;
  min-width: 380px;
  padding: 20px;
  animation: fadeDown .15s ease;
}
.megamenu-item.open .megamenu-dropdown { display: block; }
@keyframes fadeDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }

.dropdown-grid { display: flex; gap: 24px; }
.dropdown-col { flex: 1; min-width: 100px; }
.dropdown-col h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.dropdown-col a {
  display: block;
  font-size: 13px;
  color: var(--text);
  padding: 5px 0;
  transition: color var(--transition);
}
.dropdown-col a:hover { color: var(--primary); }

/* ============================================================
   HERO CAROUSEL
   ============================================================ */
.hero-carousel {
  position: relative;
  overflow: hidden;
  background: var(--secondary);
}
.carousel-track {
  display: flex;
  transition: transform .5s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
.carousel-slide {
  min-width: 100%;
  background-size: cover;
  background-position: center;
}
.slide-1 { background: linear-gradient(135deg, #0a1628 0%, #0066ff22 100%); }
.slide-2 { background: linear-gradient(135deg, #1a0a28 0%, #7c3aed22 100%); }
.slide-3 { background: linear-gradient(135deg, #0a1a28 0%, #0088ff22 100%); }

.slide-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 320px;
}
.slide-text {
  flex: 1;
  color: var(--white);
  z-index: 2;
}
.slide-tag {
  display: inline-block;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
  backdrop-filter: blur(4px);
}
.slide-text h1 {
  font-size: clamp(26px, 4vw, 46px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 14px;
  color: var(--white);
}
.slide-text h1 strong { color: #60a5fa; }
.slide-text p {
  font-size: 15px;
  color: rgba(255,255,255,.75);
  margin-bottom: 20px;
  max-width: 440px;
}
.slide-price {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.old-price {
  text-decoration: line-through;
  color: rgba(255,255,255,.5);
  font-size: 16px;
}
.new-price {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  color: var(--white);
}
.cuotas-info {
  font-size: 13px;
  color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.1);
  padding: 4px 10px;
  border-radius: 50px;
}
.discount-badge {
  background: var(--sale);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
}
.slide-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.slide-image {
  flex: 0 0 360px;
  display: none;
}
.slide-image img {
  width: 100%;
  height: 240px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  transition: transform .3s ease;
}
.slide-image img:hover { transform: scale(1.02); }

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.15);
  color: var(--white);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.2);
  transition: background var(--transition);
  z-index: 10;
}
.carousel-btn:hover { background: rgba(255,255,255,.3); }
.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }

.carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  transition: all var(--transition);
  padding: 0;
}
.dot.active { background: var(--white); width: 24px; border-radius: 4px; }

/* ============================================================
   SECTION COMMON
   ============================================================ */
.section-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
}
.section-title {
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
}

/* ============================================================
   VISUAL CATEGORIES
   ============================================================ */
.categories-section {
  padding: 48px 0;
  background: var(--white);
}
.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.cat-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.cat-img-wrap { height: 120px; overflow: hidden; }
.cat-img-wrap img { width: 100%; height: 100%; transition: transform .4s ease; }
.cat-card:hover .cat-img-wrap img { transform: scale(1.06); }
.cat-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cat-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.cat-name i { color: var(--primary); margin-right: 4px; }
.cat-count { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   DEAL OF THE DAY
   ============================================================ */
.deal-section {
  padding: 48px 0;
  background: var(--bg);
}
.deal-banner {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.deal-header {
  background: linear-gradient(135deg, var(--sale) 0%, #c62828 100%);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.deal-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fire-icon { font-size: 22px; }
.deal-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: .02em;
}
.deal-countdown {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,.9);
  font-size: 13px;
  font-weight: 600;
}
.countdown-timer {
  display: flex;
  align-items: center;
  gap: 6px;
}
.timer-block {
  background: rgba(0,0,0,.25);
  border-radius: 6px;
  padding: 6px 10px;
  text-align: center;
  min-width: 50px;
}
.timer-block span {
  font-size: 20px;
  font-weight: 800;
  color: var(--white);
  display: block;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.timer-block small { font-size: 10px; color: rgba(255,255,255,.7); }
.timer-sep { font-size: 20px; font-weight: 800; color: var(--white); }

.deal-body {
  display: flex;
  gap: 32px;
  padding: 24px;
  flex-direction: column;
}
.deal-image {
  position: relative;
  flex: 0 0 auto;
  align-self: center;
}
.deal-image img {
  width: 100%;
  max-width: 380px;
  height: 220px;
  border-radius: var(--radius);
  margin: 0 auto;
}
.deal-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--sale);
  color: var(--white);
  font-size: 14px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 50px;
}
.deal-info { flex: 1; }
.deal-category {
  display: inline-block;
  background: #e0edff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 10px;
}
.deal-info h3 {
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}
.deal-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.6;
}
.deal-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.deal-rating .stars { color: #f59e0b; font-size: 14px; }
.deal-pricing {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}
.deal-old-price {
  font-size: 16px;
  text-decoration: line-through;
  color: var(--text-muted);
}
.deal-new-price {
  font-size: 36px;
  font-weight: 800;
  color: var(--sale);
}
.deal-cuotas {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.deal-cuotas i { color: #009ee3; }

.stock-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-bottom: 6px;
  overflow: hidden;
}
.stock-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #00a844);
  border-radius: 3px;
  transition: width .6s ease;
}
.stock-text { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; display: block; }

.deal-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ============================================================
   PRODUCTS SECTION
   ============================================================ */
.products-section {
  padding: 48px 0;
  background: var(--bg);
}
.products-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}
.products-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 7px 16px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--white);
  transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary); border-color: var(--primary); color: var(--white); }

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* PRODUCT CARD */
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.product-card.hidden { display: none; }

.product-compare-check {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
  cursor: pointer;
}

.product-img-wrap {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: var(--bg);
}
.product-img-wrap img {
  width: 100%;
  height: 100%;
  transition: transform .4s ease;
}
.product-card:hover .product-img-wrap img { transform: scale(1.05); }

.product-badges {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.product-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-new { background: var(--accent); color: var(--white); }
.badge-sale { background: var(--sale); color: var(--white); }
.badge-hot { background: #f59e0b; color: var(--white); }

.product-fav {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  color: var(--text-muted);
  font-size: 15px;
  transition: color var(--transition), transform var(--transition);
  z-index: 3;
}
.product-fav:hover, .product-fav.active { color: var(--sale); transform: scale(1.15); }
.product-fav.active i { font-weight: 900; }

.product-info { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }

.product-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}
.stars-sm { color: #f59e0b; font-size: 11px; }
.rating-count { color: var(--text-muted); }

.product-price-block { margin-top: 4px; }
.product-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.product-old-price {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
  display: block;
}
.product-cuotas {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.product-stock {
  font-size: 11px;
  font-weight: 700;
  color: var(--sale);
  background: #fff0f0;
  padding: 3px 8px;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
}

.product-actions {
  display: flex;
  gap: 8px;
  padding: 0 14px 14px;
  margin-top: auto;
}
.btn-add-cart {
  flex: 1;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  transition: background var(--transition), transform var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-add-cart:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-add-cart:active { transform: translateY(0); }

/* ============================================================
   COMPARE BAR
   ============================================================ */
.compare-bar {
  position: fixed;
  bottom: -100px;
  left: 0;
  right: 0;
  background: var(--secondary);
  color: var(--white);
  z-index: 300;
  transition: bottom .3s ease;
  box-shadow: 0 -4px 20px rgba(0,0,0,.2);
}
.compare-bar.visible { bottom: 0; }
.compare-bar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.compare-count { font-size: 13px; font-weight: 600; flex: 1; min-width: 160px; }
.compare-selected { display: flex; gap: 8px; }
.compare-selected-item {
  background: rgba(255,255,255,.1);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.compare-selected-item button { color: rgba(255,255,255,.6); font-size: 12px; }
.compare-selected-item button:hover { color: var(--white); }

/* ============================================================
   BRANDS MARQUEE
   ============================================================ */
.brands-section {
  padding: 32px 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.brands-track-wrap {
  overflow: hidden;
  position: relative;
}
.brands-track-wrap::before,
.brands-track-wrap::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}
.brands-track-wrap::before { left: 0; background: linear-gradient(to right, var(--white), transparent); }
.brands-track-wrap::after { right: 0; background: linear-gradient(to left, var(--white), transparent); }
.brands-track {
  display: flex;
  gap: 0;
  width: max-content;
  animation: scrollBrands 28s linear infinite;
}
.brands-track:hover { animation-play-state: paused; }
@keyframes scrollBrands {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.brand-item {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-muted);
  opacity: .4;
  padding: 0 36px;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity var(--transition), color var(--transition);
  cursor: default;
  user-select: none;
}
.brand-item:hover { opacity: 1; color: var(--primary); }

/* ============================================================
   WHY TECHZONE
   ============================================================ */
.why-section {
  padding: 56px 0;
  background: var(--bg);
}
.why-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.why-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px;
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
  text-align: center;
}
.why-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.why-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #e0edff, #c7dfff);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
  color: var(--primary);
}
.why-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.why-card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: #0d1117; color: rgba(255,255,255,.75); }
.footer-top { padding: 48px 0 32px; }
.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
}
.footer-top .footer-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
.footer-logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--white);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}
.footer-logo i { color: var(--primary); }
.footer-brand p { font-size: 13px; line-height: 1.7; max-width: 280px; }
.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.footer-social a {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: rgba(255,255,255,.7);
  transition: background var(--transition), color var(--transition);
}
.footer-social a:hover { background: var(--primary); color: var(--white); }
.footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--white);
  margin-bottom: 14px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col a {
  font-size: 13px;
  color: rgba(255,255,255,.6);
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--white); }

.footer-payments {
  background: rgba(255,255,255,.04);
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 16px 0;
}
.footer-payments .footer-container {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.payment-label {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
.payment-icons { display: flex; gap: 8px; flex-wrap: wrap; }
.pay-badge {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.8);
  display: flex;
  align-items: center;
  gap: 5px;
}
.pay-badge i { font-size: 16px; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 16px 0;
  text-align: center;
}
.footer-bottom p {
  font-size: 12px;
  color: rgba(255,255,255,.4);
  line-height: 1.7;
}

/* ============================================================
   CART SIDEBAR
   ============================================================ */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  backdrop-filter: blur(3px);
}
.cart-overlay.open { opacity: 1; pointer-events: all; }

.cart-sidebar {
  position: fixed;
  top: 0;
  right: -420px;
  width: min(420px, 100vw);
  height: 100vh;
  background: var(--white);
  z-index: 500;
  display: flex;
  flex-direction: column;
  transition: right .3s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow-lg);
}
.cart-sidebar.open { right: 0; }

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.cart-header h3 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.cart-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.cart-close:hover { background: var(--border); }

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 40px 0;
}
.cart-empty i { font-size: 52px; opacity: .25; }
.cart-empty p { font-size: 15px; }

.cart-items { display: flex; flex-direction: column; gap: 14px; }
.cart-item {
  display: flex;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
}
.cart-item-info { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.cart-item-name { font-size: 13px; font-weight: 600; line-height: 1.4; }
.cart-item-price { font-size: 15px; font-weight: 700; color: var(--primary); }
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: all var(--transition);
}
.qty-btn:hover { border-color: var(--primary); color: var(--primary); }
.qty-num { font-size: 14px; font-weight: 600; min-width: 20px; text-align: center; }
.cart-item-remove {
  color: var(--text-muted);
  font-size: 14px;
  padding: 4px;
  margin-left: 4px;
  transition: color var(--transition);
}
.cart-item-remove:hover { color: var(--sale); }

.cart-footer {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.cart-subtotals { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.cart-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
.total-row { font-size: 16px; padding-top: 8px; border-top: 1px solid var(--border); }
.green { color: var(--accent); font-weight: 600; }
.cart-cuotas {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 12px;
  background: var(--white);
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.btn-payment {
  width: 100%;
  background: #009ee3;
  color: var(--white);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  transition: background var(--transition), transform var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-payment:hover { background: #0087c9; transform: translateY(-1px); }
.btn-clear-cart {
  width: 100%;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-clear-cart:hover { color: var(--sale); background: #fff0f0; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.compare-modal {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 900px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: scale(.96);
  transition: transform .25s ease;
}
.modal-overlay.open .compare-modal,
.modal-overlay.open .checkout-modal { transform: scale(1); }

.checkout-modal {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(.96);
  transition: transform .25s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  color: var(--text);
  transition: background var(--transition);
}
.modal-close:hover { background: var(--border); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

/* Compare table */
.compare-table-wrap { overflow-x: auto; }
.compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px;
}
.compare-table th, .compare-table td {
  padding: 12px 16px;
  border: 1px solid var(--border);
  font-size: 13px;
  vertical-align: top;
}
.compare-table th {
  background: var(--bg);
  font-weight: 700;
  text-align: left;
  width: 130px;
  color: var(--text-muted);
}
.compare-table td { text-align: center; }
.compare-table .product-col-header { font-weight: 700; font-size: 14px; }
.compare-table .price-col { font-size: 18px; font-weight: 800; color: var(--sale); }
.compare-table img { width: 100px; height: 80px; margin: 0 auto; border-radius: 6px; }

/* Checkout modal */
.checkout-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.mp-logo {
  font-size: 22px;
  font-weight: 800;
  color: #009ee3;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mp-subtitle { font-size: 14px; color: var(--text-muted); }
.mp-methods { display: flex; gap: 8px; flex-wrap: wrap; }
.mp-method {
  flex: 1;
  min-width: 110px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  transition: all var(--transition);
  line-height: 1.5;
}
.mp-method i { font-size: 18px; display: block; margin-bottom: 4px; color: var(--text-muted); }
.mp-method.active { border-color: #009ee3; background: #e6f7ff; color: #009ee3; }
.mp-method.active i { color: #009ee3; }
.mp-method:hover { border-color: #009ee3; }
.mp-form { display: flex; flex-direction: column; gap: 10px; }
.mp-form input, .mp-form select {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
  background: var(--bg);
}
.mp-form input:focus, .mp-form select:focus { border-color: #009ee3; background: var(--white); }
.mp-row { display: flex; gap: 10px; }
.mp-row input { flex: 1; }
.btn-payment-confirm {
  width: 100%;
  background: linear-gradient(135deg, #009ee3, #0070b0);
  color: var(--white);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.btn-payment-confirm:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,158,227,.4); }
.mp-secure { font-size: 12px; color: var(--text-muted); text-align: center; display: flex; align-items: center; justify-content: center; gap: 5px; }

/* ============================================================
   TOASTS
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--secondary);
  color: var(--white);
  border-radius: 50px;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 900;
  transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .3s ease;
  opacity: 0;
  white-space: nowrap;
  max-width: 90vw;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast i { color: var(--accent); font-size: 16px; }
.success-toast {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-weight: 400;
  white-space: normal;
  max-width: 340px;
  bottom: 24px;
  right: 24px;
  left: auto;
  transform: translateX(0) translateY(80px);
}
.success-toast.show { transform: translateX(0) translateY(0); }
.success-toast i { font-size: 20px; color: var(--accent); }
.success-toast strong { font-size: 15px; }
.success-toast p { font-size: 13px; color: var(--text-muted); }

/* ============================================================
   BUTTONS (shared)
   ============================================================ */
.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-sm);
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 700;
  transition: background var(--transition), transform var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary.btn-large { padding: 14px 28px; font-size: 15px; }

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,.5);
  border-radius: var(--radius-sm);
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 700;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-outline:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.8); }

.btn-ghost {
  background: rgba(255,255,255,.08);
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,.2);
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition);
}
.btn-ghost:hover { background: rgba(255,255,255,.15); }

.btn-ghost-sm {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}
.btn-ghost-sm:hover { background: rgba(255,255,255,.12); color: var(--white); }

/* ============================================================
   BREAKPOINTS — 480px
   ============================================================ */
@media (min-width: 480px) {
  .categories-grid { grid-template-columns: repeat(4, 1fr); }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   BREAKPOINTS — 768px
   ============================================================ */
@media (min-width: 768px) {
  .nav-search { display: flex; }
  #searchToggle { display: none; }
  .action-label { display: block; }

  .slide-image { display: block; }
  .slide-content { min-height: 400px; }

  .deal-body { flex-direction: row; align-items: center; }
  .deal-image img { max-width: 280px; height: 280px; }

  .footer-top .footer-container { grid-template-columns: repeat(2, 1fr); }

  .compare-bar-inner { flex-wrap: nowrap; }

  .products-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   BREAKPOINTS — 1024px
   ============================================================ */
@media (min-width: 1024px) {
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .categories-grid { grid-template-columns: repeat(4, 1fr); }
  .why-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-top .footer-container { grid-template-columns: 2fr 1fr 1fr 1fr; }

  .cat-img-wrap { height: 150px; }

  .deal-image img { max-width: 360px; height: 300px; }
  .deal-info h3 { font-size: 26px; }
}

/* ============================================================
   BREAKPOINTS — 1280px
   ============================================================ */
@media (min-width: 1280px) {
  .products-grid { grid-template-columns: repeat(4, 1fr); }
  .nav-container { padding: 0 32px; }
  .section-container { padding: 0 32px; }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #c0c4cc; }

/* ============================================================
   ANIMATIONS & UTILITIES
   ============================================================ */
.fade-in {
  animation: fadeIn .3s ease forwards;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, #f0f0f0 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.4s infinite;
  border-radius: 4px;
}
@keyframes skeleton { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* No results message */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.no-results i { font-size: 48px; opacity: .3; margin-bottom: 12px; }
.no-results p { font-size: 16px; }

/* Mega menu mobile accordion */
/* ── Hamburger button ── */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background var(--transition);
  order: -1; /* place before logo on very small screens if needed */
}
.hamburger-btn:hover { background: var(--bg); }
.hamburger-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
/* Animated X state */
.hamburger-btn.open .hamburger-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open .hamburger-bar:nth-child(2) { opacity: 0; }
.hamburger-btn.open .hamburger-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 767px) {
  .hamburger-btn { display: flex; }

  /* Megamenu hidden by default on mobile, shown when toggled */
  .megamenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }
  .megamenu.mobile-open {
    max-height: 100vh;
  }

  .megamenu-dropdown {
    position: static;
    min-width: unset;
    box-shadow: none;
    border: none;
    border-radius: 0;
    border-top: 1px solid var(--border);
    padding: 10px 16px 14px;
    background: var(--bg);
  }
  .dropdown-grid { flex-direction: column; gap: 12px; }
}
