/* ===================================
   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 */
.aw-no-animations,
.aw-no-animations *,
.no-animations,
.no-animations * {
    animation: none !important;
    transition: none !important;
    transform: 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 {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--aw-bg-overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity var(--aw-transition-normal) var(--aw-animation-smooth);
    z-index: 9999;
}

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

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.modal-instant-courier-center {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: var(--aw-spacing-lg);
}

/* Modal Content Card */
.modal-instant-courier-content {
    background-color: var(--aw-bg-primary);
    padding: 0;
    border: none;
    border-radius: var(--aw-radius-lg);
    width: 90%;
    max-width: 900px;
    height: 80%;
    max-height: 700px;
    position: relative;
    box-shadow: var(--aw-shadow-xl);
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
}

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

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

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

/* ===================================
   Modal Close Button
   =================================== */
.modal-instant-courier-close {
    position: absolute;
    right: var(--aw-spacing-md);
    top: var(--aw-spacing-md);
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 99999;
    background: var(--aw-bg-primary);
    border-radius: var(--aw-radius-full);
    color: var(--aw-text-secondary);
    border: 2px solid var(--aw-border-color);
    transition: all var(--aw-transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-instant-courier-close:hover {
    background: var(--aw-error-color);
    border-color: var(--aw-error-color);
    color: white;
    transform: rotate(90deg);
}

.modal-instant-courier-close:before,
.modal-instant-courier-close:after {
    position: absolute;
    content: "";
    height: 20px;
    width: 2px;
    background-color: currentColor;
    transition: background-color var(--aw-transition-fast);
}

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

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

/* ===================================
   Search Input
   =================================== */
#pac-input {
    height: 48px;
    box-sizing: border-box;
    padding: var(--aw-spacing-sm) var(--aw-spacing-md);
    padding-left: 2.5rem; /* Space for search icon */
    position: absolute;
    z-index: 9999;
    width: calc(100% - 2rem);
    margin: var(--aw-spacing-md);
    border: 2px solid var(--aw-border-color);
    color: var(--aw-text-primary);
    background-color: var(--aw-bg-primary);
    border-radius: var(--aw-radius-md);
    font-size: 1rem;
    transition: all var(--aw-transition-fast);
    box-shadow: var(--aw-shadow-sm);
}

#pac-input:focus {
    outline: none;
    border-color: var(--aw-border-focus);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1), var(--aw-shadow-md);
}

#pac-input::placeholder {
    color: var(--aw-text-muted);
    font-style: italic;
}

/* Search Icon Placeholder */
#pac-input:before {
    content: "🔍";
    position: absolute;
    left: var(--aw-spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--aw-text-muted);
}

.pac-container {
    z-index: 99999;
    border-radius: var(--aw-radius-md);
    border: none;
    box-shadow: var(--aw-shadow-lg);
    margin-top: var(--aw-spacing-xs);
    transform: translateY(-10px);
    animation: slideInFromTop var(--aw-transition-fast) var(--aw-animation-smooth) 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 Container
   =================================== */
#instant_maps {
    width: 100%;
    height: var(--aw-map-height, 400px);
    min-height: 250px;
    border-radius: 0 0 var(--aw-radius-lg) var(--aw-radius-lg);
    position: relative;
    background: var(--aw-bg-secondary);
    transition: opacity var(--aw-transition-slow);
}

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

/* 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 0 var(--aw-radius-lg) var(--aw-radius-lg);
    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);
}

/* ===================================
   Pinpoint Elements
   =================================== */
.instant-courier-pinpoint {
    position: absolute;
    top: 0;
    width: 100%;
    text-align: center;
    left: 0;
    margin: 0;
    padding: var(--aw-spacing-md) 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
    border-radius: var(--aw-radius-lg) var(--aw-radius-lg) 0 0;
}

#button_pinpoint {
    padding: 0;
    z-index: 4050;
    position: absolute;
    top: calc(50% - 37.5px);
    left: 50%;
    text-align: center;
    margin-left: 0;
    transform: translate(-50%, -50%);
    height: 75px;
}

#button_pinpoint .button-pinpoint-instant_courier {
    width: 150px;
    text-align: center;
    background: var(--aw-primary-color);
    color: white;
    display: block;
    font-size: 0.875rem;
    padding: var(--aw-spacing-sm) var(--aw-spacing-md);
    font-weight: 600;
    border-radius: var(--aw-radius-md);
    position: relative;
    cursor: pointer;
    z-index: 3050;
    line-height: 1.5;
    border: none;
    margin: 0 0 var(--aw-spacing-sm);
    box-shadow: var(--aw-shadow-md);
    transition: all var(--aw-transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#button_pinpoint .button-pinpoint-instant_courier:hover {
    background: var(--aw-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--aw-shadow-lg);
}

#button_pinpoint .button-pinpoint-instant_courier:active {
    transform: translateY(0);
    box-shadow: var(--aw-shadow-sm);
}

/* ===================================
   Button Style Variations
   =================================== */

/* Button Style: Rounded (default) */
.button-style-rounded,
#button_pinpoint .button-style-rounded {
    border-radius: var(--aw-radius-md);
}

/* Button Style: Square */
.button-style-square,
#button_pinpoint .button-style-square {
    border-radius: 0;
}

/* Button Style: Pill */
.button-style-pill,
#button_pinpoint .button-style-pill {
    border-radius: var(--aw-radius-full);
}

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

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

/* Button Style: Minimal */
.button-style-minimal,
#button_pinpoint .button-style-minimal {
    border-radius: var(--aw-radius-sm);
    border: none;
    background-color: var(--aw-primary-color);
    box-shadow: none;
    font-weight: 500;
}

.button-style-minimal:hover {
    background-color: var(--aw-primary-hover);
    box-shadow: var(--aw-shadow-sm);
}

/* ===================================
   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;
        border-radius: 0 !important;
    }

    .modal-size-fullscreen #instant_maps {
        border-radius: 0 !important;
    }
}

/* Location Icon Placeholder */
#button_pinpoint .button-pinpoint-instant_courier:before {
    content: "📍";
    margin-right: var(--aw-spacing-xs);
}

#button_pinpoint .image-pinpoint {
    display: block;
    max-width: none;
    height: 40px;
    width: auto;
    margin: 0 auto;
    filter: drop-shadow(var(--aw-shadow-md));
    transition: transform var(--aw-transition-fast);
}

#button_pinpoint .image-pinpoint:hover {
    transform: scale(1.1);
}

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

/* Mobile-First Base Styles */
@media (max-width: 480px) {
    /* Modal adjustments for small phones */
    .modal-instant-courier-center {
        padding: var(--aw-spacing-sm);
        align-items: flex-start;
        padding-top: var(--aw-spacing-md);
    }

    .modal-instant-courier-content {
        width: 100%;
        height: calc(100vh - 2rem);
        max-height: none;
        border-radius: var(--aw-radius-md);
        margin: 0;
    }

    /* Enhanced close button for touch */
    .modal-instant-courier-close {
        width: 48px;
        height: 48px;
        right: var(--aw-spacing-sm);
        top: var(--aw-spacing-sm);
        border-width: 3px;
        box-shadow: var(--aw-shadow-lg);
    }

    .modal-instant-courier-close:before,
    .modal-instant-courier-close:after {
        height: 22px;
        width: 3px;
    }

    /* Search input optimization */
    #pac-input {
        height: 52px;
        font-size: 16px; /* Prevent zoom on iOS */
        padding: var(--aw-spacing-md);
        padding-left: 3rem;
        margin: var(--aw-spacing-sm);
        width: calc(100% - 1rem);
        border-width: 2px;
        box-shadow: var(--aw-shadow-md);
    }

    #pac-input:focus {
        box-shadow: 0 0 0 4px rgba(66, 153, 225, 0.15), var(--aw-shadow-lg);
    }

    /* Touch-friendly pinpoint button */
    #button_pinpoint {
        top: calc(50% - 45px);
        height: 90px;
    }

    #button_pinpoint .button-pinpoint-instant_courier {
        width: 200px;
        padding: var(--aw-spacing-md) var(--aw-spacing-lg);
        font-size: 0.875rem;
        min-height: 48px;
        font-weight: 700;
        box-shadow: var(--aw-shadow-lg);
        border: 3px solid transparent;
    }

    #button_pinpoint .button-pinpoint-instant_courier:focus {
        outline: none;
        border-color: var(--aw-border-focus);
        box-shadow: 0 0 0 4px rgba(66, 153, 225, 0.15), var(--aw-shadow-lg);
    }

    #button_pinpoint .image-pinpoint {
        height: 44px;
        margin-bottom: var(--aw-spacing-xs);
    }

    /* Enhanced pinpoint area */
    .instant-courier-pinpoint {
        padding: var(--aw-spacing-lg) var(--aw-spacing-sm);
        background: linear-gradient(to bottom, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.1));
    }

    /* Map adjustments */
    #instant_maps {
        border-radius: 0 0 var(--aw-radius-md) var(--aw-radius-md);
    }

    /* Autocomplete dropdown */
    .pac-container {
        margin-top: var(--aw-spacing-sm);
        box-shadow: var(--aw-shadow-xl);
        border-radius: var(--aw-radius-lg);
    }

    .pac-item {
        padding: var(--aw-spacing-md);
        font-size: 1rem;
        border-bottom: 1px solid var(--aw-border-color);
    }

    .pac-item:last-child {
        border-bottom: none;
    }
}

/* Small tablets and large phones */
@media (min-width: 481px) and (max-width: 768px) {
    .modal-instant-courier-center {
        padding: var(--aw-spacing-md);
    }

    .modal-instant-courier-content {
        width: 95%;
        height: 85%;
        max-height: 600px;
    }

    /* Close button sizing */
    .modal-instant-courier-close {
        width: 44px;
        height: 44px;
        right: var(--aw-spacing-md);
        top: var(--aw-spacing-md);
    }

    .modal-instant-courier-close:before,
    .modal-instant-courier-close:after {
        height: 20px;
        width: 2px;
    }

    /* Search input */
    #pac-input {
        height: 50px;
        font-size: 16px;
        padding: var(--aw-spacing-md);
        padding-left: 2.75rem;
        margin: var(--aw-spacing-md);
        width: calc(100% - 2rem);
    }

    /* Pinpoint button */
    #button_pinpoint .button-pinpoint-instant_courier {
        width: 180px;
        padding: var(--aw-spacing-md);
        font-size: 0.875rem;
        min-height: 44px;
    }

    #button_pinpoint .button-pinpoint-instant_courier:focus {
        outline: none;
        border: 2px solid var(--aw-border-focus);
        box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1), var(--aw-shadow-lg);
    }

    #button_pinpoint .image-pinpoint {
        height: 42px;
    }
}

/* Large tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .modal-instant-courier-content {
        width: 90%;
        height: 80%;
        max-height: 650px;
    }

    .modal-instant-courier-close {
        width: 42px;
        height: 42px;
    }

    #pac-input {
        height: 48px;
        font-size: 1rem;
    }

    #button_pinpoint .button-pinpoint-instant_courier {
        width: 170px;
        min-height: 44px;
    }

    #button_pinpoint .button-pinpoint-instant_courier:focus {
        outline: none;
        border: 2px solid var(--aw-border-focus);
        box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1), var(--aw-shadow-md);
    }
}

/* Desktop and larger screens */
@media (min-width: 1025px) {
    .modal-instant-courier-content {
        width: 90%;
        max-width: 900px;
        height: 80%;
        max-height: 700px;
    }

    #button_pinpoint .button-pinpoint-instant_courier:focus {
        outline: none;
        border: 2px solid var(--aw-border-focus);
        box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1), var(--aw-shadow-md);
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-instant-courier-content {
        height: 95vh;
        width: 98%;
    }

    .modal-instant-courier-center {
        padding: var(--aw-spacing-xs);
        align-items: center;
        padding-top: var(--aw-spacing-sm);
    }

    .instant-courier-pinpoint {
        padding: var(--aw-spacing-sm) 0;
    }

    #button_pinpoint {
        top: calc(50% - 35px);
        height: 70px;
    }

    #button_pinpoint .button-pinpoint-instant_courier {
        padding: var(--aw-spacing-sm) var(--aw-spacing-md);
        font-size: 0.813rem;
    }

    #button_pinpoint .image-pinpoint {
        height: 36px;
    }
}

/* 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,
    #button_pinpoint .button-pinpoint-instant_courier,
    #button_pinpoint .image-pinpoint,
    #pac-input {
        animation: none;
        transition: none;
    }

    .modal-instant-courier-close:hover {
        transform: none;
    }

    #button_pinpoint .button-pinpoint-instant_courier:hover {
        transform: none;
    }

    #button_pinpoint .image-pinpoint: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) {
    .modal-instant-courier-content {
        border: 3px solid;
    }

    .modal-instant-courier-close {
        border-width: 3px;
    }

    #pac-input {
        border-width: 3px;
    }

    #button_pinpoint .button-pinpoint-instant_courier {
        border: 3px solid;
    }
}

/* 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-content {
        background-color: var(--aw-bg-primary);
        color: var(--aw-text-primary);
    }

    #pac-input {
        background-color: var(--aw-bg-primary);
        color: var(--aw-text-primary);
    }

    .instant-courier-pinpoint {
        background: linear-gradient(to bottom, rgba(26, 32, 44, 0.95), rgba(26, 32, 44, 0));
    }
}

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

    /* Remove hover states on touch devices */
    .modal-instant-courier-close:hover {
        background: var(--aw-bg-primary);
        border-color: var(--aw-border-color);
        color: var(--aw-text-secondary);
        transform: none;
    }

    #button_pinpoint .button-pinpoint-instant_courier:hover {
        background: var(--aw-primary-color);
        transform: none;
        box-shadow: var(--aw-shadow-md);
    }

    #button_pinpoint .image-pinpoint:hover {
        transform: none;
    }
}

/* Safe area adjustments for devices with notches */
@supports (padding: max(0px)) {
    .modal-instant-courier-center {
        padding-left: max(var(--aw-spacing-lg), env(safe-area-inset-left));
        padding-right: max(var(--aw-spacing-lg), env(safe-area-inset-right));
        padding-top: max(var(--aw-spacing-lg), env(safe-area-inset-top));
        padding-bottom: max(var(--aw-spacing-lg), env(safe-area-inset-bottom));
    }

    @media (max-width: 480px) {
        .modal-instant-courier-center {
            padding-left: max(var(--aw-spacing-sm), env(safe-area-inset-left));
            padding-right: max(var(--aw-spacing-sm), env(safe-area-inset-right));
            padding-top: max(var(--aw-spacing-md), env(safe-area-inset-top));
            padding-bottom: max(var(--aw-spacing-sm), 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
   =================================== */
.aw-search-results {
    position: absolute;
    top: 60px;
    left: 16px;
    right: 16px;
    max-height: 300px;
    overflow-y: auto;
    background: var(--aw-bg-primary);
    border: 1px solid var(--aw-border-color);
    border-radius: var(--aw-radius-md);
    box-shadow: var(--aw-shadow-lg);
    z-index: 10000;
    display: none;
}

.aw-search-result {
    padding: var(--aw-spacing-md);
    cursor: pointer;
    border-bottom: 1px solid var(--aw-border-color);
    transition: background-color var(--aw-transition-fast);
}

.aw-search-result:last-child {
    border-bottom: none;
}

.aw-search-result:hover {
    background-color: var(--aw-bg-secondary);
}

.aw-search-result-title {
    font-weight: 600;
    color: var(--aw-text-primary);
    margin-bottom: var(--aw-spacing-xs);
}

.aw-search-result-address {
    font-size: 0.875rem;
    color: var(--aw-text-secondary);
}

.aw-search-loading,
.aw-search-no-results,
.aw-search-error {
    padding: var(--aw-spacing-md);
    text-align: center;
    color: var(--aw-text-secondary);
    font-size: 0.875rem;
}

.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 */
.leaflet-control-custom {
    cursor: pointer;
    transition: all var(--aw-transition-fast);
}

.leaflet-control-custom:hover {
    background-color: var(--aw-primary-color) !important;
}

.leaflet-control-custom:hover svg {
    stroke: white;
}

/* Dark mode support for search results */
@media (prefers-color-scheme: dark) {
    .aw-search-results {
        background: var(--aw-bg-primary);
        border-color: var(--aw-border-color);
    }
    
    .aw-search-result:hover {
        background-color: var(--aw-bg-secondary);
    }
}

/* ===================================
   Map Field Interface
   =================================== */
.aw-map-display {
    position: relative;
    background: var(--aw-bg-secondary);
    border: 2px solid var(--aw-border-color);
    border-radius: var(--aw-radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--aw-transition-normal);
}

.aw-map-display:hover {
    border-color: var(--aw-primary-color);
    box-shadow: var(--aw-shadow-md);
}

/* Empty State */
.aw-map-display.empty-state {
    padding: var(--aw-spacing-xl);
    text-align: center;
    background: linear-gradient(135deg, #f7fafc 0%, #e2e8f0 100%);
}

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

.aw-map-icon {
    width: 60px;
    height: 60px;
    background: var(--aw-bg-primary);
    border-radius: var(--aw-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--aw-shadow-sm);
}

.aw-map-icon i {
    font-size: 28px;
    color: var(--aw-primary-color);
}

.aw-map-text h4 {
    margin: 0 0 var(--aw-spacing-xs);
    color: var(--aw-text-primary);
    font-size: 1.125rem;
    font-weight: 600;
}

.aw-map-text p {
    margin: 0;
    color: var(--aw-text-secondary);
    font-size: 0.875rem;
}

.aw-map-button {
    background: var(--aw-primary-color);
    color: white;
    border: none;
    padding: var(--aw-spacing-sm) var(--aw-spacing-lg);
    border-radius: var(--aw-radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--aw-transition-fast);
}

.aw-map-button:hover {
    background: var(--aw-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--aw-shadow-md);
}

.aw-map-button.primary {
    padding: var(--aw-spacing-md) var(--aw-spacing-xl);
    font-size: 1rem;
}

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

.aw-mini-map {
    position: relative;
    width: 100%;
    height: 100%;
}

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

.aw-map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0) 50%, 
        rgba(255, 255, 255, 0.8) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: var(--aw-spacing-md);
    opacity: 0;
    transition: opacity var(--aw-transition-fast);
}

.aw-mini-map:hover .aw-map-overlay {
    opacity: 1;
}

.aw-map-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    z-index: 10;
}

.aw-map-marker img {
    width: 30px;
    height: 42px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.aw-map-overlay .aw-map-button {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.95);
    color: var(--aw-primary-color);
    border: 2px solid var(--aw-primary-color);
}

.aw-map-overlay .aw-map-button:hover {
    background: var(--aw-primary-color);
    color: white;
}

/* Address Display */

.aw-loading-text {
    color: var(--aw-text-muted);
    font-style: italic;
}

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

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

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .aw-map-display.empty-state {
        padding: var(--aw-spacing-lg);
    }
    
    .aw-map-icon {
        width: 50px;
        height: 50px;
    }
    
    .aw-map-icon i {
        font-size: 24px;
    }
    
    .aw-map-text h4 {
        font-size: 1rem;
    }
    
    .aw-map-button.primary {
        padding: var(--aw-spacing-sm) var(--aw-spacing-lg);
        font-size: 0.875rem;
        width: 100%;
        max-width: 250px;
    }
    
    .aw-map-display.has-coordinates {
        height: 150px;
    }
    
    .aw-map-overlay {
        opacity: 1;
        background: linear-gradient(to bottom, 
            rgba(255, 255, 255, 0) 0%, 
            rgba(255, 255, 255, 0.95) 70%);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .aw-map-display {
        background: var(--aw-bg-secondary);
        border-color: var(--aw-border-color);
    }
    
    .aw-map-display.empty-state {
        background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    }
    
    .aw-map-icon {
        background: var(--aw-bg-secondary);
    }
    
    .aw-map-overlay {
        background: linear-gradient(to bottom, 
            rgba(26, 32, 44, 0) 0%, 
            rgba(26, 32, 44, 0) 50%, 
            rgba(26, 32, 44, 0.8) 100%);
    }
    
    .aw-map-overlay .aw-map-button {
        background: rgba(45, 55, 72, 0.95);
    }
}