/* ===== SECCION PRODUCTOS ESTILO E-COMMERCE MODERNO ===== */

.section-title {
  font-size: 28px;
  margin-bottom: 35px;
  font-weight: 600;
  text-align: center;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.product-card {
  background: #fff;
  border: 1px solid #f0f0f0;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* CONTENEDOR DE IMAGEN Y OVERLAY */
.product-img-wrapper {
  position: relative;
  background: #fdfdfd;
  padding: 20px 20px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-img-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.5s ease;
}

/* BADGE DE STOCK */
.badge-stock {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #050505;
  color: white;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: bold;
  border-radius: 15px;
  border: 1px solid #eee;
  z-index: 5;
  text-transform: uppercase;
}

.badge-stock.out-of-stock {
  background: #f8d7da;
  color: #721c24;
}

/* OVERLAY (EFECTO SEGUNDA IMAGEN) */
.product-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(75, 85, 99, 0.85); /* Gris azulado oscuro traslúcido */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.product-card:hover .product-overlay {
  opacity: 1;
}

.product-card:hover .product-img-wrapper img {
  transform: scale(1.05);
}

/* BOTÓN ADD TO CART INTERNO */
.btn-add-overlay {
  background: var(--primary-red); /* Rojo coral de la imagen */
  border: none;
  display: flex;
  align-items: center;
  color: white;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  border-radius: 3px;
  transition: background 0.3s;
}

.btn-add-overlay .btn-text {
  padding: 0px 15px;
  font-size: 14px;
  font-weight: 600;
}

.btn-add-overlay .btn-icon {
  background: #333; /* Fondo oscuro para el icono */
  padding: 10px 12px;
  display: flex;
  align-items: center;
}

.btn-add-overlay:hover {
  background: #e63e3e;
}

.btn-add-overlay:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* ESTRELLAS */
.product-rating {
  color: #ffc107;
  font-size: 18px;
  margin-top: 15px;
  text-align: center;
}

/* CUERPO DE LA TARJETA */
.product-body {
  padding-bottom: 10px;
  text-align: center;
}

.product-category {
  font-size: 12px;
  color: #888;
  margin-bottom: 5px;
}

.product-title {
  font-size: 12px;
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
  height: 20px;
  overflow: hidden;
}

.product-price {
  font-size: 20px;
  font-weight: 700;
  color: #ff4d4d; /* Rojo a juego con el botón */
}

/* DISEÑO DE COLUMNAS */
.main-content-wrapper {
  display: flex;
  gap: 10px;
  margin-top: 30px;
  align-items: flex-start;
}

.products-column {
  flex: 1;
}
/* ===== SIDEBAR MEJORADO ===== */

/* Contenedor principal del aside */
.sidebar-filters {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: 100px;
  background: #ffffffc2;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
  border: 1px solid #f0f0f0;
}

/* Secciones del filtro */
.filter-section {
  margin-bottom: 5px;
  border-bottom: 1px solid #f3f3f3;
  overflow-y: auto;
  max-height: 250px;
}

.filter-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Títulos de cada sección */
.filter-section h3 {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  font-weight: 700;
  color: #aaa;
  margin-bottom: 16px;
}

/* ---- CATEGORÍAS ---- */
.filter-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-list li a {
  text-decoration: none;
  color: #555;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  gap: 8px;
}

.filter-list li a::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ddd;
  flex-shrink: 0;
  transition: background 0.2s;
}

.filter-list li a:hover {
  background: #fff5f5;
  color: #ff4d4d;
  padding-left: 16px;
}

.filter-list li a:hover::before,
.filter-list li a.active::before {
  background: #ff4d4d;
}

.filter-list li a.active {
  background: #fff0f0;
  color: #ff4d4d;
  font-weight: 600;
  padding-left: 16px;
}

/* ---- FILTRO DE PRECIO ---- */
.price-range-container {
  padding: 6px 0 0;
}

.price-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  color: #444;
}

.price-display input[type="number"] {
  width: 80px;
  text-align: center;
  border: 1.5px solid #e5e5e5;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 700;
  color: #ff4d4d;
  outline: none;
  transition: border-color 0.2s;
  background: #fff9f9;
}

.price-display input[type="number"]:focus {
  border-color: #ff4d4d;
  background: #fff;
}

.price-display input[type="number"]::-webkit-outer-spin-button,
.price-display input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Slider personalizado */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(
    to right,
    #ff4d4d var(--value, 100%),
    #e5e5e5 var(--value, 100%)
  );
  outline: none;
  margin-bottom: 10px;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ff4d4d;
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow:
    0 0 0 2px #ff4d4d,
    0 2px 6px rgba(255, 77, 77, 0.3);
  transition: transform 0.15s;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ff4d4d;
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #ff4d4d;
}

.price-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #bbb;
  margin-top: 2px;
  margin-bottom: 16px;
  font-weight: 500;
}

.btn-filter-action {
  background: var(--primary-red);
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.btn-filter-action:hover {
  background: #ff4d4d;
  transform: translateY(-1px);
}

.btn-filter-action:active {
  transform: translateY(0);
}

/* ---- CHECKBOXES DE MARCAS ---- */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0px;
  border-radius: 8px;
  margin-bottom: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  color: #555;
  transition: background 0.2s;
  user-select: none;
  position: relative;
  padding-left: 38px;
}

.checkbox-container:hover {
  background: #f9f9f9;
  color: #333;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  height: 15px;
  width: 15px;
  background-color: #f0f0f0;
  border: 1.5px solid #ddd;
  transition: all 0.2s ease;
}

.checkbox-container:hover .checkmark {
  border-color: #ff4d4d;
  background: #fff5f5;
}

.checkbox-container input:checked ~ .checkmark {
  background-color: #ff4d4d;
  border-color: #ff4d4d;
}

/* Checkmark icon */
.checkmark::after {
  content: "";
  position: absolute;
  display: none;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark::after {
  display: block;
}

/* ---- MINI PRODUCTOS (MÁS VENDIDOS) ---- */
.mini-product-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mini-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 10px;
  background: #fafafa;
  border: 1px solid #f0f0f0;
  transition: all 0.2s ease;
  cursor: pointer;
}

.mini-item:hover {
  background: #fff5f5;
  border-color: #ffd5d5;
  transform: translateX(3px);
}

.mini-item img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #eee;
  flex-shrink: 0;
}

.mini-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mini-info span {
  font-size: 13px;
  color: #444;
  font-weight: 500;
  line-height: 1.3;
}

.mini-info strong {
  color: #ff4d4d;
  font-size: 14px;
  font-weight: 700;
}

/* Esto asegura que el contenido del overlay no se pegue a los bordes */
.overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
/* Estilo para el texto del stock */
.product-stock {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 5px;
}

/* ===== ESTILOS PARA VER MÁS / VER MENOS ===== */

/* Permitir que la descripción rompa palabras largas (como las ttttttt...) */
.product-descripcion {
  word-break: break-word;
  overflow: visible; /* Cambiar si tenías un overflow:hidden */
  height: auto; /* Permite que crezca dinámicamente */
  font-size: 0.8rem;
  margin-bottom: 5px;
}

/* Botón interactivo */
.btn-toggle-desc {
  background: none;
  border: none;
  color: #ff4d4d; /* Color rojo coral de tu UI */
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  margin-left: 5px;
  display: inline-block;
  text-decoration: underline;
}

.btn-toggle-desc:hover {
  color: #e63e3e;
}

/* Ajuste para la tarjeta de producto */
.product-card {
  height: 100%; /* Asegura que todas mantengan simetría */
}

/* Resaltado cuando queda poco stock */
/* .product-stock.low-stock {
    color: #e53935; 
    font-weight: bold;
} 
*/
.text-marca {
  font-size: 11px;
  color: #d87093;
}

/* Badge de Agotado (el que ya tienes) */
.badge-stock.out-of-stock {
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 10px;
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
  border-radius: 4px;
  font-size: 12px;
}

.price-display {
  text-align: center;
  font-weight: bold;
  margin-bottom: 10px;
  font-size: 12px;
  color: #333;
}

/* Precio antiguo */
.price-old {
  text-decoration: line-through;
  color: #999;
  font-size: 14px;
}

/* Precio final */
.price-final {
  color: #ff4d4d;
  font-size: 20px;
  font-weight: 700;
}

/* Badge de oferta */
.badge-offer {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ff4d4d;
  color: white;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
}

.price-discount {
  color: white;
  font-weight: 600;
  font-size: 14px;
  margin-left: 6px;
  position: absolute;
  top: 0;
  right: 0;
  background-color: rgb(255, 77, 77);
  padding: 4px 5px;
}
.valorprecio {
  width: 90px;
  text-align: center;
}

/* Contenedor del título del filtro */
.filter-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 10px 0;
  user-select: none;
}

.filter-title h3 {
  margin: 0;
  font-size: 0.6rem;
  color: #334155; /* Color adaptado a tu UI limpia */
}

/* Animación del icono de flecha */
.toggle-icon {
  font-size: 0.9rem;
  transition: transform 0.3s ease;
  color: #64748b;
}

/* Por defecto, el contenido de los filtros está colapsado */
.filter-section .filter-content {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.3s ease-out,
    opacity 0.2s ease;
  opacity: 0;
}

/* Cuando la sección tiene la clase .active, se despliega */
.filter-section.active .filter-content {
  max-height: 100%; /* Un valor alto para que entren todos los checkboxes */
  opacity: 1;
  padding-top: 10px;
  padding-bottom: 15px;
}

/* Rotar la flecha si está activo */
.filter-section.active .toggle-icon {
  transform: rotate(180deg);
}

/* ===== AJUSTES DE RESPONSIVIDAD PARA EL HOME ===== */

@media (max-width: 992px) {
  /* El contenedor principal pasa de fila a columna */
  .main-content-wrapper {
    margin-top: 15px;
    gap: 2px;
  }
  .filter-section h3 {
    font-size: 7px;
  }
  .checkbox-container {
    padding: 4px 18px;
    font-size: 8px;
  }
  .checkmark {
    left: 0px;
  }
  .price-display {
    font-size: 10px;
  }

  .valorprecio {
    text-align: center;
  }
  .price-display input[type="number"] {
    width: 45px;
    font-size: 10px;
  }
  .product-category {
    font-size: 10px;
  }
  .product-stock {
    font-size: 10px;
  }
  .product-price {
    font-size: 15px;
  }

  .price-old {
    font-size: 10px;
  }

  .price-final {
    font-size: 10px;
  }
  .price-discount {
    font-size: 10px;
  }
  .btn-add-overlay .btn-text {
    font-size: 10px;
  }

  /* Botón para mostrar filtros en móvil (Debes agregarlo al HTML) */
  .mobile-filter-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--primary-red);
    color: var(--primary-red);
    padding: 12px;
    border-radius: 8px;
    width: 100%;
    font-weight: 700;
    margin-bottom: 10px;
    cursor: pointer;
  }

  /* Grid de productos: 2 columnas en móviles para que no se vean gigantes */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .product-img-wrapper {
    height: 140px;
    padding: 10px 5px;
  }

  .product-body {
    padding: 10px;
  }

  .product-title {
    font-size: 10px;
  }
  .products-column {
    padding: 0px 5px;
  }
  .product-descripcion {
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  /* En pantallas muy pequeñas, mantenemos 2 columnas pero reducimos paddings */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .sidebar-filters {
    width: 120px;
    padding: 8px;
    display: none;
  }
  .product-descripcion {
    font-size: 0.6rem;
  }
}

/* Solo mostrar el trigger en móvil */
.mobile-filter-trigger {
  display: none;
}
