/**
 * Product Individual Modal CSS - Estilos para el Modal Individual de Productos
 * Estilos modernos y responsive para el modal avanzado de productos individuales
 * 
 * @version 2.0.0
 * @author Development Team
 */

/* Variables CSS específicas para el modal individual */
:root {
    --product-modal-bg: rgba(0, 0, 0, 0.8);
    --product-modal-content-bg: #ffffff;
    --product-modal-border-radius: 12px;
    --product-modal-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    --product-modal-z-index: 10000;
    --product-modal-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --product-modal-primary: #007cba;
    --product-modal-secondary: var(--primary-hover);
    --product-modal-success: #28a745;
    --product-modal-danger: #dc3545;
    --product-modal-warning: #ffc107;
    --product-modal-info: #17a2b8;
}

/* Modal principal */
.product-individual-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.8) !important;
    z-index: 999999 !important;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.product-individual-modal.show {
    display: flex !important;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Contenido del modal */
.product-individual-modal-content {
    background: var(--product-modal-content-bg);
    border-radius: var(--product-modal-border-radius);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--product-modal-shadow);
    display: flex;
    flex-direction: column;
    transform: translateY(-20px);
    transition: var(--product-modal-transition);
}

.product-individual-modal.show .product-individual-modal-content {
    transform: translateY(0);
}

/* Header del modal */
.product-modal-header {
    background: linear-gradient(135deg, var(--product-modal-primary) 0%, var(--product-modal-secondary) 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--product-modal-border-radius) var(--product-modal-border-radius) 0 0;
}

.product-modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-modal-header h3 i {
    font-size: 1.2rem;
}

.product-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.product-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Body del modal */
.product-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    max-height: 60vh;
}

/* Sección de productos */
.products-section {
    margin-bottom: 20px;
}

.products-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.products-header h5 {
    margin: 0;
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.products-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Item de producto */
.product-item {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.product-item.in-quote {
    border-color: var(--product-modal-success);
    background: #f8fff9;
}

.product-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.1);
}

.product-content {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

/* Imagen del producto */
.product-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e9ecef;
    background: white;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

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

/* Detalles del producto */
.product-details {
    flex: 1;
    min-width: 0;
}

.product-details h5 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--base-ultra-dark);
    line-height: 1.3;
}

.product-attributes {
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.attribute-tag {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    color: #666;
}

.product-info .sku {
    font-weight: 500;
}

.product-info .price {
    font-weight: 600;
    color: var(--base-ultra-dark);
    font-size: 0.9rem;
}

/* Acciones del producto */
.product-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 120px;
}

/* Controles de cantidad */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 2px;
}

/* Botones de cantidad específicos del modal individual - heredan de .btn-base en style.css global */
.quantity-btn {
    background: var(--primary);
    color: white;
}

.quantity-btn:hover {
    background: var(--product-modal-secondary);
}

.quantity-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.quantity-input {
    border: none;
    max-width: 50px;	
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--base-ultra-dark);
    background: transparent;
}

.quantity-input:focus {
    outline: none;
}

/* Subtotal */
.subtotal {
    text-align: center;
    padding: 8px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.subtotal strong {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 4px;
}

.subtotal .price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--base-ultra-dark);
    margin: 0;
}

/* Botones de acción */
.action-buttons {
    display: flex;
    gap: 5px;
}

/* Botones de agregar/eliminar específicos del modal individual - heredan de .btn-base en style.css global */
.btn-add, .btn-remove {
    flex: 1;
}

.btn-add {
    background: var(--product-modal-success);
    color: white;
}

.btn-add:hover {
    background: #218838;
}

.btn-remove {
    background: var(--product-modal-danger);
    color: white;
}

.btn-remove:hover {
    background: #c82333;
}

/* Footer del modal */
.product-modal-footer {
    background: #f8f9fa;
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 var(--product-modal-border-radius) var(--product-modal-border-radius);
}

.total-section {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;

}

.total-section h3 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--base-ultra-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.total-section span {
    font-weight: 700;
    color: var(--base-ultra-dark);
}

/* Botones del footer */
.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Estilos específicos del modal de producto - heredan de .btn-base en style.css global */

/* Botones principales específicos del modal */
.btn-cancel {
    background: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background: #5a6268;
}

.btn-secondary {
    background: var(--product-modal-info);
    color: white;
}

.btn-secondary:hover {
    background: #138496;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--product-modal-secondary);
}

/* Loading overlay */
.product-modal-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10001;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.loading-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.loading-content i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.loading-content p {
    margin: 0;
    font-size: 1rem;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-individual-modal {
        padding: 10px;
    }
    

    .variation-actions, .global-quote-item-actions{
        display: flex;
         flex-direction: row;
          flex-wrap: wrap;
    }

    
    .product-individual-modal-content {
        max-width: 700px;
        max-height: 95vh;
    }
    
    .product-modal-header {
        padding: 15px 20px;
    }
    
    .product-modal-header h3 {
        font-size: 1.2rem;
    }
    
    .product-modal-body {
        padding: 20px;
    }
    
    .product-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .product-image {
        width: 60px;
        height: 60px;
        align-self: center;
    }
    
    .product-actions {
        min-width: auto;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .quantity-controls {
        order: 2;
        margin: auto;
    }
    
    .subtotal {
        flex: 1;
        display: flex;
        justify-content: center;
    }
    
    .action-buttons {
        order: 3;
        flex-direction: column;
        gap: 5px;
    }
    
    /* Botones responsive específicos del modal individual */
    .btn-add, .btn-remove {
        order: 3;
    }
    
    .product-modal-footer {
        padding: 15px 20px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
/* Estilos específicos del modal de producto - heredan de .btn-base en style.css global */
}

@media (max-width: 480px) {
    .product-modal-header {
        padding: 12px 15px;
    }
    
    .product-modal-header h3 {
        font-size: 1.1rem;
    }
    
    .product-modal-body {
        padding: 15px;
    }
    
    .product-item {
        padding: 12px;
    }
    
    .product-details h5 {
        font-size: 0.9rem;
    }
    
    .product-info {
        font-size: 0.8rem;
    }
    
    .product-modal-footer {
        padding: 12px 15px;
    }
    
    .total-section {
        padding: 12px;
    }
    
    .total-section h3 {
        font-size: 1.1rem;
    }
}

/* Animaciones adicionales */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-item {
    animation: slideInUp 0.3s ease-out;
}

.product-item:nth-child(1) { animation-delay: 0.1s; }
.product-item:nth-child(2) { animation-delay: 0.2s; }
.product-item:nth-child(3) { animation-delay: 0.3s; }
.product-item:nth-child(4) { animation-delay: 0.4s; }
.product-item:nth-child(5) { animation-delay: 0.5s; }

/* Estados de hover mejorados */
.product-item:hover .product-image {
    border-color: var(--primary);
}

.product-item:hover .product-details h5 {
    color: var(--primary);
}

/* Estilos específicos del modal de producto - heredan de .btn-base en style.css global */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Spinner específico para botones */
.fa-spinner.fa-spin {
    animation: spin 1s linear infinite;
}

/* Estilos específicos del modal de producto - heredan de .btn-base en style.css global */

/* Scrollbar personalizado */
.product-modal-body::-webkit-scrollbar {
    width: 6px;
}

.product-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.product-modal-body::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.product-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--product-modal-secondary);
}

/* Mensajes de estado */
.no-products {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.no-products i {
    font-size: 2rem;
    color: #ccc;
    margin-bottom: 10px;
    display: block;
}

