/* ----------------------------------------------------------------
   Locations Component — shared across service, /locations/, homepage
   BEM block: ad-locations
   Figma ref: 12442:4676 (contracted) / 12442:4792 (expanded)
   ---------------------------------------------------------------- */

/* --- Headline --- */
.ad-locations__headline {
    text-align: center;
    margin-bottom: 40px;
}

.ad-locations__headline .ad-service-section-title {
    margin-bottom: 12px;
    color: var(--ad-service-blue-deep);
    font-family: var(--ad-font-primary);
    font-size: 40px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.ad-locations__headline .ad-service-section-lead {
    margin-top: 0;
    color: var(--ad-service-blue-deep);
    font-family: var(--ad-font-primary);
    font-size: 20px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

/* --- Tabs (Houston / Austin) — teal per Figma --- */
.ad-locations__tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.ad-locations .ad-service-tab {
    border-color: var(--ad-service-teal);
    color: var(--ad-service-teal);
}

.ad-locations .ad-service-tab.is-active {
    background: var(--ad-service-teal);
    border-color: var(--ad-service-teal);
    color: var(--ad-service-white);
}

/* --- Map canvas (Google Maps embed) --- */
.ad-locations__map {
    position: relative;
    border-radius: var(--ad-service-radius-md);
    overflow: hidden;
    background: var(--ad-service-ice);
    border: 1px solid var(--ad-service-line);
}

.ad-locations__canvas {
    width: 100%;
    height: 100%;
    min-height: inherit;
}

/* ================================================================
   SERVICE VARIANT — compact 2-col (map left, accordion right)
   Matches Figma: ice-blue section bg, white map, clean list
   ================================================================ */
.ad-locations--service {
    background: var(--ad-service-white);
    padding: 112px 0;
}

.ad-locations--service .ad-locations__body {
    display: grid;
    grid-template-columns: minmax(0, 560px) minmax(0, 608px);
    gap: 48px;
    justify-content: center;
    align-items: start;
}

.ad-locations--service .ad-locations__map {
    height: 460px;
    background: var(--ad-color-map-surface);
    border: 1px solid var(--ad-color-line-soft);
}

.ad-locations--service .ad-locations__list-col {
    display: flex;
    flex-direction: column;
    max-height: 460px;
    overflow-y: auto;
    scrollbar-width: none;
}

.ad-locations--service .ad-locations__list-col::-webkit-scrollbar {
    display: none;
}

.ad-locations--service .ad-locations__tabs {
    justify-content: flex-start;
}

/* --- Accordion list group --- */
.ad-locations__group {
    display: none;
}

.ad-locations__group.is-active {
    display: block;
}

/* --- Accordion item --- */
.ad-locations__item {
    border-bottom: 1px solid var(--ad-color-line-faint);
    transition: background 0.2s ease;
}

.ad-locations__item:last-child {
    border-bottom: none;
}

/* Trigger (collapsed row) */
.ad-locations__item-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.ad-locations__item-trigger:hover {
    background: var(--ad-color-teal-tint);
}

.ad-locations__item-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ad-service-blue-deep);
    transition: color 0.2s ease;
}

.ad-locations__item-chevron {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--ad-service-teal);
    transition: transform 0.25s ease;
}

/* Expanded panel (hidden by default) */
.ad-locations__item-panel {
    display: none;
    padding: 0 16px 20px;
}

.ad-locations__item-address {
    font-size: 15px;
    line-height: 1.5;
    color: var(--ad-service-copy-soft);
    margin: 0 0 4px;
}

.ad-locations__item-phone {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ad-service-teal-deep);
    margin: 0 0 16px;
}

.ad-locations__item-phone a {
    color: inherit;
    text-decoration: none;
}

.ad-locations__item-phone a:hover {
    text-decoration: underline;
}

.ad-locations__phone-icon {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
}

.ad-locations__item-actions {
    display: flex;
    gap: 10px;
}

/* --- Expanded state (matches Figma 12442:4792) --- */
.ad-locations__item.is-expanded {
    background: linear-gradient(135deg, rgba(70, 201, 206, 0.08) 0%, rgba(70, 201, 206, 0.03) 100%);
    border-bottom-color: transparent;
    border-radius: 10px;
    margin: 4px 0;
}

.ad-locations__item.is-expanded .ad-locations__item-title {
    color: var(--ad-service-teal-deep);
}

.ad-locations__item.is-expanded .ad-locations__item-chevron {
    transform: rotate(90deg);
    color: var(--ad-service-teal-deep);
}

.ad-locations__item.is-expanded .ad-locations__item-panel {
    display: block;
}

/* ================================================================
   GOOGLE MAP MARKERS
   ================================================================ */
.ad-gmap-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.ad-gmap-marker__bubble {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--ad-service-teal);
    border: 3px solid var(--ad-service-white);
    box-shadow: 0 2px 6px rgba(12, 37, 62, 0.25);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.ad-gmap-marker__label {
    font-family: 'Figtree', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: var(--ad-service-blue-deep);
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 3px;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.ad-gmap-marker:hover .ad-gmap-marker__bubble,
.ad-gmap-marker.is-hover .ad-gmap-marker__bubble {
    transform: scale(1.3);
    background: var(--ad-service-blue);
}

.ad-gmap-marker:hover .ad-gmap-marker__label,
.ad-gmap-marker.is-hover .ad-gmap-marker__label {
    opacity: 1;
    transform: translateY(0);
}

.ad-gmap-marker.is-active {
    z-index: 10;
}

.ad-gmap-marker.is-active .ad-gmap-marker__bubble {
    width: 22px;
    height: 22px;
    background: var(--ad-service-blue);
    box-shadow: 0 0 0 4px rgba(0, 158, 233, 0.2), 0 2px 8px rgba(12, 37, 62, 0.2);
}

.ad-gmap-marker.is-active .ad-gmap-marker__label {
    opacity: 1;
    transform: translateY(0);
    background: var(--ad-service-blue-deep);
    color: var(--ad-service-white);
    padding: 3px 8px;
}

/* ================================================================
   PILLS (for page & homepage variants)
   ================================================================ */
.ad-locations__pills {
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 24px;
}

.ad-locations__pills.is-active {
    display: flex;
}

.ad-locations__pill {
    display: inline-flex;
    align-items: center;
    height: 43px;
    padding: 10px 24px;
    border: 1px solid var(--ad-service-teal);
    border-radius: 4px;
    background: var(--ad-service-white);
    color: var(--ad-service-copy);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ad-locations__pill:hover {
    background: var(--ad-service-mist);
    border-color: var(--ad-service-teal-deep);
}

.ad-locations__pill.is-active {
    background: var(--ad-service-teal);
    border-color: var(--ad-service-teal);
    color: var(--ad-service-white);
}

/* ================================================================
   PAGE VARIANT — full /locations/ page
   ================================================================ */

/* Force full-viewport width — breaks out of any parent constraints */
.ad-locations-page {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    overflow-x: hidden;
}

/* Hero — uses the standard shell so text aligns with content below */
.ad-locations-page .ad-service-hero {
    padding: 80px 0 88px;
}

/* Region sections */
.ad-locations-page__region-section {
    background: var(--ad-service-white);
    padding: 72px 0;
    border-top: 1px solid var(--ad-service-line);
}

.ad-locations-page__region-section:first-of-type {
    border-top: none;
}

.ad-locations-page__region-section--alt {
    background: var(--ad-color-mist);
}

/* Region header — teal left accent */
.ad-locations-page__region-header {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 36px;
    padding-left: 20px;
    border-left: 3px solid var(--ad-service-teal);
}

.ad-locations-page__region-overline {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ad-service-teal-deep);
    margin: 0 0 6px;
}

.ad-locations-page__region-title {
    font-size: 30px;
    font-weight: 600;
    color: var(--ad-service-blue-deep);
    margin: 0;
}

.ad-locations-page__region-desc {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--ad-service-copy-soft);
    margin: 8px 0 0;
}

.ad-locations__body--page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
    gap: 48px;
    align-items: start;
}

.ad-locations__body--page .ad-locations__map {
    height: 460px;
}

.ad-locations__body--page .ad-locations__item-trigger {
    padding: 16px 16px;
}

.ad-locations__body--page .ad-locations__item-title {
    font-size: 17px;
}

/* ================================================================
   HOMEPAGE VARIANT
   ================================================================ */
.ad-locations--homepage {
    background: var(--ad-service-white);
    padding: 112px 0;
}

.ad-locations--homepage .ad-locations__tabs {
    justify-content: center;
}

.ad-locations--homepage .ad-locations__map {
    height: 480px;
}

/* ================================================================
   LOCATIONS BUTTON VARIANTS
   ================================================================ */
.ad-locations__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 24px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ad-locations__btn--filled {
    background: var(--ad-service-teal);
    border: 1px solid var(--ad-service-teal);
    color: var(--ad-service-white);
}

.ad-locations__btn--filled:hover {
    background: var(--ad-service-teal-deep);
    border-color: var(--ad-service-teal-deep);
}

.ad-locations__btn--outlined {
    background: var(--ad-service-white);
    border: 1px solid var(--ad-service-teal);
    color: var(--ad-service-teal);
}

.ad-locations__btn--outlined:hover {
    background: var(--ad-color-teal-hover);
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1080px) {
    .ad-locations--service .ad-locations__body {
        grid-template-columns: 1fr;
        max-width: 720px;
        margin-left: auto;
        margin-right: auto;
    }

    .ad-locations--service .ad-locations__map {
        min-height: 340px;
        height: 340px;
    }

    .ad-locations--service .ad-locations__tabs {
        justify-content: center;
    }

    .ad-locations--service,
    .ad-locations--homepage {
        padding: 72px 0;
    }

    .ad-locations__body--page {
        grid-template-columns: 1fr;
    }

    .ad-locations__body--page .ad-locations__map {
        height: 340px;
    }

    .ad-locations-page .ad-service-hero__shell {
        grid-template-columns: 1fr;
    }

    .ad-locations-page .ad-service-hero__content {
        padding: 56px 40px 40px;
    }

    .ad-locations-page .ad-service-hero__media {
        grid-column: 1;
        grid-row: auto;
    }

    .ad-locations-page .ad-service-hero__media img {
        min-height: 300px;
        max-height: 360px;
    }

    .ad-locations-page .ad-service-hero__title {
        font-size: 36px;
    }

    .ad-locations-page .ad-service-actions--hero {
        padding: 0 40px 48px;
    }

    .ad-locations-page__region-section {
        padding: 56px 0;
    }

    .ad-locations-page__region-title {
        font-size: 26px;
    }
}

@media (max-width: 767px) {
    .ad-locations--service .ad-locations__map,
    .ad-locations--page .ad-locations__map,
    .ad-locations--homepage .ad-locations__map {
        min-height: 280px;
        height: 280px;
    }

    .ad-locations--service,
    .ad-locations--homepage {
        padding: 64px 0;
    }

    .ad-locations-page__region-section {
        padding: 40px 0;
    }

    .ad-locations__body--page .ad-locations__map {
        height: 260px;
    }

    .ad-locations-page__region-header {
        padding-left: 16px;
    }

    .ad-locations-page__region-title {
        font-size: 24px;
    }

    .ad-locations__pill {
        height: 38px;
        padding: 8px 18px;
        font-size: 14px;
    }

    .ad-locations-page__card-actions {
        flex-direction: column;
    }

    .ad-locations-page__card-actions .ad-service-button {
        width: 100%;
        text-align: center;
    }

    .ad-locations__item-actions {
        flex-direction: column;
    }

    .ad-locations__item-actions .ad-locations__btn {
        width: 100%;
        text-align: center;
    }
}
