:root {
  --brand: #2563eb;
  --brand-2: #60a5fa;
  --accent: #f97316;
  --success: #22c55e;
  --danger: #ef4444;
  --bg-main: #050c1a;
  --bg-soft: #071020;
  --bg-card: rgba(8, 18, 38, 0.75);
  --bg-card-strong: rgba(10, 22, 46, 0.92);
  --bg-elevated: #0d1e3a;
  --text-main: #e8f0ff;
  --text-soft: #7fa8d4;
  --border-soft: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(37, 99, 235, 0.28);
  --shadow-soft: 0 20px 60px rgba(0, 0, 0, 0.38);
  --shadow-glow: 0 10px 40px rgba(37, 99, 235, 0.2);
}

html,
body {
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.1), transparent 28%),
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.07), transparent 22%),
    linear-gradient(180deg, #050c1a 0%, #060f1e 45%, #070d1c 100%);
  color: var(--text-main);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  transition: background-color .4s cubic-bezier(0.16, 1, 0.3, 1), color .4s ease;
  overflow-x: hidden;
}

body.theme-light {
  --bg-main: #f5f7ff;
  --bg-soft: #eef3ff;
  --bg-card: rgba(255, 255, 255, 0.78);
  --bg-card-strong: rgba(255, 255, 255, 0.94);
  --bg-elevated: #ffffff;
  --text-main: #111827;
  --text-soft: #5f6f89;
  --border-soft: rgba(17, 24, 39, 0.08);
  --border-strong: rgba(124, 58, 237, 0.16);
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.08);
  --shadow-glow: 0 10px 30px rgba(124, 58, 237, 0.1);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.07), transparent 28%),
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.07), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, #f5f8ff 100%);
}

.site-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bg-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(20px);
  opacity: .55;
  animation: floatOrb 16s ease-in-out infinite;
}

.orb-1 {
  width: 420px;
  height: 420px;
  left: -80px;
  top: 60px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.4), transparent 65%);
}

.orb-2 {
  width: 360px;
  height: 360px;
  right: -60px;
  top: 140px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.32), transparent 65%);
  animation-delay: -4s;
}

.orb-3 {
  width: 280px;
  height: 280px;
  left: 55%;
  bottom: 40px;
  background: radial-gradient(circle, rgba(30, 64, 175, 0.22), transparent 70%);
  animation-delay: -8s;
}

.bg-grid {
  position: absolute;
  inset: 0;
  opacity: .08;
  background-image:
    linear-gradient(rgba(255,255,255,.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.4) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 85%);
}

.topbar {
  background: rgba(2, 6, 23, .82);
  color: rgba(255,255,255,.85);
  font-size: .9rem;
  border-bottom: 1px solid rgba(255,255,255,.05);
  backdrop-filter: blur(14px);
}

.topbar a,
.custom-breadcrumb a,
a {
  color: inherit;
}

.navbar-shell {
  background: rgba(7, 11, 22, .58);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-soft);
}

body.theme-light .navbar-shell {
  background: rgba(255,255,255,.72);
}

.brand-badge {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  border-radius: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-glow);
}

.hero {
  position: relative;
  padding: 3.5rem 0 1.5rem;
}

.hero-home {
  min-height: auto;
}

.hero-title {
  letter-spacing: -.03em;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow-pill {
  padding: .55rem .95rem;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--text-main);
  backdrop-filter: blur(16px);
}

.eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.15);
}

.glass-card,
.search-bar,
.custom-card,
.store-card,
.comparison-card,
.stats-card,
.empty-state,
.footer-note,
.detail-card,
.related-card,
.info-box,
.mini-row,
.page-link,
.hero-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 1.35rem;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.glass-soft {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.05);
}

.hero-panel {
  position: relative;
  overflow: hidden;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: -40% auto auto -20%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, .22), transparent 70%);
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -60px -60px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96, 165, 250, .18), transparent 70%);
}

.panel-kicker,
.section-kicker,
.price-caption {
  color: var(--brand-2);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .76rem;
  font-weight: 700;
}

.pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .8rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, .14);
  color: #86efac;
  border: 1px solid rgba(34,197,94,.18);
}

.pulse-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 0 rgba(134, 239, 172, .6);
  animation: pulseDot 1.8s infinite;
}

.hero-metric,
.mini-log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.05);
}

.mini-log-list {
  display: grid;
  gap: .75rem;
}

.search-bar .form-control,
.search-bar .form-select,
.form-control,
.form-select {
  border: 1px solid transparent;
  box-shadow: none;
  min-height: 52px;
  background: rgba(255,255,255,.02);
  color: var(--text-main);
}

body.theme-light .search-bar .form-control,
body.theme-light .search-bar .form-select,
body.theme-light .form-control,
body.theme-light .form-select {
  background: rgba(17, 24, 39, .02);
}

.search-bar .form-control::placeholder,
.form-control::placeholder {
  color: var(--text-soft);
}

.section-title {
  font-size: clamp(1.45rem, 2vw, 2rem);
  font-weight: 800;
  letter-spacing: -.03em;
}

.section-subtitle,
.text-body-secondary,
.text-secondary,
small,
.breadcrumb-item,
.table,
.page-link {
  color: var(--text-soft) !important;
}

.category-pill {
  border: 1px solid var(--border-soft);
  border-radius: 1.1rem;
  background: var(--bg-card);
  padding: .95rem 1rem;
  display: flex;
  align-items: center;
  gap: .85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-main);
  transition: .25s ease;
  white-space: normal;
  word-break: break-word;
  line-height: 1.2;
}

.fancy-hover,
.related-card,
.custom-card,
.store-card,
.page-link,
.stats-card {
  transition: transform .5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow .5s cubic-bezier(0.16, 1, 0.3, 1), border-color .5s ease, background-color .5s ease, filter .5s ease;
}

.fancy-hover:hover,
.related-card:hover,
.custom-card:hover,
.store-card:hover,
.page-link:hover,
.stats-card:hover {
  transform: translateY(-10px) scale(1.02);
  filter: brightness(1.08);
  border-color: var(--border-strong);
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.45), var(--shadow-glow);
  color: var(--text-main);
}

.icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(96, 165, 250, 0.18));
  color: #bdd5fe;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.offer-thumb,
.store-logo,
.detail-image,
.related-thumb {
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(30, 41, 59, .9), rgba(15, 23, 42, .95));
  border: 1px solid var(--border-soft);
}

body.theme-light .offer-thumb,
body.theme-light .store-logo,
body.theme-light .detail-image,
body.theme-light .related-thumb {
  background: linear-gradient(135deg, #f3f6ff, #ffffff);
}

.product-thumb-wrap,
.detail-image-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
}

.product-thumb-wrap::after,
.detail-image-wrap::after {
  content: "";
  position: absolute;
  inset: auto -25% -40% auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, .12), transparent 70%);
}

.offer-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.detail-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  padding: 1rem;
}

.related-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  height: 100%;
}

.related-card-lg {
  align-items: stretch;
}

.related-thumb {
  width: 86px;
  height: 86px;
  object-fit: cover;
  flex-shrink: 0;
}

.related-thumb-lg {
  width: 120px;
  height: 120px;
}

.store-detail-logo {
  width: 92px;
  height: 92px;
}

.mini-store-logo {
  width: 54px;
  height: 54px;
}

.price-now {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
}

.detail-price {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
}

.best-price-note {
  color: #86efac;
  font-weight: 600;
}

.price-old {
  color: #94a3b8;
  text-decoration: line-through;
  font-size: .95rem;
}

.price-badge,
.mini-badge {
  font-weight: 700;
  border-radius: 999px;
  padding: .35rem .7rem;
  font-size: .8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.price-badge {
  background: rgba(34,197,94,.12);
  color: #86efac;
}

.badge-stock-ok {
  background: rgba(34,197,94,.14);
  color: #86efac;
}

.badge-stock-no {
  background: rgba(239,68,68,.14);
  color: #fca5a5;
}

.badge-neutral {
  background: rgba(148,163,184,.16);
  color: var(--text-main);
}

.soft-badge,
.custom-badge {
  background: rgba(37,99,235,.14);
  color: #bdd5fe;
  border: 1px solid rgba(37,99,235,.2);
}

body.theme-light .soft-badge,
body.theme-light .custom-badge {
  color: #1d4ed8;
}

.footer {
  background: rgba(2, 6, 23, 0.92);
  color: rgba(255,255,255,.75);
  border-top: 1px solid rgba(255,255,255,.05);
  backdrop-filter: blur(14px);
}

.footer a {
  color: rgba(255,255,255,.75);
  text-decoration: none;
}

.mini-stat,
.footer-note,
.info-box,
.mini-row {
  padding: 1rem 1.15rem;
}

.stat-label {
  color: var(--text-soft);
  font-size: .88rem;
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -.03em;
}

.floating-card {
  animation: floatCard 6s ease-in-out infinite;
}

.delay-1 { animation-delay: -.8s; }
.delay-2 { animation-delay: -1.6s; }
.delay-3 { animation-delay: -2.4s; }

.sticky-search {
  margin-top: -2rem;
  position: relative;
  z-index: 3;
}

.empty-state {
  padding: 2rem;
  text-align: center;
}

.store-logo-box {
  height: 80px;
}

.store-logo-img {
  max-height: 100%;
  width: auto;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: none;
  box-shadow: var(--shadow-glow);
  transition: all .35s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover,
.btn-primary:focus {
  filter: brightness(1.1);
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.38);
}

.btn-outline-primary {
  border-color: rgba(37, 99, 235, .38);
  color: #bdd5fe;
}

body.theme-light .btn-outline-primary {
  color: #1d4ed8;
}

.form-control:focus,
.form-select:focus,
.btn:focus,
.page-link:focus {
  box-shadow: 0 0 0 .2rem rgba(37,99,235,.16);
  border-color: rgba(37,99,235,.32);
}

.table.custom-table {
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--border-soft);
}

.table.custom-table thead th {
  background: rgba(255,255,255,.03);
}

.page-link,
.page-item.active .page-link {
  color: var(--text-main);
}

.page-item.active .page-link {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
}

.custom-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  color: var(--text-soft);
}

.detail-sticky {
  top: 6rem;
}

.stretched-link-sibling {
  position: relative;
  z-index: 2;
}

code {
  color: #c4b5fd;
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -60px) scale(1.12); }
  66% { transform: translate(-30px, 30px) scale(0.92); }
}

@keyframes floatCard {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(1.5deg); }
}

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(134, 239, 172, .55); }
  70% { box-shadow: 0 0 0 10px rgba(134, 239, 172, 0); }
  100% { box-shadow: 0 0 0 0 rgba(134, 239, 172, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .bg-orb,
  .floating-card,
  .pulse-badge::before {
    animation: none !important;
  }

  .fancy-hover,
  .related-card,
  .custom-card,
  .store-card,
  .page-link,
  .stats-card {
    transition: none !important;
  }
}

@media (max-width: 991.98px) {
  .sticky-search {
    margin-top: 0;
  }

  .hero {
    padding-top: 2rem;
  }

  .related-card,
  .related-card-lg {
    flex-direction: column;
    align-items: flex-start;
  }

  .related-thumb,
  .related-thumb-lg {
    width: 100%;
    height: 180px;
  }
}

.search-sticky-bar {
  position: fixed;
  top: 78px;
  left: 0;
  width: 100%;
  z-index: 1015;
  padding: 12px 0 10px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.search-sticky-bar .search-bar {
  margin: 0 auto;
}

@media (max-width: 991.98px) {
  .search-sticky-bar {
    top: 70px;
    padding: 10px 0 8px;
  }
}

.page-search-results {
  padding-top: 190px !important;
}

.search-filters-sidebar {
  position: sticky;
  top: 170px;
}

@media (max-width: 991.98px) {
  .page-search-results {
    padding-top: 230px !important;
  }

  .search-filters-sidebar {
    position: static;
  }
}
.search-autocomplete-wrap {
  position: relative;
}

.search-suggest-dropdown {
  position: absolute;
  top: calc(100% + .75rem);
  left: 0;
  right: 0;
  z-index: 1050;
  display: none;
  padding: .75rem;
  border-radius: 1.1rem;
  background: var(--bg-card-strong);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
  max-height: 430px;
  overflow-y: auto;
}

.search-suggest-dropdown.is-open {
  display: block;
}

.search-suggest-section {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--brand-2);
  padding: .5rem .6rem .35rem;
}

.search-suggest-item,
.search-suggest-submit {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: .85rem;
  text-align: left;
  padding: .8rem .9rem;
  border-radius: .95rem;
  transition: background-color .2s ease, transform .2s ease;
}

.search-suggest-item:hover,
.search-suggest-submit:hover {
  background: rgba(255,255,255,.06);
  transform: translateY(-1px);
}

.search-suggest-icon {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: .8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, .16);
  color: var(--brand-2);
  flex-shrink: 0;
}

.search-suggest-text {
  min-width: 0;
  display: grid;
}

.search-suggest-label {
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.search-suggest-meta {
  font-size: .85rem;
  color: var(--text-soft);
  line-height: 1.2;
}

.search-suggest-empty {
  padding: 1rem;
  color: var(--text-soft);
}

.live-search-panel {
  margin-top: 1.25rem;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* ===== Bajar más la búsqueda en vivo en index ===== */
#home-live-section,
#home-live-results,
.home-live-results-wrap {
  position: relative;
  z-index: 1;
}

#home-live-section {
  margin-top: 1.5rem;
  scroll-margin-top: 2rem;
}

/* Si el bloque real es el grid de resultados */
#home-live-results {
  margin-top: 1rem;
}

/* La barra sticky debe quedar arriba, pero sin tapar el contenido */
.search-sticky-bar {
  position: sticky;
  top: 72px;
  z-index: 30;
}

/* En pantallas chicas conviene bajar un poco menos */
@media (max-width: 991.98px) {
  #home-live-section {
    margin-top: 1rem;
  }

  .search-sticky-bar {
    top: 64px;
  }
}

.search-chip-clear-danger{
  color: #ff6262 !important;
  font-weight: 700;
}
.search-chip-clear-danger:hover{
  color: #b00000 !important;
}


.search-chip-hot:hover {  
  border-color: rgba(248, 140, 62, 0.65);
}

.search-chip-hot-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  margin-left: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #ff7a00;
  color: #ffffff !important;
  font-weight: 800;
  font-size: 0.78rem;
  line-height: 1;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 6px 16px rgba(255,122,0,0.28);
}

.offer-list-item {
  width: 100%;
}

.offer-list-item .offer-product-thumb {
  flex-shrink: 0;
}

.offer-list-item .offer-block {
  min-width: 140px;
}

.offer-list-item .offer-price {
  min-width: 120px;
  text-align: right;
}

.offer-list-item .offer-actions {
  min-width: 110px;
  text-align: right;
}

select,
.form-select {
  background-color: var(--bg-card) !important;
  color: var(--text-main) !important;
}

.footer-suggestion-card {
  display: flex;
  align-items: stretch;
  min-height: 100%;
}

.footer-suggestion-card .btn {
  width: 100%;
}

.suggestion-modal {
  background: var(--bg-card-strong);
  border: 1px solid var(--border-soft);
  border-radius: 1.35rem;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.suggestion-modal .modal-header,
.suggestion-modal .modal-footer {
  border-color: var(--border-soft);
}

.suggestion-modal .form-control,
.suggestion-modal textarea {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-soft);
  color: var(--text-main);
  border-radius: 1rem;
}

body.theme-light .suggestion-modal .form-control,
body.theme-light .suggestion-modal textarea {
  background: rgba(255,255,255,.9);
  color: var(--text-main);
}

.suggestion-modal .form-control::placeholder,
.suggestion-modal textarea::placeholder {
  color: var(--text-soft);
}

@media (max-width: 991.98px) {
  .footer-suggestion-card .btn {
    width: 100%;
  }
}

.category-badge {
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  line-height: 1.2;
  flex: 1 1 auto;
}

.mini-badge {
  flex-shrink: 0;
}

.search-sticky-container {
  z-index: 1020;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
  transition: all 0.3s ease;
}

/* ================================================================= */
/* CONFIGURACIÓN UNIFICADA DE LA BARRA DE BÚSQUEDA (ESCRITORIO/MÓVIL)*/
/* ================================================================= */

/* Contenedor base: cuando NO está fijo, fluye de forma natural sin solaparse */
.search-sticky-container {
  z-index: 1020;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
  transition: all 0.3s ease;
}

/* Estado FIJO activo (Se aplica solo cuando tiene la clase) */
.search-sticky-container.is-sticky {
  position: sticky !important;
  top: 78px !important; /* Altura del navbar en Escritorio */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Optimización exclusiva para pantallas móviles */
@media (max-width: 991.98px) {
  .search-sticky-container.is-sticky {
    top: 70px !important; /* Altura del navbar en Móvil */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
  }

  /* Comprimir la barra en celulares */
  .search-sticky-container .search-bar {
    padding: 0.5rem !important;
    border-radius: 0.8rem !important;
  }

  /* Ocultar filtros secundarios en móvil para ahorrar espacio */
  .search-sticky-container .form-select,
  .search-sticky-container .col-lg-1.d-grid {
    display: none !important;
  }

  /* Forzar buscador al 100% de ancho */
  .search-sticky-container .col-lg-5 {
    width: 100% !important;
    margin-bottom: 0 !important;
  }

  .search-sticky-container .form-control {
    min-height: 40px !important;
    font-size: 0.9rem !important;
  }

  /* Ocultar el pin en celulares (siempre queda fija en móvil) */
  .search-sticky-container #toggle-sticky-btn {
    display: none !important;
  }
}

/* ================================================================= */
/* CORRECCIÓN DE COLOR DE ICONOS EN MODO CLARO                       */
/* ================================================================= */

body.theme-light {
  /* 1. Nos aseguramos de que las variables de texto globales sean oscuras */
  --text-main: #070b16;
  --text-soft: #4f5e7b;
}

/* 2. Forzamos a que todos los iconos sueltos hereden el color oscuro correcto */
body.theme-light i.bi,
body.theme-light .bi {
  color: var(--text-main) !important;
}

/* 3. Ajuste específico para tu contenedor .icon-wrap */
body.theme-light .icon-wrap {
  background-color: rgba(7, 11, 22, 0.06) !important; /* Un fondo gris sutil en vez del fondo oscuro */
  border-color: rgba(7, 11, 22, 0.1) !important;
}

/* 4. Aseguramos que el icono dentro del wrap sea bien oscuro y visible */
body.theme-light .icon-wrap i.bi {
  color: #070b16 !important;
}

/* Bloqueamos el fondo y el borde con los colores originales oscuros */
body.theme-light .footer-suggestion-card {
  background: rgba(14, 20, 35, 0.72) !important; /* Variable --bg-card en modo oscuro */
  border: 1px solid rgba(255, 255, 255, 0.08) !important; /* Variable --border-soft en modo oscuro */
  backdrop-filter: blur(12px);
}

/* Forzamos a que los títulos y textos internos sigan siendo claros/legibles */
body.theme-light .footer-suggestion-card strong {
  color: #edf3ff !important; /* Variable --text-main en modo oscuro */
}

body.theme-light .footer-suggestion-card .small {
  color: #9fb2d1 !important; /* Variable --text-soft en modo oscuro */
}

/* Como esta tarjeta vuelve a ser oscura, el ícono dentro del botón principal debe seguir siendo blanco */
body.theme-light .footer-suggestion-card .btn-primary i.bi {
  color: #ffffff !important;
}

/* ================================================================= */
/* ANIMACIONES ESTILO MODERN (REVEAL & SMOOTH)                      */
/* ================================================================= */

@keyframes revealUp {
  0% { opacity: 0; transform: translateY(50px); filter: blur(10px); }
  100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes revealIn {
  0% { opacity: 0; transform: scale(0.94); filter: blur(12px); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

/* Clases de animación para usar en el HTML */
.animate-reveal-up {
  opacity: 0;
  animation: revealUp 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-reveal-in {
  opacity: 0;
  animation: revealIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Delays para efectos escalonados (Staggered) */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* Efecto Shimmer (Brillo sutil que recorre la tarjeta) */
@keyframes shimmerSweep {
  0% { transform: translateX(-150%) skewX(-25deg); }
  100% { transform: translateX(150%) skewX(-25deg); }
}

.shimmer-card {
  position: relative;
  overflow: hidden;
}

.shimmer-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  animation: shimmerSweep 4s infinite;
}


/* ================================================================= */
/* REESTRUCTURACIÓN DE BARRA DE BÚSQUEDA (GLASS PURO Y CAPAS ALTA)   */
/* ================================================================= */

/* Contenedor Base: Resolvemos el problema de capas del historial */
.search-sticky-container {
  position: relative !important; /* Crea el contexto para que el historial no se vaya atrás */
  z-index: 1060 !important;       /* Posiciona la barra y el historial sobre todo el contenido */
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: none !important; /* Eliminamos cualquier borde inferior */
  box-shadow: none !important;
  transition: box-shadow 0.3s ease;
}

/* Glass sutil en Modo Claro (Mismo comportamiento, sin fondos invasivos) */
body.theme-light .search-sticky-container {
  border-bottom: none !important;
}

/* Cuando la barra entra en Modo Movimiento (Fijado por Scroll/Pin) */
.search-sticky-container.is-sticky {
  position: sticky !important;
  top: 78px !important; /* Se mantiene alineado abajo de tu navbar */
  /* Una sombra flotante muy suave para dar profundidad en el aire */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12) !important; 
}

/* Modo Movimiento en Modo Claro */
body.theme-light .search-sticky-container.is-sticky {
  background: rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 10px 30px rgba(7, 11, 22, 0.03) !important;
}

/* Asegurar que el panel flotante del historial/sugerencias mantenga prioridad */
.search-suggest-dropdown {
  z-index: 1070 !important; /* Por encima del contenedor */
}


/* ================================================================= */
/* BOTÓN DEL PIN EN MODO CLARO (PIN E ICONO 100% BLANCOS)            */
/* ================================================================= */

/* Estado Desclavado: Botón gris azulado oscuro para que resalte el texto e icono blanco */
body.theme-light #toggle-sticky-btn {
  background-color: #4f5e7b !important;
  border-color: #4f5e7b !important;
  color: #ffffff !important; /* Texto blanco */
}

/* Forzamos de manera estricta que el pin ignore la regla negra global */
body.theme-light #toggle-sticky-btn i,
body.theme-light #toggle-sticky-btn i.bi,
body.theme-light #toggle-sticky-btn .bi {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important; /* Seguridad para variantes de renderizado */
}

/* Estado Clavado (Activo): Muta al color azul de tu marca con el pin e icono impecablemente blancos */
body.theme-light #toggle-sticky-btn.btn-primary {
  background-color: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #ffffff !important;
}

body.theme-light #toggle-sticky-btn.btn-primary i,
body.theme-light #toggle-sticky-btn.btn-primary .bi {
  color: #ffffff !important;
}

/* Efecto Hover para el Modo Claro */
body.theme-light #toggle-sticky-btn:hover {
  background-color: #3b4861 !important;
  border-color: #3b4861 !important;
  opacity: 0.95;
}

/* ================================================================= */
/* CONFIGURACIÓN DEL LATERAL DE FILTROS (SCROLL NATURAL)             */
/* ================================================================= */

.search-filters-sidebar {
  /* Cambiamos de sticky a relative para que se mueva en sintonía con los productos */
  position: relative !important; 
  top: auto !important; /* Quitamos la distancia fija del techo */
  margin-bottom: 2rem;
}

/* Mantenemos tu configuración actual para pantallas móviles */
@media (max-width: 991.98px) {
  .search-filters-sidebar {
    position: static !important;
  }
}

/* Correcciones explícitas para el Modo Claro en formularios de Tarjetas */
body.theme-light .card .form-control,
body.theme-light .card .form-select {
  background-color: rgba(0, 0, 0, 0.04) !important;
  color: #070b16 !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

body.theme-light .card .form-control:focus,
body.theme-light .card .form-select:focus {
  background-color: #ffffff !important;
  color: #070b16 !important;
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.15) !important;
}

/* Forzar que los textos atenuados se lean bien sobre fondo claro */
body.theme-light .text-body-secondary,
body.theme-light .text-muted {
  color: #4f5e7b !important;
}

body.theme-light {
  --bg-card-strong: #ffffff;                  /* Fondo del modal completamente blanco o gris muy claro */
  --text-main: #070b16;                       /* Texto principal oscuro */
  --text-soft: #4f5e7b;                       /* Texto secundario gris oscuro legible */
  --border-soft: rgba(0, 0, 0, 0.08);         /* Bordes sutiles oscuros para el botón Cancelar */
  --theme-close-filter: none;                 /* Hace que la 'X' de cerrar vuelva a ser oscura */
}

/* ================================================================= */
/* POSICIÓN CORRECTA DEL BOTÓN PIN EN LA BARRA DE BÚSQUEDA           */
/* ================================================================= */
.search-pin-col {
  display: grid !important;
  place-items: center;
}

.search-pin-btn,
#toggle-sticky-btn.search-pin-btn {
  position: static !important;
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  padding: 0 !important;
}

.search-pin-btn i,
#toggle-sticky-btn.search-pin-btn i {
  font-size: 1rem !important;
  line-height: 1;
}

@media (max-width: 991.98px) {
  .search-pin-col {
    display: none !important;
  }
}


/* ================================================================= */
/* BARRA DE BÚSQUEDA OPTIMIZADA PARA MÓVIL                           */
/* ================================================================= */

.search-submit-btn {
  min-height: 52px;
}

.search-submit-text {
  display: none;
}

@media (max-width: 991.98px) {
  .search-sticky-container {
    padding: 0.55rem 0.65rem !important;
  }

  .search-sticky-container .container {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .search-sticky-container .search-bar {
    padding: 0.75rem !important;
    border-radius: 1.1rem !important;
  }

  .search-mobile-form {
    row-gap: 0.65rem !important;
  }

  .search-input-col,
  .search-category-col,
  .search-order-col,
  .search-submit-col {
    display: block !important;
  }

  .search-input-col {
    width: 100% !important;
  }

  .search-category-col,
  .search-order-col {
    width: 50% !important;
  }

  .search-submit-col {
    width: 100% !important;
    display: grid !important;
  }

  .search-sticky-container .form-control,
  .search-sticky-container .form-select,
  .search-submit-btn {
    min-height: 46px !important;
    border-radius: 0.95rem !important;
    font-size: 0.92rem !important;
  }

  .search-submit-btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .search-submit-text {
    display: inline !important;
    font-weight: 700;
  }

  .search-sticky-container .search-discovery-stack {
    display: flex !important;
    max-height: 92px;
    overflow-y: auto;
    padding-right: 0.2rem;
  }

  .search-sticky-container .search-chip-row {
    display: flex;
    overflow-x: auto;
    gap: 0.45rem;
    padding-bottom: 0.15rem;
    scrollbar-width: thin;
  }

  .search-sticky-container .search-chip-label,
  .search-sticky-container .search-chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .search-pin-col,
  .search-sticky-container #toggle-sticky-btn {
    display: none !important;
  }
}

@media (max-width: 420px) {
  .search-category-col,
  .search-order-col {
    width: 100% !important;
  }

  .search-sticky-container .search-discovery-stack {
    display: none !important;
  }
}

/* Refuerzo contra reglas móviles anteriores que ocultaban selects y botones */
@media (max-width: 991.98px) {
  .search-sticky-container .search-category-col .form-select,
  .search-sticky-container .search-order-col .form-select {
    display: block !important;
  }

  .search-sticky-container .search-submit-col {
    display: grid !important;
  }

  .search-sticky-container .search-submit-col .search-submit-btn {
    display: inline-flex !important;
    align-items: center !important;
  }

  .search-sticky-container .search-pin-col {
    display: none !important;
  }
}

/* Mostrar historial y tendencias también en móvil */
@media (max-width: 991.98px) {
  .search-sticky-container .search-discovery-stack {
    display: flex !important;
    width: 100%;
    padding-top: 0.75rem !important;
  }

  .search-sticky-container .search-chip-row {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.25rem;
    scrollbar-width: thin;
  }

  .search-sticky-container .search-chip-label {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .search-sticky-container .search-chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

/* Hover más sutil para la paginación de productos */
.pagination .page-link {
  transform: none;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, filter .18s ease;
}

.pagination .page-link:hover {
  transform: none;
  filter: brightness(1.03);
  background: rgba(255, 255, 255, .07);
  border-color: rgba(96, 165, 250, .26);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
  color: var(--text-main) !important;
}

.pagination .page-item.active .page-link:hover {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  filter: brightness(1.02);
}

.pagination .page-item.disabled .page-link {
  transform: none;
  filter: none;
  opacity: .5;
}

.clickable-card:focus-visible {
  outline: 2px solid rgba(96, 165, 250, .65);
  outline-offset: 4px;
}

.clickable-card a,
.clickable-card button {
  cursor: pointer;
}

.clickable-card,
.clickable-card * {
  cursor: pointer !important;
}

.related-card.clickable-card,
.related-card.clickable-card *,
article.clickable-card,
article.clickable-card * {
  cursor: pointer !important;
}