/* Overlay del modal */
#ndw-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: ndwFadeIn 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

@keyframes ndwFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal */
#ndw-modal {
    background: #fff;
    border-radius: 8px;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: ndwSlideIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes ndwSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Header del modal */
.ndw-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f8f8f8;
    flex-shrink: 0;
}

.ndw-modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #d9534f;
}

.ndw-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.ndw-modal-close:hover {
    color: #333;
}

/* Contenido del modal */
.ndw-modal-content {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.ndw-error-group {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.ndw-error-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.ndw-error-group h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 20px;
}

.ndw-error-message {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.ndw-products-list h4 {
    margin-bottom: 15px;
    color: #555;
    font-size: 16px;
}

/* Items de producto */
.ndw-product-item {
    display: grid;
    grid-template-columns: 1fr 100px;
    gap: 15px;
    align-items: center;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 10px;
}

.ndw-product-info {
    min-width: 0;
}

.ndw-product-info a {
    color: #0073aa;
    text-decoration: none;
    display: block;
    margin-bottom: 5px;
    word-wrap: break-word;
}

.ndw-product-info a:hover {
    text-decoration: underline;
}

.ndw-product-price {
    color: #666;
    font-size: 14px;
    display: block;
}

.ndw-product-actions {
    display: flex;
    justify-content: center;
    align-items: center;
}

.ndw-qty-input {
    width: 80px !important;
    padding: 10px !important;
    border: 1px solid #ddd !important;
    border-radius: 25px !important;
    text-align: center !important;
    font-size: 16px !important;
    box-sizing: border-box !important;
}

/* Acciones del grupo */
.ndw-group-actions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #ddd;
    text-align: right;
}

.ndw-update-cart-group {
    padding: 12px 24px;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
}

.ndw-update-cart-group:hover {
    background-color: #005a87;
}

.ndw-update-cart-group:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    #ndw-modal {
        width: 95%;
        max-height: 90vh;
    }

    .ndw-product-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ndw-product-actions {
        justify-content: flex-start;
    }
}