/* ============================================================================
   MODALES - ESTILOS RESPONSIVE
   ============================================================================ */

/* 🔥 TABLETS Y MÓVILES (max-width: 768px) */
@media (max-width: 768px) {
    .modal {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: 2rem;
    }
    
    .modal-content,
    .address-modal,
    .checkout-modal,
    .payment-modal,
    .order-modal {
        max-width: 100%;
        width: 95%;
        margin: 0 auto;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-header h2,
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    .cart-content {
        max-width: 100%;
        width: 95%;
        max-height: 90vh;
        padding: 1.5rem;
    }

    /* Formulario de dirección responsive */
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .address-actions {
        margin-left: 0;
    }
    
    .address-details {
        margin-left: 0;
    }
    
    .address-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .payment-method-btn {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .payment-info {
        text-align: center;
    }

    /* Toast responsive */
    .toast-container {
        left: 10px;
        right: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* 🔥 DISPOSITIVOS PEQUEÑOS (max-width: 480px) */
@media (max-width: 480px) {
    .modal {
        padding: 0.25rem;
    }
    
    .modal-content {
        border-radius: 8px;
    }
    
    .modal-header {
        padding: 0.75rem;
    }
    
    .modal-body {
        padding: 1rem;
    }

    /* Cart items responsive */
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .cart-item-actions {
        width: 100%;
        justify-content: space-between;
    }

    /* Checkout items responsive */
    .order-items li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .checkout-item-info {
        width: 100%;
    }
    
    .checkout-item-price {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

/* 🔥 MÓVILES MUY PEQUEÑOS (max-width: 360px) */
@media (max-width: 360px) {
    .modal-header h2,
    .modal-header h3 {
        font-size: 1rem;
    }
    
    .modal-body {
        padding: 0.75rem;
    }
    
    .address-card {
        padding: 1rem;
    }
    
    .payment-method-btn {
        padding: 1rem;
    }
    
    .payment-icon {
        font-size: 2rem;
        min-width: 40px;
    }
}

/* 🔥 ORIENTACIÓN HORIZONTAL EN MÓVILES */
@media (max-height: 500px) and (orientation: landscape) {
    .modal {
        align-items: flex-start;
        padding-top: 1rem;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-body {
        max-height: 60vh;
    }
}

/* 🔥 iPhone X+ SAFE AREA */
@supports (padding: max(0px)) {
    .modal {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}