/* ==========================================
   SOLUCIÓN AL DESPLAZAMIENTO HORIZONTAL (SCROLL LATERAL)
   ========================================== */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important; /* Bloquea por completo el movimiento lateral con el dedo */
    position: relative;
}

/* Asegura que ningún elemento interno sobrepase el ancho del contenedor */
*, *:before, *:after {
    box-sizing: border-box;
}
/* ==========================================
   ESTILOS GENERALES Y LAYOUT
   ========================================== */
.catalog-main {
  padding: 30px 0 60px 0;
  background-color: #f8fafc;
  width: 100%;
  box-sizing: border-box;
}

.catalog-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  box-sizing: border-box;
}

.catalog-layout {
  display: block;
  width: 100%;
  margin-top: 25px;
  box-sizing: border-box;
}

.catalog-content {
  width: 100%;
  box-sizing: border-box;
}

/* ==========================================
   BANNER DE CATEGORÍA (CABECERA)
   ========================================== */
.catalog-header-banner {
  width: 100%;
  max-width: 100%;
  background-color: #ffffff;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 220px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  margin-bottom: 35px;
  border: 1px solid #f1f5f9;
  box-sizing: border-box;
}

/* Columna de Texto */
.catalog-header-text {
  flex: 1;
  padding: 35px 40px;
  z-index: 2;
  max-width: 520px;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 18px;
}

.breadcrumb-nav a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb-nav a:hover {
  text-decoration: underline;
}

.breadcrumb-nav .separator {
  color: #64748b;
  font-size: 12px;
}

.breadcrumb-nav .current {
  color: #64748b;
  font-weight: 500;
}

.catalog-category-title {
  font-size: 42px;
  font-weight: 800;
  color: #0046be;
  margin: 0 0 10px 0;
  letter-spacing: -0.8px;
  line-height: 1;
}

.catalog-category-desc {
  font-size: 13.5px;
  color: #475569;
  line-height: 1.5;
  margin: 0;
}

.catalog-category-desc strong {
  color: #1e293b;
  font-weight: 700;
}

/* Columna Imagen con difuminado suave */
.catalog-header-image {
  flex: 1.1;
  height: 100%;
  min-height: 220px;
  background-size: cover;
  background-position: center right;
  position: relative;
}

.image-fade-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 45%;
  height: 100%;
  background: linear-gradient(to right, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
}

/* ==========================================
   BARRA SUPERIOR DE CONTROLES (TOPBAR)
   ========================================== */
.catalog-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  gap: 15px;
  width: 100%;
}

.catalog-results-count {
  font-size: 14px;
  color: #64748b;
}

.catalog-results-count strong {
  color: #0f172a;
}

.controls-buttons-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Botones estilo Pill */
.btn-control {
  height: 42px;
  padding: 0 20px;
  border-radius: 50px;
  border: 1px solid #000000;
  background-color: #ffffff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.btn-control:hover {
  background-color: #f8fafc;
  border-color: #000000;
}

.custom-select-wrapper {
  position: relative;
  display: inline-block;
}

.btn-sort {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

/* ==========================================
   PANEL LATERAL (DRAWER / OFF-CANVAS) Y OVERLAY
   ========================================== */
.filter-drawer-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.4) !important;
    z-index: 9998 !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.filter-drawer-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
}

.filter-drawer {
    position: fixed !important;
    top: 0 !important;
    right: -320px !important;
    width: 100% !important;
    max-width: 280px !important; /* Panel de filtros más estrecho y elegante */
    height: 100vh !important;
    background: #ffffff !important;
    z-index: 9999 !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15) !important;
    visibility: hidden !important;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s ease !important;
    box-sizing: border-box !important;
}
.filter-drawer.active {
    right: 0 !important;
    visibility: visible !important;
}

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.btn-close-drawer {
  background: none;
  border: none;
  font-size: 28px;
  color: #64748b;
  cursor: pointer;
  line-height: 1;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

/* Estilos de Acordeón para Filtros */
.filter-accordion {
  border-bottom: 1px solid #f1f5f9;
  padding: 12px 0;
}

.filter-accordion-title {
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-accordion-title::-webkit-details-marker {
  display: none;
}

.filter-accordion-title::after {
  content: '›';
  font-size: 18px;
  transform: rotate(90deg);
  transition: transform 0.2s;
}

details[open] .filter-accordion-title::after {
  transform: rotate(-90deg);
}

/* Listas y Links dentro del Drawer */
.filter-list {
  list-style: none !important;
  padding: 10px 0 0 0 !important;
  margin: 0 !important;
}

.filter-list li {
  margin-bottom: 4px;
}

.filter-link {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  color: #475569;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.filter-link:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.filter-link.active {
  background-color: #eff6ff;
  color: #2563eb;
  font-weight: 700;
}

/* Indicadores Visuales */
.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 10px;
  flex-shrink: 0;
}

.badge-sale {
  background-color: #ef4444;
}

.badge-featured {
  background-color: #2563eb;
}

/* Card WhatsApp dentro del Drawer */
.filter-help-card {
  background-color: #f8fafc;
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  border: 1px solid #e2e8f0;
  margin-top: 20px;
}

.filter-help-card h4 {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.filter-help-card p {
  margin: 0 0 12px 0;
  font-size: 12px;
  color: #64748b;
}

.btn-whatsapp-help {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #0046be;
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: background-color 0.2s ease;
}

.btn-whatsapp-help:hover {
  background-color: #00328a;
}

/* Footer del Drawer */
.drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 12px;
  background-color: #ffffff;
}

.btn-drawer-clear {
  flex: 1;
  height: 44px;
  border-radius: 50px;
  background: #f1f5f9;
  color: #0f172a;
  text-decoration: none;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.btn-drawer-apply {
  flex: 1;
  height: 44px;
  border-radius: 50px;
  background: #000000;
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

/* ==========================================
   GRILLA Y TARJETAS DE PRODUCTO
   ========================================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 35px;
  width: 100%;
  box-sizing: border-box;
}

.product-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

/* Badges Flotantes sobre la tarjeta */
.product-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  color: #ffffff;
  text-transform: uppercase;
  display: inline-block;
  line-height: 1.2;
}

.badge-featured {
  background-color: #0046be;
}

.badge-custom {
  background-color: #64748b;
}

.card-badge {
  background-color: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  display: inline-block;
}

/* Contenedor Adaptativo de Imágenes (1:1) */
.card-image-link,
.product-image-wrapper {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: #ffffff;
  padding: 0px;
}

.card-image-link img,
.product-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
}

.card-image-link .img-primary,
.product-image-wrapper .img-primary,
.product-image {
  position: relative;
  z-index: 1;
  opacity: 1;
}

.card-image-link .img-hover,
.product-image-wrapper .img-hover {
  position: absolute;
  top: 0;
  left: 0;
  padding: 12px;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}

/* Transiciones Hover para Imágenes */
.product-card:hover .card-image-link:not(.has-hover) .img-primary,
.product-card:hover .product-image-wrapper:not(.has-hover) .product-image {
  transform: scale(1.40);
}

.product-card:hover .card-image-link.has-hover .img-primary,
.product-card:hover .product-image-wrapper.has-hover .img-primary {
  opacity: 0;
}

.product-card:hover .card-image-link.has-hover .img-hover,
.product-card:hover .product-image-wrapper.has-hover .img-hover {
  opacity: 1;
  transform: scale(1.40);
}

/* Información del Producto */
.card-content,
.product-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-category,
.product-category {
  font-size: 11px;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.card-title,
.product-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.card-title a,
.product-title a {
  color: #0f172a;
  text-decoration: none;
  transition: color 0.2s ease;
}

.card-title a:hover,
.product-title a:hover {
  color: #0046be;
}

.product-desc {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.4;
  margin: 0 0 12px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Caja de Precios Formateados */
.card-price-box {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
}

.card-price {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.card-old-price {
  font-size: 13px;
  color: #94a3b8;
  text-decoration: line-through;
  font-weight: 500;
}

.product-actions {
  margin-top: auto;
}

.btn-product-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background-color: #25d366;
  color: #ffffff;
  padding: 9px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  transition: background-color 0.2s ease;
}

.btn-product-wa:hover {
  background-color: #1ebc57;
}

.no-products-found {
  grid-column: 1 / -1;
  background: #ffffff;
  padding: 40px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid #e2e8f0;
  color: #64748b;
}


/* ==========================================
   PAGINACIÓN CORREGIDA Y VISIBLE
   ========================================== */
.catalog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
    padding: 0 10px;
}

.pagination-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 5px;
    align-items: center;
    max-width: 100%;
    flex-wrap: wrap; /* Permite que se acomoden en otra línea si es necesario en pantallas muy pequeñas */
    justify-content: center;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

/* Ajuste específico para que los botones de texto largo no se corten */
.page-link.prev,
.page-link.next {
    padding: 0 12px;
    font-size: 12.5px;
    white-space: nowrap;
}

.page-link:hover {
    border-color: #0046be;
    color: #0046be;
    background-color: #f8fafc;
}

.page-item.active .page-link {
    background-color: #0046be;
    border-color: #0046be;
    color: #ffffff;
}

.page-item.disabled .page-link {
    background-color: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
    pointer-events: none;
    opacity: 0.6;
}

/* ==========================================
   DISEÑO RESPONSIVO Y MEDIA QUERIES
   ========================================== */
@media (max-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .catalog-header-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .catalog-header-text {
    max-width: 100%;
    padding: 25px 20px 15px 20px;
  }

  .catalog-category-title {
    font-size: 32px;
  }

  .catalog-header-image {
    width: 100%;
    height: 180px;
  }

  .image-fade-overlay {
    width: 100%;
    height: 40%;
    background: linear-gradient(to bottom, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
  }
}

@media (max-width: 576px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
.catalog-header-banner
{
    display:none;
}
  .catalog-controls-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .controls-buttons-group {
    width: 100%;
    justify-content: space-between;
  }

  .btn-control {
    flex: 1;
  }

  .filter-drawer {
    max-width: 100%;
  }
}

