/* ==========================================================================
   Find A Studio - New Popup Implementation
   ========================================================================== */

/* Backdrop overlay */
.fas-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1040;
}
.fas-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

/* Popup panel - desktop: left-side, mobile: full-screen */
.fas-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 388px;
    max-width: 100vw;
    height: 100vh;
    background: #FFFFFF;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    border: 2px solid #E0E7EB;
    transform: translateX(-100%);
    /* delay visibility:hidden until after the slide-out animation completes */
    transition: transform 0.3s ease, visibility 0s ease 0.3s;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    visibility: hidden;
    font-family: 'OpenSans-Regular', 'Open Sans', sans-serif;
    border-end-end-radius: 6px;
    border-start-end-radius: 6px;
}
.fas-popup.is-open {
    transform: translateX(0);
    visibility: visible;
    /* make visible instantly on open, then animate slide-in */
    transition: transform 0.3s ease, visibility 0s ease 0s;
}

/* Header section */
.fas-header {
    position: relative;
    padding: 20px 24px 0;
    flex-shrink: 0;
}
.fas-title {
    font-family: 'Open Sans', sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 140%;
    color: #000000;
    /* stretch full-width and draw divider below title only */
    margin: 0 -24px;
    padding: 0 24px 16px;
    border-bottom: 2px solid #E0E0E0;
    text-align: center;
}
.fas-subtitle {
    font-family: 'OpenSans-Regular', 'Open Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 24px;
    color: #000000;
    margin: 16px 0 0;
    text-align: center;
    letter-spacing: 0.25px;
}
.fas-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 24px;
    height: 24px;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #686868;
}
.fas-close:hover,
.fas-close:focus {
    color: #000000;
    outline: none;
}
.fas-close svg {
    width: 18px;
    height: 18px;
}

/* Search form */
.fas-search {
    padding: 24px 24px 18px;
    flex-shrink: 0;
}
.fas-label {
    display: block;
    font-family: 'OpenSans-SemiBold', 'Open Sans', sans-serif;
    font-weight: 600;
    font-size: 14px;
    line-height: 24px;
    color: #000000;
    margin: 0 0 6px;
}
.fas-input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #BEBEBE;
    border-radius: 4px;
    font-family: 'OpenSans-Regular', 'Open Sans', sans-serif;
    font-size: 14px;
    line-height: 24px;
    color: #000000;
    background: #FFFFFF;
    box-sizing: border-box;
}
.fas-input::placeholder {
    color: #767676;
}
.fas-input:focus {
    outline: 2px solid #EA212D;
    outline-offset: -1px;
    border-color: #EA212D;
}
.fas-input.has-error {
    border-color: #EA212D;
    outline: 1px solid #EA212D;
}

.fas-search-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    gap: 12px;
}
.fas-geo-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 0;
    padding: 6px 0;
    cursor: pointer;
    color: #000000;
    font-family: 'OpenSans-Regular', 'Open Sans', sans-serif;
    font-size: 14px;
    line-height: 23px;
    text-decoration: underline;
}
.fas-geo-link:hover,
.fas-geo-link:focus {
    color: #EA212D;
    outline: none;
}
.fas-geo-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.fas-search-btn {
    background: #EA212D;
    color: #FFFFFF;
    border: 0;
    border-radius: 24px;
    height: 39px;
    min-width: 122px;
    padding: 0 22px;
    font-family: 'OpenSans-SemiBold', 'Open Sans', sans-serif;
    font-weight: 600;
    font-size: 14px;
    line-height: 19px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease;
}
.fas-search-btn:hover {
    background: #CC0000;
}
.fas-search-btn:focus {
    outline: 2px solid #000000;
    outline-offset: 2px;
}

/* Error / status row */
.fas-error {
    display: none;
    color: #EA212D;
    font-size: 12px;
    line-height: 18px;
    margin: 6px 0 0;
}
.fas-error.is-visible {
    display: block;
}

/* Results section */
.fas-results-wrap {
    flex: 1 1 auto;
    overflow-y: auto;
    border-top: 1px solid #E0E0E0;
}
.fas-results-wrap.is-empty {
    border-top: 0;
}

/* Loading spinner */
.fas-loading {
    text-align: center;
    padding: 40px 20px;
}
.fas-loading img {
    width: 60px;
    height: auto;
}

/* Result list */
.fas-results {
    list-style: none;
    margin: 0;
    padding: 0;
}
.fas-result {
    display: block;
    padding: 16px 24px;
    border-bottom: 1px solid #E0E0E0;
    cursor: pointer;
    background: #FFFFFF;
    transition: background 0.15s ease;
}
.fas-result:hover {
    background: #F8F8F8;
}
.fas-result.is-selected {
    cursor: default;
}
.fas-result-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.fas-radio {
    flex-shrink: 0;
    width: 17px;
    height: 17px;
    border: 1px solid #2D3137;
    border-radius: 50%;
    margin-top: 06px;
    background: #FFFFFF;
    position: relative;
}
.fas-result.is-selected .fas-radio {
    border-color: #424B5A;
}
.fas-result.is-selected .fas-radio::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: #424B5A;
}
.fas-result-body {
    flex: 1 1 auto;
    min-width: 0;
}
.fas-result-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-family: 'Open Sans', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 30px;
    color: #2D3137;
    margin: 0 0 4px;
}
.fas-meta {
    font-family: 'Open Sans', sans-serif;
    font-size: 10px;
    line-height: 15px;
    color: #2D3137;
    text-decoration: underline;
    margin: 0;
}
.fas-mystudio-badge {
    flex-shrink: 0;
    display: inline-block;
    padding: 3px 10px;
    border: 1px solid #2E7D32;
    border-radius: 4px;
    color: #2E7D32;
    font-family: 'OpenSans-SemiBold', 'Open Sans', sans-serif;
    font-size: 11px;
    line-height: 14px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    background: #FFFFFF;
}

/* Selected studio expanded details — rendered as sibling of fas-result-row */
.fas-result-details {
    display: block;
    margin-top: 10px;
    padding-left: 29px; /* 17px radio + 12px gap = aligns with fas-result-body */
}
.fas-detail-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    font-family: 'Open Sans', sans-serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    color: #424B5A;
}
.fas-detail-row a {
    color: #424B5A;
    text-decoration: underline;
}
.fas-detail-row a:hover {
    color: #EA212D;
}
.fas-detail-row svg,
.fas-detail-row img {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #CC0000;
}
.fas-schedule-btn {
    display: block;
    width: 182px;
    box-sizing: border-box;
    margin-top: 14px;
    background: #EA212D;
    color: #FFFFFF;
    border: 0;
    border-radius: 21px;
    height: 39px;
    padding: 9px;
    font-family: 'Open Sans', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1.25px;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease;
}
.fas-schedule-btn:hover {
    background: #CC0000;
    color: #FFFFFF;
    text-decoration: none;
}
.fas-schedule-btn:focus {
    outline: 2px solid #000000;
    outline-offset: 2px;
    color: #FFFFFF;
}

/* No results state */
.fas-no-results {
    padding: 22px 24px 40px;
}
.fas-no-results-title {
    font-family: 'OpenSans-Bold', 'Open Sans', sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 28px;
    color: #000000;
    margin: 0 0 8px;
}
.fas-no-results-msg {
    font-family: 'OpenSans-Regular', 'Open Sans', sans-serif;
    font-size: 13px;
    line-height: 20px;
    color: #B40000;
    margin: 0;
}

/* Footer */
.fas-footer {
    flex-shrink: 0;
    padding: 18px 24px;
    background: #F4F4F4;
    text-align: center;
}
.fas-footer-text {
    margin: 0;
    font-family: 'OpenSans-Regular', 'Open Sans', sans-serif;
    font-size: 14px;
    line-height: 22px;
    color: #000000;
}

/* Lock body scroll when popup open */
body.fas-popup-open {
    overflow: hidden;
}

/* Mobile */
@media (max-width: 820px) {
    .fas-popup {
        width: 100vw;
        max-width: 100vw;
    }
    .fas-title {
        font-size: 20px;
        line-height: 28px;
    }
    .fas-search-btn {
        min-width: 110px;
    }
}

@media (max-width: 400px) {
    .fas-search-row {
        gap: 8px;
    }
    .fas-search-btn {
        min-width: 100px;
        padding: 0 14px;
    }
}

/* Header: selected studio name — keep icon and text on the same line, truncate if needed */
.h-findStudio-text-selected { display: none; }
.h-findStudio.has-studio .h-findStudio-text-default { display: none; }
.h-findStudio.has-studio .h-findStudio-text-selected {
    display: inline-block;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 145px;
}
/* Make the icon+text row a flex container so they stay on the same line */
.h-findStudio .h-findStudio-text .inner-sec > div:first-child {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
    flex: 1;
}
