/* „Добави нов адрес“ на телефон (01.11.2026, по забележка на собственика „много малко пространство, картата да се вижда“) — общ за касата
   (checkout.php) и профила (menu.php), зарежда се СЛЕД checkout.css / profile-ui.css. На телефон прозорецът е на цял екран: горе заглавие,
   в средата превъртане (адрес, подсказка, голяма карта, бележки), долу винаги видим „Запази адреса“. Компютърът не е пипан. */
@media (max-width: 600px) {
    #add-address-modal .modal-content, #add-address-modal .address-modal-content {
        position: fixed !important; inset: 0 !important; top: 0 !important; left: 0 !important; transform: none !important;
        width: 100% !important; max-width: none !important; height: 100vh; height: 100dvh; max-height: none !important;
        margin: 0 !important; border-radius: 0 !important; display: flex !important; flex-direction: column; overflow: hidden !important;
        animation: addrSheetUp .22s ease-out;
    }
    #add-address-modal .modal-header { flex: none; padding: 12px 16px !important; padding-top: calc(12px + env(safe-area-inset-top, 0px)) !important; }
    #add-address-modal .modal-header h3 { font-size: 17px !important; }
    #add-address-modal .modal-close { width: 40px; height: 40px; }
    #add-address-modal .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto !important; -webkit-overflow-scrolling: touch; padding: 14px 16px 0 !important; }
    #add-address-form { display: flex; flex-direction: column; gap: 14px; min-height: 100%; }
    #add-address-form .form-group { margin: 0 !important; }
    /* адресът: поле + подсказка + голяма карта */
    #add-address-form .form-group:has(#new-address-map) { display: flex; flex-direction: column; gap: 8px; }
    #add-address-form .form-group:has(#new-address-map) > label { order: 1; }
    #add-address-form .address-input-container { order: 2; }
    #add-address-form .addr-map-hint { order: 3; margin: 0 !important; font-size: 13px !important; }
    #add-address-form .address-map-container { order: 4; }
    #add-address-form .addr-point-chip { order: 5; margin-top: 0 !important; }
    #add-address-form .map-toggle-container { display: none !important; }   /* на телефон картата е винаги видима */
    #add-address-modal .address-map-container, #add-address-modal .address-map-container.hidden {
        display: block !important; height: clamp(280px, 50vh, 480px) !important; height: clamp(280px, 50dvh, 480px) !important;
        margin-top: 0 !important; border-radius: 10px !important;
    }
    #add-address-modal .address-map { border-radius: 10px !important; }
    /* бутоните върху картата: без +/− (увеличава се с два пръста), по-малки и по-прозрачни */
    #add-address-modal #zoom-in, #add-address-modal #zoom-out { display: none !important; }
    #add-address-modal .address-map-controls { top: 10px !important; right: 10px !important; gap: 8px !important; }
    #add-address-modal .map-control-btn { width: 40px !important; height: 40px !important; min-width: 40px; min-height: 40px; border-radius: 10px !important; }
    #add-address-modal textarea#new-address-notes { min-height: 64px; }
    /* „Запази адреса“ винаги долу */
    #add-address-modal .form-actions {
        position: sticky !important; bottom: 0; z-index: 5; margin: auto -16px 0 !important; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
        background: var(--pf-bg, #1a1a1a); border-top: 1px solid rgba(127,127,127,.22);
    }
    html[data-theme="light"] #add-address-modal .form-actions { background: var(--pf-bg, #fff); }
    #add-address-modal .form-actions .btn-primary { min-height: 50px; border-radius: 10px !important; font-size: 16px; width: 100%; }
}
@keyframes addrSheetUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #add-address-modal .modal-content { animation: none !important; } }
