/* Customer Information Modal Styles */
.customer-info-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.customer-info-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.customer-info-modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.delivery-notice {
    padding: 20px;
    background: #f8f9fa;
}

.notice-box {
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid;
    background: white;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.notice-box.warning {
    border-color: #ff9800;
    background: #fff3e0;
    color: #e65100;
}

.notice-box i {
    font-size: 1.1rem;
    margin-top: 2px;
}

.notice-box strong {
    display: block;
    margin-bottom: 5px;
}

#customer-info-form {
    padding: 0 20px 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.form-group label i {
    margin-right: 8px;
    color: #25D366;
    width: 16px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    color: #666 !important;
    font-size: 12px !important;
    margin-top: 5px !important;
    display: block !important;
    line-height: 1.3;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 25px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    color: #555;
    position: relative;
    padding-left: 35px;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    left: 0;
    top: 2px;
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-color: #fff;
    border: 2px solid #25D366;
    border-radius: 4px;
    transition: all 0.2s;
}

.checkbox-label input[type="checkbox"]:checked {
    background-color: #25D366;
    border-color: #25D366;
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 4px;
    color: white;
    font-size: 16px;
    font-weight: bold;
}

/* Mejorar el tap target en móvil */
@media (max-width: 768px) {
    .checkbox-label {
        padding-left: 40px;
        font-size: 13px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .checkbox-label input[type="checkbox"] {
        width: 24px;
        height: 24px;
        top: 10px;
    }
    
    .checkbox-label input[type="checkbox"]:checked::after {
        left: 5px;
        top: 0;
        font-size: 18px;
    }
}

.form-actions {
    padding: 20px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    text-decoration: none;
    min-height: 44px;
    box-sizing: border-box;
}

.btn i {
    font-size: 1rem;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-primary {
    background: #25D366;
    color: white;
}

.btn-primary:hover {
    background: #20b358;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 211, 102, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Form validation styles */
.form-group input:invalid,
.form-group textarea:invalid {
    border-color: #dc3545;
}

.form-group input:valid,
.form-group textarea:valid {
    border-color: #28a745;
}

/* Loading state */
.btn-primary.loading {
    position: relative;
    color: transparent;
}

.btn-primary.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .customer-info-modal-content {
        margin: 10px;
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .delivery-notice,
    #customer-info-form {
        padding: 15px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .notice-box {
        padding: 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .customer-info-modal-content {
        margin: 5px;
        width: calc(100% - 10px);
        max-height: calc(100vh - 10px);
        border-radius: 8px;
    }
    
    .modal-header {
        border-radius: 8px 8px 0 0;
    }
    
    .form-actions {
        border-radius: 0 0 8px 8px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .customer-info-modal {
        background-color: rgba(0, 0, 0, 0.8);
    }
    
    .form-group input,
    .form-group textarea {
        border-width: 3px;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .customer-info-modal-content {
        animation: none;
    }
    
    .btn {
        transition: none;
    }
    
    .btn:hover {
        transform: none;
    }
}

/* ========================================
   PAYMENT & DELIVERY SYSTEM STYLES
   ======================================== */

/* Sección de Pago y Entrega */
.payment-delivery-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Select de Método de Pago */
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
    appearance: none;
}

.form-group select:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.form-group select:invalid {
    border-color: #dc3545;
}

/* Opciones de Entrega */
.delivery-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    position: relative;
}

.radio-option:hover {
    border-color: #25D366;
    background: #f8fff9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.1);
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    margin: 0;
    z-index: 1;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.2s;
    background: #fff;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: #25D366;
    background: #25D366;
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.radio-option input[type="radio"]:checked ~ .option-content strong {
    color: #25D366;
}

.option-content {
    flex-grow: 1;
    pointer-events: none;
}

.option-content strong {
    display: block;
    color: #333;
    font-size: 14px;
    margin-bottom: 4px;
    transition: color 0.2s;
}

.option-content small {
    color: #666;
    font-size: 12px;
    line-height: 1.3;
}

/* Aviso de Costo de Domicilio */
.delivery-notice {
    margin-top: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.delivery-notice.hidden {
    display: none;
}

.notice-box.info {
    border-color: #2196F3;
    background: linear-gradient(145deg, #e3f2fd, #f0f9ff);
    color: #1565C0;
}

.notice-content {
    flex-grow: 1;
}

.notice-content strong {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

.notice-content p {
    margin: 6px 0;
    font-size: 13px;
    line-height: 1.4;
}

/* Animaciones */
@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 200px;
        transform: translateY(0);
    }
}

/* Responsive Design para Payment & Delivery */
@media (max-width: 768px) {
    .payment-delivery-section {
        margin-top: 15px;
        padding-top: 15px;
    }
    
    .radio-option {
        padding: 12px;
        gap: 10px;
        min-height: 60px; /* Mejor área de toque */
    }
    
    .radio-custom {
        width: 22px;
        height: 22px;
        margin-top: 4px;
    }
    
    .option-content strong {
        font-size: 13px;
    }
    
    .option-content small {
        font-size: 11px;
    }
    
    .notice-box {
        padding: 12px;
        gap: 10px;
    }
    
    .notice-content strong {
        font-size: 13px;
    }
    
    .notice-content p {
        font-size: 12px;
    }
    
    .form-group select {
        padding: 14px 12px;
        background-position: right 10px center;
    }
}

@media (max-width: 480px) {
    .delivery-options {
        gap: 10px;
    }
    
    .radio-option {
        padding: 15px 12px;
        min-height: 65px; /* Área de toque más grande en móviles pequeños */
    }
    
    .radio-custom {
        width: 24px;
        height: 24px;
    }
    
    .radio-option input[type="radio"]:checked + .radio-custom::after {
        width: 10px;
        height: 10px;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    .radio-option,
    .delivery-notice,
    .radio-custom {
        transition: none;
    }
    
    .radio-option:hover {
        transform: none;
    }
    
    @keyframes slideDown {
        from { opacity: 0; }
        to { opacity: 1; }
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .radio-option {
        border-width: 3px;
    }
    
    .radio-custom {
        border-width: 3px;
    }
    
    .notice-box.info {
        border-left-width: 6px;
        background: #e3f2fd;
    }
    
    .form-group select {
        border-width: 3px;
    }
}

/* Focus States para Accesibilidad */
.radio-option:focus-within {
    outline: 2px solid #25D366;
    outline-offset: 2px;
}

.form-group select:focus-visible {
    outline: 2px solid #25D366;
    outline-offset: 2px;
}

/* Loading State para Select */
.form-group select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

/* Error States */
.radio-option.error {
    border-color: #dc3545 !important;
    background: #fff5f5;
}

.form-group select.error {
    border-color: #dc3545 !important;
}