/* src/public/modules/store/product-grid/product-grid.css */

/* 1. Contenedor Principal */
#product-grid-container {
    display: block;
    margin-top: 20px;
}

/* 2. Grid de Productos */
.category-products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 15px;
    /* Reducido */
}

/* 3. Título de la Sección */
.category-title {
    text-align: left;
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 20px;
    margin-top: 10px;
    color: #1a1a1a;
    letter-spacing: -0.5px;
    padding-left: 2px;
}


/* Loader Spinner */
.loader-container {
    display: flex;
    justify-content: center;
    padding: 30px;
    width: 100%;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #16a34a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state-msg {
    text-align: center;
    padding: 50px;
    color: #6c757d;
    font-size: 1.2rem;
}

/* =====================================================
   PRODUCT CARD — Nuevo diseño
   ===================================================== */

.product-card {
    background-color: #ffffff;
    border-radius: 14px;
    border: 1px solid #ebebeb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    padding-bottom: 46px;
    /* Espacio para el badge PACK y carrito flotantes */
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* --- Imagen --- */
.card-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #f5f5f5;
    border-radius: 14px 14px 0 0;
    overflow: hidden;
    flex-shrink: 0;
}

.product-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    padding: 16px;
    transition: transform 0.3s ease;
}

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

/* --- Badge descuento (esquina superior izquierda) --- */
.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #dc3545;
    color: #fff;
    font-weight: 800;
    font-size: 0.78rem;
    padding: 3px 8px;
    border-radius: 6px;
    z-index: 10;
    letter-spacing: 0.3px;
}

/* --- Botón carrito flotante (esquina inferior derecha de LA CARD) --- */
.card-cart-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background-color: #16a34a;
    color: #fff;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.card-cart-btn:hover {
    background-color: #15803d;
    transform: scale(1.1);
}

.card-cart-btn:active {
    transform: scale(0.95);
}

.card-cart-btn svg {
    width: 18px;
    height: 18px;
    stroke: #ffffff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* --- Info inferior --- */
.product-info {
    padding: 10px 10px 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.product-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* --- Precios --- */
.price-container {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 4px;
}

.original-price-crossed {
    text-decoration: line-through;
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 500;
}

.product-price {
    font-size: 0.92rem;
    color: #1a1a1a;
    font-weight: 800;
    display: block;
}

.product-price.discount-price {
    color: #dc3545;
}

/* --- Badge PACK / IS_PACK (esquina inferior izquierda de la card) --- */
.pack-badge {
    position: absolute;
    bottom: 16px;
    left: 10px;
    background-color: #FFC107;
    color: #1a1a1a;
    font-size: 0.72rem;
    font-weight: 900;
    padding: 3px 8px;
    border-radius: 5px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* --- Botón Ver Todas Las Categorías --- */
.view-all-cats-container {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    margin-bottom: 10px;
}

.view-all-cats-btn {
    background-color: transparent;
    color: #16a34a;
    border: 2px solid #16a34a;
    padding: 10px 24px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.view-all-cats-btn:hover {
    background-color: #16a34a;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(216, 131, 27, 0.2);
}

.view-all-cats-btn:active {
    transform: scale(0.96);
}