/* assets/css/delivery-location-picker.css */
/* Styles for Automatic Location Prompt, Dedicated Top Delivery Bar & Interactive Map Modal */

/* 1. Dedicated Top Delivery & Location Bar */
.ph-top-delivery-bar {
    background: linear-gradient(90deg, #1e293b 0%, #0f172a 100%);
    color: #f1f5f9;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12px;
    line-height: 1.4;
    width: 100%;
}
.ph-top-bar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 6px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.ph-top-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.ph-top-pill-express {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.ph-top-msg {
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 400;
}
.ph-top-bar-right {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    border: 1px solid rgba(255, 255, 255, 0.14);
    white-space: nowrap;
    user-select: none;
    flex-shrink: 0;
}
.ph-top-bar-right:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
}
.ph-top-bar-right .ph-pin {
    color: #ef4444;
    font-size: 12px;
}
.ph-top-del-text {
    color: #94a3b8;
    font-size: 11.5px;
}
.ph-top-city {
    color: #ffffff;
    font-weight: 700;
    font-size: 12px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ph-top-badge-30m {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: #10b981;
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    letter-spacing: 0.2px;
    line-height: 1.2;
}
.ph-top-change {
    color: #38bdf8;
    font-size: 11px;
    font-weight: 600;
    text-decoration: underline;
    margin-left: 2px;
}

/* Mobile Top Bar Responsiveness */
@media (max-width: 768px) {
    .ph-top-bar-container {
        padding: 5px 12px;
        justify-content: center;
    }
    .ph-top-bar-left {
        display: none;
    }
    .ph-top-bar-right {
        background: transparent;
        border: none;
        padding: 2px 0;
        font-size: 11.5px;
    }
    .ph-top-city {
        max-width: 150px;
    }
}

/* Mobile Sidebar Location Card */
.mob-nav-loc-card {
    display: none;
    list-style: none;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}
@media (max-width: 1200px) {
    .mob-nav-loc-card {
        display: block !important;
    }
}
.mob-loc-card-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}
.mob-loc-card-inner:hover {
    background: #f1f5f9;
}

/* 2. Floating Smart Auto-Prompt (Bottom Corner) */
.ph-auto-location-prompt {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 99998;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
    padding: 16px 18px;
    max-width: 380px;
    width: calc(100vw - 32px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: promptSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes promptSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.ph-prompt-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.ph-prompt-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #d97706;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.ph-prompt-text {
    flex: 1;
}
.ph-prompt-text strong {
    display: block;
    font-size: 14px;
    color: #0f172a;
    margin-bottom: 2px;
}
.ph-prompt-text p {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}
.ph-prompt-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    line-height: 1;
    transition: color 0.15s ease;
}
.ph-prompt-close:hover {
    color: #334155;
    background: #f1f5f9;
}
.ph-prompt-actions {
    display: flex;
    gap: 8px;
}
.btn-prompt-gps {
    flex: 1;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
    transition: all 0.2s ease;
}
.btn-prompt-gps:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
}
.btn-prompt-map {
    flex: 1;
    background: #f1f5f9;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-prompt-map:hover {
    background: #e2e8f0;
}

/* 3. Delivery Map Modal */
.ph-map-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.ph-map-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.ph-map-modal {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 680px;
    width: 100%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.ph-map-modal-overlay.active .ph-map-modal {
    transform: translateY(0) scale(1);
}

.ph-map-modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ph-map-modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ph-map-modal-header h3 i {
    color: #c0392b;
}
.ph-map-modal-close {
    background: #f1f5f9;
    border: none;
    color: #64748b;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.ph-map-modal-close:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Search & Voice Search Bar */
.ph-map-search-bar {
    padding: 10px 18px 8px 18px;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
}
.ph-search-input-box {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 3px 8px 3px 12px;
    transition: all 0.2s ease;
}
.ph-search-input-box:focus-within {
    background: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}
.ph-search-icon {
    color: #94a3b8;
    font-size: 14px;
    margin-right: 8px;
    flex-shrink: 0;
}
#phMapSearchInput {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13.5px;
    color: #1e293b;
    outline: none;
    padding: 7px 0;
    font-family: inherit;
    min-width: 0;
}
#phMapSearchInput::placeholder {
    color: #94a3b8;
}
.ph-clear-search-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}
.ph-clear-search-btn:hover {
    color: #334155;
}
.ph-voice-search-btn {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 1px solid #fca5a5;
    color: #dc2626;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.ph-voice-search-btn:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    transform: scale(1.05);
}
.ph-voice-search-btn.listening {
    background: #ef4444 !important;
    color: #ffffff !important;
    border-color: #b91c1c !important;
    animation: phVoicePulse 1.2s infinite;
}
@keyframes phVoicePulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.ph-voice-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 5px 10px;
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: 8px;
    font-size: 12px;
    color: #b91c1c;
    font-weight: 600;
}
.ph-voice-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    animation: phPulseDot 0.8s infinite alternate;
}
@keyframes phPulseDot {
    from { opacity: 0.3; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1.3); }
}
.ph-map-search-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 18px;
    right: 18px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    max-height: 220px;
    overflow-y: auto;
    z-index: 10000;
    padding: 4px 0;
}
.ph-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 12.5px;
    color: #334155;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f8fafc;
}
.ph-search-item:last-child {
    border-bottom: none;
}
.ph-search-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}
.ph-search-item i {
    color: #ef4444;
    font-size: 14px;
    flex-shrink: 0;
}
.ph-search-item-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ph-search-item strong {
    font-size: 12.5px;
    color: #0f172a;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}
.ph-search-item small {
    font-size: 11px;
    color: #64748b;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

/* Quick Locality Jump Bar */
.ph-map-quick-bar {
    padding: 8px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}
.ph-map-quick-bar::-webkit-scrollbar {
    display: none;
}
.ph-quick-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}
.ph-quick-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}
.ph-quick-btn.active-store {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}
.ph-quick-btn.btn-gps-map {
    background: #ecfdf5;
    border-color: #10b981;
    color: #065f46;
}

/* Map Canvas Container */
.ph-map-canvas-wrapper {
    position: relative;
    width: 100%;
    height: 340px;
    background: #e2e8f0;
}
#deliveryMapCanvas {
    width: 100%;
    height: 100%;
}
.ph-map-legend-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    border-radius: 8px;
    padding: 6px 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-size: 11px;
    color: #334155;
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: none;
}
.ph-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}
.ph-legend-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.35);
    border: 2px solid #10b981;
}

/* Modal Live Info Panel */
.ph-map-info-panel {
    padding: 14px 20px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ph-status-card {
    padding: 10px 14px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all 0.2s ease;
}
.ph-status-card.express-active {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}
.ph-status-card.standard-active {
    background: #fffbeb;
    border: 1px solid #fde68a;
}
.ph-status-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.ph-status-card.express-active .ph-status-icon-wrap {
    background: #10b981;
    color: #ffffff;
}
.ph-status-card.standard-active .ph-status-icon-wrap {
    background: #f59e0b;
    color: #ffffff;
}
.ph-status-text {
    flex: 1;
}
.ph-status-text strong {
    display: block;
    font-size: 13px;
    color: #0f172a;
}
.ph-status-card.express-active .ph-status-text strong {
    color: #065f46;
}
.ph-status-card.standard-active .ph-status-text strong {
    color: #92400e;
}
.ph-status-text small {
    font-size: 11px;
    color: #64748b;
    display: block;
    margin-top: 1px;
}
.ph-distance-badge {
    text-align: right;
    flex-shrink: 0;
}
.ph-dist-num {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}
.ph-dist-unit {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
    color: #64748b;
}

/* Modal Actions */
.ph-map-modal-actions {
    display: flex;
    gap: 10px;
}
.btn-map-cancel {
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-map-cancel:hover {
    background: #e2e8f0;
}
.btn-map-confirm {
    flex: 1;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
}
.btn-map-confirm:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* Pick on Map Trigger Buttons on Forms */
.btn-select-map-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1.5px solid #0284c7;
    color: #0284c7;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-select-map-trigger:hover {
    background: #f0f9ff;
    border-color: #0369a1;
    color: #0369a1;
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .ph-auto-location-prompt {
        left: 16px;
        right: 16px;
        bottom: 16px;
        width: auto;
    }
    .ph-map-modal {
        max-height: 96vh;
    }
    .ph-map-canvas-wrapper {
        height: 270px;
    }
    .header-location-chip {
        display: none; /* Hide in tiny mobile header to keep brand space */
    }
}
