/**
 * 🎨 DISEÑO MODERNO PARA PRODUCTOS EN VENTA
 * Estilo UI/UX optimizado con layout de 2 líneas
 * Diseño tipo card con micro-interacciones fluidas
 * Fecha: Noviembre 2025
 * Versión: 2.0 - Completamente reescrito
 */

/* ============================================
   PRODUCTOS - DISEÑO CARD MODERNO
   ============================================ */

/* Contenedor principal del producto - Estilo Card */
.newProduct {
    margin: 12px 8px !important;
    padding: 16px 18px !important;
    background-color: #fff !important;
    border: 1px solid #e8ecef !important;
    border-radius: 10px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06) !important;
}

.newProduct:hover {
    border-color: #3c8dbc !important;
    box-shadow: 0 6px 16px rgba(60, 141, 188, 0.12), 0 3px 6px rgba(60, 141, 188, 0.08) !important;
    transform: translateY(-2px) !important;
}

.newProduct > .row {
    margin: 0 !important;
}

/* ============================================
   LÍNEA 1: DESCRIPCIÓN Y BOTÓN ELIMINAR
   ============================================ */

.product-description-row {
    padding: 0 !important;
    margin-bottom: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.product-description-row .product-name {
    flex: 1 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    line-height: 1.4 !important;
    padding-right: 12px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.product-description-row .removeProduct {
    flex-shrink: 0 !important;
    width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
    border: 1px solid rgba(231, 76, 60, 0.25) !important;
    border-radius: 8px !important;
    background: rgba(231, 76, 60, 0.08) !important;
    color: #e74c3c !important;
    font-size: 16px !important;
    line-height: 28px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    opacity: 0.75 !important;
}

.product-description-row .removeProduct:hover {
    opacity: 1 !important;
    background: #e74c3c !important;
    color: #ffffff !important;
    border-color: #e74c3c !important;
    transform: scale(1.15) rotate(90deg) !important;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.35) !important;
}

.product-description-row .removeProduct:active {
    transform: scale(0.95) rotate(90deg) !important;
}

/* ============================================
   LÍNEA 2: CONTROLES (CANTIDAD Y PRECIO TOTAL)
   ============================================ */

.product-controls-row {
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
}

/* Controles de cantidad */
.quantity-controls {
    display: inline-flex !important;
    align-items: center !important;
    background: #f8f9fa !important;
    border-radius: 10px !important;
    padding: 6px !important;
    gap: 8px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) inset !important;
}

.quantity-controls .btn-number {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    color: #3c8dbc !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    line-height: 36px !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
}

.quantity-controls .btn-number:hover {
    background: #3c8dbc !important;
    color: #ffffff !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(60, 141, 188, 0.35) !important;
}

.quantity-controls .btn-number:active {
    transform: scale(0.95) !important;
}

.quantity-controls .btn-number[data-type="minus"] {
    color: #e74c3c !important;
}

.quantity-controls .btn-number[data-type="minus"]:hover {
    background: #e74c3c !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.35) !important;
}

.quantity-controls .newProductQuantity {
    width: 60px !important;
    height: 36px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border: none !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    text-align: center !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #2c3e50 !important;
    transition: all 0.2s ease !important;
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

.quantity-controls .newProductQuantity::-webkit-outer-spin-button,
.quantity-controls .newProductQuantity::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

.quantity-controls .newProductQuantity:focus {
    outline: none !important;
    background: rgba(60, 141, 188, 0.1) !important;
    color: #3c8dbc !important;
    box-shadow: 0 0 0 3px rgba(60, 141, 188, 0.15) !important;
}

/* Precio total */
.price-display {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.price-display .newProductPrice {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #27ae60 !important;
    letter-spacing: -0.5px !important;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Tablets y pantallas medianas */
@media (max-width: 991px) {
    .newProduct {
        margin: 10px 6px !important;
        padding: 14px 16px !important;
    }
    
    .product-description-row {
        margin-bottom: 9px !important;
    }
    
    .product-description-row .product-name {
        font-size: 14px !important;
    }
    
    .quantity-controls .btn-number {
        width: 34px !important;
        height: 34px !important;
        line-height: 34px !important;
        font-size: 18px !important;
    }
    
    .quantity-controls .newProductQuantity {
        width: 55px !important;
        height: 34px !important;
        font-size: 16px !important;
    }
    
    .price-display .newProductPrice {
        font-size: 18px !important;
    }
}

/* Móviles */
@media (max-width: 768px) {
    .newProduct {
        margin: 8px 4px !important;
        padding: 12px 14px !important;
    }
    
    .product-description-row {
        margin-bottom: 8px !important;
    }
    
    .product-description-row .product-name {
        font-size: 13px !important;
    }
    
    .product-description-row .removeProduct {
        width: 28px !important;
        height: 28px !important;
        line-height: 26px !important;
        font-size: 14px !important;
    }
    
    .product-controls-row {
        gap: 12px !important;
    }
    
    .quantity-controls {
        gap: 6px !important;
        padding: 5px !important;
    }
    
    .quantity-controls .btn-number {
        width: 32px !important;
        height: 32px !important;
        line-height: 32px !important;
        font-size: 16px !important;
    }
    
    .quantity-controls .newProductQuantity {
        width: 50px !important;
        height: 32px !important;
        font-size: 15px !important;
    }
    
    .price-display .newProductPrice {
        font-size: 17px !important;
    }
}

/* Móviles pequeños */
@media (max-width: 576px) {
    .newProduct {
        padding: 10px 12px !important;
    }
    
    .product-description-row {
        margin-bottom: 7px !important;
    }
}

/* Móviles muy pequeños */
@media (max-width: 480px) {
    .newProduct {
        margin: 6px 2px !important;
        padding: 10px !important;
    }
    
    .product-description-row .product-name {
        font-size: 12px !important;
    }
    
    .quantity-controls .btn-number {
        width: 30px !important;
        height: 30px !important;
        line-height: 30px !important;
        font-size: 15px !important;
    }
    
    .quantity-controls .newProductQuantity {
        width: 45px !important;
        height: 30px !important;
        font-size: 14px !important;
        padding: 0 8px !important;
    }
    
    .price-display .newProductPrice {
        font-size: 16px !important;
    }
}

@media (max-width: 360px) {
    .newProduct {
        padding: 8px !important;
    }
    
    .product-description-row {
        margin-bottom: 6px !important;
    }
    
    .product-controls-row {
        gap: 8px !important;
    }
    
    .quantity-controls {
        gap: 5px !important;
        padding: 4px !important;
    }
}

/* ============================================
   COMPATIBILIDAD CON PRODUCTOS EXISTENTES
   ============================================ */

/* Botón remover estilo tradicional (si aún existe) */
.btn.btn-danger.removeProduct {
    width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
    border: 1px solid rgba(231, 76, 60, 0.25) !important;
    border-radius: 8px !important;
    background: rgba(231, 76, 60, 0.08) !important;
    color: #e74c3c !important;
    font-size: 16px !important;
    line-height: 28px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    opacity: 0.75 !important;
}

.btn.btn-danger.removeProduct:hover {
    opacity: 1 !important;
    background: #e74c3c !important;
    color: #ffffff !important;
    border-color: #e74c3c !important;
    transform: scale(1.15) rotate(90deg) !important;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.35) !important;
}

/* ============================================
   ESTADOS DE INTERACCIÓN
   ============================================ */

/* Estado de enfoque para accesibilidad */
.newProduct:focus-within {
    outline: 3px solid rgba(60, 141, 188, 0.25) !important;
    outline-offset: 2px !important;
}

/* Animación de entrada */
@keyframes slideInProduct {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.newProduct {
    animation: slideInProduct 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ============================================
   FIN DEL DISEÑO MODERNO
   ============================================ */
