/* ===== SECTION ===== */
.consult-location-partner {
    position: relative;
    padding: 5em 1em 10em;
    font-size: 0.625vw;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

/* ===== BACKGROUND LINE ===== */
.locations__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.locations__bg img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* ===== TITLE ===== */
.partner-title {
    position: relative;
    z-index: 1;
    font-size: 3.2em;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--primary-500);
    margin-bottom: 0.5em;
    text-transform: uppercase;
}

/* ===== LIST ===== */
#consult-location-partner .location-list {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1em;
    gap: 1.2em;
    flex-wrap: wrap;
}

/* ===== ITEM ===== */
#consult-location-partner .location-item {
    position: relative;
    width: 20%;
    border-radius: 1em;
    padding: 0.8em 1.6em;
    min-width: 9em;
    min-height: 3.5em;
    cursor: pointer;
}

/* ===== LOGO ===== */
#consult-location-partner .location-item img {
    max-width: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* ===== MOBILE/TABLET BANNER & TITLE ===== */
.search-locations-banner {
    display: none;
    /* Hidden on desktop */
}

.search-locations-banner__img {
    width: 100%;
    height: auto;
    display: block;
}

.search-locations-title {
    display: block;
    font-size: 4em;
    font-weight: 700;
    color: var(--primary-700);
    text-align: center;
    margin: 1em 0 0.5em;
    text-transform: uppercase;
}

/* ===== FORM SEARCH ===== */
.form-consultant {
    padding: 2em 1em;
    font-size: 0.625vw;
}

.form-input.form {
    display: flex;
    align-items: flex-start;
    gap: 1em;
    padding: 1em;
    border-radius: 3em;
}

/* container select */
.container-province-district {
    display: flex;
    gap: 1em;
    flex: 1;
}

/* select group */
.custom-form__group {
    position: relative;
    flex: 1;
}

.custom-form__select {
    width: 100%;
    padding: 0.9em 2.5em 0.9em 1.2em;
    border-radius: 2em;
    border: 0.08em solid #e0e0e0;
    font-size: 1.6em;
    appearance: none;
    background: #fff;
    cursor: pointer;
}

.custom-form__select:focus {
    outline: none;
    border-color: #0aa89e;
}

/* arrow */
.custom-form__arrow {
    position: absolute;
    right: 1.2em;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
    color: #666;
    pointer-events: none;
}

/* error message for location-type */
.location-type-error {
    display: none;
    color: #dc2626;
    font-size: 1.2em;
    margin-top: 0.5em;
    padding-left: 2.4em;
    font-weight: 400;
}

/* button */
.input-control button {
    padding: 0.9em 2em;
    border-radius: 2em;
    border: none;
    font-size: 1.6em;
    font-weight: 400;
    background: #0aa89e;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.input-control button>svg {
    width: 2em;
    height: 2em;
}

.input-control button:hover {
    background: #088f86;
}

/* ===== SEARCH RESULT WRAPPER ===== */
.search-result-wrapper {
    display: flex;
    margin-top: 2em;
    padding: 0 1em 3em;
    gap: 2em;
    font-size: 0.625vw;
}

/* ===== EMPTY STATE ===== */
.msd-loader-wrapper,
.msd-no-result-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5em 0;
}

.msd-loader-img img {
    width: 25.4em;
    margin-bottom: 1em;
}

.msd-no-result-wrapper .msd-loader-img img {
    width: 35.4em;
    margin-bottom: 1em;
}

.msd-loader-text {
    display: block;
    font-size: 2.8em;
    font-weight: 600;
}

.msd-loader-text.small {
    font-weight: 400;
    font-size: 1.6em;
    color: var(--neutral-900);
}

/* ===== LIST ===== */
.search-result {
    border-radius: 1.2em;
    box-shadow: 0 0.5em 2em rgba(0, 0, 0, 0.08);
    padding: 1em;
    flex: 1;
}

.search-result__list {
    display: flex;
    flex-direction: column;
    gap: 1em;

    max-height: 70em;
    overflow-y: auto;
    padding-right: 0.5em;
    scroll-behavior: smooth;
}

.search-result__list::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

.search-result__list::-webkit-scrollbar {
    width: 0.5em;
}

.search-result__list::-webkit-scrollbar-track {
    background: transparent;
}

.search-result__list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 1em;
}

.search-result__list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.search-result__list::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

.search-result__list {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

.location {
    scroll-margin-top: 1em;
}

.location {
    display: flex;
    gap: 1em;
    padding: 1em;
    border-radius: 1em;
    background: #ffffff;
    cursor: pointer;
    transition:
        background 0.3s ease,
        transform 0.3s ease;
}

.location:hover {
    background: #EBFFFD;
    transform: translateY(-0.1em);
}

/* active khi click map */
.location.is-active {
    background: #e7fffb;
    border-left: 0.3em solid #0aa89e;
}

.location__thumb {
    flex-shrink: 0;
}

.location__thumb-img,
.location__thumb-small {
    width: 12.7em;
    aspect-ratio: 1;
    border-radius: 0.8em;
    object-fit: cover;
    background: #eee;
}

.location__body,
.location__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.location__name,
.location__info__name {
    font-size: 1.8em;
    font-weight: 600;
    color: var(--primary-500);
    line-height: 1.3;
}

.location__meta {
    display: flex;
    flex-direction: column;
    gap: 0.3em;
}

.location__row,
.location__info__address,
.location__info__phone {
    display: flex;
    align-items: flex-start;
    gap: 0.5em;
    font-size: 1.4em;
    font-weight: 400;
    color: #333534;
}

.location__icon,
.address__icon,
.phone__icon {
    width: 1.6em;
    height: 1.6em;
    font-size: 1.1em;
    flex-shrink: 0;
    color: var(--primary-500);
    fill: transparent;
}

.location__text,
.address__text,
.phone-number__text {
    line-height: 1.4;
}

/* Location Actions - Mobile only */
.location__actions {
    display: none;
    margin-top: 1em;
}

.location__btn-direction {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.8em 1.5em;
    background: transparent;
    color: var(--primary-500);
    font-size: 1.4em;
    font-weight: 500;
    border-radius: 3.5em;
    text-decoration: none;
    transition: background 0.3s ease;
    width: 100%;
    justify-content: center;
    align-items: center;
    border: 0.2em solid var(--primary-500);
}

.location__btn-direction:hover {
    background: var(--primary-700);
    color: var(--neutral-900);
}

.location__btn-icon {
    width: 2em;
    height: 2em;
    flex-shrink: 0;
    fill: currentColor;
    pointer-events: none;
}

.location__btn-direction span {
    pointer-events: none;
}

/* ===== GOOGLE MAP ===== */
.google-map {
    position: relative;
    background: #eaeaea;
    border-radius: 1.2em;
    overflow: hidden;
    min-height: 60em;
    box-shadow: 0 0.5em 2em rgba(0, 0, 0, 0.08);
    flex: 1;
}

/* iframe nếu dùng */
.google-map iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* loader */
.google-map .loading {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================
   CUSTOM DROPDOWN
========================================== */

.custom-dropdown {
    position: relative;
    width: 100%;
    font-size: 1.4em;
    /* = 14px text */
}

/* SELECT DISPLAY */
.custom-dropdown__select {
    height: 4.8em;
    padding: 0 4.2em 0 2em;
    border: 0.1em solid #e5e5e5;
    border-radius: 2.4em;
    background-color: #fff;

    display: flex;
    align-items: center;

    font-size: 1em;
    line-height: 1;
    color: #111827;

    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-dropdown__select:hover {
    border-color: #cbd5e1;
}

.custom-dropdown__select:focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 0.2em rgba(15, 118, 110, 0.15);
    outline: none;
}

/* ARROW */
.custom-dropdown__select::after {
    content: "";
    position: absolute;
    right: 2em;
    top: 50%;
    width: 0.6em;
    height: 0.6em;
    border-right: 0.15em solid #6b7280;
    border-bottom: 0.15em solid #6b7280;
    transform: translateY(-60%) rotate(45deg);
    pointer-events: none;
}

/* ==========================================
   DROPDOWN MENU
========================================== */

.custom-dropdown__menu {
    position: absolute;
    top: calc(100% + 0.8em);
    left: 0;
    width: 100%;

    background: #fff;
    border-radius: 1.2em;
    border: 0.1em solid #e5e7eb;
    box-shadow: 0 1.2em 3em rgba(0, 0, 0, 0.12);
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.custom-dropdown__menu--open {
    display: block;
}

/* SEARCH INPUT */
.custom-dropdown__search {
    width: 100%;
    height: 4em;
    padding: 0 1.6em;
    font-size: 1.3em;
    border: none;
    border-bottom: 0.1em solid #e5e7eb;
    outline: none;
}

/* LIST */
.custom-dropdown__menu-inner {
    max-height: 22em;
    overflow-y: auto;
}

/* ITEM */
.custom-dropdown__item {
    padding: 1em 1.6em;
    font-size: 1.1em;
    cursor: pointer;
    transition: background .15s ease;
}

.custom-dropdown__item:hover {
    background-color: #f3f4f6;
}

/* ACTIVE */
.custom-dropdown__item--selected {
    background-color: #ecfdf5;
    color: #047857;
    font-weight: 500;
}

/* ==========================================
   SCROLLBAR (LIGHT)
========================================== */

.custom-dropdown__menu-inner::-webkit-scrollbar {
    width: 0.4em;
}

.custom-dropdown__menu-inner::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 1em;
}

.custom-dropdown__menu-inner {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}


/* MOBILE */
@media (max-width: 768px) {
    .custom-dropdown__menu {
        max-height: 70vh;
    }
}


/* ===== RESPONSIVE ===== */

/* Tablet and below (≤1024px) */
@media (max-width: 1099px) {
    .root-container {
        max-height: 100%;
        min-height: 100svh;
        overflow-y: unset;
    }

    .hpvft-footer {
        display: block;
    }

    .fast-action-controls {
        display: none;
    }

    #body-main-content {
        padding-bottom: 7em;
    }

    /* Responsive font-size for main sections */
    .consult-location-partner,
    .form-consultant,
    .search-result-wrapper {
        font-size: 0.875vw;
    }

    .search-locations-banner {
        display: block;
    }

    .search-locations-title {
        display: block;
    }

    /* Adjust form padding */
    .form-consultant {
        padding: 1em;
    }

    /* Stack form inputs vertically */
    .container-province-district {
        flex-direction: row;
    }

    .form-input.form {
        flex-direction: row;
        padding: 1.5em;
    }

    .input-control button {
        width: 100%;
    }
}

/* Mobile (≤575.98px) */
@media (max-width: 575.98px) {

    .consult-location-partner,
    .form-consultant {
        font-size: 2vw;
    }

    .search-result-wrapper {
        font-size: 1.5vw;
    }

    #body-main-content {
        padding-bottom: 7em;
    }

    .consult-location-partner {
        padding: 5em 1em 10em;
        font-size: 1.15vw;
    }

    .search-locations-title {
        font-size: 2em;
        margin: 1em 0 0.5em;
    }

    .form-consultant {
        padding: 0.5em;
    }

    .custom-form__select {
        font-size: 1.4em;
    }

    .input-control button {
        font-size: 1.4em;
    }

    #consult-location-partner .location-item {
        width: 45%;
    }

    /* Mobile Form Layout */
    .form-input.form {
        flex-direction: column;
        padding: 0;
        gap: 1em;
    }

    /* Row 1: Province and District side by side */
    .container-province-district {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 1em;
    }

    .input-control {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    /* Province - top left */
    .container-province-district .custom-form__group:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
    }

    /* District - top right */
    .container-province-district .custom-form__group:nth-child(2) {
        grid-column: 2;
        grid-row: 1;
    }

    /* Location Type - full width on second row */
    .container-province-district .custom-form__group:nth-child(3) {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    /* Button - full width */
    .input-control button {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .google-map {
        display: none !important;
    }

    /* Location Article */
    .search-result {
        box-shadow: none;
        padding: 0;
    }

    .location {
        color: #F7F7F7;
        flex-direction: column;
        padding: 0;
    }

    .location__body,
    .location__info {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 2em;
    }

    .location__thumb-img,
    .location__thumb-small {
        width: 100%;
        aspect-ratio: 361/154;
        object-fit: cover;
        background: #eee;
    }

    /* Show direction button on tablet/mobile */
    .location__actions {
        display: block;
    }
}