/* Region and office pickers (listbox dropdowns), the branch card and the Call Us dialog on the contact and claim form blocks. */

[data-branch-finder] [hidden],
.branch-finder-dialog [hidden] {
    display: none !important;
}

.branch-picker-row {
    grid-column: 1 / -1;
}

.branch-picker {
    position: relative;
    text-align: left;
}

.branch-picker-label {
    display: block;
}

.branch-picker-toggle {
    width: 100%;
    min-height: 60px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 16px 16px 16px 24px;
    color: rgba(87, 87, 86, .94);
    background-color: #fff;
    border: 1px solid rgba(214, 214, 214, .82);
    border-radius: 10px;
    font-family: Albert Sans, sans-serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 20px;
    text-align: left;
    cursor: pointer;
    transition: box-shadow .3s, color .3s, border-color .3s;
}

.branch-picker-toggle:hover:not(:disabled) {
    border-color: #e2e8eb;
    box-shadow: 0 2px 12px rgba(20, 20, 43, .1);
}

.branch-picker-toggle:focus-visible,
.branch-picker-listbox:focus-visible,
.branch-finder-outline-button:focus-visible,
.branch-finder-dialog-close:focus-visible {
    outline: 2px solid #0b7377;
    outline-offset: 2px;
}

.branch-picker-toggle[aria-expanded="true"],
.branch-picker.has-value .branch-picker-toggle {
    color: #043b58;
}

.branch-picker-toggle[aria-expanded="true"] {
    border-color: #043b58;
}

.branch-picker-toggle:disabled {
    background-color: #f5f8f8;
    color: #6e7191;
    cursor: not-allowed;
}

.branch-picker-toggle.input-validation-error {
    border-color: #e23939;
}

.branch-picker-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.branch-picker-chevron {
    flex-shrink: 0;
    color: #043b58;
    transition: transform .2s;
}

.branch-picker-toggle[aria-expanded="true"] .branch-picker-chevron {
    transform: rotate(180deg);
}

.branch-picker-listbox {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 20;
    margin: 6px 0 0;
    padding: 6px;
    max-height: 320px;
    overflow-y: auto;
    list-style: none;
    background-color: #fff;
    border: 1px solid #d6d6d6;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(20, 20, 43, .12);
    outline: none;
}

.branch-picker-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 8px;
    font-family: Albert Sans, sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #043b58;
    cursor: pointer;
}

.branch-picker-option.is-active {
    background-color: #f1f6f6;
}

.branch-picker-option[aria-selected="true"] {
    font-weight: 600;
}

.branch-picker-tick {
    width: 18px;
    height: 18px;
    display: flex;
    flex-shrink: 0;
    color: #0b7377;
    visibility: hidden;
}

.branch-picker-option[aria-selected="true"] .branch-picker-tick {
    visibility: visible;
}

.branch-picker-option-name {
    flex: 1;
}

.branch-picker-option-count {
    font-size: 14px;
    font-weight: 400;
    color: #6e7191;
    white-space: nowrap;
}

.branch-finder-office-name {
    color: #043b58;
    font-family: Albert Sans, sans-serif;
    font-size: 17px;
    font-weight: 500;
    line-height: 24px;
}

.branch-finder-address {
    color: #585857;
    font-family: Albert Sans, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
}

/* Office rows are spaced in the card; in the dialog the flex gap separates them. */
.branch-finder-row {
    margin-bottom: 1.5rem;
}

.branch-finder-dialog-office .branch-finder-row {
    margin-bottom: 0;
}

.branch-finder-outline-button {
    display: inline-block;
    min-height: 50px;
    padding: 0 22px;
    color: #043b58;
    background-color: #fff;
    border: 2px solid #043b58;
    border-radius: 10px;
    font-family: Albert Sans, sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .3s, color .3s;
}

.branch-finder-outline-button:hover {
    background-color: #043b58;
    color: #fff;
}

[data-branch-panel-details] .branch-finder-outline-button {
    margin-top: 8px;
}

.branch-finder-dialog {
    width: 440px;
    max-width: calc(100% - 32px);
    max-height: calc(100vh - 32px);
    box-sizing: border-box;
    /* The inner wrapper scrolls, not the dialog, so a scrollbar never squares off the rounded corners. */
    overflow: hidden;
    padding: 0;
    border: 0;
    border-radius: 20px;
    background-color: #fff;
    color: #043b58;
    font-family: Albert Sans, sans-serif;
}

.branch-finder-dialog[open] {
    display: block;
}

.branch-finder-dialog::backdrop {
    background-color: rgba(0, 0, 0, .5);
}

.branch-finder-dialog-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-sizing: border-box;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 60px 30px 30px;
}

.branch-finder-dialog-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: #043b58;
    cursor: pointer;
}

.branch-finder-dialog-title {
    margin: 0;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.15;
    color: #043b58;
}

.branch-finder-dialog-text {
    margin: 0;
    font-size: 17px;
    font-weight: 400;
    line-height: 24px;
    color: #043b58;
}

.branch-finder-dialog .branch-picker-label {
    margin-bottom: 8px;
    font-size: 17px;
    font-weight: 500;
}

/* The dialog clips overflow, so inside it the list sits in the flow and grows the dialog instead of floating over it. */
.branch-finder-dialog .branch-picker-listbox {
    position: static;
    max-height: 240px;
}

.branch-finder-dialog-office {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.branch-finder-dialog-office .branch-details {
    min-height: 48px;
}

.branch-finder-dialog .branch-finder-outline-button {
    align-self: flex-start;
    min-height: 56px;
    padding: 0 24px;
}

@media screen and (max-width: 479px) {
    .branch-picker-row {
        grid-column: span 1 / span 1;
    }

    .branch-finder-dialog-inner {
        padding: 56px 20px 24px;
    }
}
