/* =========== Autocomplete Dropdown =========== */
.locationiq-autocomplete-dropdown {
    max-height: 300px;
    overflow-y: auto;
    font-size: 16px;
    border-radius: 8px;
    box-shadow: 0 4px 18px rgba(60,60,60,0.12);
    border: 1px solid #ccc;
    background: #fff;
    margin-top: 2px;
    z-index: 99999;
    width: 100%;
    min-width: 0;
    left: 0 !important;
    right: 0 !important;
    position: absolute !important;
}

@media (min-width: 600px) {
    .locationiq-autocomplete-dropdown {
        width: 360px !important;
        left: unset !important;
        right: unset !important;
    }
}

.locationiq-autocomplete-option {
    padding: 14px 18px;
    cursor: pointer;
    border-bottom: 1px solid #f2f2f2;
    transition: background 0.1s;
    display: block;
    outline: none;
    font-size: 16px;
}

.locationiq-autocomplete-option:last-child {
    border-bottom: none;
}

.locationiq-autocomplete-option:hover,
.locationiq-autocomplete-option.active,
.locationiq-autocomplete-option:focus {
    background: #f2f7fa;
}

.autocomplete-primary {
    font-weight: 600;
    color: #222;
    font-size: 16px;
    line-height: 1.2;
}

.autocomplete-secondary {
    color: #666;
    font-size: 13px;
    line-height: 1.2;
    margin-top: 2px;
    white-space: normal;
}

/* =========== Calculator Form & Header Offset =========== */
#p2p-calculator {
    /* push below fixed header (adjust 80px to your header height) */
    margin: 80px auto 0;
    max-width: 1200px;
    padding: 0 12px;
}

#p2p-calculator input[type="text"] {
    width: 100%;
    font-size: 1.08em;
    padding: 13px 11px;
    margin-bottom: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    background: #fff;
}

/* =========== Custom Button Style =========== */
#p2p-calculator button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    letter-spacing: 0.02em;
    font-weight: 500;
    text-transform: uppercase;
    text-align: center;
    padding: 12px 30px;
    margin-right: 40px;
    margin-bottom: 16px;
    border-radius: 25px;
    border: 2px solid var(--global-color-9);
    color: var(--global-color-9);
    background: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border 0.15s;
    box-shadow: 0 1px 2px rgba(60,60,60,0.04);
}
#p2p-calculator button:active,
#p2p-calculator button:focus,
#p2p-calculator button:hover {
    background: var(--global-color-9);
    color: #fff;
    border-color: var(--global-color-9);
    outline: none;
}

@media (max-width: 600px) {
    #p2p-calculator button {
        width: 100%;
        margin-right: 0;
        padding: 13px 0;
        font-size: 15px;
        border-radius: 22px;
    }
}

/* Result and text output */
#result {
    font-size: 1.09em;
    min-height: 32px;
    margin-bottom: 10px;
}

/* =========== Flex Layout: Side-by-Side on Desktop, Stacked on Mobile =========== */
.p2p-calc-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: flex-start;
}

.p2p-calc-fields,
.p2p-calc-map {
    flex: 1 1 300px;
    min-width: 280px;
    position: relative;
    z-index: 0;
}

/* =========== Map Styling =========== */
#route-map {
    width: 100%;
    height: 420px;
    min-height: 220px;
    margin-top: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    background: #f7f7f9;
    display: block !important;
    visibility: visible !important;
}

@media (max-width: 900px) {
    .p2p-calc-flex {
        flex-direction: column;
        gap: 16px;
    }
    .p2p-calc-fields,
    .p2p-calc-map {
        max-width: 100%;
        min-width: 0;
        display: block !important;
    }
    #route-map {
        height: 220px !important;
        margin-top: 12px !important;
    }
}

/* =========== Coupon Form Spacing =========== */
#coupon-section {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#coupon-section input,
#coupon-section button {
    margin: 0;
    width: 100%;
    max-width: 320px;
}

/* =========== Autocomplete Mobile Dropdown Fix =========== */
@media (max-width: 600px) {
    .locationiq-autocomplete-dropdown {
        width: 100vw !important;
        min-width: 0;
        left: 0 !important;
    }
}

/* Accessibility: visually hidden but screen reader available */
.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* Hide Leaflet Attribution (compliant only if you credit elsewhere) */
.leaflet-control-attribution {
    display: none !important;
}
/* Small credits under the map */
.map-credits {
  display: block;
  margin-top: 6px;
  color: #888;
  font-size: 12px;
  line-height: 1.2;
  text-align: right;
}

@media (max-width: 900px) {
  .map-credits {
    text-align: left;
    margin-top: 8px;
    font-size: 11.5px;
  }
}
