/* ========================================
   HEADER LOCATION CONTROL
======================================== */

.header-location-button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 150px;
    min-height: 56px;
    padding: 8px 12px;
    border: 1px solid #d5deeb;
    border-radius: 10px;
    background: #ffffff;
    color: #14213d;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.header-location-button:hover,
.header-location-button:focus-visible,
.header-location-button[aria-expanded="true"] {
    border-color: #17479e;
    background: #f8fbff;
    box-shadow: 0 0 0 3px rgba(23, 71, 158, 0.12);
    outline: none;
}

.header-location-icon {
    flex: 0 0 auto;
    font-size: 18px;
}

.header-location-copy {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    line-height: 1.15;
}

.header-location-copy small {
    margin-bottom: 3px;
    color: #6b7890;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.header-location-copy strong {
    overflow: hidden;
    color: #17264a;
    font-size: 15px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-location-arrow {
    flex: 0 0 auto;
    color: #61708b;
    font-size: 12px;
}

/* ========================================
   LOCATION PICKER
======================================== */

body.location-picker-open {
    overflow: hidden;
}

.location-picker[hidden] {
    display: none;
}

.location-picker {
    position: fixed;
    inset: 0;
    z-index: 3000;
}

.location-picker-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    padding: 0;
    border: 0;
    background: rgba(10, 26, 55, 0.48);
    cursor: default;
}

.location-picker-panel {
    position: absolute;
    top: var(--location-picker-top, 84px);
    right: var(--location-picker-right, 24px);
    display: flex;
    width: min(640px, calc(100vw - 32px));
    max-height: min(720px, calc(100vh - 104px));
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #d9e2ef;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(8, 27, 63, 0.25);
}

.location-picker-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 26px 18px;
    border-bottom: 1px solid #e5ebf3;
}

.location-picker-eyebrow {
    margin: 0 0 6px;
    color: #f15b22;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.location-picker-header h2 {
    margin: 0;
    color: #17479e;
    font-size: 28px;
    line-height: 1.2;
}

.location-picker-introduction {
    margin: 7px 0 0;
    color: #64728b;
    font-size: 14px;
    line-height: 1.5;
}

.location-picker-close {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid #d8e0ec;
    border-radius: 50%;
    background: #ffffff;
    color: #283955;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
}

.location-picker-close:hover,
.location-picker-close:focus-visible {
    border-color: #17479e;
    color: #17479e;
    outline: none;
}

.location-picker-search {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin: 18px 26px 12px;
    padding: 6px 7px 6px 14px;
    border: 1px solid #cad5e5;
    border-radius: 12px;
    background: #ffffff;
}

.location-picker-search:focus-within {
    border-color: #17479e;
    box-shadow: 0 0 0 3px rgba(23, 71, 158, 0.1);
}

.location-picker-search-icon {
    color: #687892;
    font-size: 16px;
}

.location-picker-search input {
    width: 100%;
    min-width: 0;
    padding: 9px 0;
    border: 0;
    background: transparent;
    color: #14213d;
    font: inherit;
    outline: none;
}

.location-picker-search button {
    min-height: 38px;
    padding: 8px 17px;
    border: 0;
    border-radius: 8px;
    background: #17479e;
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.location-picker-breadcrumb {
    padding: 0 26px 12px;
    overflow-x: auto;
}

.location-picker-breadcrumb ol {
    display: flex;
    align-items: center;
    gap: 7px;
    width: max-content;
    margin: 0;
    padding: 0;
    list-style: none;
}

.location-picker-breadcrumb li {
    display: flex;
    align-items: center;
    gap: 7px;
}

.location-picker-breadcrumb li:not(:last-child)::after {
    content: "/";
    color: #98a5b8;
}

.location-picker-breadcrumb button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #17479e;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.location-picker-message {
    min-height: 20px;
    padding: 0 26px;
    color: #66758e;
    font-size: 13px;
}

.location-picker-message.is-error {
    color: #b42318;
}

.location-picker-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 8px 26px 4px;
    padding: 12px 14px;
    border: 1px solid #dce6f3;
    border-radius: 11px;
    background: #f7faff;
}

.location-picker-current[hidden] {
    display: none;
}

.location-picker-current div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.location-picker-current span {
    color: #73819a;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.location-picker-current strong {
    margin-top: 3px;
    color: #17479e;
    font-size: 16px;
}

.location-picker-current small {
    margin-top: 3px;
    overflow: hidden;
    color: #687791;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.location-picker-postal-button {
    flex: 0 0 auto;
    padding: 8px 11px;
    border: 1px solid #f15b22;
    border-radius: 8px;
    background: #fff8f3;
    color: #c84412;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.location-picker-postal-button[hidden] {
    display: none;
}

.location-picker-results-section {
    min-height: 180px;
    padding: 14px 26px 18px;
    overflow-y: auto;
}

.location-picker-results-heading h3 {
    margin: 0;
    color: #1c3158;
    font-size: 18px;
}

.location-picker-results-heading p {
    margin: 4px 0 0;
    color: #748198;
    font-size: 13px;
}

.location-picker-results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 14px 16px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.location-picker-select-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 7px;
}

.location-picker-select-field label {
    color: #253858;
    font-size: 13px;
    font-weight: 700;
}

.location-picker-select-field select {
    width: 100%;
    min-height: 48px;
    padding: 10px 38px 10px 12px;
    border: 1px solid #cad5e5;
    border-radius: 10px;
    background-color: #ffffff;
    color: #17264a;
    font: inherit;
    cursor: pointer;
}

.location-picker-select-field select:hover,
.location-picker-select-field select:focus-visible {
    border-color: #17479e;
    box-shadow: 0 0 0 3px rgba(23, 71, 158, 0.1);
    outline: none;
}

.location-picker-result-button {
    display: flex;
    width: 100%;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #dce4ef;
    border-radius: 10px;
    background: #ffffff;
    color: #1c3158;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.location-picker-result-button:hover,
.location-picker-result-button:focus-visible,
.location-picker-result-button.is-selected {
    border-color: #17479e;
    background: #f3f7ff;
    outline: none;
}

.location-picker-result-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.location-picker-result-copy strong {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.location-picker-result-copy small {
    margin-top: 3px;
    color: #748198;
    font-size: 11px;
}

.location-picker-result-arrow {
    flex: 0 0 auto;
    color: #17479e;
}

.location-picker-empty {
    padding: 30px 12px;
    color: #6d7a91;
    text-align: center;
}

.location-picker-empty[hidden] {
    display: none;
}

.location-picker-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 26px;
    border-top: 1px solid #e2e8f1;
    background: #fbfcfe;
}

.location-picker-actions > div {
    display: flex;
    gap: 10px;
}

.location-picker-clear,
.location-picker-cancel,
.location-picker-apply {
    min-height: 42px;
    padding: 9px 15px;
    border-radius: 9px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.location-picker-clear {
    padding-left: 0;
    border: 0;
    background: transparent;
    color: #b42318;
}

.location-picker-cancel {
    border: 1px solid #bdc9da;
    background: #ffffff;
    color: #243858;
}

.location-picker-apply {
    border: 1px solid #17479e;
    background: #17479e;
    color: #ffffff;
}

.location-picker-apply:disabled {
    border-color: #aab5c5;
    background: #aab5c5;
    cursor: not-allowed;
}

/* ========================================
   RESPONSIVE LOCATION PICKER
======================================== */

@media (max-width: 767px) {

    .header-location-button {
        width: 100%;
    }

    .location-picker-panel {
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-height: 92vh;
        border-radius: 20px 20px 0 0;
    }

    .location-picker-header {
        padding: 20px 18px 15px;
    }

    .location-picker-header h2 {
        font-size: 23px;
    }

    .location-picker-search {
        margin: 15px 18px 11px;
    }

    .location-picker-breadcrumb,
    .location-picker-message {
        padding-right: 18px;
        padding-left: 18px;
    }

    .location-picker-current {
        align-items: flex-start;
        flex-direction: column;
        margin-right: 18px;
        margin-left: 18px;
    }

    .location-picker-results-section {
        padding-right: 18px;
        padding-left: 18px;
    }

    .location-picker-results {
        grid-template-columns: 1fr;
    }

    .location-picker-actions {
        align-items: stretch;
        flex-direction: column-reverse;
        padding: 13px 18px;
    }

    .location-picker-actions > div {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .location-picker-clear,
    .location-picker-cancel,
    .location-picker-apply {
        width: 100%;
    }
}

@media (prefers-reduced-motion: no-preference) {

    .location-picker-panel {
        animation: location-picker-enter 0.18s ease-out;
    }

    @keyframes location-picker-enter {

        from {
            opacity: 0;
            transform: translateY(-8px);
        }

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

/* Cascading dropdowns replace the old breadcrumb navigation. */
.location-picker-breadcrumb {
    display: none;
}