/* ================================================================== */
/*          CARDS.CSS - TARJETAS DE PRODUCTO RESPONSIVAS              */
/* ================================================================== */

/* --- VARIABLES Y FUENTES --- */
:root {
    /* Paleta de colores principal */
    --primary-color: #2AC1DB;
    --dark-color: #1B1B1B;
    --white-color: #FFFFFF;

    /* Colores de apoyo */
    --gray-light: #f4f6f8;
    --gray-medium: #e9ecef;
    --gray-dark: #6c757d;
    --price-color: #363993;
    --discount-badge-bg: #e74c3c;
    --featured-badge-bg: #363993;

    /* Fuentes */
    --font-primary: 'Orbitron', sans-serif;
    --font-secondary: 'Outfit', sans-serif;

    /* Transiciones */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s ease;
}

/* ================================================================== */
/* ESTILO PRINCIPAL DE LA TARJETA DE PRODUCTO                         */
/* ================================================================== */
.product-card {
    position: relative;
    background: var(--white-color);
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 220px;
    max-width: 18rem;
    height: auto;
    min-height: 460px;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    flex-shrink: 0; /* Importante para carruseles */
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(42, 193, 219, 0.2);
    border-color: var(--primary-color);
}

/* ================================================================== */
/* BADGES (DESCUENTO Y DESTACADO)                                     */
/* ================================================================== */
.badge-porcentaje,
.badge-featured {
    position: absolute;
    top: 1rem;
    z-index: 10;
    color: var(--white-color);
    font-family: var(--font-secondary);
    font-weight: 700;
    border-radius: 100px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.badge-porcentaje {
    left: 1rem;
    background-color: var(--discount-badge-bg);
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-featured {
    right: 1rem;
    background-color: var(--featured-badge-bg);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* ================================================================== */
/* IMAGEN DEL PRODUCTO                                                */
/* ================================================================== */
.product-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-image-container {
    height: 220px;
    padding: 1rem;
    background-color: var(--white-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform var(--transition-smooth);
}

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

/* ================================================================== */
/* INFORMACIÓN DEL PRODUCTO (TÍTULO, DESC, PRECIO)                    */
/* ================================================================== */
.product-info {
    padding: 0 1.5rem 1.5rem 1.5rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 140px;
}

.product-title {
    font-family: var(--font-secondary);
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8rem;
}

.product-description {
    font-size: 0.85rem;
    color: var(--gray-dark);
    margin: 0 0 1rem 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.55rem;
}

.product-price {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.price-now {
    font-family: var(--font-secondary);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--price-color);
}

.price-old {
    font-size: 0.8rem;
    color: var(--gray-dark);
    text-decoration: line-through;
}

/* ================================================================== */
/* FORMULARIO "AGREGAR AL CARRITO"                                    */
/* ================================================================== */
.add-to-cart-form {
    padding: 0 1.5rem 1.5rem 1.5rem;
    margin-top: auto;
}

.quantity-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quantity-input {
    width: 50px;
    height: 44px;
    border: 2px solid var(--gray-medium);
    border-radius: 12px;
    text-align: center;
    font-family: var(--font-secondary);
    font-weight: 700;
    font-size: 1rem;
    color: var(--dark-color);
    background-color: var(--white-color);
    transition: border-color var(--transition-fast);
    -moz-appearance: textfield;
}

.quantity-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.add-button {
    flex-grow: 1;
    height: 44px;
    background-color: var(--primary-color);
    color: var(--white-color);
    border: none;
    border-radius: 12px;
    font-family: var(--font-secondary);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background-color var(--transition-smooth), transform var(--transition-fast);
}

.add-button:hover {
    background-color: #23a0b6;
    transform: scale(1.02);
}

.add-button:active {
    transform: scale(0.98);
}

/* ================================================================== */
/* ESTADO VACÍO (CUANDO NO HAY PRODUCTOS)                             */
/* ================================================================== */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background-color: rgba(42, 193, 219, 0.05);
    border-radius: 20px;
    border: 2px dashed var(--primary-color);
}

.empty-icon { 
    font-size: 3rem; 
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-title { 
    font-family: var(--font-primary); 
    font-size: 1.5rem; 
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.empty-description { 
    color: var(--gray-dark);
    font-size: 1rem;
}

/* ================================================================== */
/* DISEÑO RESPONSIVE                                                  */
/* ================================================================== */

/* Tablets medianos */
@media (max-width: 1024px) {
    .product-card {
        min-width: 260px;
        max-width: 300px;
        min-height: 440px;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .product-card {
        min-width: 250px;
        max-width: 280px;
        min-height: 420px;
    }
    
    .product-image-container {
        height: 180px;
        padding: 0.8rem;
    }
    
    .product-info, .add-to-cart-form {
        padding: 0 1.2rem 1.2rem 1.2rem;
        min-height: 120px;
    }
    
    .product-title {
        font-size: 0.9rem;
        min-height: 2.5rem;
    }
    
    .product-description {
        font-size: 0.8rem;
        min-height: 2.4rem;
    }
    
    .price-now {
        font-size: 1.3rem;
    }
    
    .quantity-input {
        width: 45px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .add-button {
        height: 40px;
        font-size: 0.85rem;
    }
}

/* Móviles */
@media (max-width: 480px) {
    .product-card {
        min-width: 140px;
        max-width: 180px;
        min-height: 300px;
    }
    
    .product-image-container {
        height: 120px;
        padding: 0.5rem;
    }
    
    .product-info, .add-to-cart-form {
        padding: 0 0.8rem 0.8rem 0.8rem;
        min-height: 40px;
    }
    
    .product-title {
        font-size: 0.8rem;
        min-height: 4rem;
        line-height: 1.1;
    }
    
    .product-description {
        font-size: 0.7rem;
        min-height: 1.8rem;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .price-now {
        font-size: 1rem;
    }
    
    .price-old {
        font-size: 0.8rem;
    }
    
    .quantity-input {
        width: 40px;
        height: 36px;
        font-size: 0.85rem;
    }
    
    .add-button {
        height: 32px;
        font-size: 0.6rem;
        letter-spacing: 0.3px;
        padding: 0 0.6rem;
    }
    
    .quantity-input {
        width: 35px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .badge-porcentaje {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
    
    .badge-featured {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
    }
    .product-price{
        margin-bottom: 0;
    }
}

/* Extra pequeño (pantallas muy pequeñas) */
@media (max-width: 320px) {
    .product-card {
        min-width: 130px;
        max-width: 160px;
        min-height: 280px;
    }
    
    .product-image-container {
        height: 100px;
        padding: 0.4rem;
    }
    
    .product-info, .add-to-cart-form {
        padding: 0 0.6rem 0.6rem 0.6rem;
    }
    
    .product-title {
        font-size: 0.75rem;
        min-height: 1.8rem;
        line-height: 1.1;
    }
    
    .product-description {
        display: none; /* Ocultar en pantallas muy pequeñas */
    }
    
    .price-now {
        font-size: 0.9rem;
    }
    
    .price-old {
        font-size: 0.7rem;
    }
    
    .quantity-input {
        width: 30px;
        height: 28px;
        font-size: 0.7rem;
    }
    
    .add-button {
        height: 28px;
        font-size: 0.7rem;
        padding: 0 0.4rem;
    }
}