/* ===================================
   CSS Variables for Design System
   =================================== */
:root {
    /* Color Palette */
    --aw-primary-color: #ff7f00;
    --aw-primary-hover: #f57a00;
    --aw-primary-dark: #e56f00;
    --aw-secondary-color: #4a5568;
    --aw-success-color: #48bb78;
    --aw-error-color: #f56565;
    --aw-error-dark: #e53e3e;
    --aw-warning-color: #ed8936;
    --aw-info-color: #4299e1;

    /* Neutral Colors */
    --aw-text-primary: #2d3748;
    --aw-text-secondary: #718096;
    --aw-text-muted: #a0aec0;
    --aw-bg-primary: #ffffff;
    --aw-bg-secondary: #f7fafc;
    --aw-bg-overlay: rgba(0, 0, 0, 0.5);
    --aw-border-color: #e2e8f0;
    --aw-border-focus: #4299e1;

    /* Spacing */
    --aw-spacing-xs: 0.25rem;
    --aw-spacing-sm: 0.5rem;
    --aw-spacing-md: 1rem;
    --aw-spacing-lg: 1.5rem;
    --aw-spacing-xl: 2rem;

    /* Border Radius */
    --aw-radius-sm: 4px;
    --aw-radius-md: 8px;
    --aw-radius-lg: 12px;
    --aw-radius-full: 9999px;

    /* Shadows */
    --aw-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --aw-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --aw-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --aw-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --aw-transition-fast: 0.2s ease;
    --aw-transition-normal: 0.3s ease;
    --aw-transition-slow: 0.4s ease;

    /* Animation Variables */
    --aw-animation-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --aw-animation-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --aw-animation-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --aw-spinner-size: 40px;
    --aw-spinner-size-sm: 20px;
    --aw-spinner-size-lg: 60px;
    --aw-loading-bg: rgba(255, 255, 255, 0.95);
    --aw-loading-overlay: rgba(0, 0, 0, 0.3);
    --aw-pulse-color: rgba(255, 127, 0, 0.6);
}

/* ===================================
   General Utilities
   =================================== */
.display-none {
    display: none;
}

body.modal-open {
    overflow: hidden;
}

/* Disable animations when user prefers reduced motion or admin setting.
   Note: `transform` is intentionally NOT reset — layout positioning
   (centered marker, translate-based placement) relies on it. */
.aw-no-animations,
.aw-no-animations *,
.no-animations,
.no-animations * {
    animation: none !important;
    transition: none !important;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===================================
   Keyframe Animations
   =================================== */
@keyframes awSpinnerRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes awPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

@keyframes awSlideUp {
    0% {
        transform: translateY(30px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes awFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes awShimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

@keyframes awDotBounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes awShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ===================================
   Loading States & Spinners
   =================================== */
.aw-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--aw-loading-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--aw-transition-normal) var(--aw-animation-smooth);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border-radius: var(--aw-radius-lg);
}

.aw-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.aw-spinner {
    width: var(--aw-spinner-size);
    height: var(--aw-spinner-size);
    border: 3px solid rgba(255, 127, 0, 0.3);
    border-top: 3px solid var(--aw-primary-color);
    border-radius: 50%;
    animation: awSpinnerRotate 1s linear infinite;
    position: relative;
}

.aw-spinner.sm {
    width: var(--aw-spinner-size-sm);
    height: var(--aw-spinner-size-sm);
    border-width: 2px;
}

.aw-spinner.lg {
    width: var(--aw-spinner-size-lg);
    height: var(--aw-spinner-size-lg);
    border-width: 4px;
}

.aw-spinner-with-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--aw-spacing-md);
}

.aw-spinner-text {
    color: var(--aw-text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    animation: awPulse 2s ease-in-out infinite;
}

.aw-dots-spinner {
    display: flex;
    gap: 4px;
    align-items: center;
}

.aw-dots-spinner .dot {
    width: 8px;
    height: 8px;
    background-color: var(--aw-primary-color);
    border-radius: 50%;
    animation: awDotBounce 1.4s ease-in-out infinite both;
}

.aw-dots-spinner .dot:nth-child(1) { animation-delay: -0.32s; }
.aw-dots-spinner .dot:nth-child(2) { animation-delay: -0.16s; }
.aw-dots-spinner .dot:nth-child(3) { animation-delay: 0; }

.aw-shimmer {
    background: linear-gradient(
            90deg,
            #f0f0f0 25%,
            #e0e0e0 50%,
            #f0f0f0 75%
    );
    background-size: 200px 100%;
    animation: awShimmer 1.5s infinite;
}

.aw-btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.aw-btn-loading .aw-btn-text {
    opacity: 0;
}

.aw-btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: awSpinnerRotate 1s linear infinite;
}

/* Enhanced Animation Classes */
.aw-fade-in {
    animation: awFadeIn var(--aw-transition-normal) var(--aw-animation-smooth);
}

.aw-slide-up {
    animation: awSlideUp var(--aw-transition-slow) var(--aw-animation-elastic);
}

.aw-bounce-in {
    animation: awBounceIn 0.6s var(--aw-animation-bounce);
}

.aw-error-shake {
    animation: awShake 0.6s ease-in-out;
}

.aw-pulse {
    animation: awPulse 2s ease-in-out infinite;
}

/* ===================================
   Form Elements
   =================================== */
#agenwebsite_billing_pinpoint {
    cursor: pointer;
    transition: color var(--aw-transition-fast);
}

#agenwebsite_billing_pinpoint:hover {
    color: var(--aw-primary-color);
}

#agenwebsite_billing_pinpoint_field #label_address {
    font-size: 0.875rem;
    color: var(--aw-text-secondary);
    font-weight: 500;
}

#agenwebsite_billing_pinpoint_field .optional {
    display: none;
}

/* ===================================
   Error States
   =================================== */
.instant-courier-error {
    border: 1px solid var(--aw-error-color);
    padding: var(--aw-spacing-md);
    color: var(--aw-error-color);
    background-color: #fff5f5;
    border-radius: var(--aw-radius-md);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ===================================
   Modal Overlay & Container
   =================================== */
.modal-instant-courier-wrapper {
    /* Scoped design tokens for the pinpoint modal */
    --aw-ic-font: "Plus Jakarta Sans", "Geist", "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --aw-ic-ink: #0c1220;
    --aw-ic-muted: #5c6472;
    --aw-ic-faint: #98a1af;
    --aw-ic-surface: #ffffff;
    --aw-ic-surface-2: #f4f6f9;
    --aw-ic-hairline: rgba(12, 18, 32, 0.08);
    --aw-ic-ease: cubic-bezier(0.32, 0.72, 0, 1);
    --aw-ic-shadow: 0 48px 100px -28px rgba(8, 14, 28, 0.45), 0 18px 44px -22px rgba(8, 14, 28, 0.3);

    display: none;
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: rgba(9, 13, 22, 0.52);
    backdrop-filter: blur(14px) saturate(1.25);
    -webkit-backdrop-filter: blur(14px) saturate(1.25);
    opacity: 0;
    transition: opacity 0.4s var(--aw-ic-ease);
    z-index: 9999;
    font-family: var(--aw-ic-font);
}

.modal-instant-courier-wrapper.aw-fade-in,
.modal-instant-courier-wrapper.no-animations,
.modal-instant-courier-wrapper.aw-no-animations {
    opacity: 1;
}

.modal-instant-courier-wrapper.hide {
    opacity: 0;
    pointer-events: none;
}

.modal-instant-courier-center {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: clamp(16px, 3vw, 40px);
}

/* Modal card — outer shell of the double-bezel: a frosted tray
   holding the inner core, with a concentric radius pair. */
.modal-instant-courier-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 90%;
    max-width: 900px;
    height: 82%;
    max-height: 720px;
    padding: 7px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.62));
    border: none;
    border-radius: 28px;
    box-shadow: var(--aw-ic-shadow),
        inset 0 1px 1px rgba(255, 255, 255, 0.95),
        0 0 0 1px rgba(255, 255, 255, 0.4);
    overflow: visible;
    transition: transform 0.65s var(--aw-ic-ease), opacity 0.5s var(--aw-ic-ease);
}

.modal-instant-courier-wrapper.hide .modal-instant-courier-content {
    transform: translateY(18px) scale(0.97);
    opacity: 0;
}

/* Inner core — concentric radius (28px shell − 7px padding),
   flex column: header / map stage / footer */
.aw-ic-core {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--aw-ic-surface);
    border-radius: 21px;
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--aw-ic-hairline);
}

/* Header */
.aw-ic-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 20px 16px 24px;
    background: var(--aw-ic-surface);
    transition: opacity 0.55s var(--aw-ic-ease) 0.08s, transform 0.55s var(--aw-ic-ease) 0.08s;
}

.aw-ic-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--aw-primary-dark, #e56f00);
    background: rgba(0, 0, 0, 0.04);
    background: color-mix(in srgb, var(--aw-primary-color, #ff7f00) 9%, #ffffff);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--aw-primary-color, #ff7f00) 22%, #ffffff);
}

.instant-courier-pinpoint {
    position: static;
    width: auto;
    margin: 10px 0 3px;
    padding: 0;
    background: none;
    border-radius: 0;
    text-align: left;
    font-family: var(--aw-ic-font);
    font-size: 19px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--aw-ic-ink);
}

.aw-ic-subtitle {
    display: block;
    font-size: 13px;
    line-height: 1.5;
    color: var(--aw-ic-muted);
}

/* Entry choreography — @starting-style animates the first frame after
   display:none flips; older browsers simply appear instantly. */
@starting-style {
    .modal-instant-courier-wrapper.aw-fade-in {
        opacity: 0;
    }

    .modal-instant-courier-wrapper.aw-fade-in .modal-instant-courier-content {
        transform: translateY(28px) scale(0.965);
        opacity: 0;
    }

    .modal-instant-courier-wrapper.aw-fade-in .aw-ic-header,
    .modal-instant-courier-wrapper.aw-fade-in .instant-courier-search-row,
    .modal-instant-courier-wrapper.aw-fade-in .aw-ic-footer {
        opacity: 0;
        transform: translateY(12px);
    }

    .modal-instant-courier-wrapper.aw-fade-in #button_use_my_location_instant {
        opacity: 0;
    }
}

/* ===================================
   Modal Close Button
   =================================== */
.modal-instant-courier-close {
    position: relative;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    cursor: pointer;
    background: var(--aw-ic-surface-2);
    border: none;
    border-radius: 999px;
    color: var(--aw-ic-muted);
    box-shadow: inset 0 0 0 1px var(--aw-ic-hairline);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.5s var(--aw-ic-ease), background-color 0.3s var(--aw-ic-ease), color 0.3s var(--aw-ic-ease);
}

.modal-instant-courier-close:hover {
    background: var(--aw-ic-ink);
    color: #ffffff;
    transform: rotate(90deg) scale(1.05);
}

.modal-instant-courier-close:active {
    transform: rotate(90deg) scale(0.95);
}

.modal-instant-courier-close:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 1px var(--aw-ic-hairline), 0 0 0 3px rgba(255, 127, 0, 0.25);
    box-shadow: inset 0 0 0 1px var(--aw-ic-hairline), 0 0 0 3px color-mix(in srgb, var(--aw-primary-color, #ff7f00) 30%, transparent);
}

.modal-instant-courier-close:before,
.modal-instant-courier-close:after {
    position: absolute;
    content: "";
    height: 15px;
    width: 1.5px;
    border-radius: 2px;
    background-color: currentColor;
}

.modal-instant-courier-close:before {
    transform: rotate(45deg);
}

.modal-instant-courier-close:after {
    transform: rotate(-45deg);
}

/* ===================================
   Search — floating glass command bar
   =================================== */
.instant-courier-search-row {
    position: absolute;
    z-index: 1200;
    top: 14px;
    left: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    height: 52px;
    padding: 6px 6px 6px 18px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px) saturate(1.4);
    -webkit-backdrop-filter: blur(10px) saturate(1.4);
    border-radius: 999px;
    box-shadow: 0 14px 36px -14px rgba(8, 14, 28, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 0 0 1px rgba(12, 18, 32, 0.06);
    transition: box-shadow 0.4s var(--aw-ic-ease),
        opacity 0.55s var(--aw-ic-ease) 0.16s,
        transform 0.55s var(--aw-ic-ease) 0.16s;
}

.instant-courier-search-row:focus-within {
    box-shadow: 0 18px 44px -16px rgba(8, 14, 28, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 0 0 1.5px var(--aw-primary-color);
}

.aw-ic-search-icon {
    display: flex;
    flex: 0 0 auto;
    margin-right: 10px;
    color: var(--aw-ic-faint);
}

#pac-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    font-family: var(--aw-ic-font);
    font-size: 15px;
    color: var(--aw-ic-ink);
    transition: none;
}

#pac-input:focus {
    outline: none;
    border: none;
    background: transparent;
    box-shadow: none;
}

#pac-input::placeholder {
    color: var(--aw-ic-faint);
    font-style: normal;
}

.aw-instant-search-btn {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--aw-primary-color);
    color: #fff;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 8px 18px -8px rgba(8, 14, 28, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--aw-primary-color) 70%, rgba(8, 14, 28, 0.2)), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transition: transform 0.45s var(--aw-ic-ease), background-color 0.25s var(--aw-ic-ease), box-shadow 0.45s var(--aw-ic-ease);
}

.aw-instant-search-btn:hover {
    background: var(--aw-primary-hover);
    transform: translateX(1px) scale(1.05);
}

.aw-instant-search-btn:active {
    transform: scale(0.94);
}

.pac-container {
    z-index: 99999;
    border-radius: 18px;
    border: none;
    box-shadow: 0 24px 60px -20px rgba(8, 14, 28, 0.4), 0 0 0 1px rgba(12, 18, 32, 0.06);
    margin-top: 10px;
    overflow: hidden;
    transform: translateY(-10px);
    animation: slideInFromTop 0.3s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}

@keyframes slideInFromTop {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search input loading state */
#pac-input.loading {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23a0aec0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 11-6.219-8.56"/></svg>');
    background-repeat: no-repeat;
    background-position: calc(100% - 12px) center;
    background-size: 16px;
    animation: inputSpinning 1s linear infinite;
}

@keyframes inputSpinning {
    from {
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23a0aec0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" transform="rotate(0)"><path d="M21 12a9 9 0 11-6.219-8.56"/></svg>');
    }
    to {
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23a0aec0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" transform="rotate(360)"><path d="M21 12a9 9 0 11-6.219-8.56"/></svg>');
    }
}

/* ===================================
   Map Stage & Container
   =================================== */
.aw-ic-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    background: var(--aw-ic-surface-2);
    overflow: hidden;
}

#instant_maps {
    width: 100%;
    height: 100%;
    min-height: 250px;
    border-radius: 0;
    position: relative;
    background: var(--aw-ic-surface-2);
    transition: opacity 0.4s var(--aw-ic-ease);
}

#instant_maps.loading {
    opacity: 0.3;
    pointer-events: none;
}

#instant_maps .aw-loading-overlay {
    border-radius: 0;
}

/* Leaflet controls — align with the glass design system.
   Zoom sits below the floating search bar. */
.modal-instant-courier-wrapper .leaflet-top.leaflet-left {
    top: 72px;
    left: 6px;
}

.modal-instant-courier-wrapper .leaflet-bar {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 26px -12px rgba(8, 14, 28, 0.35), 0 0 0 1px rgba(12, 18, 32, 0.06);
}

.modal-instant-courier-wrapper .leaflet-bar a {
    width: 36px;
    height: 36px;
    line-height: 36px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--aw-ic-ink);
    border: none;
    border-bottom: 1px solid rgba(12, 18, 32, 0.06);
    font-size: 15px;
    font-weight: 400;
    transition: background-color 0.25s var(--aw-ic-ease), color 0.25s var(--aw-ic-ease);
}

.modal-instant-courier-wrapper .leaflet-bar a:last-child {
    border-bottom: none;
}

.modal-instant-courier-wrapper .leaflet-bar a:hover {
    background: #ffffff;
    color: var(--aw-primary-color);
}

/* Map Loading Overlay */
.map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--aw-loading-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 0;
    opacity: 1;
    transition: opacity var(--aw-transition-normal);
}

.map-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.map-loading-content {
    text-align: center;
    color: var(--aw-text-secondary);
}

.map-loading-content .loading-spinner {
    margin: 0 auto var(--aw-spacing-md);
}

.section-google-maps-gojek #gojek_maps {
    min-height: 300px;
    border-radius: var(--aw-radius-md);
    box-shadow: var(--aw-shadow-md);
    border: 1px solid var(--aw-border-color);
}

/* ===================================
   Center Marker (decorative — the map pans beneath it)
   =================================== */
#button_pinpoint {
    position: absolute;
    left: 50%;
    top: 50%;
    height: auto;
    padding: 0;
    margin: 0;
    /* Pin tip lands exactly on the map center = picked coordinate */
    transform: translate(-50%, -100%);
    z-index: 1100;
    pointer-events: none;
    text-align: center;
}

#button_pinpoint .image-pinpoint {
    display: block;
    position: relative;
    z-index: 2;
    height: 52px;
    width: auto;
    max-width: none;
    margin: 0 auto;
    filter: drop-shadow(0 12px 14px rgba(8, 14, 28, 0.3));
    transform-origin: 50% 100%;
}

/* Pin colors follow the configured primary color */
.image-pinpoint .aw-ic-pin-body {
    fill: var(--aw-primary-color, #ff7f00);
    stroke: rgba(8, 14, 28, 0.18);
    stroke-width: 1;
}

.image-pinpoint .aw-ic-pin-dot {
    fill: #ffffff;
    fill-opacity: 0.95;
}

.aw-ic-marker-shadow {
    position: absolute;
    left: 50%;
    bottom: -4px;
    z-index: 1;
    width: 16px;
    height: 7px;
    margin-left: -8px;
    border-radius: 50%;
    background: radial-gradient(50% 50% at 50% 50%, rgba(8, 14, 28, 0.38), rgba(8, 14, 28, 0) 72%);
}

.modal-instant-courier-wrapper.aw-fade-in #button_pinpoint .image-pinpoint {
    animation: awIcPinDrop 0.7s var(--aw-ic-ease) 0.28s both;
}

.modal-instant-courier-wrapper.aw-fade-in .aw-ic-marker-shadow {
    animation: awIcShadowIn 0.7s var(--aw-ic-ease) 0.28s both;
}

@keyframes awIcPinDrop {
    from {
        transform: translateY(-18px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes awIcShadowIn {
    from {
        opacity: 0;
        transform: scaleX(0.4);
    }
    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

/* ===================================
   Confirm Footer & Primary CTA
   =================================== */
.aw-ic-footer {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 14px 14px 24px;
    background: var(--aw-ic-surface);
    box-shadow: 0 -1px 0 var(--aw-ic-hairline);
    transition: opacity 0.55s var(--aw-ic-ease) 0.2s, transform 0.55s var(--aw-ic-ease) 0.2s;
}

.aw-ic-footer-hint {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--aw-ic-muted);
}

.aw-ic-hint-dot {
    --aw-ic-dot-glow: rgba(255, 127, 0, 0.4);
    --aw-ic-dot-glow: color-mix(in srgb, var(--aw-primary-color, #ff7f00) 45%, transparent);
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--aw-primary-color);
    animation: awIcDotPulse 2.4s var(--aw-ic-ease) infinite;
}

@keyframes awIcDotPulse {
    0% {
        box-shadow: 0 0 0 0 var(--aw-ic-dot-glow);
    }
    70% {
        box-shadow: 0 0 0 8px transparent;
    }
    100% {
        box-shadow: 0 0 0 0 transparent;
    }
}

#button_pinpoint_instant_courier {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: auto;
    min-height: 48px;
    margin: 0;
    padding: 8px 8px 8px 24px;
    border: none;
    background: var(--aw-primary-color);
    color: #ffffff;
    font-family: var(--aw-ic-font);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
    text-transform: none;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 14px 30px -12px rgba(8, 14, 28, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--aw-primary-color) 55%, rgba(8, 14, 28, 0.3)), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transition: transform 0.5s var(--aw-ic-ease), box-shadow 0.5s var(--aw-ic-ease), background-color 0.25s var(--aw-ic-ease);
}

#button_pinpoint_instant_courier:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 38px -12px rgba(8, 14, 28, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    box-shadow: 0 18px 38px -12px color-mix(in srgb, var(--aw-primary-color) 65%, rgba(8, 14, 28, 0.3)), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

#button_pinpoint_instant_courier:active {
    transform: translateY(0) scale(0.97);
}

#button_pinpoint_instant_courier:focus-visible {
    outline: none;
    box-shadow: 0 14px 30px -12px rgba(8, 14, 28, 0.4), 0 0 0 3px rgba(255, 127, 0, 0.3);
    box-shadow: 0 14px 30px -12px rgba(8, 14, 28, 0.4), 0 0 0 3px color-mix(in srgb, var(--aw-primary-color) 35%, transparent);
}

/* Nested trailing icon — pure pseudo-element so hideButtonLoading()'s
   .text() restore never wipes it */
#button_pinpoint_instant_courier:not(.aw-btn-loading)::after {
    content: "";
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.18);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 15px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25);
    transition: transform 0.5s var(--aw-ic-ease);
}

#button_pinpoint_instant_courier:hover:not(.aw-btn-loading)::after {
    transform: scale(1.08);
}

/* Loading state — spinner replaces the icon circle, label dims */
#button_pinpoint_instant_courier.aw-btn-loading {
    color: rgba(255, 255, 255, 0.55);
}

/* Spinner keeps the exact 32px footprint of the icon disc so the
   label never shifts while loading */
#button_pinpoint_instant_courier.aw-btn-loading::after {
    content: "";
    position: static;
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 32px;
    height: 32px;
    margin: 0;
    background-color: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 999px;
    animation: awSpinnerRotate 0.8s linear infinite;
}

/* ===================================
   "Gunakan Lokasi Saya" GPS button
   Glass pill floating bottom-left of the map stage
   (Leaflet locate control = bottom-right).
   =================================== */
#button_use_my_location_instant {
    position: absolute;
    bottom: 16px;
    left: 14px;
    z-index: 1150;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 8px 16px 8px 9px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px) saturate(1.4);
    -webkit-backdrop-filter: blur(10px) saturate(1.4);
    color: var(--aw-ic-ink);
    border: none;
    border-radius: 999px;
    font-family: var(--aw-ic-font);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 12px 28px -12px rgba(8, 14, 28, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 0 0 1px rgba(12, 18, 32, 0.06);
    transition: transform 0.45s var(--aw-ic-ease),
        box-shadow 0.45s var(--aw-ic-ease),
        opacity 0.55s var(--aw-ic-ease) 0.24s;
}

#button_use_my_location_instant:hover {
    background: #ffffff;
    color: var(--aw-ic-ink);
    transform: translateY(-2px);
    box-shadow: 0 16px 34px -12px rgba(8, 14, 28, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 0 0 1px rgba(12, 18, 32, 0.08);
}

#button_use_my_location_instant:active {
    transform: translateY(0) scale(0.97);
}

#button_use_my_location_instant .dashicons {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 15px;
    line-height: 28px;
    background: rgba(0, 0, 0, 0.05);
    background: color-mix(in srgb, var(--aw-primary-color, #ff7f00) 12%, #ffffff);
    color: var(--aw-primary-color);
}

/* ===================================
   Button Style Variations (admin setting)
   =================================== */

/* Button Style: Rounded (default) */
#button_pinpoint_instant_courier.button-style-rounded {
    border-radius: 16px;
}

/* Button Style: Square */
#button_pinpoint_instant_courier.button-style-square {
    border-radius: 6px;
}

/* Button Style: Pill */
#button_pinpoint_instant_courier.button-style-pill {
    border-radius: 999px;
}

/* Button Style: Modern */
#button_pinpoint_instant_courier.button-style-modern {
    border-radius: 18px;
    background: linear-gradient(135deg, var(--aw-primary-color) 0%, var(--aw-primary-dark) 100%);
}

#button_pinpoint_instant_courier.button-style-modern:hover {
    background: linear-gradient(135deg, var(--aw-primary-hover) 0%, var(--aw-primary-dark) 100%);
}

/* Button Style: Minimal */
#button_pinpoint_instant_courier.button-style-minimal {
    border-radius: 12px;
    border: none;
    background-color: var(--aw-primary-color);
    box-shadow: none;
    font-weight: 600;
}

#button_pinpoint_instant_courier.button-style-minimal:hover {
    background-color: var(--aw-primary-hover);
    transform: none;
}

/* ===================================
   Modal Size Variations
   =================================== */

/* Modal Size: Small */
.modal-size-small {
    max-width: 400px !important;
    width: 90% !important;
}

/* Modal Size: Medium (default) */
.modal-size-medium {
    max-width: 600px !important;
    width: 90% !important;
}

/* Modal Size: Large */
.modal-size-large {
    max-width: 800px !important;
    width: 95% !important;
}

/* Modal Size: Fullscreen */
.modal-size-fullscreen {
    width: 95vw !important;
    max-width: none !important;
    height: 95vh !important;
    max-height: none !important;
}

@media (max-width: 768px) {
    .modal-size-fullscreen {
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        padding: 0 !important;
        border-radius: 0 !important;
    }

    .modal-size-fullscreen .aw-ic-core {
        border-radius: 0;
    }
}

/* ===================================
   Responsive Design & Mobile Optimization
   =================================== */

/* Phones — full-screen takeover sheet */
@media (max-width: 640px) {
    .modal-instant-courier-center {
        padding: 0;
    }

    .modal-instant-courier-content {
        width: 100% !important;
        max-width: none !important;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        padding: 0;
        border-radius: 0;
        background: var(--aw-ic-surface);
        box-shadow: none;
    }

    .aw-ic-core {
        border-radius: 0;
        box-shadow: none;
    }

    .aw-ic-header {
        padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 12px 18px;
    }

    .instant-courier-pinpoint {
        font-size: 17px;
        margin-top: 8px;
    }

    .aw-ic-subtitle {
        font-size: 12.5px;
    }

    .instant-courier-search-row {
        top: 10px;
        left: 10px;
        right: 10px;
        height: 50px;
    }

    #pac-input {
        font-size: 16px; /* Prevent zoom-on-focus on iOS */
    }

    /* Pinch-to-zoom replaces the zoom buttons on touch screens */
    .modal-instant-courier-wrapper .leaflet-control-zoom {
        display: none;
    }

    #button_use_my_location_instant {
        bottom: 14px;
        left: 10px;
    }

    .aw-ic-footer {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 10px;
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .aw-ic-footer-hint {
        justify-content: center;
    }

    #button_pinpoint_instant_courier {
        width: 100%;
        justify-content: space-between;
        min-height: 52px;
        padding-left: 22px;
    }
}

/* Tablets */
@media (min-width: 641px) and (max-width: 1024px) {
    .modal-instant-courier-content {
        width: 94%;
        height: 84%;
    }
}

/* Short landscape phones — reclaim vertical space for the map */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
    .aw-ic-subtitle {
        display: none;
    }

    .aw-ic-header {
        padding-top: 10px;
        padding-bottom: 8px;
    }

    .instant-courier-pinpoint {
        margin-top: 6px;
        font-size: 15px;
    }

    .aw-ic-footer {
        flex-direction: row;
        align-items: center;
        padding-top: 10px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }

    .aw-ic-footer-hint {
        display: none;
    }

    #button_pinpoint_instant_courier {
        width: auto;
        margin-left: auto;
        min-height: 44px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    #button_pinpoint .image-pinpoint {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: optimize-contrast;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .modal-instant-courier-wrapper,
    .modal-instant-courier-content,
    .modal-instant-courier-close,
    .aw-ic-header,
    .aw-ic-footer,
    .instant-courier-search-row,
    #button_pinpoint .image-pinpoint,
    .aw-ic-marker-shadow,
    .aw-ic-hint-dot,
    #button_pinpoint_instant_courier,
    #button_use_my_location_instant,
    #pac-input {
        animation: none;
        transition: none;
    }

    .modal-instant-courier-close:hover,
    #button_pinpoint_instant_courier:hover,
    #button_use_my_location_instant:hover,
    .aw-instant-search-btn:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .modal-instant-courier-wrapper {
        display: none !important;
    }
}

/* ===================================
   Accessibility Enhancements
   =================================== */

/* Screen reader support */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .aw-ic-core {
        box-shadow: 0 0 0 3px currentColor;
    }

    .modal-instant-courier-close {
        box-shadow: inset 0 0 0 2px currentColor;
    }

    .instant-courier-search-row {
        box-shadow: 0 0 0 2px currentColor;
    }

    #button_pinpoint_instant_courier {
        box-shadow: 0 0 0 2px currentColor;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --aw-bg-primary: #1a202c;
        --aw-bg-secondary: #2d3748;
        --aw-bg-overlay: rgba(0, 0, 0, 0.8);
        --aw-text-primary: #f7fafc;
        --aw-text-secondary: #cbd5e0;
        --aw-text-muted: #718096;
        --aw-border-color: #4a5568;
    }

    .modal-instant-courier-wrapper {
        --aw-ic-ink: #f2f5fa;
        --aw-ic-muted: #a4aebc;
        --aw-ic-faint: #6e7888;
        --aw-ic-surface: #10151f;
        --aw-ic-surface-2: #171d29;
        --aw-ic-hairline: rgba(255, 255, 255, 0.08);
        background: rgba(4, 6, 12, 0.6);
    }

    .modal-instant-courier-content {
        background: linear-gradient(180deg, rgba(36, 42, 56, 0.85), rgba(20, 24, 34, 0.65));
        box-shadow: var(--aw-ic-shadow),
            inset 0 1px 1px rgba(255, 255, 255, 0.12),
            0 0 0 1px rgba(255, 255, 255, 0.08);
    }

    .instant-courier-search-row,
    #button_use_my_location_instant {
        background: rgba(18, 23, 33, 0.9);
        box-shadow: 0 14px 36px -14px rgba(0, 0, 0, 0.6),
            inset 0 1px 0 rgba(255, 255, 255, 0.06),
            0 0 0 1px rgba(255, 255, 255, 0.08);
    }

    #button_use_my_location_instant:hover {
        background: #1b2230;
    }

    #button_use_my_location_instant .dashicons {
        background: rgba(255, 255, 255, 0.08);
        background: color-mix(in srgb, var(--aw-primary-color, #ff7f00) 18%, #10151f);
    }

    .aw-ic-eyebrow {
        color: var(--aw-primary-color);
        background: rgba(255, 255, 255, 0.06);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    }

    .modal-instant-courier-wrapper .leaflet-bar a {
        background: rgba(18, 23, 33, 0.94);
        color: var(--aw-ic-ink);
        border-bottom-color: rgba(255, 255, 255, 0.06);
    }

    .modal-instant-courier-wrapper .leaflet-bar a:hover {
        background: #1b2230;
        color: var(--aw-primary-color);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Ensure all interactive elements are touch-friendly */
    .modal-instant-courier-close,
    #button_pinpoint_instant_courier {
        min-width: 44px;
        min-height: 44px;
    }

    /* Remove hover states on touch devices */
    .modal-instant-courier-close:hover {
        background: var(--aw-ic-surface-2);
        color: var(--aw-ic-muted);
        transform: none;
    }

    #button_pinpoint_instant_courier:hover,
    #button_use_my_location_instant:hover,
    .aw-instant-search-btn:hover {
        transform: none;
    }
}

/* Safe area adjustments for devices with notches
   (phones go full-screen; the sheet handles its own insets) */
@supports (padding: max(0px)) {
    @media (min-width: 641px) {
        .modal-instant-courier-center {
            padding-left: max(24px, env(safe-area-inset-left));
            padding-right: max(24px, env(safe-area-inset-right));
            padding-top: max(24px, env(safe-area-inset-top));
            padding-bottom: max(24px, env(safe-area-inset-bottom));
        }
    }
}

/* ===================================
   Loading States & Animations
   =================================== */

/* Loading Spinner Component */
.loading-spinner {
    width: var(--aw-spinner-size);
    height: var(--aw-spinner-size);
    border: 3px solid var(--aw-border-color);
    border-top: 3px solid var(--aw-primary-color);
    border-radius: var(--aw-radius-full);
    animation: spin 1s linear infinite;
    display: inline-block;
}

.loading-spinner.small {
    width: var(--aw-spinner-size-sm);
    height: var(--aw-spinner-size-sm);
    border-width: 2px;
}

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

/* Pulsing Animation */
.loading-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* Shimmer Loading Effect */
.loading-shimmer {
    background: linear-gradient(90deg, var(--aw-bg-secondary) 25%, #f0f0f0 50%, var(--aw-bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Loading States for Buttons */
.button-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.button-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--aw-spinner-size-sm);
    height: var(--aw-spinner-size-sm);
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: var(--aw-radius-full);
    animation: spin 1s linear infinite;
}

/* Error States */
.error-shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.error-message {
    background: #fff5f5;
    border: 1px solid var(--aw-error-color);
    color: var(--aw-error-color);
    padding: var(--aw-spacing-md);
    border-radius: var(--aw-radius-md);
    margin: var(--aw-spacing-sm) 0;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: var(--aw-spacing-sm);
    opacity: 0;
    transform: translateY(-10px);
    animation: errorSlideIn var(--aw-transition-normal) forwards;
}

@keyframes errorSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-message::before {
    content: '⚠️';
    font-size: 1rem;
}

/* Success States */
.success-message {
    background: #f0fff4;
    border: 1px solid var(--aw-success-color);
    color: var(--aw-success-color);
    padding: var(--aw-spacing-md);
    border-radius: var(--aw-radius-md);
    margin: var(--aw-spacing-sm) 0;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: var(--aw-spacing-sm);
    opacity: 0;
    transform: translateY(-10px);
    animation: successSlideIn var(--aw-transition-normal) forwards;
}

@keyframes successSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-message::before {
    content: '✅';
    font-size: 1rem;
}

/* Hover Animations */
.hover-lift {
    transition: transform var(--aw-transition-fast), box-shadow var(--aw-transition-fast);
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--aw-shadow-lg);
}

/* Focus Animations */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
    border-color: var(--aw-border-focus);
}

/* Loading overlay for entire modal */
.modal-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--aw-loading-bg);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    border-radius: var(--aw-radius-lg);
    opacity: 0;
    visibility: hidden;
    transition: all var(--aw-transition-normal);
}

.modal-loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-loading-content {
    text-align: center;
    color: var(--aw-text-secondary);
    background: var(--aw-bg-primary);
    padding: var(--aw-spacing-xl);
    border-radius: var(--aw-radius-md);
    box-shadow: var(--aw-shadow-lg);
    transform: scale(0.9);
}

.modal-loading-overlay.show .modal-loading-content {
    transform: scale(1);
}

.modal-loading-content h3 {
    margin: var(--aw-spacing-md) 0 var(--aw-spacing-sm);
    color: var(--aw-text-primary);
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-loading-content p {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Status indicator animations */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: var(--aw-radius-full);
    margin-right: var(--aw-spacing-xs);
}

.status-indicator.loading {
    background: var(--aw-info-color);
    animation: pulse 1s infinite;
}

.status-indicator.success {
    background: var(--aw-success-color);
    animation: successPulse 0.6s ease-out;
}

.status-indicator.error {
    background: var(--aw-error-color);
    animation: errorPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes errorPulse {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* Geocoding loading state */
.geocoding-loading {
    position: relative;
}

.geocoding-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: var(--aw-spacing-md);
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid var(--aw-border-color);
    border-top: 2px solid var(--aw-primary-color);
    border-radius: var(--aw-radius-full);
    animation: spin 1s linear infinite;
}

/* Mobile loading spinner adjustments */
@media (max-width: 768px) {
    .loading-spinner {
        width: 32px;
        height: 32px;
    }

    .modal-loading-content {
        padding: var(--aw-spacing-lg);
        margin: var(--aw-spacing-md);
    }

    .geocoding-loading::after {
        width: 14px;
        height: 14px;
        margin-top: -7px;
        border-width: 1.5px;
    }
}

/* ===================================
   Search Results Dropdown for Leaflet
   (injected after #pac-input, positions against the glass bar)
   =================================== */
.aw-search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none;
    border-radius: 20px;
    padding: 6px;
    box-shadow: 0 24px 60px -20px rgba(8, 14, 28, 0.4), 0 0 0 1px rgba(12, 18, 32, 0.06);
    z-index: 1300;
    display: none;
}

.aw-search-result {
    padding: 11px 14px;
    cursor: pointer;
    border: none;
    border-radius: 14px;
    transition: background-color 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

.aw-search-result + .aw-search-result {
    margin-top: 2px;
}

.aw-search-result:hover {
    background-color: var(--aw-ic-surface-2, #f4f6f9);
}

.aw-search-result-title {
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: -0.005em;
    color: var(--aw-ic-ink, #0c1220);
    margin-bottom: 2px;
}

.aw-search-result-address {
    font-size: 12px;
    line-height: 1.45;
    color: var(--aw-ic-muted, #5c6472);
}

.aw-search-loading,
.aw-search-no-results,
.aw-search-error {
    padding: 14px;
    text-align: center;
    color: var(--aw-ic-muted, #5c6472);
    font-size: 13px;
}

.aw-search-error {
    color: var(--aw-error-color);
}

/* Leaflet-specific styles */
.leaflet-container {
    font-family: inherit;
}

.leaflet-control-container .leaflet-control-attribution {
    display: none;
}


/* Custom location control for Leaflet (JS sets inline styles — override) */
.modal-instant-courier-wrapper .leaflet-control-custom {
    cursor: pointer;
    width: 44px !important;
    height: 44px !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.94) !important;
    box-shadow: 0 12px 28px -12px rgba(8, 14, 28, 0.4), 0 0 0 1px rgba(12, 18, 32, 0.06) !important;
    transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal-instant-courier-wrapper .leaflet-control-custom:hover {
    background: #ffffff !important;
    transform: translateY(-2px) scale(1.03);
}

.modal-instant-courier-wrapper .leaflet-control-custom svg {
    width: 20px;
    height: 20px;
}

/* Dark mode support for search results & locate control */
@media (prefers-color-scheme: dark) {
    .aw-search-results {
        background: rgba(16, 21, 31, 0.97);
        box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
    }

    .aw-search-result:hover {
        background-color: #171d29;
    }

    .modal-instant-courier-wrapper .leaflet-control-custom {
        background: rgba(18, 23, 33, 0.94) !important;
    }

    .modal-instant-courier-wrapper .leaflet-control-custom:hover {
        background: #1b2230 !important;
    }

    .modal-instant-courier-wrapper .leaflet-control-custom svg path {
        fill: #f2f5fa;
    }
}

/* ===================================
   Map Field Interface (checkout / edit-address pinpoint card)
   Lives outside the modal wrapper, so the design tokens are
   re-declared here on the card itself.
   =================================== */
.aw-map-display {
    --aw-ic-font: "Plus Jakarta Sans", "Geist", "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --aw-ic-ink: #0c1220;
    --aw-ic-muted: #5c6472;
    --aw-ic-faint: #98a1af;
    --aw-ic-surface: #ffffff;
    --aw-ic-surface-2: #f4f6f9;
    --aw-ic-hairline: rgba(12, 18, 32, 0.08);
    --aw-ic-ease: cubic-bezier(0.32, 0.72, 0, 1);

    position: relative;
    background: var(--aw-ic-surface);
    border: none;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    font-family: var(--aw-ic-font);
    box-shadow: 0 0 0 1px var(--aw-ic-hairline), 0 10px 26px -18px rgba(8, 14, 28, 0.3);
    transition: box-shadow 0.45s var(--aw-ic-ease), transform 0.45s var(--aw-ic-ease);
}

.aw-map-display:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 0 1.5px rgba(255, 127, 0, 0.45), 0 18px 38px -18px rgba(8, 14, 28, 0.35);
    box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--aw-primary-color, #ff7f00) 45%, transparent), 0 18px 38px -18px rgba(8, 14, 28, 0.35);
}

/* Empty State */
.aw-map-display.empty-state {
    padding: 28px 20px;
    text-align: center;
    background: linear-gradient(160deg, #fbfdff 0%, #f3f6fa 100%);
}

.aw-map-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.aw-map-icon {
    width: 56px;
    height: 56px;
    background: var(--aw-ic-surface);
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--aw-primary-color);
    box-shadow: inset 0 0 0 1px var(--aw-ic-hairline),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 10px 22px -12px rgba(8, 14, 28, 0.25);
}

.aw-map-icon svg {
    display: block;
}

/* Legacy dashicon fallback (older cached markup) */
.aw-map-icon i {
    font-size: 24px;
    color: var(--aw-primary-color);
}

.aw-map-text h4 {
    margin: 2px 0 4px;
    color: var(--aw-ic-ink);
    font-family: var(--aw-ic-font);
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.aw-map-text p {
    margin: 0 auto;
    max-width: 340px;
    color: var(--aw-ic-muted);
    font-size: 13px;
    line-height: 1.55;
}

.aw-map-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--aw-primary-color);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 9px 18px;
    font-family: var(--aw-ic-font);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.3;
    cursor: pointer;
    box-shadow: 0 10px 22px -10px rgba(8, 14, 28, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--aw-primary-color) 55%, rgba(8, 14, 28, 0.25)), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transition: transform 0.45s var(--aw-ic-ease), box-shadow 0.45s var(--aw-ic-ease), background-color 0.25s var(--aw-ic-ease);
}

.aw-map-button:hover {
    background: var(--aw-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 14px 28px -10px rgba(8, 14, 28, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.aw-map-button:active {
    transform: scale(0.97);
}

.aw-map-button svg {
    display: block;
    flex: 0 0 auto;
}

/* Primary CTA — island pill with nested trailing arrow disc */
.aw-map-button.primary {
    margin-top: 2px;
    padding: 6px 6px 6px 20px;
    gap: 10px;
    font-size: 13.5px;
}

.aw-map-button.primary::after {
    content: "";
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.18);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='13 6 19 12 13 18'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25);
    transition: transform 0.45s var(--aw-ic-ease);
}

.aw-map-display:hover .aw-map-button.primary::after {
    transform: translateX(2px);
}

/* Mini Map with Coordinates */
.aw-map-display.has-coordinates {
    padding: 0;
    height: 210px;
}

.aw-mini-map {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--aw-ic-surface-2);
}

.aw-map-canvas {
    width: 100%;
    height: 100%;
}

/* Floating change-location action — bottom-right of the map card */
.aw-map-overlay {
    position: absolute;
    top: auto;
    left: auto;
    right: 10px;
    bottom: 10px;
    z-index: 700; /* above Leaflet panes (tiles 200, markers 600) */
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
    background: none;
    opacity: 1;
}

.aw-map-overlay .aw-map-button {
    flex: 0 0 auto;
    padding: 8px 15px;
    font-size: 12.5px;
}

/* Address Display */

.aw-loading-text {
    color: var(--aw-ic-faint, #98a1af);
    font-style: normal;
}

.leaflet-marker-pane {
    display: none !important;
}

.aw-mini-map .leaflet-marker-pane {
    display: block !important;
}

/* Mini-map SVG pin (L.divIcon) — kill Leaflet's default div-icon chrome */
.aw-pin-div-icon {
    background: none;
    border: none;
    filter: drop-shadow(0 6px 8px rgba(8, 14, 28, 0.3));
}

.aw-pin-div-icon svg {
    display: block;
}

/* Touch devices — no lift physics */
@media (hover: none) and (pointer: coarse) {
    .aw-map-display:hover,
    .aw-map-button:hover {
        transform: none;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .aw-map-display.empty-state {
        padding: 22px 16px;
    }

    .aw-map-icon {
        width: 50px;
        height: 50px;
    }

    .aw-map-text h4 {
        font-size: 14.5px;
    }

    .aw-map-text p {
        font-size: 12.5px;
    }

    .aw-map-display.has-coordinates {
        height: 180px;
    }

    .aw-map-overlay {
        right: 8px;
        bottom: 8px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .aw-map-display {
        --aw-ic-ink: #f2f5fa;
        --aw-ic-muted: #a4aebc;
        --aw-ic-faint: #6e7888;
        --aw-ic-surface: #10151f;
        --aw-ic-surface-2: #171d29;
        --aw-ic-hairline: rgba(255, 255, 255, 0.08);
    }

    .aw-map-display.empty-state {
        background: linear-gradient(160deg, #131926 0%, #0e131d 100%);
    }

    .aw-map-icon {
        background: #171d29;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1),
            0 10px 22px -12px rgba(0, 0, 0, 0.5);
    }
}