/**
 * Estilos para Livriz Multiple Addresses
 */

/* Contenedor principal */
.lma-address-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Formulario */
.lma-address-form {
    margin-top: 20px;
}

.lma-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.lma-form-column {
    flex: 1;
}

.lma-form-column label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.lma-form-column input,
.lma-form-column select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.lma-form-column input:focus,
.lma-form-column select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.2);
}

.lma-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.lma-checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Botones de acción */
.lma-form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.lma-form-actions .button {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lma-form-actions .button-primary {
    background: #0073aa;
    color: #fff;
}

.lma-form-actions .button-primary:hover {
    background: #005a87;
}

.lma-form-actions .button-secondary {
    background: #f7f7f7;
    color: #333;
    border: 1px solid #ddd;
}

.lma-form-actions .button-secondary:hover {
    background: #eee;
}

/* Mensajes */
.lma-form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    font-weight: 500;
}

.lma-form-message.lma-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.lma-form-message.lma-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Lista de direcciones */
.lma-addresses-list {
    margin-top: 40px;
}

.lma-addresses-list h3 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.lma-address-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    margin-bottom: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #0073aa;
    transition: all 0.3s ease;
}

.lma-address-item:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.lma-address-content h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.lma-address-content p {
    margin: 5px 0;
    color: #666;
    line-height: 1.4;
}

.lma-default-badge {
    display: inline-block;
    background: #28a745;
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 10px;
}

.lma-address-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 120px;
}

.lma-address-actions .button {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.lma-edit-btn {
    background: #0073aa;
    color: #fff;
}

.lma-edit-btn:hover {
    background: #005a87;
}

.lma-default-btn {
    background: #28a745;
    color: #fff;
}

.lma-default-btn:hover {
    background: #1e7e34;
}

.lma-delete-btn {
    background: #dc3545;
    color: #fff;
}

.lma-delete-btn:hover {
    background: #c82333;
}

/* Sin direcciones */
.lma-no-addresses {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.lma-no-addresses p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* Mi Cuenta */
.lma-my-account-content {
    max-width: 1000px;
    margin: 0 auto;
}

.lma-my-account-content h2 {
    color: #333;
    margin-bottom: 10px;
}

.lma-my-account-content > p {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .lma-form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .lma-address-item {
        flex-direction: column;
        gap: 15px;
    }
    
    .lma-address-actions {
        flex-direction: row;
        justify-content: center;
        min-width: auto;
    }
    
    .lma-form-actions {
        flex-direction: column;
    }
    
    .lma-form-actions .button {
        text-align: center;
    }
}

/* Estados de carga */
.lma-loading {
    opacity: 0.6;
    pointer-events: none;
}

.lma-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Estilos para Checkout */
.lma-checkout-address-selector {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.lma-checkout-address-selector h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
}

.lma-address-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lma-address-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lma-address-option:hover {
    border-color: #0073aa;
    background: #f8f9fa;
}

.lma-address-option input[type="radio"] {
    margin: 0;
}

.lma-address-option label {
    margin: 0;
    cursor: pointer;
    flex: 1;
}

.lma-saved-addresses {
    border-top: 1px solid #dee2e6;
    padding-top: 15px;
    margin-top: 15px;
}

.lma-saved-addresses p {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
}

/* Opción para guardar dirección */
.lma-save-address-option {
    margin: 20px 0;
    padding: 15px;
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 4px;
}

.lma-save-address-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
}

.lma-save-address-option input[type="checkbox"] {
    margin: 0;
}

/* Formulario para guardar dirección */
.lma-save-address-form {
    margin: 15px 0;
    padding: 15px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.lma-save-address-form h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.lma-save-address-form p {
    margin: 0 0 15px 0;
    color: #666;
}

.lma-save-form-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.lma-save-form-row input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.lma-save-form-row .button {
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.lma-save-form-row .button:hover {
    background: #005a87;
}

/* Mensajes de guardado */
.lma-save-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    font-weight: 500;
}

.lma-save-message.lma-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.lma-save-message.lma-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Campos deshabilitados */
.lma-fields-disabled {
    opacity: 0.6;
}

.lma-fields-disabled input,
.lma-fields-disabled select {
    background: #f5f5f5;
    cursor: not-allowed;
}

/* Mensajes en Mi Cuenta */
.lma-message {
    margin: 15px 0;
    padding: 12px 15px;
    border-radius: 4px;
    font-weight: 500;
}

.lma-message.lma-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.lma-message.lma-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Errores de campo */
.lma-field-error {
    border-color: #dc3545 !important;
}

.lma-field-error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    font-weight: 500;
}

/* ===== ESTILOS PARA CHECKOUT ===== */

.lma-checkout-address-selector-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.lma-checkout-address-selector-container h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.lma-address-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.lma-address-option {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lma-address-option input[type="radio"] {
    margin: 0;
}

.lma-address-option label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    color: #333;
}

.lma-saved-addresses {
    border-top: 1px solid #dee2e6;
    padding-top: 15px;
    margin-top: 15px;
}

.lma-saved-addresses p {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
}

/* Responsive para checkout */
@media (max-width: 768px) {
    .lma-checkout-address-selector-container {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .lma-checkout-address-selector-container h3 {
        font-size: 16px;
    }
}

/* ===== ESTILOS PARA BOTONES DE SELECCIÓN EN CHECKOUT ===== */

.lma-address-selector-billing,
.lma-address-selector-shipping {
    margin-bottom: 15px;
}

.lma-select-address-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lma-select-address-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.lma-select-address-btn:active {
    transform: translateY(0);
}

/* ===== ESTILOS PARA MODAL DE SELECCIÓN DE DIRECCIONES ===== */

.lma-addresses-list-modal {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px 0;
}

.lma-modal-address-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lma-modal-address-option:hover {
    background: #e9ecef;
    border-color: #0073aa;
    transform: translateY(-1px);
}

.lma-modal-address-option input[type="radio"] {
    margin: 0;
    flex-shrink: 0;
}

.lma-modal-address-option label {
    margin: 0;
    cursor: pointer;
    flex: 1;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

.lma-modal-address-option input[type="radio"]:checked + label {
    color: #0073aa;
    font-weight: 600;
}

.lma-modal-address-option:has(input[type="radio"]:checked) {
    background: #e7f3ff;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* Responsive para modal de direcciones */
@media (max-width: 768px) {
    .lma-modal-address-option {
        padding: 10px;
        gap: 10px;
    }
    
    .lma-modal-address-option label {
        font-size: 14px;
    }
    
    .lma-addresses-list-modal {
        max-height: 250px;
    }
}

/* ===== ESTILOS PARA EL MODAL ===== */

.lma-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lma-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.lma-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
}

.lma-modal-show {
    transform: scale(1) !important;
    opacity: 1 !important;
}

.lma-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.lma-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.lma-modal-close {
    position: absolute;
    top: 1px;
    right: 1px;
}

/* .lma-modal-close {
    background: none !important;
    border: none !important;
    font-size: 24px !important;
    color: #666 !important;
    cursor: pointer !important;
    padding: 0 !important;
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
} */

.lma-modal-close:hover {
    background: #e9ecef;
    color: #333;
}

.lma-modal-body {
    padding: 25px;
}

.lma-modal-body p {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    line-height: 1.5;
}

.lma-modal-body p:last-child {
    margin-bottom: 0;
}

.lma-address-preview {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
    margin-top: 15px;
    font-size: 14px;
    color: #666;
}

.lma-modal-footer {
    display: flex;
    gap: 15px;
    padding: 20px 25px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    justify-content: flex-end;
}

.lma-modal-footer .button {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.lma-modal-cancel {
    background: #6c757d;
    color: #fff;
}

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

.lma-modal-accept {
    background: #0073aa;
    color: #fff;
}

.lma-modal-accept:hover {
    background: #005a87;
}

/* Responsive para el modal */
@media (max-width: 768px) {
    .lma-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .lma-modal-header,
    .lma-modal-body,
    .lma-modal-footer {
        padding: 15px 20px;
    }
    
    .lma-modal-footer {
        flex-direction: column;
    }
    
    .lma-modal-footer .button {
        width: 100%;
        text-align: center;
    }
}
