/* =========================================
   SECCIÓN DE PRODUCTOS (GLOBAL)
   ========================================= */
.all-products-section {
  padding: 2px; /* Reducido de 2rem a 1rem */
  background: var(--color-background);
}

/* Asegura que el container-fluid no meta padding lateral en móvil */
.all-products-section .container-fluid {
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.section-title {
  margin-bottom: 2rem;
  font-weight: 700;
  color: var(--color-text);
  font-size: 1.8rem;
  position: relative;
}
.section-title::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
}

/* =========================================
   GRID DE PRODUCTOS
   ========================================= */
.products-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  align-items: stretch;
}

/* =========================================
   PRODUCT CARD
   ========================================= */
.product-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  position: relative;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  height: 100%;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* =========================================
   BADGES
   ========================================= */
.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  color: #fff;
  z-index: 3;
}
.badge-new {
  background: var(--color-accent);
}

/* =========================================
   IMAGEN DEL PRODUCTO
   ========================================= */
.product-image {
  height: 200px;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.product-image img {
  max-width: 100%;
  max-height: 100%;
  transition: transform 0.4s;
  object-fit: contain;
}
.product-card:hover .product-image img {
  transform: scale(1.05);
}

/* =========================================
   INFO DEL PRODUCTO
   ========================================= */
.product-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
  line-height: 1.25;
}

/* =========================================
   PRECIOS
   ========================================= */
.product-price {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.current-price {
  color: var(--color-primary);
  font-weight: 700;
}
.original-price {
  text-decoration: line-through;
  color: #9ca3af;
  font-size: 0.9rem;
}
.discount-percent {
  margin-left: auto;
  color: var(--color-secondary);
  font-weight: 600;
  font-size: 0.85rem;
}

/* =========================================
   BOTONES
   ========================================= */
.product-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}
.btn-add-cart,
.btn-details {
  padding: 0.55rem;
  border-radius: 10px;
  border: none;
  font-size: 0.9rem;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s;
  cursor: pointer;
  font-weight: 600;
}
.btn-add-cart {
  flex: 1;
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.btn-add-cart:hover {
  filter: brightness(0.9);
  transform: translateY(-1px);
}
.btn-add-cart.added {
  background: #28a745 !important;
}
.btn-details {
  flex: 0 0 42px;
  background: #f3f4f6;
  color: var(--color-text);
}
.btn-details:hover {
  background: #e5e7eb;
}

/* =========================================
   INPUT DE CANTIDAD
   ========================================= */
.quantity-control-custom {
  gap: 0.35rem;
  margin: 6px 0;
}
.quantity-control-custom .btn-qty {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #4b5563;
  line-height: 1;
}
.quantity-control-custom .btn-qty:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.quantity-control-custom .qty-input-custom {
  width: 42px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  background: #fff;
}
.quantity-control-custom .qty-input-custom:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.04);
}

/* =========================================
   SELECT DE VARIACIONES
   ========================================= */
.variation-select,
.variation-select-custom {
  font-size: 0.75rem;
  padding: 4px 6px;
  height: auto;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #4b5563;
  margin-bottom: 6px;
  width: 100%;
}
.variation-select:focus,
.variation-select-custom:focus {
  outline: none;
  border-color: var(--color-primary);
  background: #fff;
}

/* =========================================
   CÓDIGO DEL PRODUCTO
   ========================================= */
.product-code-label {
  position: absolute;
  margin-bottom: 2px;
  left: 0;
  background: var(--color-secondary);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

/* =========================================
   RESPONSIVE - TABLET
   ========================================= */
@media (max-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 992px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =========================================
   RESPONSIVE - MÓVIL (SIN ESPACIOS)
   ========================================= */
@media (max-width: 767px) {
  /* Sección sin padding lateral */
  .all-products-section {
    padding: 2px;
  }
  .all-products-section .container-fluid {
    padding-left: 0.3rem;
    padding-right: 0.3rem;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem; /* Mínimo espacio entre cards */
  }
  .product-image {
    height: 150px;
  }
  .product-info {
    padding: 0.6rem;
  }
  .product-title {
    font-size: 0.75rem;
    min-height: 34px;
  }
  .current-price {
    font-size: 0.95rem;
  }
  .original-price {
    font-size: 0.75rem;
  }
  .discount-percent {
    font-size: 0.7rem;
  }

  /* Botones compactos en móvil */
  .btn-add-cart,
  .btn-details {
    padding: 0.45rem;
    font-size: 0.8rem;
    border-radius: 8px;
  }
  .btn-details {
    flex: 0 0 36px;
  }

  /* Input cantidad compacto */
  .quantity-control-custom .btn-qty {
    width: 26px;
    height: 26px;
    font-size: 0.85rem;
  }
  .quantity-control-custom .qty-input-custom {
    width: 34px;
    height: 26px;
    font-size: 0.78rem;
  }

  /* Código del producto más pequeño */
  .product-code-label {
    font-size: 0.6rem;
    padding: 2px 6px;
  }
}
