html,
body {
  height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

footer {
  flex-shrink: 0;
}

:root {
  --topbar-bg: #0f0f10;
  --header-bg: #151516;
  --accent: #0d6efd;
  /* Bootstrap primary */
}

/* Topbar */
.topbar {
  background: var(--topbar-bg);
}

/* Logo */
.logo-menu {
  height: 50px;
  /* ajusta según la altura del menú */
  display: block;
}

/* Searchbar */
.searchbar .form-control {
  border-left: 0;
}

.searchbar .input-group-text {
  border-right: 0;
}

/* Navbar colors */
header .navbar {
  background: var(--header-bg);
}

header .nav-link {
  color: rgba(255, 255, 255, .8);
}

header .nav-link:hover,
header .nav-link:focus {
  color: #fff;
}

/* Hero / Banner */
.hero {
  min-height: auto !important;
}

#heroCarousel {
  position: relative;
  z-index: auto;
  aspect-ratio: 4.8 / 1;
  background: #151821;
}

#heroCarousel .carousel-inner,
#heroCarousel .carousel-item {
  height: 100% !important;
  min-height: 0 !important;
}

@media (max-width: 991px) {
  #heroCarousel {
    aspect-ratio: 2.2 / 1;
  }
}

#homeCarousels {
  position: relative;
  z-index: auto;
  margin-top: 3rem !important;
}

#heroCarousel .carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-bg {
  position: absolute;
  inset: 0;
  filter: saturate(1.05) contrast(1.02);
}

/* HERO carousel */
#heroCarousel .carousel-item {
  height: clamp(260px, 45vw, 390px);
  /* altura flexible: reduce “zoom” */
}

#heroCarousel .carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* rellena sin deformar */
  object-position: center;
  display: block;
}

/* Botones del carrusel (más visibles en fondos oscuros) */
#heroCarousel .carousel-control-prev,
#heroCarousel .carousel-control-next {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35));
}

/* Discount badge estilo “medalla” */
.discount-badge {
  display: inline-block;
  background: #ffd34d;
  color: #1b1b1b;
  font-weight: 800;
  border-radius: 50px;
  padding: .15rem .6rem;
  margin-left: .25rem;
}

/* Mockup de producto (placeholder) */
.product-mockup {
  width: min(100%, 460px);
  height: 240px;
  margin-inline: auto;
  background:
    radial-gradient(600px 200px at -10% 10%, rgba(255, 255, 255, .15), rgba(0, 0, 0, 0)),
    linear-gradient(135deg, #2b2e37, #15171d);
  border: 1px solid rgba(255, 255, 255, .08);
}

/* Typo refuerzo */
.fw-extrabold {
  font-weight: 900;
}

/* ====== PRODUCT GRID (estilo Amazon) ====== */
.product-card {
  border: 1px solid rgba(0, 0, 0, .08);
  transition: box-shadow .2s ease, transform .08s ease;
}

.product-card:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, .08);
  transform: translateY(-1px);
}

.product-thumb {
  position: relative;
  overflow: hidden;
  border-top-left-radius: .375rem;
  border-top-right-radius: .375rem;
  background: #f8f9fa;
  aspect-ratio: 4 / 3;
}

.product-thumb>img {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  padding: 10px;
}

/* Badge flotante arriba-izq */
.badge-floating {
  position: absolute;
  top: .5rem;
  left: .5rem;
  background: #0b5ed7;
  color: #fff;
  font-weight: 600;
  border-radius: .25rem;
  padding: .25rem .4rem;
}

.badge-floating:has(+ .*) {}

/* placeholder para especificidad */

.product-title {
  font-size: .98rem;
  line-height: 1.35;
  font-weight: 500;
  margin: 0 0 .25rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  /* 2 líneas */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rating i {
  font-size: .95rem;
  color: #f59e0b;
  /* dorado */
}

.reviews {
  white-space: nowrap;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: .5rem;
}

.price {
  font-size: 1.25rem;
  font-weight: 700;
}

.list-price {
  color: #6c757d;
  text-decoration: line-through;
  font-size: .95rem;
}

/* Botón carrito al estilo Amazon (amarillo) */
.btn-warning {
  background-color: #ffd814;
  border-color: #fcd200;
  color: #0f1111;
}

.btn-warning:hover {
  background-color: #f7ca00;
  border-color: #f2c200;
  color: #0f1111;
}

/* Correcciones responsivas */
@media (min-width: 1200px) {
  .product-grid .col-xl-3 {
    display: flex;
  }

  .product-grid .product-card {
    width: 100%;
  }
}

/* La badge NO debe ocupar todo el .ratio */
.product-thumb .badge-floating {
  position: absolute;
  z-index: 2;
  width: auto;
  /* anula el 100% de .ratio > * */
  height: auto;
  /* anula el 100% de .ratio > * */
  inset: auto;
  /* resetea top/right/bottom/left */
  top: .5rem;
  left: .5rem;
  background: #0b5ed7;
  color: #fff;
  font-weight: 600;
  border-radius: .25rem;
  padding: .25rem .4rem;
}

/* ===== Sidebar filtros ===== */
.filters-card {
  position: sticky;
  top: 1rem;
  /* se mantiene visible al hacer scroll */
}

#filterGroups .form-check {
  margin-bottom: .25rem;
}

#quickRanges li {
  margin-bottom: .25rem;
}

#quickRanges a {
  text-decoration: none;
}

#quickRanges a:hover {
  text-decoration: underline;
}

/* Paginación activa (ya lo tenías, lo dejo por si acaso) */
/*#paginacion .pagination .page-item.active .page-link {
  background-color: var(--accent);
  border-color: var(--accent);
}*/

/* ======= Modern Pager ======= */
.modern-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .375rem;
  margin-top: 1rem;
  user-select: none;
  flex-wrap: wrap;
}

.pg-btn {
  --pg-bg: #ffffff;
  --pg-fg: #0d6efd;
  --pg-bd: #e6eaf2;
  --pg-bg-h: #eef4ff;
  --pg-bd-h: #cfe1ff;
  --pg-bg-a: #0d6efd;
  --pg-fg-a: #ffffff;

  appearance: none;
  border: 1px solid var(--pg-bd);
  background: var(--pg-bg);
  color: var(--pg-fg);
  padding: .45rem .75rem;
  line-height: 1;
  border-radius: 999px;
  /* pastilla */
  font-weight: 600;
  font-size: .95rem;
  transition: all .18s ease;
  box-shadow: 0 1px 1px rgba(16, 24, 40, .04);
}

.pg-btn:hover:not(.is-disabled):not(.is-active) {
  background: var(--pg-bg-h);
  border-color: var(--pg-bd-h);
}

.pg-btn.is-active {
  background: var(--pg-bg-a);
  color: var(--pg-fg-a);
  border-color: var(--pg-bg-a);
  box-shadow: 0 6px 16px rgba(13, 110, 253, .25);
}

.pg-btn.is-disabled {
  opacity: .45;
  cursor: not-allowed;
}

.pg-ellipsis {
  color: #98a2b3;
  padding: 0 .25rem;
  font-weight: 700;
}

/* ===== Accordion filtros (compacto y limpio) ===== */
#filtersAccordion .accordion-button {
  padding: .6rem .25rem;
  font-weight: 600;
}

#filtersAccordion .accordion-body {
  padding: .5rem .25rem .75rem .25rem;
}

/* Quita background exagerado del accordion-button en Bootstrap */
#filtersAccordion .accordion-button:not(.collapsed) {
  background: transparent;
  box-shadow: none;
}

#filtersAccordion .accordion-item {
  border: 0;
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}

/* cargando index */
.page-loader {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, .75);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  z-index: 9999;
}

.page-loader.is-hidden {
  display: none;
}

.page-loader__card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 14px;
  padding: 22px 26px;
  text-align: center;
  min-width: 280px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .10);
}

/*********************/
/*** Ajustes para el carrousel con telefonos ****/
@media (max-width: 576px) {

  /* 1) Quitar separación entre header y carrusel */
  #homeCarousels {
    margin-top: 1rem !important;
    margin-bottom: 2rem !important;
  }

  /* Si tu header/nav tiene margen inferior, también lo eliminamos */
  header,
  .navbar,
  .header,
  #topbar {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  /* 2) Controlar altura del slide para que no quede "hueco" */
  #heroCarousel .carousel-item {
    height: auto !important;
    /* clave: que no se quede fijo alto */
    min-height: 0 !important;
  }

  #heroCarousel .carousel-item img {
    width: 100% !important;
    height: auto !important;
    /* clave: ajusta alto real de la imagen */
    display: block !important;
    /* elimina espacios tipo inline */
    object-fit: contain !important;
    object-position: center !important;
  }
}

/************************************************/
/**** Ajuste visual carrito en telefonos *****/
/* =================== HEADER: carrito arriba a la derecha SOLO móvil =================== */
@media (max-width: 576px) {

  /* compactar un poco el header */
  header.py-3 {
    padding-top: .6rem !important;
    padding-bottom: .6rem !important;
  }

  /* usar el row como referencia para posicionar el carrito */
  header .container .row {
    position: relative;
  }

  /* Logo ocupa todo el ancho en móvil */
  header .container .row>.col-6.col-lg-3 {
    width: 100% !important;
    flex: 0 0 100% !important;
  }

  /* Columna de acciones (donde vive #btnCart) la ponemos arriba a la derecha */
  header .container .row>.header-actions-col {
    position: absolute !important;
    top: 5px !important;
    right: 20px !important;
    width: auto !important;
    flex: 0 0 auto !important;
    padding-right: 0 !important;
  }

  /* Ajustes del botón carrito */
  #btnCart {
    position: relative;
    padding: .25rem .35rem !important;
  }

  /* Badge como circulito arriba del ícono */
  #btnCart .cart-badge {
    position: absolute !important;
    top: -6px !important;
    right: -8px !important;
    margin-left: 0 !important;
    /* anula el ms-1 */
    background: #dc3545 !important;
    color: #fff !important;
    border-radius: 999px !important;
    font-size: 11px !important;
    line-height: 18px !important;
    min-width: 18px !important;
    height: 18px !important;
    padding: 0 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Ocultar "Cuenta" en móvil (por si alguna vez se mostrara) */
  header .header-actions a:has(.bi-person) {
    display: none !important;
  }
}

/*******************************************/
/*****************producto.php***************/
/* =================== DETALLE DE PRODUCTO =================== */
.product-detail-card,
.product-info-card {
  border-radius: 18px;
}

.product-gallery {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 1rem;
  align-items: start;
}

.product-gallery-thumbs {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.product-thumb-btn {
  border: 1px solid rgba(0, 0, 0, .12);
  background: #fff;
  border-radius: 14px;
  padding: .35rem;
  width: 100%;
  aspect-ratio: 1 / 1;
  transition: all .18s ease;
}

.product-thumb-btn:hover {
  border-color: #0d6efd;
  box-shadow: 0 6px 14px rgba(13, 110, 253, .10);
}

.product-thumb-btn.is-active {
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, .12);
}

.product-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.product-gallery-main {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 18px;
  min-height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.product-gallery-main img {
  width: 100%;
  max-height: 430px;
  object-fit: contain;
  display: block;
}

.product-detail-title {
  font-size: clamp(1.1rem, 1.4vw, 1.5rem);
  line-height: 1.2;
  font-weight: 700;
}

.product-detail-price {
  font-size: clamp(1.1rem, 1.4vw, 1.5rem);
  line-height: 1.1;
  font-weight: 700;
  color: #111827;
}

.qty-control-detail {
  width: fit-content;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.qty-control .qty-minus,
.qty-control .qty-plus {
  border: 0;
  min-width: 42px;
  height: 42px;
  border-radius: 0;
}

.qty-control .qty-input {
  width: 64px;
  height: 42px;
  border: 0;
  text-align: center;
  outline: none;
  box-shadow: none;
}

.feature-box {
  height: 100%;
  border: 1px solid rgba(0, 0, 0, .08);
  background: #f8f9fa;
  border-radius: 14px;
  padding: 1rem;
}

.feature-label {
  font-size: .85rem;
  color: #6c757d;
  margin-bottom: .35rem;
}

.feature-value {
  font-weight: 600;
  color: #111827;
  word-break: break-word;
}

/* Responsive detalle */
@media (max-width: 991.98px) {
  .product-gallery {
    grid-template-columns: 1fr;
  }

  .product-gallery-thumbs {
    order: 2;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: .25rem;
  }

  .product-thumb-btn {
    min-width: 78px;
    width: 78px;
    flex: 0 0 78px;
  }

  .product-gallery-main {
    order: 1;
    min-height: 320px;
  }

  .product-gallery-main img {
    max-height: 300px;
  }
}

@media (max-width: 576px) {
  .product-detail-title {
    font-size: 1.25rem;
  }

  .product-detail-price {
    font-size: 1.55rem;
  }

  .product-gallery-main {
    min-height: 260px;
    padding: .75rem;
  }

  .product-gallery-main img {
    max-height: 240px;
  }

  .feature-box {
    padding: .85rem;
  }
}

.product-detail-title-link {
  color: var(--accent);
}

.product-detail-title-link:hover {
  color: #0b5ed7;
}

.product-thumb-hidden {
  display: none !important;
}

.product-inline-features {
  border-top: 1px solid rgba(0, 0, 0, .06);
  padding-top: 1rem;
}

.product-inline-features-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.product-inline-feature {
  min-width: 0;
}

.product-inline-feature .fw-semibold {
  color: #111827;
  word-break: break-word;
}

.product-inline-feature-span-2 {
  grid-column: 1 / -1;
}

.product-buy-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: end;
}

.product-qty-col {
  min-width: 150px;
}

.product-cart-col {
  min-width: 0;
}

.product-detail-cart-btn {
  width: 100%;
  min-height: 42px;
  font-size: 1rem;
}

@media (max-width: 767.98px) {
  .product-buy-row {
    grid-template-columns: 1fr;
    gap: .85rem;
  }

  .product-qty-col {
    min-width: 0;
  }

  .product-detail-cart-btn {
    width: 100%;
  }

  .product-inline-features-grid {
    grid-template-columns: 1fr;
    gap: .85rem;
  }

  .product-inline-feature-span-2 {
    grid-column: auto;
  }
}

.product-info-card {
  height: 100%;
}

.product-info-card .card-body {
  min-height: 100%;
}

@media (min-width: 992px) {

  .product-detail-card,
  .product-info-card {
    height: 100%;
  }
}

/*******fin producto.php*********************/

/* ===== OPTIMIZACIÓN DE BUSCADOR MÓVIL (responsivo <= 991.98px) ===== */
@media (max-width: 991.98px) {
  .search-container {
    display: none !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #212529;
    /* Fondo oscuro idéntico al header */
    z-index: 1050;
    padding: 0 1rem;
    align-items: center;
  }

  .search-container.is-active {
    display: flex !important;
  }

  /* Asegura que el logo y las acciones coexistan en móviles de forma compacta */
  header .container .row>.col-6.col-lg-3 {
    width: 50% !important;
    flex: 0 0 50% !important;
  }

  header .container .row>.header-actions-col {
    width: 50% !important;
    flex: 0 0 50% !important;
    position: static !important;
    /* Resetea para móviles medianos */
  }
}

/* Para móviles pequeños (<576px), el posicionamiento de las acciones vuelve a ser absoluto arriba */
@media (max-width: 576px) {
  header .container .row>.header-actions-col {
    position: absolute !important;
    top: 5px !important;
    right: 20px !important;
    width: auto !important;
    flex: 0 0 auto !important;
    padding-right: 0 !important;
  }
}

/* ===== OPTIMIZACIÓN DE TABS DEL CARRUSEL EN MÓVIL (<= 767.98px) ===== */
@media (max-width: 767.98px) {
  #carouselTabs {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    justify-content: flex-start !important;
    padding: 0.25rem 0.5rem 0.5rem 0.5rem;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    scrollbar-width: none;
    /* Oculta scrollbar en Firefox */
    -webkit-overflow-scrolling: touch;
  }

  #carouselTabs::-webkit-scrollbar {
    display: none;
    /* Oculta scrollbar en Chrome/Safari */
  }

  #carouselTabs .nav-item {
    flex: 0 0 auto;
  }

  #carouselTabs .nav-link {
    font-size: 0.85rem !important;
    padding: 0.4rem 0.75rem !important;
    border-radius: 999px !important;
    /* Estilo cápsula */
    white-space: nowrap;
    border: 1px solid rgba(13, 110, 253, 0.15) !important;
    transition: all 0.2s ease;
  }

  #carouselTabs .nav-link:not(.active) {
    background-color: #fff !important;
    color: #0d6efd !important;
  }

  #carouselTabs .nav-link.active {
    background-color: #0d6efd !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.2);
  }
}

/* ===== DRAWER / SIDEBAR DE FILTROS FLOTANTE (Escritorio y Móvil) ===== */
.filter-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 350px;
  height: 100vh;
  background-color: #fff;
  z-index: 2000;
  /* Alto para estar sobre el header y modales comunes */
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.filter-drawer.open {
  transform: translateX(0);
}

.filter-drawer-header {
  padding: 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

/* Overlay oscuro de fondo */
.filter-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.55);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.filter-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Evitar scroll del body al estar abierto el drawer */
body.filter-drawer-open {
  overflow: hidden !important;
}

/* Drawer en teléfonos (ancho 85% de pantalla) */
@media (max-width: 767.98px) {
  .filter-drawer {
    width: 85%;
    max-width: 360px;
  }
}

/* ===== CORRECCIÓN DE ESPACIADO MÓVIL (<= 767.98px) ===== */
@media (max-width: 767.98px) {
  #homeCarousels {
    margin-bottom: 0px !important;
    margin-top: 1rem !important;
  }

  #homeCarousels .text-center {
    margin-bottom: 0.5rem !important;
    /* Acercar el título a las tarjetas */
  }

  main.py-5 {
    padding-top: 0.5rem !important;
    /* Acercar el botón de opciones a las tarjetas */
  }
}

/* ===== CORRECCIÓN DE ESPACIADO ESCRITORIO (>= 768px) ===== */
@media (min-width: 768px) {
  #homeCarousels {
    margin-bottom: 1rem !important;
  }

  main.py-5 {
    padding-top: 1.25rem !important;
  }
}

/* ===== ESTILO DE FILTROS REFINADO (Estilo Amazon) ===== */
.filter-drawer-header {
  padding: 0.85rem 1.25rem;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e5e7eb;
}

.filter-drawer-header h5 {
  font-size: 15px !important;
  font-weight: 700;
  color: #111827;
}

.filter-drawer-header .btn-close {
  font-size: 0.8rem;
  padding: 0.5rem;
}

.filter-drawer-body {
  padding: 0.75rem 1.25rem;
}

/* Acordeón ultra compacto sin bordes ni fondos exagerados */
#filtersAccordion .accordion-item {
  border: 0 !important;
  border-bottom: 1px solid #f0f0f0 !important;
}

#filtersAccordion .accordion-item:last-child {
  border-bottom: 0 !important;
}

#filtersAccordion .accordion-button {
  font-size: 13.5px !important;
  font-weight: 700;
  color: #111827;
  padding: 0.65rem 0 !important;
  /* Padding vertical muy reducido */
  background: transparent !important;
  box-shadow: none !important;
}

#filtersAccordion .accordion-button::after {
  width: 0.8rem;
  height: 0.8rem;
  background-size: 0.8rem;
  margin-left: auto;
}

#filtersAccordion .accordion-body {
  padding: 0 0 0.75rem 0 !important;
  /* Padding inferior controlado */
}

/* Opciones y Checkboxes ultra compactos */
#filtersAccordion .form-check {
  display: flex !important;
  align-items: flex-start !important;
  margin-bottom: 5px !important;
  /* Separación vertical mínima */
  padding-left: 0.75rem !important;
  /* Separación del borde izquierdo para evitar cortes */
  min-height: auto !important;
}

#filtersAccordion .form-check-input {
  width: 13px !important;
  height: 13px !important;
  margin-top: 3px !important;
  margin-right: 8px !important;
  float: none !important;
  flex-shrink: 0 !important;
  border: 1px solid #ccc !important;
  border-radius: 2px !important;
  /* Más cuadrado */
}

#filtersAccordion .form-check-label {
  font-size: 12.5px !important;
  color: #333 !important;
  line-height: 1.35 !important;
  cursor: pointer;
  user-select: none;
}

#filtersAccordion .form-check-input:checked {
  background-color: #0d6efd !important;
  border-color: #0d6efd !important;
}

/* Inputs de rango de precio compactos */
#priceMin,
#priceMax {
  height: 28px !important;
  font-size: 12px !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  border: 1px solid #ccc !important;
  text-align: center;
}

#filtersAccordion span {
  font-size: 12px;
  color: #666;
}

/* Botón Limpiar Filtros elegante y sutil */
#btnClearFilters {
  font-size: 12px !important;
  font-weight: 600;
  padding: 0.35rem 0.75rem !important;
  background-color: #f7f8fa !important;
  border: 1px solid #d5d9d9 !important;
  color: #0f1111 !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 5px rgba(213, 217, 217, .5) !important;
  transition: background-color 0.2s;
}

#btnClearFilters:hover {
  background-color: #e7e9ec !important;
  border-color: #a2a6ac !important;
}

/* ===== DOUBLE SLIDER DE PRECIOS ===== */
.price-slider-wrapper {
  position: relative;
  width: 100%;
  height: 24px;
  margin-top: 5px;
}

.price-slider-wrapper input[type="range"] {
  position: absolute;
  width: 100%;
  height: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}

.price-slider-track {
  position: absolute;
  width: 100%;
  height: 4px;
  background-color: #e5e7eb;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 999px;
  z-index: 1;
}

.price-slider-wrapper input[type="range"]::-webkit-slider-thumb {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #0d6efd;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  pointer-events: auto;
  -webkit-appearance: none;
  z-index: 2;
  position: relative;
}

.price-slider-wrapper input[type="range"]::-moz-range-thumb {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #0d6efd;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  pointer-events: auto;
  z-index: 2;
}

/* ===== GRID DE 5 PRODUCTOS POR FILA EN ESCRITORIO (>= 1200px) ===== */
@media (min-width: 1200px) {
  #productGrid.product-grid {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 1.5rem !important;
  }

  #productGrid.product-grid>div {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    padding: 0 !important;
  }
}

/* ===== CONTROLES DE CARRITO ESTILO AMAZON ===== */
.cart-control-wrapper,
.product-actions-wrapper {
  position: relative !important;
  z-index: 5 !important;
  /* Asegura estar sobre el pseudo-elemento stretched-link */
  margin-top: auto;
}

/* Botón Agregar al Carrito (Estado 0) */
.cart-add-btn {
  background-color: #ffd814 !important;
  border: 1px solid #fcd200 !important;
  color: #0f1111 !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  height: 30px !important;
  padding: 0 1rem !important;
  box-shadow: 0 2px 5px 0 rgba(213, 217, 217, .5) !important;
  transition: background-color 0.2s, border-color 0.2s;
}

.cart-add-btn:hover {
  background-color: #f7ca00 !important;
  border-color: #f2c200 !important;
}

/* Control de Cantidad (Estados 1 y 2) */
.cart-quantity-control {
  border: 1.5px solid #ffd814 !important;
  background-color: #fff !important;
  height: 30px !important;
  box-shadow: 0 2px 5px 0 rgba(213, 217, 217, .5);
}

.cart-quantity-control .btn {
  background: transparent !important;
  border: 0 !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 0 !important;
  color: #0f1111 !important;
  transition: background-color 0.15s;
}

.cart-quantity-control .qty-remove-btn,
.cart-quantity-control .qty-minus-btn {
  border-top-left-radius: 999px !important;
  border-bottom-left-radius: 999px !important;
}

.cart-quantity-control .qty-plus-btn {
  border-top-right-radius: 999px !important;
  border-bottom-right-radius: 999px !important;
}

.cart-quantity-control .btn:hover {
  background-color: #f7f8fa !important;
}

.cart-control-text {
  font-size: 12px !important;
  color: #0f1111 !important;
  font-weight: 600 !important;
  white-space: nowrap;
}

.product-card .card-body {
  display: flex;
  flex-direction: column;
}

/* ===== DISEÑO COMPACTO PARA PRODUCTOS NUEVOS EN MÓVIL (<= 768px) ===== */
@media (max-width: 768px) {

  /* Título de la sección "Productos Nuevos" más pequeño */
  #homeCarousels .section-title {
    font-size: 18px !important;
  }

  #homeCarousels .section-title span {
    width: 35px !important;
    height: 2.5px !important;
  }

  /* Carrusel de nuevos productos más compacto */
  #cx-new .carr-track {
    grid-auto-columns: 145px !important;
    /* Ancho de tarjeta angosto y refinado */
    gap: 0.6rem !important;
    padding-bottom: 0.4rem !important;
  }

  /* Tarjetas del carrusel de productos nuevos más compactas */
  #cx-new .product-card {
    padding: 8px !important;
  }

  #cx-new .product-card .product-thumb {
    max-height: 110px !important;
  }

  #cx-new .product-card .card-body {
    padding: 8px 4px 4px 4px !important;
  }

  #cx-new .product-card .product-title {
    font-size: 12.5px !important;
    margin-bottom: 4px !important;
    line-height: 1.3 !important;
    height: 32px !important;
    overflow: hidden;
  }

  #cx-new .product-card .price-row {
    margin-bottom: 2px !important;
  }

  #cx-new .product-card .price {
    font-size: 14px !important;
  }

  #cx-new .product-card .small.text-muted {
    font-size: 11px !important;
    margin-bottom: 6px !important;
  }

  /* Botones de carrito y cantidades compactos en el carrusel de nuevos */
  #cx-new .product-card .cart-add-btn {
    height: 28px !important;
    font-size: 11.5px !important;
    padding: 0 0.5rem !important;
  }

  #cx-new .product-card .cart-quantity-control {
    height: 28px !important;
  }

  #cx-new .product-card .cart-control-text {
    font-size: 11px !important;
  }

  #cx-new .product-card .cart-quantity-control .btn {
    padding: 0 6px !important;
  }
}

/* ===== CABECERA MÓVIL OPTIMIZADA (<= 768px) ===== */
@media (max-width: 768px) {

  /* Ocultar la primera franja negra de información e idioma */
  .topbar {
    display: none !important;
  }

  /* Reducir la altura del header principal en móviles */
  header.py-3 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }

  /* Reducir tamaño del logo */
  .logo-menu-mobile {
    height: 26px !important;
    max-height: 26px !important;
  }

  /* Compactar y alinear las acciones del header en móviles */
  .header-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 1.15rem !important;
    height: 100% !important;
  }

  .header-actions #btnSearchOpen,
  .header-actions #btnCart {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 2px !important;
    margin: 0 !important;
    height: 28px !important;
    line-height: 1 !important;
    font-size: 1.2rem !important;
    color: white !important;
  }

  /* Alinear la bandera móvil con el botón dropdown */
  #langDropdownMobile {
    outline: none !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 28px !important;
  }

  #langDropdownMobile span {
    font-size: 1.35rem !important;
    vertical-align: middle;
  }

}

/* Centrar el botón de OPCIONES de forma global se maneja ahora a través del contenedor del navbar */

/* Ajustes para el selector de idioma y cabecera en escritorio */
@media (min-width: 992px) {
  .header-actions {
    gap: 0.85rem !important;
    /* Más compacto y elegante */
  }

  .desktop-lang-dropdown {
    margin-left: 2.75rem !important;
    /* Separación extra respecto al carrito */
  }
}

/* Selector de idioma premium en escritorio */
.desktop-lang-selector {
  background-color: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  font-size: 0.85rem !important;
  border-radius: 6px !important;
  transition: background-color 0.2s ease, border-color 0.2s ease !important;
}

.desktop-lang-selector:hover,
.desktop-lang-selector:focus,
.desktop-lang-selector:active {
  background-color: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: #fff !important;
}

/* Menú desplegable premium */
.desktop-lang-dropdown-menu {
  background-color: #151516 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  margin-top: 6px !important;
}

.desktop-lang-dropdown-menu .dropdown-item {
  color: rgba(255, 255, 255, 0.8) !important;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.desktop-lang-dropdown-menu .dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}

.desktop-lang-dropdown-menu .dropdown-item.active {
  background-color: var(--accent, #0d6efd) !important;
  color: #fff !important;
}

/* Transición suave para enlaces de la cabecera en hover */
.header-actions a {
  transition: opacity 0.2s ease;
}

.header-actions a:hover {
  opacity: 0.85;
}

/* ==========================================================================
   Nueva barra de navegación: Categorías | Products
   ========================================================================== */

.category-products-nav {
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  padding: 0.5rem 1rem;
}

/* El botón de Filtros/Categorías estilizado como pestaña */
.category-products-nav .nav-tab-btn {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0.25rem 0.5rem !important;
  font-size: 1.25rem !important;
  font-weight: 500 !important;
  color: #6c757d !important;
  cursor: pointer !important;
  transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.category-products-nav .nav-tab-btn:hover {
  color: var(--accent, #0d6efd) !important;
  transform: translateY(-1px);
}

.category-products-nav .nav-tab-btn:active {
  transform: translateY(0);
}

/* Icono dentro del botón de Filtros/Categorías */
.category-products-nav .nav-tab-btn i {
  font-size: 1.15rem;
  transition: transform 0.2s ease;
}

.category-products-nav .nav-tab-btn:hover i {
  transform: scale(1.1);
}

/* Separador vertical */
.category-products-nav .nav-separator {
  color: #dee2e6 !important;
  font-size: 1.5rem !important;
  font-weight: 300 !important;
  user-select: none !important;
  align-self: center;
}

/* Pestaña activa (Products) */
.category-products-nav .nav-tab-active {
  padding: 0.25rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
}

.category-products-nav .nav-tab-text {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  color: #212529 !important;
  letter-spacing: 0.5px;
}

/* Indicador de pestaña activa */
.category-products-nav .nav-tab-indicator {
  display: block;
  width: 32px;
  /* Ancho fijo elegante para el indicador de línea */
  height: 3px;
  background-color: var(--accent, #0d6efd);
  border-radius: 2px;
  margin-top: 4px;
  transition: width 0.3s ease;
}

.category-products-nav:hover .nav-tab-indicator {
  width: 48px;
  /* Animación sutil de expansión al pasar el mouse por la sección */
}