/* ==========================================
         TIENDA / GRID DE PRODUCTOS
   ========================================== */
#products {
    width: 100%;
}

#productGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    padding: 20px;
}

.product-card {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centra todo el contenido verticalmente */
    text-align: center;
    background: #fff;
    padding: 20px;
    border-radius: 15px;
    position: relative;
    transition: transform 0.3s ease;
}

.product-card img {
    width: 220px;
    max-width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}

.product-img-container {
    position: relative !important; /* CLAVE: El botón se ancla aquí */
    display: flex !important;
    justify-content: center;
    align-items: center;
    width: 100%;
    background-color: #f9f9f9; /* Fondo suave para que resalte la foto */
    border-radius: 12px;
    padding: 10px;
    overflow: visible !important; /* Permite que el botón se vea si sobresale un poco */
}

.product-card h3 {
    color: var(--cafe-oscuro);
    margin: 15px 0 5px 0;
    min-height: 50px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.product-card h2 {
  text-align: center;
}

.product-card p {
  margin: 0;
}

.product-card.clickable {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card.clickable:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.product-card.out-of-stock {
    cursor: default;
    opacity: 0.7;
}

.product-card.out-of-stock-card {
    opacity: 0.7;
}

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

.product-info {
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.in-stock, .out-of-stock {
    margin-bottom: 10px; 
    font-size: 14px;
    letter-spacing: 0.5px;
    display: block; 
}

.card-bottom {
    margin-top: auto; 
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px; 
}

.product-img-container.out-of-stock-filter {
    position: relative !important;
    overflow: hidden !important; /* Mantiene el badge dentro de los bordes redondeados */
}

/* Opacidad sutil a la imagen del perfume agotado */
.product-img-container.out-of-stock-filter .product-img {
    filter: brightness(0.7) grayscale(0.2);
}

/* Centrado perfecto del badge "AGOTADO" sobre la imagen */
.sold-out-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Truco clave para centrar ejes X e Y */
    background-color: rgba(0, 0, 0, 0.75); /* Fondo oscuro semitransparente premium */
    color: #ffffff;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    border-radius: 4px;
    text-transform: uppercase;
    z-index: 2;
    pointer-events: none; /* Evita que interfiera con los clics */
    white-space: nowrap;
}

/* Estilo para la tarjeta deshabilitada completa (opcional) */
.disabled-card {
    cursor: default;
}