/* ── Google Fonts ──────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

/* ── Variables ─────────────────────────────────────────────────────────── */
:root {
  --primary:        #1a1a1a;
  --primary-light:  #f5f5f5;
  --bg:             #ffffff;
  --bg-soft:        #f8f9fa;
  --bg-input:       #f2f2f2;
  --text:           #1a1a1a;
  --text-secondary: #636469;
  --text-muted:     #9e9ea3;
  --border:         #f0f0f0;
  --border-md:      #e0e0e0;
  --shadow-soft:    0 2px 12px rgba(0,0,0,.06);
  --shadow-card:    0 2px 8px rgba(0,0,0,.06);
  --shadow-hover:   0 6px 20px rgba(0,0,0,.12);
  --shadow-sidebar: 4px 0 24px rgba(0,0,0,.14);
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      16px;
  --radius-pill:    50px;
  --nav-h:          54px;
  --cat-h:          40px;
  --font:           'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* dark mode desactivado — siempre tema claro */

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  padding-top: calc(var(--nav-h) + var(--cat-h));
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: var(--font); }

/* ── Navbar ────────────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 8px;
}

.nav-hamburger {
  background: none; border: none; cursor: pointer;
  color: var(--text); font-size: 22px;
  padding: 6px 8px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.nav-hamburger:hover { background: var(--bg-soft); }

.navbar-brand { flex-shrink: 0; }
.navbar-brand img { height: 32px; object-fit: contain; }

.nav-search {
  flex: 1;
  position: relative;
  max-width: 600px;
}
.nav-search-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 14px; pointer-events: none;
}
.nav-search input {
  width: 100%; height: 34px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0 14px 0 36px;
  font-size: 13px; font-family: var(--font);
  color: var(--text); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.nav-search input::placeholder { color: var(--text-muted); }
.nav-search input:focus {
  border-color: var(--border-md);
  box-shadow: 0 0 0 3px rgba(0,0,0,.04);
}

.nav-actions { display: flex; gap: 2px; margin-left: auto; flex-shrink: 0; }
.nav-action-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary); font-size: 19px;
  padding: 6px 8px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.nav-action-btn:hover { background: var(--bg-soft); color: var(--text); }

/* ── Category Tabs Row (below navbar, sticky) ───────────────────────────── */
.cat-tabs-row {
  position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  z-index: 490;
  height: var(--cat-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  padding: 0 4px;
  scrollbar-width: none;
  gap: 0;
}
.cat-tabs-row::-webkit-scrollbar { display: none; }

.cat-tab {
  flex-shrink: 0;
  display: flex; align-items: center;
  padding: 0 14px;
  font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  white-space: nowrap; cursor: pointer;
  transition: color .15s, border-color .15s;
  text-decoration: none;
}
.cat-tab:hover  { color: var(--text); }
.cat-tab.active { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }

/* ── Sidebar (drawer izquierdo) ─────────────────────────────────────────── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,.45);
  animation: fade-in .2s ease;
}
.sidebar-overlay.open { display: block; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.sidebar {
  position: fixed; top: 0; left: -280px; bottom: 0;
  z-index: 1200; width: 268px;
  background: var(--bg);
  box-shadow: var(--shadow-sidebar);
  transition: left .25s cubic-bezier(.4,0,.2,1);
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
}
.sidebar.open { left: 0; }

.sidebar-header {
  padding: 18px 20px 14px;
  font-size: 16px; font-weight: 700; letter-spacing: -.2px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-divider {
  height: 1px; background: var(--border); margin: 4px 0;
}

.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 20px;
  font-size: 13px; font-weight: 400;
  color: var(--text-secondary);
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background .12s, color .12s;
  text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-item:hover  { background: var(--bg-soft); color: var(--text); }
.sidebar-item.active { color: var(--text); font-weight: 600; border-left-color: var(--text); background: var(--primary-light); }

.sidebar-item i { font-size: 16px; flex-shrink: 0; }

/* ── Banner ────────────────────────────────────────────────────────────── */
.banner-swiper img { width: 100%; height: 260px; object-fit: cover; }
.swiper-pagination-bullet { background: rgba(255,255,255,.5) !important; opacity: 1; }
.swiper-pagination-bullet-active { background: #fff !important; }

/* ── Sección / encabezados ──────────────────────────────────────────────── */
.page-section { padding: 14px 16px 0; }
.section-header {
  display: flex; align-items: baseline;
  justify-content: space-between; margin-bottom: 10px;
}
.section-title { font-size: 14px; font-weight: 700; letter-spacing: -.1px; text-transform: uppercase; }
.section-link  { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.section-link:hover { color: var(--text); }

/* ── Barra de marcas (brand chips scroll) ───────────────────────────────── */
.brand-bar {
  display: flex; gap: 6px; overflow-x: auto; padding: 8px 16px 10px;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none; align-items: center;
}
.brand-bar::-webkit-scrollbar { display: none; }

.brand-chip {
  flex-shrink: 0;
  height: 26px; padding: 0 12px;
  background: var(--bg-soft); border: 1px solid var(--border-md);
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; white-space: nowrap;
  transition: all .15s;
}
.brand-chip:hover  { background: var(--bg); border-color: var(--text); color: var(--text); }
.brand-chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ── Barra de filtros (sort/count) ──────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.filter-select {
  height: 28px; padding: 0 10px;
  border: 1px solid var(--border-md); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 12px;
  outline: none; cursor: pointer;
  transition: border-color .15s;
}
.filter-select:focus { border-color: var(--text); }
.results-count { font-size: 12px; color: var(--text-muted); margin-left: auto; }

/* ── Grid de productos ─────────────────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 12px 16px;
}
@media (min-width: 480px)  { .products-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px)  { .products-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px) { .products-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1280px) { .products-grid { grid-template-columns: repeat(6, 1fr); } }

/* ── Product Card ──────────────────────────────────────────────────────── */
.product-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column;
  transition: box-shadow .2s, border-color .2s, transform .2s;
}
.product-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--border-md);
  transform: translateY(-2px);
}

.product-card-img-wrap {
  background: var(--bg-soft);
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.product-card-img {
  width: 100%; height: 100%;
  object-fit: contain; padding: 10px;
  transition: transform .3s;
}
.product-card:hover .product-card-img { transform: scale(1.04); }

/* Badge disponibilidad sobre imagen */
.avail-badge {
  position: absolute; bottom: 7px; left: 7px;
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(20,120,50,.88);
  color: #fff; font-size: 9px; font-weight: 600;
  padding: 2px 8px; border-radius: var(--radius-pill);
  letter-spacing: .2px; backdrop-filter: blur(2px);
}
.avail-badge.unavailable { background: rgba(90,90,90,.80); }
.avail-badge i { font-size: 9px; }

.product-card-body {
  padding: 8px 10px 10px;
  display: flex; flex-direction: column; gap: 2px; flex: 1;
}
.product-card-brand {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-muted);
}
.product-card-name {
  font-size: 12px; font-weight: 500;
  color: var(--text); line-height: 1.35; margin-top: 1px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.badge-new {
  display: inline-block;
  background: var(--text); color: var(--bg);
  font-size: 9px; font-weight: 700;
  letter-spacing: .4px; text-transform: uppercase;
  padding: 1px 6px; border-radius: 20px;
  vertical-align: middle; margin-left: 4px;
}
.badge-good-price {
  display: inline-flex; align-items: center; gap: 3px;
  background: #e8f8ed; color: #1a7f3c;
  font-size: 9px; font-weight: 600;
  padding: 2px 7px; border-radius: var(--radius-pill);
  margin-top: 2px; align-self: flex-start;
}
.product-card-price {
  font-size: 15px; font-weight: 700;
  color: var(--text); margin-top: auto; padding-top: 6px;
}

/* ── Categorías scroll (home page chips) ───────────────────────────────── */
.categories-scroll {
  display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 4px;
  scrollbar-width: none;
}
.categories-scroll::-webkit-scrollbar { display: none; }

.cat-chip {
  flex-shrink: 0; width: 76px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 6px 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-md); cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  text-align: center; text-decoration: none;
}
.cat-chip:hover {
  border-color: var(--border-md);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}
.cat-chip i    { font-size: 20px; color: var(--text); }
.cat-chip span { font-size: 10px; font-weight: 500; color: var(--text-secondary); line-height: 1.2; }

/* ── Página detalle de producto ─────────────────────────────────────────── */
.product-detail-wrap { padding: 14px 16px; max-width: 1100px; }

.back-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; color: var(--text-secondary); margin-bottom: 16px;
  transition: color .15s;
}
.back-link:hover { color: var(--text); }

.detail-swiper-wrap { background: var(--bg-soft); border-radius: var(--radius-lg); overflow: hidden; }
.detail-swiper .swiper-slide img {
  width: 100%; height: 320px;
  object-fit: contain; padding: 16px; background: var(--bg-soft);
}

.swiper-button-next, .swiper-button-prev {
  color: var(--text) !important;
  background: var(--bg);
  width: 32px !important; height: 32px !important;
  border-radius: 50%;
  box-shadow: var(--shadow-card);
}
.swiper-button-next::after, .swiper-button-prev::after { font-size: 12px !important; font-weight: 700; }

.thumbs-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.product-thumb {
  width: 56px; height: 56px; border-radius: var(--radius-sm);
  object-fit: contain; background: var(--bg-soft);
  border: 1.5px solid var(--border); padding: 4px; cursor: pointer;
  transition: border-color .15s;
}
.product-thumb.active { border-color: var(--text); }

.product-info { padding: 0 2px; }
.cat-badge {
  display: inline-block;
  background: var(--bg-soft); color: var(--text-secondary);
  font-size: 10px; font-weight: 600; letter-spacing: .5px;
  text-transform: uppercase; padding: 3px 10px;
  border-radius: var(--radius-pill); margin-bottom: 10px;
}
.product-name  { font-size: 18px; font-weight: 700; line-height: 1.3; margin-bottom: 4px; }
.product-brand { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); margin-bottom: 4px; }
.product-model { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.product-price { font-size: 26px; font-weight: 700; letter-spacing: -.5px; margin-bottom: 14px; }

.availability-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500; padding: 4px 12px;
  border-radius: var(--radius-pill); margin-bottom: 16px;
}
.availability-chip.available   { background: #e8f8ed; color: #1a7f3c; }
.availability-chip.unavailable { background: var(--bg-soft); color: var(--text-muted); }

.btn-whatsapp {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 44px;
  background: #25d366; color: #fff;
  font-family: var(--font); font-size: 15px; font-weight: 600;
  border: none; border-radius: var(--radius-md); cursor: pointer;
  text-decoration: none; margin-bottom: 18px;
  transition: background .2s, transform .15s;
}
.btn-whatsapp:hover { background: #1db954; transform: translateY(-1px); color: #fff; }

.product-description-box {
  background: var(--bg-soft); border-radius: var(--radius-md); padding: 14px 16px;
}
.product-description-box h6 {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--text-muted); margin-bottom: 8px;
}
.product-description-box p {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.65; white-space: pre-line; margin: 0;
}

/* ── Métodos de pago ────────────────────────────────────────────────────── */
.payment-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px; margin-bottom: 12px;
}
.payment-card h5 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.payment-logo { height: 44px; object-fit: contain; filter: grayscale(15%); transition: filter .2s, transform .2s; }
.payment-logo:hover { filter: none; transform: scale(1.06); }

/* ── Product Modal (bottom sheet) ───────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 800;
  background: rgba(0,0,0,.5);
  animation: fade-in .2s ease;
}
.modal-overlay.open { display: block; }

.product-modal {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%) translateY(100%);
  z-index: 850;
  width: 100%; max-width: 900px;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -6px 40px rgba(0,0,0,.18);
  max-height: 88vh;
  overflow-y: auto;
  transition: transform .32s cubic-bezier(.4,0,.2,1);
}
.product-modal.open {
  transform: translateX(-50%) translateY(0);
}

.modal-handle {
  width: 40px; height: 4px;
  background: var(--border-md); border-radius: 2px;
  margin: 10px auto 0;
}

.modal-close {
  position: absolute; top: 12px; right: 14px;
  background: var(--bg-soft); border: none; cursor: pointer;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--text-secondary);
  transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--border-md); color: var(--text); }

.modal-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 16px 20px 28px;
}
@media (min-width: 600px) {
  .modal-inner { grid-template-columns: 1fr 1fr; }
}

.modal-img-wrap {
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
}
.modal-img-wrap img {
  width: 100%; height: 100%;
  object-fit: contain; padding: 16px;
}

.modal-info { display: flex; flex-direction: column; gap: 6px; }
.modal-brand { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); }
.modal-name  { font-size: 17px; font-weight: 700; line-height: 1.3; }
.modal-model { font-size: 12px; color: var(--text-muted); }
.modal-price { font-size: 24px; font-weight: 700; letter-spacing: -.4px; margin-top: 2px; }

/* ── Empty state ────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 2.5rem; opacity: .25; display: block; margin-bottom: 12px; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
footer {
  background: var(--bg); border-top: 1px solid var(--border);
  padding: 20px 16px; margin-top: 40px;
  text-align: center; font-size: 12px; color: var(--text-muted);
}
footer img { margin: 0 auto 8px; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 576px) {
  .banner-swiper img { height: 160px; }
  .detail-swiper .swiper-slide img { height: 240px; }
  .product-price { font-size: 22px !important; }
}
@media (min-width: 768px) {
  body { padding-top: calc(var(--nav-h) + var(--cat-h)); }
  .product-detail-wrap { padding: 20px 24px; }
  .banner-swiper img { height: 320px; }
  .products-grid { padding: 12px 24px; }
  .brand-bar { padding: 8px 24px 10px; }
  .filter-bar { padding: 8px 24px; }
  .page-section { padding: 14px 24px 0; }
}
@media (min-width: 1024px) {
  .product-detail-wrap { padding: 24px 32px; }
  .banner-swiper img { height: 380px; }
  .products-grid { padding: 12px 32px; }
  .brand-bar { padding: 8px 32px 10px; }
  .filter-bar { padding: 8px 32px; }
  .page-section { padding: 14px 32px 0; }
}
