/* Grid de Productos */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.8rem;
    margin-bottom: 3rem;
}

/* Tarjeta de Producto */
.producto-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid rgba(66, 165, 245, 0.25);
    box-shadow: 0 2px 6px rgba(66, 165, 245, 0.075), 0 1px 4px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Borde verde suave para productos de inicio */
.producto-card[data-inicio="1"] {
    border: 2px solid rgba(76, 175, 80, 0.4);
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.1), 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* Borde dorado suave para productos destacados */
.producto-card[data-destacado="1"] {
    border: 2px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 2px 6px rgba(255, 215, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* Borde rojo suave para productos en oferta */
.producto-card[data-oferta="1"] {
    border: 2px solid rgba(255, 82, 82, 0.4);
    box-shadow: 0 2px 6px rgba(255, 82, 82, 0.1), 0 1px 4px rgba(0, 0, 0, 0.04);
}

.producto-card:hover {
    transform: translateY(-5px);
    border-color: rgba(66, 165, 245, 0.5);
    box-shadow: 0 4px 10px rgba(66, 165, 245, 0.125), 0 2px 6px rgba(0, 0, 0, 0.075);
}

.producto-card[data-inicio="1"]:hover {
    border-color: rgba(76, 175, 80, 0.6);
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.15), 0 2px 6px rgba(0, 0, 0, 0.075);
}

.producto-card[data-destacado="1"]:hover {
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.075);
}

.producto-card[data-oferta="1"]:hover {
    border-color: rgba(255, 82, 82, 0.6);
    box-shadow: 0 4px 10px rgba(255, 82, 82, 0.15), 0 2px 6px rgba(0, 0, 0, 0.075);
}

.producto-imagen {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1.1;
    overflow: hidden;
    background: #f5f5f5;
    cursor: pointer;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.producto-imagen:hover {
    opacity: 0.9;
}

.producto-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
    padding: 0;
    background: white;
}

.producto-imagen .imagen-principal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.producto-imagen .imagen-secundaria {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.producto-card:hover .imagen-principal {
    opacity: 0;
}

.producto-card:hover .imagen-secundaria {
    opacity: 1;
}

.producto-descuento {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.producto-sin-stock {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
}

.producto-info {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.producto-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #999;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.meta-categoria {
    color: #666;
    font-weight: 500;
}

.meta-separator {
    color: #ccc;
    font-size: 10px;
}

.meta-marca {
    color: #999;
    font-weight: 400;
}

.producto-categoria {
    font-size: 0.8rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.producto-nombre {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.8rem 0;
    line-height: 1.4;
    height: 2.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    cursor: pointer;
    transition: color 0.3s ease;
}

.producto-nombre:hover {
    color: #667eea;
    color: #333;
    margin-bottom: 0.8rem;
    min-height: 2.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.producto-precios {
    margin-bottom: 0.75rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.precio-final {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    order: 1;
}

.precio-original {
    font-size: 0.85rem;
    color: #999;
    text-decoration: line-through;
    order: 2;
}

.producto-stock {
    font-size: 0.85rem;
    color: #10b981;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.producto-stock.bajo {
    color: #f59e0b;
}

/* Badges de stock en catálogo */
.producto-card .stock-badge {
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.btn-agregar {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    margin-top: auto;
    flex-shrink: 0;
}

.btn-agregar:hover {
    transform: translateY(-2px);
}

.btn-agregar:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Botón de reposición en catálogo */
.producto-card .btn-reposicion {
    margin-top: auto;
    flex-shrink: 0;
}

/* Modal Carrito */
.modal-carrito {
    background: white;
    border-radius: 24px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideUp 0.3s ease-out;
}

.modal-carrito .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 24px 24px 0 0;
}

.modal-carrito .modal-header h2 {
    font-size: 1.5rem;
}

.btn-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-carrito .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.carrito-vacio {
    text-align: center;
    padding: 3rem;
    color: #999;
    font-size: 1.1rem;
}

.carrito-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
}

.carrito-item-imagen {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

.carrito-item-info {
    flex: 1;
}

.carrito-item-nombre {
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.carrito-item-precio {
    color: #667eea;
    font-weight: 600;
}

.carrito-item-controles {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-cantidad {
    width: 30px;
    height: 30px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 700;
}

.btn-cantidad:hover {
    background: #667eea;
    color: white;
}

.carrito-item-cantidad {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
}

.btn-eliminar {
    background: #fee;
    color: #f44;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 2px solid #e0e0e0;
}

.carrito-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #333;
}

.carrito-total span:last-child {
    color: #667eea;
}

.btn-checkout {
    width: 100%;
    padding: 1.2rem;
    font-size: 1.1rem;
}

.btn-checkout:disabled,
.btn-checkout.disabled {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-checkout:disabled:hover,
.btn-checkout.disabled:hover {
    transform: none;
}

/* Responsive */
@media (max-width: 768px) {
    .productos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.6rem;
    }
    
    /* Para Panel Inicio (Nuevos Ingresos): 1 columna en móvil */
    .productos-grid.grid-inicio-mobile {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    /* Alto de imagen específico solo para panel inicio en móvil */
    .productos-grid.grid-inicio-mobile .producto-imagen {
        height: 280px;
        aspect-ratio: 1 / 1;
    }
    
    .producto-info {
        padding: 0.4rem;
    }
    
    .producto-imagen {
        height: 180px;
    }
    
    .producto-nombre {
        font-size: 0.95rem;
        min-height: auto;
    }
    
    .precio-final {
        font-size: 1.2rem;
    }
}
