/* ============================================================
   GM INGTEC MARKETPLACE — marketplace.css v2
   Inspirado en Ingram XVantage: cards con imagen, VPN/SKU,
   precio COP + USD, stock verde/rojo
   ============================================================ */

:root {
  --blue:        #063961;
  --blue-mid:    #0a5a9c;
  --blue-light:  #d6e8f7;
  --green:       #02a30a;
  --green-dark:  #01781e;
  --green-light: #e6f9e7;
  --red:         #d32f2f;
  --red-light:   #fdecea;
  --orange:      #f57c00;

  --bg:          #f0f2f5;
  --surface:     #ffffff;
  --surface-2:   #f8fafb;
  --border:      #e0e6ed;
  --border-2:    #c8d3de;

  --text:        #1a2332;
  --text-2:      #4a5568;
  --text-3:      #8a9bb0;

  --radius:      8px;
  --radius-sm:   5px;
  --shadow-sm:   0 1px 3px rgba(6,57,97,.07), 0 1px 2px rgba(6,57,97,.04);
  --shadow:      0 4px 12px rgba(6,57,97,.10);
  --shadow-lg:   0 8px 32px rgba(6,57,97,.16);
  --transition:  0.18s ease;
  --header-h:    108px;
  --sidebar-w:   252px;
}

[data-theme="dark"] {
  /* Azules GM */
  --blue:        #00aaff;
  --blue-mid:    #33bbff;
  --blue-light:  rgba(0,170,255,.12);
  /* Verdes GM */
  --green:       #05C012;
  --green-dark:  #03900d;
  --green-light: rgba(5,192,18,.12);
  /* Rojo */
  --red:         #ef5350;
  --red-light:   rgba(239,83,80,.13);

  /* Fondos — dark navy corporativo (menos agresivo que pure black) */
  --bg:          #141b25;
  --surface:     #1e2635;
  --surface-2:   #252f3e;
  --border:      rgba(255,255,255,.13);
  --border-2:    rgba(255,255,255,.07);

  /* Texto */
  --text:        #eef1f6;
  --text-2:      #a8b4c4;
  --text-3:      #7a8898;

  --shadow-sm:   0 1px 4px rgba(0,0,0,.5);
  --shadow:      0 4px 16px rgba(0,0,0,.6);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.75);
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Roboto', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}
a { color: var(--blue); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select { font-family: inherit; }
.container { max-width: 1440px; margin: 0 auto; padding: 0 1.25rem; }

/* ── HEADER ─────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 6px rgba(6,57,97,.08);
}
[data-theme="dark"] .site-header {
  background: #1a2332;
  border-bottom-color: rgba(255,255,255,.1);
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.header-top { padding: 0.65rem 0; }
.header-inner { display: flex; align-items: center; gap: 1rem; }

.brand {
  display: flex; align-items: center; gap: .55rem;
  text-decoration: none; flex-shrink: 0;
  background: none; border: none; padding: 0; cursor: pointer;
}
.brand-gm     { color: var(--blue); font-size: 1.45rem; font-weight: 700; letter-spacing: -1px; }
.brand-ingtec { color: var(--green); font-size: 1.45rem; font-weight: 700; letter-spacing: -1px; }
.brand-market { color: var(--text-3); font-size: .7rem; text-transform: uppercase; letter-spacing: 1.5px; align-self: flex-end; margin-bottom: 2px; }
.brand-logo-img { height: 40px; width: auto; object-fit: contain; display: block; }
[data-theme="dark"] .brand-gm    { color: #fff; }
[data-theme="dark"] .brand-market { color: rgba(255,255,255,.5); }
/* Logo imagen: aumentar brillo en dark para garantizar visibilidad */
[data-theme="dark"] .brand-logo-img {
  filter: brightness(2) drop-shadow(0 0 3px rgba(255,255,255,.1));
}

.search-wrap {
  flex: 1; display: flex; max-width: 620px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden; transition: all var(--transition);
}
.search-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(6,57,97,.1); }
[data-theme="dark"] .search-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,170,255,.12); }
.search-input { flex: 1; padding: .6rem 1rem; background: transparent; border: none; color: var(--text); font-size: .9rem; outline: none; }
.search-input::placeholder { color: var(--text-3); }
.search-clear {
  padding: 0 .45rem; background: none; border: none;
  color: var(--text-3); display: flex; align-items: center;
  transition: color var(--transition);
}
.search-clear:hover { color: var(--red); }
.search-btn {
  padding: 0 1rem; border: none; color: #fff;
  background: var(--grad-btn); background-size: var(--grad-btn-size);
  transition: background-position .4s ease;
}
.search-btn:hover { background-position: right center; }

/* TRM chip — estilo pill unificado */
.trm-chip {
  display: flex; align-items: center; gap: .35rem; flex-shrink: 0;
  background: var(--blue); color: #fff;
  border: 1.5px solid var(--blue);
  padding: .3rem .8rem; border-radius: 20px;
  font-size: .8rem; font-weight: 600; white-space: nowrap;
}
.trm-value { font-weight: 700; font-size: .8rem; }
[data-theme="dark"] .trm-chip {
  background: rgba(0,170,255,.15); color: var(--blue-mid);
  border-color: rgba(0,170,255,.45);
}

/* ══════════════════════════════════════════════════════════════
   GRADIENTE GM INGTEC — mismo estilo que index.php en TODOS los
   botones primarios del marketplace
   ══════════════════════════════════════════════════════════════ */
/* Variable de gradiente para reutilización */
:root {
  --grad-btn: linear-gradient(to right, #063961 0%, #02a30a 100%);
  --grad-btn-size: 200% auto;
}
[data-theme="dark"] {
  --grad-btn: linear-gradient(to right, #00aaff 0%, #05C012 100%);
}

/* Clase base reutilizable para cualquier botón/enlace primario */
.btn-gm-primary {
  background: var(--grad-btn); background-size: var(--grad-btn-size);
  color: #fff !important; border: none; cursor: pointer;
  transition: background-position .45s ease, transform .15s ease, opacity .15s ease;
  font-weight: 600;
}
.btn-gm-primary:hover { background-position: right center; opacity: .9; transform: translateY(-1px); }

/* ── Botón "← GM INGTEC" en el header ── */
.btn-home-site {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .38rem .85rem;
  background: var(--grad-btn); background-size: var(--grad-btn-size);
  border-radius: 5px; text-decoration: none; white-space: nowrap; flex-shrink: 0;
  font-size: .78rem;
  transition: background-position .4s ease, transform .15s ease;
}
.btn-home-site, .btn-home-site:hover { color: #fff; }
.btn-home-site:hover { background-position: right center; transform: translateY(-1px); }

.header-actions { display: flex; align-items: center; gap: .15rem; flex-shrink: 0; }
.action-btn {
  display: flex; flex-direction: column; align-items: center; gap: .12rem;
  position: relative; padding: .45rem .6rem;
  background: transparent; border: none; color: var(--text-2);
  border-radius: var(--radius-sm); transition: background var(--transition);
}
.action-btn:hover { background: var(--blue-light); color: var(--blue); }
[data-theme="dark"] .action-btn { color: rgba(255,255,255,.8); }
[data-theme="dark"] .action-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.action-label { font-size: .62rem; font-weight: 500; letter-spacing: .5px; }
.badge {
  position: absolute; top: 1px; right: 1px;
  background: var(--green); color: #fff;
  font-size: .62rem; font-weight: 700;
  min-width: 17px; height: 17px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}
[data-theme="dark"] .badge { border-color: #002D5A; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: none !important; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block !important; }
[data-theme="dark"] .theme-toggle { color: #ffd700; }   /* dorado visible en dark */

/* Categorías nav */
.cat-nav { background: var(--blue-light); border-top: 1px solid var(--border); }
[data-theme="dark"] .cat-nav { background: rgba(0,0,0,.25); border-top-color: rgba(0,170,255,.12); }
.cat-nav-inner {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: .35rem; padding: .5rem 0; overflow-x: auto; scrollbar-width: none;
}
.cat-nav-inner::-webkit-scrollbar { display: none; }
.cat-pill {
  flex-shrink: 0; padding: .3rem .85rem;
  background: var(--blue); border: 1.5px solid var(--blue);
  border-radius: 20px; color: #fff;
  font-size: .78rem; font-weight: 600; white-space: nowrap;
  transition: all var(--transition);
}
.cat-pill:hover { background: var(--blue-mid); border-color: var(--blue-mid); }
.cat-pill.active { background: var(--green); border-color: var(--green); color: #fff; }
[data-theme="dark"] .cat-pill {
  background: rgba(0,170,255,.15); border-color: rgba(0,170,255,.45); color: var(--blue-mid);
}
[data-theme="dark"] .cat-pill:hover {
  background: rgba(0,170,255,.3); border-color: rgba(0,170,255,.65); color: #fff;
}
[data-theme="dark"] .cat-pill.active { background: var(--green); border-color: var(--green); color: #fff; }

/* ── MAIN LAYOUT ─────────────────────────────────────────── */
.site-main { padding: 1.25rem 0 3rem; }
.layout-wrapper { display: flex; gap: 1.25rem; align-items: flex-start; }

/* ── SIDEBAR ─────────────────────────────────────────────── */
.filters-sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  position: sticky; top: calc(var(--header-h) + .75rem);
  max-height: calc(100vh - var(--header-h) - 1.5rem);
  overflow-y: auto; scrollbar-width: thin;
  transition: width .25s ease, opacity .25s ease, min-width .25s ease;
}
/* Sidebar dock/hide button — oculto: reemplazado por filter-toggle-btn unificado */
.sidebar-dock-btn { display: none; }
/* Estado colapsado */
.filters-sidebar.sidebar-hidden {
  width: 0; min-width: 0; overflow: hidden; opacity: 0; border: none; padding: 0; margin: 0;
}
.layout-wrapper.sidebar-collapsed .products-area { flex: 1; }
.sidebar-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: .85rem 1rem .7rem; border-bottom: 1px solid var(--border);
}
.sidebar-header h3 { font-size: .9rem; font-weight: 700; color: var(--blue); }
.btn-link { background: none; border: none; color: var(--text-3); font-size: .76rem; padding: 0; }
.btn-link:hover { color: var(--blue); }

.filter-group { padding: .8rem 1rem; border-bottom: 1px solid var(--border); }
.filter-group:last-child { border-bottom: none; }
.filter-title { font-size: .75rem; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .7px; margin-bottom: .55rem; }

/* Precio: Min arriba, Máx abajo */
.price-inputs-stack { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .55rem; }
.price-input {
  width: 100%; padding: .38rem .6rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: .78rem; background: var(--surface-2);
  color: var(--text); outline: none;
}
.price-input:focus { border-color: var(--blue); }

/* Sub-label dentro de filtros jerárquicos */
.filter-sub-label {
  font-size: .67rem; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: .28rem;
}

/* Ruta de categoría activa */
.cat-path {
  font-size: .71rem; color: var(--blue); margin-bottom: .5rem;
  padding: .28rem .55rem; background: var(--blue-light);
  border-radius: var(--radius-sm); line-height: 1.5;
}
[data-theme="dark"] .cat-path { background: rgba(0,170,255,.1); color: #00aaff; }
.cat-path-item { font-weight: 600; }

/* ── ÁRBOL JERÁRQUICO DE CATEGORÍAS ──────────────────────── */
.cat-tree { display: flex; flex-direction: column; gap: .05rem; }

/* Cada nodo del árbol */
.ct-node { display: flex; flex-direction: column; }

/* Fila: checkbox label + botón toggle */
.ct-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: .2rem; border-radius: 4px; padding: .08rem .05rem;
}
.ct-row:hover { background: var(--blue-light); }
[data-theme="dark"] .ct-row:hover { background: rgba(0,170,255,.08); }
.ct-row .filter-check { flex: 1; padding: .2rem 0; margin: 0; }

/* Botón toggle ▶/▼ */
.ct-toggle {
  flex-shrink: 0; background: none; border: none;
  width: 22px; height: 22px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); cursor: pointer; transition: all var(--transition);
}
.ct-toggle:hover { background: var(--blue-light); color: var(--blue); }
[data-theme="dark"] .ct-toggle:hover { background: rgba(0,170,255,.15); }

.ct-chevron { transition: transform .18s ease; display: block; }
.ct-chevron.expanded { transform: rotate(180deg); }

/* Hijos: sangría + línea lateral de color */
.ct-children {
  display: flex; flex-direction: column; gap: .05rem;
  padding-left: .7rem;
  border-left: 2px solid var(--blue-light);
  margin-left: .55rem; margin-top: .1rem; margin-bottom: .1rem;
}
.ct-lvl2 > .ct-children {
  border-left-color: var(--green-light);
}
[data-theme="dark"] .ct-children   { border-left-color: rgba(0,170,255,.25); }
[data-theme="dark"] .ct-lvl2 > .ct-children { border-left-color: rgba(5,192,18,.25); }

/* Nivel 3: font slightly smaller */
.ct-lvl3 .filter-check { font-size: .77rem; }

/* Botón "Mostrar más / Mostrar menos" dentro del árbol */
.ct-show-more {
  display: inline-flex; align-items: center; gap: .2rem;
  background: none; border: none; color: var(--blue);
  font-size: .73rem; font-weight: 600; cursor: pointer;
  padding: .2rem .05rem; margin-top: .1rem;
}
.ct-show-more:hover { text-decoration: underline; }
.btn-filter-apply {
  width: 100%; padding: .36rem; background: var(--blue); color: #fff;
  border: none; border-radius: var(--radius-sm); font-size: .77rem; font-weight: 600;
  margin-top: .45rem;
}
.btn-filter-apply:hover { background: var(--blue-mid); }

.filter-search-input {
  width: 100%; padding: .33rem .55rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: .78rem; background: var(--surface-2);
  color: var(--text); outline: none; margin-bottom: .45rem;
}
.filter-options { display: flex; flex-direction: column; gap: .15rem; max-height: 190px; overflow-y: auto; }
.filter-check { display: flex; align-items: center; gap: .45rem; padding: .22rem 0; font-size: .8rem; color: var(--text-2); cursor: pointer; }
.filter-check input { accent-color: var(--blue); width: 14px; height: 14px; }
.filter-check:hover { color: var(--blue); }

.filter-skeleton { height: 16px; background: var(--border); border-radius: 4px; margin-bottom: 7px; animation: shimmer 1.4s infinite; }
.filter-skeleton.short { width: 60%; }

/* ── PRODUCTS AREA ────────────────────────────────────────── */
.products-area { flex: 1; min-width: 0; }

/* Barra combinada: contador izquierda, controles derecha */
.products-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: .5rem .9rem; margin-bottom: .9rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  gap: .5rem;
}
.products-bar-left {
  display: flex; align-items: center; gap: .45rem;
  font-size: .82rem; font-weight: 600; color: var(--text-2);
  white-space: nowrap;
}
.products-bar-label { font-weight: 500; color: var(--text-2); }
.products-bar-right { display: flex; align-items: center; gap: .45rem; }
/* Compat */
.product-count { font-size: .82rem; color: var(--text-2); font-weight: 500; }
.toolbar-right { display: flex; align-items: center; gap: .45rem; }
.sort-select {
  padding: .38rem .65rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface-2);
  color: var(--text); font-size: .8rem; outline: none;
}
.sort-select:focus { border-color: var(--blue); }
.view-toggle { display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.view-btn { padding: .32rem .55rem; background: transparent; border: none; color: var(--text-3); font-size: .95rem; transition: all var(--transition); }
.view-btn.active { background: var(--blue); color: #fff; }
.filter-toggle-btn {
  display: flex; align-items: center; gap: .35rem;
  padding: .38rem .7rem; background: var(--blue); color: #fff;
  border: 2px solid var(--blue); border-radius: var(--radius-sm); font-size: .8rem; font-weight: 600;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
/* Estado "filtros ocultos" → botón outlined para indicar que el panel está cerrado */
.filter-toggle-btn.filters-off {
  background: transparent;
  color: var(--blue);
}
[data-theme="dark"] .filter-toggle-btn.filters-off {
  color: var(--blue-mid);
  border-color: var(--blue-mid);
}

/* ── PRODUCTS GRID ────────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);   /* 3 cols fijas — max 24 por página (8 filas) */
  gap: 1rem;
}
.products-grid.view-list { grid-template-columns: 1fr; }
@media (max-width: 860px) { .products-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .products-grid { grid-template-columns: 1fr; } }

/* ── PRODUCT CARD ─────────────────────────────────────────── */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-2);
}

/* Imagen */
.product-img-wrap {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  padding: .5rem;
}
.product-img-wrap img {
  max-width: 85%; max-height: 85%;
  object-fit: contain;
  transition: transform .3s ease;
}
.product-card:hover .product-img-wrap img { transform: scale(1.04); }
.product-img-placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}
.product-img-fallback {
  max-width: 70%; max-height: 70%;
  object-fit: contain; opacity: .35;
  filter: grayscale(40%);
}

/* Badges sobre imagen */
.prod-badges {
  position: absolute; top: .4rem; left: .4rem;
  display: flex; flex-direction: column; gap: .2rem;
}
.prod-badge {
  padding: .15rem .45rem; border-radius: 4px;
  font-size: .65rem; font-weight: 700; line-height: 1.4;
}
.badge-new        { background: #e3f2fd; color: #1565c0; }
.badge-disc       { background: #fff3e0; color: #e65100; }
.badge-restricted { background: #fce4ec; color: #c62828; }

/* Body de la card */
.product-body { padding: .65rem .8rem; flex: 1; display: flex; flex-direction: column; gap: .22rem; }

/* Descripción truncada — primer campo */
.product-desc {
  font-size: .90rem; font-weight: 500; color: var(--text); /* +15% vs .78rem */
  line-height: 1.4;
}
/* Marca — texto descriptivo (ya no uppercase, ahora en card-meta) */
.product-brand { display: none; } /* reemplazado por .card-meta */

/* VPN / SKU / Marca en card — +20% vs .73rem base → .88rem */
.product-meta-row {
  font-size: .73rem; color: var(--text-3);
  font-family: 'Roboto Mono', monospace;
}
.product-meta-row strong { color: var(--text-2); }

/* Estilo específico para Marca/VPN/SKU en tarjeta */
.card-meta {
  font-size: .82rem; color: var(--text-3);
  font-family: 'Roboto Mono', monospace; line-height: 1.4;
}
.meta-label { color: #1a3a6b; font-weight: 600; font-style: italic; }
[data-theme="dark"] .meta-label { color: #7eb3e0; }
.card-meta strong { color: var(--text); font-weight: 700; }

/* Bloque de precio centrado */
.product-price-block { margin-top: auto; padding-top: .3rem; text-align: center; }
.product-price-cop {
  font-size: 1.05rem; font-weight: 700; color: var(--green);
  line-height: 1.2;
}
.product-price-usd {
  font-size: .79rem; font-weight: 600; color: #1a3a6b; /* +10% vs .72rem */
}
[data-theme="dark"] .product-price-usd { color: #7eb3e0; }
.product-price-pending {
  font-size: .75rem; color: var(--text-3); font-style: italic;
}
.product-price-gated,
.modal-price-gated {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .75rem; color: var(--blue); font-weight: 500;
  cursor: pointer; border: 1px dashed var(--blue);
  border-radius: 6px; padding: .3rem .6rem;
  transition: background .15s;
}
.product-price-gated:hover,
.modal-price-gated:hover { background: color-mix(in srgb, var(--blue) 10%, transparent); }
.price-iva-note {
  font-size: .67rem; color: var(--red);
  margin-top: .1rem; font-style: italic; line-height: 1.3;
}

/* Compat legacy (modal u otros) */
.product-vendor { font-size: .68rem; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: .8px; }
.product-name   { font-size: .8rem; font-weight: 500; color: var(--text); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.product-ids    { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .1rem; }
.product-id-tag { font-size: .67rem; color: var(--text-3); font-family: 'Roboto Mono', monospace; }
.product-id-tag strong { color: var(--text-2); }
.product-price-row { margin-top: auto; padding-top: .35rem; display: flex; flex-direction: column; gap: .1rem; }

/* Disponibilidad — igual que XVantage */
.product-avail {
  display: flex; align-items: center; gap: .3rem;
  font-size: .73rem; font-weight: 600; margin-top: .25rem;
  padding: .25rem .5rem; border-radius: 4px;
}
.product-avail svg { flex-shrink: 0; }
.in-stock  { color: var(--green); background: var(--green-light); }
.out-stock { color: var(--red);   background: var(--red-light);   }
.loading   { color: var(--text-3); background: transparent; }

[data-theme="dark"] .in-stock  { background: rgba(76,175,80,.15); }
[data-theme="dark"] .out-stock { background: rgba(239,83,80,.15); }

/* Acciones de la card — todo en una fila */
.product-actions {
  padding: .5rem .65rem;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: row; align-items: center; gap: .35rem;
}

/* Selector de cantidad en tarjeta */
.card-qty-wrap {
  display: flex; align-items: center; justify-content: center; gap: .35rem;
}
.card-qty-btn {
  width: 26px; height: 26px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 1.05rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); flex-shrink: 0;
}
.card-qty-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.card-qty-val {
  min-width: 30px; text-align: center;
  font-size: .85rem; font-weight: 600; color: var(--text);
}

/* Botón icono carrito — fila horizontal con qty selector */
.btn-add-cart {
  flex: 1; padding: .42rem .4rem;
  background: var(--grad-btn); background-size: var(--grad-btn-size);
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-size: .75rem; font-weight: 600;
  transition: background-position .4s ease, opacity .15s ease;
  display: flex; align-items: center; justify-content: center; gap: .25rem;
}
.btn-add-cart:hover { background-position: right center; opacity: .9; }
.btn-add-cart.added { background: var(--green); background-size: auto; }
.no-stock-label {
  font-size: .73rem; color: var(--text-3); text-align: center;
  padding: .3rem 0; font-style: italic;
}

/* Botón detalle (ojo) — compacto en la misma fila */
.btn-detail {
  flex-shrink: 0; width: 30px; height: 30px; padding: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.btn-detail:hover { border-color: var(--blue); color: var(--blue); }

/* Compat legacy */
.btn-add-quote {
  flex: 1; padding: .42rem .5rem;
  background: var(--grad-btn); background-size: var(--grad-btn-size);
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-size: .76rem; font-weight: 600;
  transition: background-position .4s ease; white-space: nowrap;
}
.btn-add-quote:hover { background-position: right center; }
.btn-add-quote.added { background: var(--green); background-size: auto; }

/* ── Vista lista — layout XVantage ─────────────────────────────── */
.products-grid.view-list .product-card {
  flex-direction: row; min-height: 130px; align-items: stretch;
}
/* Imagen cuadrada compacta estilo XVantage */
.products-grid.view-list .product-img-wrap {
  width: 130px; height: 130px; flex-shrink: 0;
  aspect-ratio: 1; border-radius: var(--radius) 0 0 var(--radius);
}
/* Cuerpo: descripción completa ocupa todo el espacio */
.products-grid.view-list .product-body {
  flex-direction: column; flex: 1; padding: .75rem 1rem;
  justify-content: flex-start; gap: .2rem;
}
/* Descripción — azul clickable en ambas vistas */
.product-desc {
  font-size: .84rem; font-weight: 600;
  color: var(--blue); cursor: pointer;
  line-height: 1.45; margin-bottom: .2rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-desc:hover { text-decoration: underline; }
.products-grid.view-list .product-desc {
  font-size: .86rem; -webkit-line-clamp: unset; overflow: visible; display: block;
}
/* VPN/SKU en una línea compacta (estilo XVantage) */
.card-meta-inline {
  font-size: .76rem; color: var(--text-3); margin-bottom: .2rem;
}
.card-meta-inline .meta-label { color: var(--text-3); font-weight: 500; font-style: normal; }
.card-meta-inline strong { color: var(--text-2); }
/* ── Fila de stock ───────────────────────────────────────────── */
.card-stock-row {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  margin-top: .2rem;
}
/* En GRID (sin clase view-list): centrar el badge de disponibilidad */
#productsGrid:not(.view-list) .card-stock-row { justify-content: center; }
/* En LIST: alinear a la izquierda (por defecto) */
#productsGrid.view-list .card-stock-row { justify-content: flex-start; }
/* Filas Marca/VPN/SKU para vista GRID */
.card-meta-rows { font-size: .76rem; color: var(--text-3); margin-bottom: .2rem; }
.card-meta-rows .meta-label { color: var(--text-3); font-weight: 500; }
.card-meta-rows strong { color: var(--text-2); }
/* ── Panel de precio en lista (columna derecha) ──────────────── */
.list-price-panel {
  border-top: none !important; border-left: 1px solid var(--border) !important;
  flex-direction: column; align-items: stretch; gap: .45rem;
  min-width: 185px; flex-shrink: 0; padding: .85rem .85rem;
  justify-content: center;
}
.list-price-panel .product-price-block { text-align: right; margin-top: 0; padding-top: 0; }
.list-price-panel .product-price-cop { font-size: 1.1rem; }
.list-price-panel .price-msrp-note { text-align: right; }
.list-price-panel .card-qty-wrap { justify-content: center; margin-top: .2rem; }
.list-price-panel .btn-add-cart {
  width: 100%; height: 42px; border-radius: 20px;
  font-size: .82rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: .4rem;
}
.no-stock-label {
  font-size: .78rem; color: var(--red); font-weight: 600; text-align: center;
}

/* Precio sugerido en lista */
.price-msrp-note {
  font-size: .72rem; color: var(--text-3); margin-top: .15rem;
}
/* Acciones en lista: columna compacta a la derecha */
.products-grid.view-list .product-actions {
  border-top: none; border-left: 1px solid var(--border);
  flex-direction: column; align-items: stretch; gap: .4rem;
  min-width: 160px; flex-shrink: 0; padding: .75rem .7rem; justify-content: center;
}
.products-grid.view-list .card-qty-wrap { justify-content: center; margin-bottom: .1rem; }
/* Botón carrito en lista — gradiente, sin texto extra */
.products-grid.view-list .btn-add-cart {
  width: 100%; height: 42px; border-radius: 20px;
  font-size: .82rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: .4rem;
}
/* Botón detalle en lista */
.products-grid.view-list .btn-detail {
  width: 100%; height: 34px; border-radius: var(--radius-sm);
  font-size: .76rem; display: flex; align-items: center; justify-content: center; gap: .3rem;
  background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text-2);
}
.products-grid.view-list .btn-detail::after { content: ' Ver detalles'; }
/* Elementos solo visibles en lista */
.list-only { display: none; }
.products-grid.view-list .list-only { display: block; }
/* Cat-path verde — visible en grid (pequeña) y lista (normal) */
.card-cat-path {
  font-size: .68rem; color: var(--green); font-weight: 500;
  margin-bottom: .3rem; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.products-grid.view-list .card-cat-path { font-size: .75rem; white-space: normal; }
[data-theme="dark"] .card-cat-path { color: var(--green); }
.card-full-desc { font-size: .8rem; color: var(--text-2); line-height: 1.5; margin-bottom: .4rem; max-height: 3.6em; overflow: hidden; }
/* Sin stock: solo muestra btn-detail */
.no-stock-actions { display: flex; justify-content: center; width: 100%; }
.no-stock-actions .btn-detail { width: 100%; height: 34px; border-radius: var(--radius-sm); font-size: .75rem; }
.no-stock-actions .btn-detail::after { content: ' Ver detalles'; font-size: .72rem; margin-left: .3rem; }

/* Skeletons */
.skeleton-card { pointer-events: none; }
.skeleton-img  { height: 155px; background: var(--border); animation: shimmer 1.4s infinite; }
.skeleton-body { padding: .7rem .8rem; display: flex; flex-direction: column; gap: .45rem; }
.skeleton-line { height: 12px; background: var(--border); border-radius: 4px; animation: shimmer 1.4s infinite; }
.skeleton-line.short { width: 55%; }
.skeleton-line.price { width: 45%; height: 18px; margin-top: .4rem; }
@keyframes shimmer { 0%,100%{opacity:1} 50%{opacity:.5} }

/* ── NO RESULTS / ERROR ─────────────────────────────────── */
.no-results, .error-state {
  display: flex; flex-direction: column; align-items: center;
  gap: .7rem; padding: 3.5rem 2rem; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.no-results-icon, .error-icon { font-size: 2.8rem; }
.no-results h3, .error-state h3 { font-size: 1rem; color: var(--text); }
.no-results p,  .error-state p  { color: var(--text-2); font-size: .855rem; line-height: 1.6; }

/* ── PAGINATION ──────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; align-items: center; gap: .3rem; margin-top: 1.75rem; padding: .75rem; }
.page-btn {
  min-width: 34px; height: 34px; padding: 0 .45rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-2); font-size: .82rem; font-weight: 500;
  transition: all var(--transition);
}
.page-btn:hover    { border-color: var(--blue); color: var(--blue); }
.page-btn.active   { background: var(--blue); border-color: var(--blue); color: #fff; }
.page-btn.disabled { opacity: .4; pointer-events: none; }
.page-ellipsis { color: var(--text-3); padding: 0 .2rem; }

/* ── QUOTE PANEL ─────────────────────────────────────────── */
.quote-overlay { display: none; position: fixed; inset: 0; background: rgba(6,57,97,.4); z-index: 200; backdrop-filter: blur(2px); }
.quote-overlay.open { display: block; }
.quote-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 100vw;
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg); z-index: 201;
  transform: translateX(100%); transition: transform .3s ease;
  display: flex; flex-direction: column;
}
.quote-panel.open { transform: translateX(0); }
.quote-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem 1.2rem 1rem; border-bottom: 1px solid var(--border);
  background: var(--blue); color: #fff;
}
[data-theme="dark"] .quote-panel-header { background: #071a2b; }
.quote-panel-header h2 { font-size: .95rem; font-weight: 700; }
.panel-close { background: rgba(255,255,255,.1); border: none; color: #fff; width: 28px; height: 28px; border-radius: 50%; font-size: .85rem; }
.panel-close:hover { background: rgba(255,255,255,.2); }
.quote-body { flex: 1; overflow-y: auto; padding: .9rem; }
.quote-empty { display: flex; flex-direction: column; align-items: center; padding: 3rem 1rem; text-align: center; color: var(--text-3); gap: .65rem; }
.quote-empty-icon { font-size: 2.5rem; }

.quote-item {
  display: flex; gap: .65rem; align-items: center;
  padding: .65rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: .5rem;
  background: var(--surface-2);
}
.quote-item-info { flex: 1; min-width: 0; }
.quote-item-name  { font-size: .78rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quote-item-sku   { font-size: .68rem; color: var(--text-3); font-family: 'Roboto Mono', monospace; }
.quote-item-price { font-size: .82rem; font-weight: 700; color: var(--blue); margin-top: .15rem; }

.qty-ctrl { display: flex; align-items: center; gap: .25rem; }
.qty-btn { width: 23px; height: 23px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; font-size: .85rem; color: var(--text-2); display: flex; align-items: center; justify-content: center; }
.qty-btn:hover { border-color: var(--blue); color: var(--blue); }
.qty-val { font-size: .82rem; font-weight: 600; min-width: 22px; text-align: center; }
.remove-item { width: 24px; height: 24px; background: none; border: none; color: var(--text-3); font-size: .95rem; border-radius: 4px; }
.remove-item:hover { background: var(--red-light); color: var(--red); }

.quote-footer { padding: .9rem 1.1rem; border-top: 1px solid var(--border); }
.quote-subtotal { display: flex; justify-content: space-between; align-items: center; margin-bottom: .45rem; font-size: .9rem; font-weight: 600; }
.quote-disclaimer { font-size: .68rem; color: var(--text-3); margin-bottom: .7rem; line-height: 1.5; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1.2rem; background: var(--blue); color: #fff;
  border: none; border-radius: var(--radius-sm); font-size: .85rem; font-weight: 600;
  transition: background var(--transition);
}
.btn-primary:hover { background: var(--blue-mid); }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1.2rem; background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .85rem; font-weight: 600;
  transition: all var(--transition);
}
.btn-secondary:hover { border-color: var(--blue); color: var(--blue); }
.btn-full { width: 100%; margin-bottom: .45rem; }

/* ── MODAL PRODUCTO ──────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(6,57,97,.5);
  z-index: 300; display: flex; align-items: center; justify-content: center;
  padding: 1rem; backdrop-filter: blur(4px);
}
.product-modal {
  background: var(--surface); border-radius: var(--radius);
  width: 82vw; max-width: 82vw; min-height: 38vh; max-height: 80vh;
  overflow-y: auto; position: relative;
  box-shadow: var(--shadow-lg); animation: modalIn .2s ease;
}
@media (max-width: 860px) { .product-modal { width: 95vw; max-width: 95vw; } }
@keyframes modalIn { from{transform:scale(.96);opacity:0} to{transform:scale(1);opacity:1} }
.modal-close {
  position: absolute; top: .7rem; right: .7rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 50%; width: 30px; height: 30px; font-size: .85rem; color: var(--text-2); z-index: 1;
}
.modal-close:hover { background: var(--red-light); color: var(--red); border-color: var(--red); }
.modal-body { padding: 1.5rem; }
.modal-loading { padding: 3rem; text-align: center; color: var(--text-3); }

/* ── FOOTER ──────────────────────────────────────────────── */
.site-footer {
  background: var(--blue); color: rgba(255,255,255,.85);
  padding: 2rem 0 0; margin-top: 2rem;
}
[data-theme="dark"] .site-footer { background: #071a2b; }

.footer-inner-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 2rem; padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.footer-col h4 {
  color: #fff; font-size: .88rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .7px;
  margin-bottom: .85rem; padding-bottom: .4rem;
  border-bottom: 2px solid var(--green); display: inline-block;
}
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: .45rem; }
.footer-col a { color: rgba(255,255,255,.65); font-size: .82rem; transition: color .15s, padding-left .15s; }
.footer-col a:hover { color: var(--green); padding-left: 4px; }

.footer-logo-img { height: 50px; object-fit: contain; margin-bottom: .5rem; display: block; }
.footer-logo-link { display: inline-block; }

.footer-tagline {
  font-size: .78rem; color: rgba(255,255,255,.5);
  font-style: italic; margin: .35rem 0 .85rem;
}

.footer-social { display: flex; gap: .85rem; }
.footer-social a { color: rgba(255,255,255,.55); font-size: 1.25rem; transition: color .15s, transform .15s; }
.footer-social a:hover { color: var(--green); transform: translateY(-2px); }

.footer-contact-list { list-style: none; padding: 0; }
.footer-contact-list li {
  display: flex; align-items: flex-start; gap: .5rem;
  margin-bottom: .55rem; font-size: .82rem;
}
.footer-contact-list i { color: var(--green); font-size: 1rem; margin-top: .05rem; flex-shrink: 0; }
.footer-contact-list span, .footer-contact-list a {
  color: rgba(255,255,255,.65); font-size: .82rem;
}
.footer-contact-list a:hover { color: var(--green); padding-left: 0; }


.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding: .85rem 0; font-size: .72rem; color: rgba(255,255,255,.35);
  flex-wrap: wrap; gap: .5rem;
}

@media (max-width: 900px) {
  .footer-inner-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-inner-grid { grid-template-columns: 1fr; }
}

/* ── FILTROS ACTIVOS (chips) ─────────────────────────────── */
.active-filters {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
  margin-bottom: .65rem;
}
.filter-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .28rem .7rem; border-radius: 20px;
  background: var(--blue); color: #fff;
  border: 1.5px solid var(--blue);
  font-size: .76rem; font-weight: 600;
}
[data-theme="dark"] .filter-chip {
  background: rgba(0,170,255,.15); color: var(--blue-mid);
  border-color: rgba(0,170,255,.45);
}
.filter-chip-remove {
  background: none; border: none; color: inherit; cursor: pointer;
  display: flex; align-items: center; padding: 0; opacity: .8;
  font-size: .85rem; line-height: 1;
}
.filter-chip-remove:hover { opacity: 1; }
.filter-chips-clear {
  font-size: .74rem; color: var(--text-3); background: none;
  border: none; cursor: pointer; padding: .2rem .35rem;
  border-radius: 4px;
}
.filter-chips-clear:hover { color: var(--red); }

/* ── HINT FILTRO VACÍO ───────────────────────────────────── */
.filter-empty-hint { font-size: .73rem; color: var(--text-3); font-style: italic; }

/* Opción "Todas" en filtros radio */
.filter-all-opt { font-style: italic; color: var(--text-3); font-size: .75rem; }

/* Radio buttons en filtros (accent igual que checkboxes) */
.cat-radio, .subcat-radio, .type-radio { accent-color: var(--blue); width: 14px; height: 14px; }


/* ── DESCUENTO BADGE ─────────────────────────────────────── */
.badge-discount-pct {
  position: absolute; top: .4rem; right: .4rem;
  background: #e65100; color: #fff;
  font-size: .63rem; font-weight: 700;
  padding: .18rem .42rem; border-radius: 4px; line-height: 1.3;
  white-space: nowrap;
}

/* ── CONTADOR DE PRODUCTOS (pill azul en la barra) ────────── */
.tab-count {
  background: var(--blue); color: #fff;
  border-radius: 20px; padding: .06rem .5rem;
  font-size: .7rem; font-weight: 700; line-height: 1.6;
}
[data-theme="dark"] .tab-count { background: rgba(0,170,255,.25); color: #00aaff; }

/* ── COLLAPSIBLE FILTERS ─────────────────────────────────── */
.filter-group-header {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; background: none; border: none;
  padding: .7rem 1rem; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.filter-group-header:hover { background: var(--surface-2); }
.filter-group-title {
  font-size: .75rem; font-weight: 700; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .7px;
}
.filter-chevron {
  width: 16px; height: 16px; flex-shrink: 0;
  color: var(--text-3);
  transition: transform var(--transition);
}
.filter-group.collapsed .filter-chevron { transform: rotate(-90deg); }
.filter-group-body {
  padding: .65rem 1rem;
}
.filter-group.collapsed .filter-group-body { display: none; }
.filter-group { border-bottom: 1px solid var(--border); }
.filter-group:last-child { border-bottom: none; }

/* remove old filter-title since it's now inside filter-group-header */
.filter-title { display: none; }

/* ── MOSTRAR MÁS / MENOS ─────────────────────────────────── */
.show-more-btn {
  display: flex; align-items: center; gap: .25rem;
  background: none; border: none; color: var(--blue);
  font-size: .75rem; font-weight: 600;
  padding: .3rem 0; cursor: pointer; margin-top: .2rem;
}
.show-more-btn:hover { text-decoration: underline; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 920px) {
  .filters-sidebar {
    display: none; position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 150; width: 280px; transform: translateX(-100%);
    transition: transform .3s ease; border-radius: 0; max-height: 100vh;
  }
  .filters-sidebar.mobile-open { display: flex; flex-direction: column; transform: translateX(0); }
  .layout-wrapper { display: block; }
  .products-area { width: 100%; }
}
@media (max-width: 600px) {
  .brand-market { display: none; }
  .action-label { display: none; }
  .quote-panel { width: 100vw; }
}

/* ── HOME SECTION ─────────────────────────────────────────── */
.home-section { display: none; padding-bottom: 3rem; }
.home-section.visible { display: block; }

/* Breadcrumb de vuelta al sitio */
.back-to-site {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .82rem; color: var(--text-3); padding: .6rem 0;
  transition: color var(--transition);
}
.back-to-site:hover { color: var(--green); }
.back-to-site svg { flex-shrink: 0; }

/* Categorías círculos */
.home-categories {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 1.25rem; padding: 2rem 0 1rem;
}
.home-cat-item {
  display: flex; flex-direction: column; align-items: center;
  gap: .5rem; width: 100px; cursor: pointer;
  transition: transform var(--transition);
}
.home-cat-item:hover { transform: translateY(-4px); }
.home-cat-circle {
  width: 68px; height: 68px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.home-cat-item:hover .home-cat-circle {
  background: var(--blue); border-color: var(--blue);
  box-shadow: 0 4px 16px rgba(6,57,97,.25);
}
[data-theme="dark"] .home-cat-item:hover .home-cat-circle {
  background: var(--green); border-color: var(--green);
  box-shadow: 0 4px 16px rgba(5,192,18,.3);
}
.home-cat-label {
  font-size: .76rem; font-weight: 600; color: var(--text-2);
  text-align: center; line-height: 1.2;
}

/* Banners / slider placeholder */
.home-banners {
  display: grid; grid-template-columns: 2fr 1fr;
  gap: 1rem; margin: 1.5rem 0;
}
.home-banner {
  border-radius: var(--radius); overflow: hidden;
  position: relative; cursor: pointer;
  min-height: 220px;
  display: flex; align-items: flex-end;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
.home-banner:hover { box-shadow: var(--shadow-lg); }
.home-banner-bg {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 5rem; opacity: .15;
}
.home-banner-content {
  position: relative; z-index: 1;
  padding: 1.25rem; width: 100%;
  background: linear-gradient(to top, rgba(0,0,0,.55) 0%, transparent 100%);
}
.home-banner-content h3 {
  color: #fff; font-size: 1.1rem; font-weight: 700;
  margin-bottom: .2rem;
}
.home-banner-content p {
  color: rgba(255,255,255,.8); font-size: .82rem; margin: 0;
}
.home-banner.primary { background: linear-gradient(135deg, var(--blue) 0%, #0a5a9c 100%); }
.home-banner.secondary { background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 100%); }
.home-banner.accent {
  grid-column: 1 / -1;
  min-height: 120px;
  background: linear-gradient(135deg, #063961 0%, #02a30a 100%);
}
[data-theme="dark"] .home-banner.primary  { background: linear-gradient(135deg, #002D5A 0%, #00aaff 100%); }
[data-theme="dark"] .home-banner.secondary { background: linear-gradient(135deg, #002D0A 0%, #05C012 100%); }
[data-theme="dark"] .home-banner.accent { background: linear-gradient(135deg, #0f2e3b 0%, #002D5A 100%); }

/* Logo en el header del marketplace */
.brand-logo-img {
  height: 44px; width: auto; object-fit: contain;
  display: block;
}
.brand { display: flex; align-items: center; gap: .6rem; cursor: pointer; }

/* Listing section */
.listing-section { display: none; }
.listing-section.visible { display: block; }

@media (max-width: 700px) {
  .home-banners { grid-template-columns: 1fr; }
  .home-banner.accent { grid-column: 1; }
  .home-categories { gap: .8rem; }
  .home-cat-item { width: 80px; }
  .home-cat-circle { width: 56px; height: 56px; font-size: 1.3rem; }
}

/* ── MODAL PRODUCTO — Layout 3 columnas (estilo XVantage) ── */
.modal-layout {
  display: grid;
  grid-template-columns: 200px 1fr 190px;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 700px) { .modal-layout { grid-template-columns: 1fr; } }

.modal-col-image { /* carrusel */ }

.modal-col-info { }
/* "Comprar todo {Marca} Productos" — enlace azul estilo XVantage */
.modal-brand-link {
  font-size: .78rem; color: var(--green); text-decoration: underline; cursor: pointer;
  margin-bottom: .4rem; font-weight: 500; display: inline-block;
}
/* Label "Categoría" en la ruta de categoría */
.modal-cat-label {
  font-weight: 600; color: var(--text-2); margin-right: .2rem;
}
.modal-cat-green { color: var(--green); font-weight: 500; }
.modal-product-name {
  font-size: .98rem; font-weight: 700; color: var(--text);
  line-height: 1.45; margin-bottom: .5rem;
}
.modal-ids {
  font-size: .78rem; margin-bottom: .4rem;
  font-family: 'Roboto Mono', monospace; line-height: 1.6;
}
.modal-ids, .modal-ids span { color: #1a3a6b; font-weight: 600; font-style: italic; }
[data-theme="dark"] .modal-ids, [data-theme="dark"] .modal-ids span { color: #7eb3e0; }
.modal-ids strong { color: var(--text); font-weight: 700; font-style: normal; }
.modal-cat-path {
  font-size: .72rem; color: var(--green); font-weight: 500;
  margin-bottom: .55rem; line-height: 1.5;
}
/* modal-full-desc ya no se usa (eliminado del modal) */

/* ── Specs grid (reemplaza la tabla inline) ───────────────── */
.modal-specs { margin-top: .7rem; }
.modal-specs-title {
  font-size: .7rem; font-weight: 700; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .7px; margin-bottom: .45rem;
  border-bottom: 1px solid var(--border); padding-bottom: .25rem;
}
.modal-specs-grid {
  display: grid;
  grid-template-columns: minmax(90px, auto) 1fr;
  font-size: .77rem; gap: 0;
}
.spec-key {
  padding: .28rem .65rem .28rem 0;
  color: var(--text-3); font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap; align-self: start;
}
.spec-val {
  padding: .28rem 0;
  color: var(--text); border-bottom: 1px solid var(--border);
  word-break: break-word; line-height: 1.45;
}
.modal-desc {
  font-size: .81rem; color: var(--text-2); line-height: 1.65;
  margin-bottom: .8rem; padding: .6rem .75rem;
  background: var(--surface-2); border-radius: 6px;
  border-left: 3px solid var(--green);
}

.modal-col-cart {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem .85rem;
  position: sticky; top: .5rem;
}
.modal-price-block {
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .6rem;
  text-align: center;
}
.modal-price-cop {
  font-size: 1.35rem; font-weight: 700; color: var(--green); line-height: 1.2;
  text-align: center;
}
.modal-price-unit { font-size: .72rem; font-weight: 400; color: var(--text-2); }
.modal-price-usd {
  font-size: .97rem; /* +15 % sobre .84rem */
  font-weight: 600; color: #1a3a6b; margin-top: .15rem;
  text-align: center;
}
[data-theme="dark"] .modal-price-usd { color: #7eb3e0; }
.modal-msrp {
  font-size: .67rem; color: var(--text-3); margin-top: .25rem; line-height: 1.4;
  text-align: center;
}
.modal-price-loading { font-size: .88rem; color: var(--text-3); font-style: italic; text-align: center; }
.modal-price-iva-note { font-size: .67rem; color: var(--red); font-style: italic; margin-top: .1rem; text-align: center; }
.modal-price-unit { display: none; } /* eliminado c/u */

.modal-avail-block { margin-bottom: .6rem; }

.modal-qty-row {
  display: flex; align-items: center; justify-content: center;
  gap: .5rem; margin-bottom: .55rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .25rem .4rem; background: var(--surface);
}
.btn-modal-cart {
  width: 100%; padding: .65rem 1rem;
  background: var(--grad-btn); background-size: var(--grad-btn-size);
  color: #fff; border: none; border-radius: 20px;
  font-size: .88rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  transition: background-position .4s ease, opacity .15s ease;
}
.btn-modal-cart:hover { background-position: right center; opacity: .9; }
.modal-no-stock { color: var(--red); font-size: .84rem; padding: .75rem 0; text-align: center; }

/* ── MODAL CAROUSEL ──────────────────────────────────────── */
.modal-disc-badge-row {
  text-align: right; margin-bottom: .35rem;
}
.modal-carousel { margin-bottom: .6rem; }
.carousel-main-wrap {
  background: var(--surface-2); border-radius: 8px;
  padding: 1rem; text-align: center; min-height: 200px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); position: relative; overflow: hidden;
}
.carousel-main-img {
  max-width: 100%; max-height: 220px; object-fit: contain;
  transition: opacity .18s ease;
}
.carousel-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(6,57,97,.7); color: #fff; border: none;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 1.2rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition); z-index: 2;
}
.carousel-nav:hover { background: var(--blue); }
.carousel-nav.prev { left: .4rem; }
.carousel-nav.next { right: .4rem; }
.carousel-thumbs {
  display: flex; gap: .35rem; margin-top: .45rem;
  overflow-x: auto; scrollbar-width: none; padding-bottom: .2rem;
}
.carousel-thumbs::-webkit-scrollbar { display: none; }
.carousel-thumb {
  width: 54px; height: 54px; object-fit: contain; flex-shrink: 0;
  border: 2px solid var(--border); border-radius: 5px;
  cursor: pointer; padding: .18rem;
  background: var(--surface-2);
  transition: border-color var(--transition), opacity var(--transition);
}
.carousel-thumb:hover { border-color: var(--blue-mid); }
.carousel-thumb.active { border-color: var(--green); }

/* ══════════════════════════════════════════════════════════════════════
   FASE 3 — AUTH MODAL + USER MENU
══════════════════════════════════════════════════════════════════════ */

/* ── Overlay ─────────────────────────────────────────────────────────── */
.auth-overlay {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .18s ease;
}

/* ── Modal card ──────────────────────────────────────────────────────── */
.auth-modal {
  position: relative;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-2);
  border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.25);
  padding: 1.8rem 2rem 2rem;
  width: min(420px, 94vw);
  max-height: 90dvh; overflow-y: auto;
  animation: slideUp .2s ease;
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Close ───────────────────────────────────────────────────────────── */
.auth-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none; cursor: pointer;
  color: var(--text-2); font-size: 1.1rem; line-height: 1;
  padding: .25rem .4rem; border-radius: 50%;
  transition: background var(--transition), color var(--transition);
}
.auth-close:hover { background: var(--surface-3); color: var(--text); }

/* ── Logo ────────────────────────────────────────────────────────────── */
.auth-logo { text-align: center; margin-bottom: 1.1rem; }

/* ── Tabs ────────────────────────────────────────────────────────────── */
.auth-tabs {
  display: flex; gap: .25rem;
  background: var(--surface-2); border-radius: 8px; padding: .25rem;
  margin-bottom: 1.4rem;
}
.auth-tab {
  flex: 1; background: none; border: none; cursor: pointer;
  padding: .55rem 0; border-radius: 6px;
  font-size: .88rem; font-weight: 500; color: var(--text-2);
  transition: background var(--transition), color var(--transition);
}
.auth-tab.active {
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.auth-tab:hover:not(.active) { color: var(--text); }

/* ── Fields ──────────────────────────────────────────────────────────── */
.auth-field { margin-bottom: 1rem; }
.auth-field label {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--text-2); margin-bottom: .35rem;
}
.auth-field label small { font-weight: 400; color: var(--text-3); }
.auth-field input {
  width: 100%; padding: .62rem .85rem;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-2); border-radius: 8px;
  font-size: .9rem; font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-sizing: border-box;
}
.auth-field input:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,153,255,.15);
}

/* ── Eye toggle ──────────────────────────────────────────────────────── */
.input-eye-wrap { position: relative; }
.input-eye-wrap input { padding-right: 2.4rem; }
.btn-eye {
  position: absolute; right: .6rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: .2rem;
  display: flex; align-items: center;
  transition: color var(--transition);
}
.btn-eye:hover { color: var(--text); }

/* ── Two-column row ──────────────────────────────────────────────────── */
.auth-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

/* ── Error ───────────────────────────────────────────────────────────── */
.auth-error {
  background: rgba(220,53,69,.1); border: 1px solid rgba(220,53,69,.35);
  color: #c82333; border-radius: 6px;
  padding: .5rem .8rem; font-size: .82rem;
  margin-bottom: .8rem;
}

/* ── Submit btn ──────────────────────────────────────────────────────── */
.btn-auth-submit {
  width: 100%; padding: .75rem;
  background: var(--grad-btn); background-size: var(--grad-btn-size);
  background-position: left center;
  color: #fff; border: none; border-radius: 20px;
  font-size: .95rem; font-weight: 600; cursor: pointer;
  margin-top: .4rem;
  transition: background-position .4s ease, opacity .15s ease;
}
.btn-auth-submit:hover { background-position: right center; opacity: .9; }
.btn-auth-submit:disabled { opacity: .6; cursor: not-allowed; }

/* ── Header loginBtn: avatar circle cuando está logueado ─────────────── */
.action-btn.auth-logged .action-label { display: none; }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--grad-btn); color: #fff;
  font-size: .78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.auth-logged .user-avatar { display: flex; }

/* ── User dropdown menu ──────────────────────────────────────────────── */
.user-menu {
  position: fixed; top: 4rem; right: 1rem; z-index: 900;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
  width: 240px; padding: .5rem 0;
  animation: fadeIn .15s ease;
}
.user-menu-backdrop {
  position: fixed; inset: 0; z-index: 899;
}
.user-menu-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem 1rem;
}
.user-avatar-lg {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--grad-btn); color: #fff;
  font-size: 1rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.user-menu-info { min-width: 0; }
.user-menu-name  { font-size: .88rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu-email { font-size: .75rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu-role  {
  display: inline-block; margin-top: .2rem;
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  padding: .1rem .45rem; border-radius: 10px;
  background: var(--blue); color: #fff;
}
.user-menu-role.role-admin { background: #b8860b; }
.user-menu-divider { border: none; border-top: 1px solid var(--border); margin: .25rem 0; }
.user-menu-item {
  display: flex; align-items: center; gap: .6rem;
  width: 100%; padding: .62rem 1rem;
  background: none; border: none; cursor: pointer;
  font-size: .88rem; color: var(--text-2); text-align: left;
  transition: background var(--transition), color var(--transition);
}
.user-menu-item:hover { background: var(--surface-2); color: var(--text); }
.user-menu-item.danger { color: #c0392b; }
.user-menu-item.danger:hover { background: rgba(192,57,43,.1); }

/* ── loginBtn label when logged ──────────────────────────────────────── */
#loginBtn .user-name-short {
  font-size: .78rem; font-weight: 600; max-width: 80px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Botón "Ver todos los detalles" en modal ─────────────────── */
.btn-modal-ver-todo {
  display: inline-flex; align-items: center; gap: .3rem;
  background: none; border: none; cursor: pointer; padding: 0;
  font-size: .78rem; color: var(--blue); font-weight: 500;
  text-decoration: underline; margin: .35rem 0 .6rem;
}
.btn-modal-ver-todo:hover { color: var(--green); }
/* ════════════════════════════════════════════════════════════════════════
   NUEVOS ESTILOS — Empresa/Persona selector, ciudad autocomplete,
   IVA breakdown en carrito, totales, avail gated
   ════════════════════════════════════════════════════════════════════════ */

/* ── Selector Empresa / Persona Natural ─────────────────────────────── */
.account-type-selector {
  display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
  margin-top: .35rem;
}
.type-radio-opt {
  display: flex; align-items: center; justify-content: center;
  gap: .4rem; padding: .55rem .5rem;
  border: 1.5px solid var(--border-2); border-radius: 8px;
  cursor: pointer; font-size: .85rem; font-weight: 500;
  color: var(--text-2); transition: all var(--transition);
  user-select: none;
}
.type-radio-opt input[type="radio"] { display: none; }
.type-radio-opt:hover { border-color: var(--blue); color: var(--blue); }
.type-radio-opt.active {
  border-color: var(--blue); background: rgba(6,57,97,.08);
  color: var(--blue); font-weight: 700;
}
[data-theme="dark"] .type-radio-opt.active { background: rgba(6,57,97,.25); }

/* ── Ciudad autocomplete dropdown ───────────────────────────────────── */
.city-suggestions {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 1000;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 0 0 8px 8px; box-shadow: 0 6px 18px rgba(0,0,0,.15);
  max-height: 200px; overflow-y: auto;
  margin-top: 1px;
}
.city-sug-item {
  padding: .5rem .85rem; font-size: .84rem; cursor: pointer;
  color: var(--text-2); transition: background var(--transition);
}
.city-sug-item:hover { background: var(--surface-2); color: var(--text); }

/* ── IVA / totales en panel de cotización ───────────────────────────── */
.quote-totals {
  display: flex; flex-direction: column; gap: .35rem;
  padding: .75rem 1rem; background: var(--surface-2);
  border-radius: 8px; margin-bottom: .6rem;
}
.quote-total-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .83rem; color: var(--text-2);
}
.quote-total-row strong { font-weight: 600; color: var(--text); }
.quote-total-final {
  padding-top: .35rem; margin-top: .2rem;
  border-top: 1px solid var(--border);
  font-size: .9rem; font-weight: 700;
}
.quote-total-final strong { color: var(--blue); font-size: .98rem; }
.quote-usd-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .75rem; color: var(--text-3); margin-top: .1rem;
}

/* ── Stock badge: candado para usuarios no logueados ─────────────────── */
.product-avail.gated {
  background: rgba(6,57,97,.08); color: var(--blue);
  border-color: rgba(6,57,97,.2);
  font-size: .72rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .55rem; border-radius: 10px; border: 1px solid;
}
[data-theme="dark"] .product-avail.gated { background: rgba(6,57,97,.25); }

/* ── Panel recuperar contraseña ─────────────────────────────────────── */
#forgotPasswordPanel {
  padding: 8px 0 4px; border-top: 1px solid var(--border); margin-top: 8px;
}
