﻿.find-a-dealer {
    background: #fff;
    padding: 0;
    --dealer-panel-height: 1100px;
}

.find-a-dealer__inner {
    width: 100%;
    margin: 0;
    display: flex;
    align-items: stretch;
    padding: 0;
    box-sizing: border-box;
}

/* Map LEFT / Panel RIGHT with 50% / 50% */
.find-a-dealer__inner--map-left {
    flex-direction: row;
}

.find-a-dealer__map {
    flex: 0 0 50%;
    min-width: 320px;
    display: flex;
}

.find-a-dealer__panel {
    flex: 0 0 50%;
    min-width: 420px;
    background: #f2f2f2;
    display: flex;
    flex-direction: column;
    height: var(--dealer-panel-height);
}

.find-a-dealer__map-inner {
    height: var(--dealer-panel-height);
    width: 100%;
}

@media (min-width: 981px) {
    .find-a-dealer {
        min-height: 100vh;
    }

    .find-a-dealer__inner {
        min-height: 100vh;
    }

    .find-a-dealer__panel {
        height: var(--dealer-panel-height);
    }

    .find-a-dealer__map-inner {
        height: var(--dealer-panel-height);
    }

    /* Squeeze/center the tabs group like the reference design */
    .find-a-dealer__tabs {
        width: 100%;
        max-width: 560px;
        margin-left: auto;
        margin-right: auto;
    }

    .find-a-dealer__tabs-items {
        justify-content: stretch;
        padding: 0;
    }

    .find-a-dealer__tabs-items .tabs__item {
        flex: 1 1 0;
    }

    .find-a-dealer__tabs-items .tabs__button {
        width: 100%;
        padding: 0 12px;
    }
}

/* SEARCH */
.find-a-dealer__search {
    padding: 2px 32px 20px;
    border-bottom: 1px solid #e6e6e6;
    background: #fff;
}

/* Tabs */
.tabs {
    position: relative;
}

.tabs__items {
    display: flex;
    justify-content: center;
    gap: 0;
    padding: 0;
    margin: 0;
    list-style: none;
}

.tabs__item {
    flex: 0 0 auto;
    position: relative;
}

.tabs__button {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 48px;
    padding: 0 32px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #9b9b9b;
    border: 0;
    background: transparent;
    transition: color 0.2s ease;
}

.tabs__item:hover .tabs__button {
    color: #666666;
}

.tabs__item.active .tabs__button {
    color: #111111;
    font-weight: 600;
}

/* Hide the full-width inactive line div */
.tabs__inactive-line {
    display: none;
}

.tabs__active-line {
    display: none;
}

/* Animated active indicator (enabled by JS on desktop) */
.tabs.tabs--animated-indicator .tabs__item::after {
    content: none;
}

.tabs.tabs--animated-indicator .tabs__inactive-line {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: #d0d0d0;
    z-index: 1;
}

.tabs.tabs--animated-indicator .tabs__active-line {
    display: block;
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    width: 0;
    background: #111111;
    transform: translateX(0);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, width;
    z-index: 2;
}

/* Tab underlines via pseudo-elements */
.tabs__item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: #d0d0d0;
    transition: height 0.2s ease, background-color 0.2s ease;
}

/* Active tab - thick black underline */
.tabs__item.active::after {
    height: 4px;
    background: #111111;
}

.tabs__items-mobile {
    display: none;
}

/* Form */
.find-a-dealer__search-wrapper {
    margin-top: 20px;
}

.find-a-dealer__search-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-field--select {
    height: 52px;
    padding: 14px 48px 14px 20px;
    border: 0;
    border-bottom: 2px solid #111111;
    border-radius: 0;
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #111111;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2714%27%20height%3D%279%27%20viewBox%3D%270%200%2014%209%27%20fill%3D%27none%27%3E%3Cpath%20d%3D%27M1%201l6%206%206-6%27%20stroke%3D%27%23111111%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    background-size: 14px 9px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.form-field--select:hover {
    background-color: #fafafa;
}

.form-field--select:focus {
    outline: none;
    background-color: #ffffff;
}

.find-a-dealer__search-note {
    margin-top: 0px;
}

.find-a-dealer__search-note p {
    margin: 0;
    font-size: 14px;
    color: #999999;
    text-align: left;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

/* LIST */
.find-a-dealer__output {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 6px 28px;
    background: #f5f5f5;
    scrollbar-gutter: stable;
}

/* Visible scrollbar styling for list panel */
.find-a-dealer__output::-webkit-scrollbar {
    width: 8px;
}

.find-a-dealer__output::-webkit-scrollbar-track {
    background: #e6e6e6;
}

.find-a-dealer__output::-webkit-scrollbar-thumb {
    background: #b3b3b3;
    border-radius: 8px;
}

.find-a-dealer__output {
    scrollbar-width: thin;
    scrollbar-color: #b3b3b3 #e6e6e6;
}

@media (min-width: 981px) {
    /* Show ~2 cards then scroll like Mazda */
    .find-a-dealer__output {
        max-height: none;
    }
}

.find-a-dealer__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.find-a-dealer__list-item {
    padding: 0;
    border: 0;
    cursor: pointer;
    background: transparent;
}

.find-a-dealer__list-item:hover {
    background: transparent;
}

.find-a-dealer__list-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.find-a-dealer__list-address {
    font-size: 13px;
    color: #444;
}

.find-a-dealer__list-distance {
    font-size: 13px;
    margin-top: 6px;
    color: #111;
    font-weight: 600;
}

.find-a-dealer__list-meta {
    font-size: 12px;
    margin-top: 4px;
    color: #777;
}

.find-a-dealer__empty {
    padding: 18px;
    color: #666;
}

.find-a-dealer__use-radius {
    display: flex;
    justify-content: center;
}

.find-a-dealer__use-radius .form-field--select {
    width: 100%;
    min-width: 200px;
    max-width: 280px;
}

/* Dealer card overrides now live in dealer.css */

/* InfoWindow content styling */
.dealer-iw {
    position: relative;
    min-width: 200px;
    max-width: 320px;
    padding: 14px 16px;
    background: #fff;
    box-sizing: border-box;
}

.dealer-iw__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.dealer-iw__title {
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #333333;
    margin: 0;
    line-height: 1.3;
}

.dealer-iw__close {
    flex-shrink: 0;
    border: 0;
    background: transparent;
    font-size: 20px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    color: #666666;
    transition: color 0.15s ease;
}

.dealer-iw__close:hover {
    color: #111111;
}

/* Google Maps InfoWindow overrides - remove all default padding/gaps */
#dealerMap .gm-ui-hover-effect {
    display: none !important;
}

#dealerMap .gm-style-iw {
    padding: 0 !important;
    background: transparent !important;
}

#dealerMap .gm-style-iw-c {
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

#dealerMap .gm-style-iw-d {
    overflow: hidden !important;
    padding: 0 !important;
}
/*
#dealerMap .gm-style-iw-tc,
#dealerMap .gm-style-iw-tc::after {
    background: #f5f5f5 !important;
}*/

/* Remove the white background wrapper */
#dealerMap .gm-style-iw-chr {
    display: none !important;
}

/* Mobile */
@media (max-width: 980px) {
    .find-a-dealer__inner--map-left {
        flex-direction: column;
    }

    .find-a-dealer__map {
        flex: 0 0 auto;
        min-width: 0;
    }

    .find-a-dealer__panel {
        min-height: 520px;
        height: auto;
        background: #ffffff;
        min-width: 0;
    }

    .find-a-dealer__map-inner {
        height: 280px;
    }

    .find-a-dealer__search {
        padding: 0;
        border-bottom: none;
        background: #f5f5f5;
    }

    /* Tabs - left aligned on mobile */
    .tabs__items {
        display: flex;
        justify-content: flex-start;
        gap: 0;
        margin: 0;
        padding: 0;
        background: #ffffff;
    }

    .tabs__item {
        flex: 1 1 0;
    }

    .tabs__button {
        height: 44px;
        width: 100%;
        padding: 0 8px;
        font-size: 13px;
        font-weight: 700;
        letter-spacing: 0.3px;
    }

    .tabs__item.active .tabs__button {
        font-weight: 700;
    }

    /* Tab underlines on mobile */
    .tabs__item::after {
        height: 1px;
        background: #e0e0e0;
    }

    .tabs__item.active::after {
        height: 3px;
        background: #111111;
    }

    .tabs__items-mobile {
        display: none;
    }

    .tabs__inactive-line,
    .tabs__active-line {
        display: none;
    }

    /* Dropdown wrapper on mobile */
    .find-a-dealer__search-wrapper {
        margin-top: 0;
        padding: 16px;
        background: #f5f5f5;
    }

    .find-a-dealer__use-radius {
        justify-content: center;
    }

    .find-a-dealer__use-radius .form-field--select {
        width: 100%;
        max-width: 280px;
    }

    .form-field--select {
        height: 44px;
        font-size: 13px;
        padding: 10px 40px 10px 14px;
        background-color: #ffffff;
        border: 0;
        border-bottom: 2px solid #111111;
    }

    .find-a-dealer__search-note {
        margin-top: 8px;
    }

    .find-a-dealer__search-note p {
        font-size: 12px;
        text-align: left;
        color: #888888;
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
    }

    .find-a-dealer__output {
        padding: 4px;
        background: #ffffff;
    }

    .find-a-dealer__list {
        gap: 16px;
    }

    /* Dealer card overrides now live in dealer.css */
}

@media (max-width: 1366px) {
    .swiper-pagination-hero-banner {
        margin: 0 !important
    }
}

