/* AHI Dealer Locator - Enhanced Styles */
.ahi-top-search,
.ahi-top-search *,
.ahi-dealer-wrap,
.ahi-dealer-wrap *,
.ahi-container,
.ahi-container * {
    font-family: inherit;
}

/* Ensure Dashicons render correctly in frontend locator UI */
.ahi-top-search .dashicons,
.ahi-dealer-wrap .dashicons,
.ahi-container .dashicons {
    font-family: "dashicons" !important;
}

.ahi-top-search, .ahi-dealer-wrap {
    font-family: 'Montserrat';
}

.ahi-top-search {

}

.ahi-container {
    max-width: 1200px;
    margin: 0 auto;
	background: #fafafa;
    padding: 60px;
    border-bottom: 1px solid #eee;
    margin-bottom: 50px;
}

.ahi-top-search h2 {
    margin: 0 0 30px 0;
    font-size: 17px;
    color: #333;
}

.ahi-sub {
    color: #666;
    margin: 0 0 20px 0;
    font-size: 14px;
}

.ahi-filters {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    align-items: center;
}

.ahi-search-input {
    flex: 1;
    min-width: 250px;
    padding: 10px 15px;
    border: 1px solid #fff;
    border-radius: 4px;
    font-size: 14px;
}

.ahi-filters select {
    padding: 10px 15px;
    border: 1px solid #fff;
    border-radius: 4px;
    min-width: 180px;
    font-size: 14px;
    background: #fff;
}

.ahi-btn {
    background: #333;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
}

.ahi-btn:hover {
    background: #555;
}

.ahi-btn-secondary {
    background: #666;
}

.ahi-btn-secondary:hover {
    background: #888;
}

.ahi-dealer-wrap {
    display: flex;
    gap: 0;
    max-width: 100%;
    margin: 20px auto;
    min-height: 600px;
}

.ahi-left {
    width: 40%;
    background: #f9f9f9;
    border-right: 1px solid #eaeaea;
    box-sizing: border-box;
    overflow-y: auto;
    max-height: 700px;
    overflow-x: hidden;
}

.ahi-map {
    flex: 1;
    height: 700px;
    min-height: 600px;
}

.ahi-tabs {
    display: flex;
    margin-bottom: 15px;
    flex-wrap: wrap;
    justify-content: space-between;
    background: #666666;
}

.ahi-dealer-search-wrapper {
    position: relative;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ahi-dealer-search-input {
    flex: 1;
    padding: 16px 50px 16px 15px !important;
    border: 1px solid transparent !important;
    font-size: 14px;
    background: #fff;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    border-radius: 5px;
}

.ahi-dealer-search-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.ahi-dealer-search-input::placeholder {
    color: #999;
}

.ahi-dealer-select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.ahi-dealer-search-btn {
    line-height: 0;
    background: #163865 !important;
    color: #fff !important;
    border: none !important;
    width: 50px !important;
    height: 50px !important;
    border-radius: 0 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.3s;
}

.ahi-dealer-search-btn:hover {
    background: #135e96;
}

.ahi-dealer-search-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.ahi-tab {
    background: #666;
    color: #fff;
    padding: 15px 28px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.3s;
}

.ahi-tab:hover {
    background: #555;
}

.ahi-tab.active {
    background: #333 !important;
}

.ahi-results-count .results-info {
    margin: 0;
    color: #333;
    font-size: 14px;
}

.ahi-results-count .results-info strong {
    color: #000;
}

#ahi_dealer_list {
    margin-top: 0;
    color: #393a3b;
}

.dealer-card {
    padding: 25px 25px 25px 45px;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
}

.dealer-card h4 {
    margin: 0 0 12px 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.dealer-field {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    display: flex;
    gap: 10px;
    font-weight: 500;
    font-family: 'Montserrat';
}

.dealer-field strong {
    color: #393a3b;
    margin-right: 5px;
    font-family: 'Montserrat';
}

.dealer-field a {
    text-decoration: none;
    color: #393a3b;
}

.dealer-field a:hover {
    text-decoration: underline;
}

.services-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
}

.service-badge {
    display: inline-block;
    background: #e8e8e8;
    color: #333;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

/* Hidden by default */
.view-on-map-btn {
    margin-top: 12px;
    padding: 8px 16px;
    background: #606060;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: 0.3s ease;
    position: absolute;
    transform: rotate(270deg) translateY(50%);
    transform-origin: center;
    top: 35%;
    right: -40px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.dealer-card:hover .view-on-map-btn {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.view-on-map-btn:hover {
    background: #163865;
}

.no-results {
    color: #777;
    padding: 20px;
    text-align: center;
    font-size: 14px;
}

/* Map popup styles */
.dealer-popup {
    font-size: 13px;
    line-height: 1.6;
}

.dealer-popup h3 {
    font-size: 16px;
    color: #fff;
}

.dealer-popup p {
    margin: 8px 0;
    color: #555;
}

.dealer-popup strong {
    color: #333;
    margin-right: 5px;
}

.dealer-popup a {
    color: #0066cc;
    text-decoration: none;
}

.dealer-popup a:hover {
    text-decoration: underline;
}

/* Map popup styles - Enhanced for better visibility */
.dealer-map-popup .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}

.dealer-map-popup .leaflet-popup-content {
    margin: 0;
    min-width: 350px;
    max-width: 450px;
    max-height: 500px;
    overflow-y: auto;
}

.dealer-popup-header {
    background: #163865;
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px 8px 0 0;
}

.dealer-popup-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dealer-popup-body {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.dealer-popup-field {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f1;
}

.dealer-popup-field:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.dealer-popup-label {
    min-width: 100px;
    font-weight: 600;
    color: #1d2327;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dealer-popup-label strong {
    color: #1d2327;
    font-weight: 600;
}

.dealer-popup-value {
    flex: 1;
    color: #50575e;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.6;
}

.dealer-popup-link {
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
}

.dealer-popup-link:hover {
    color: #135e96;
    text-decoration: underline;
}

.dealer-popup-services {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dealer-popup-service-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #e8e8e8;
    color: #333;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: capitalize;
}

/* Scrollbar Styling */
.ahi-dealer-list::-webkit-scrollbar,
.dealer-popup-body::-webkit-scrollbar {
    width: 8px;
}

.ahi-dealer-list::-webkit-scrollbar-track,
.dealer-popup-body::-webkit-scrollbar-track {
    background: #f6f7f7;
    border-radius: 4px;
}

.ahi-dealer-list::-webkit-scrollbar-thumb,
.dealer-popup-body::-webkit-scrollbar-thumb {
    background: #c3c4c7;
    border-radius: 4px;
}

.ahi-dealer-list::-webkit-scrollbar-thumb:hover,
.dealer-popup-body::-webkit-scrollbar-thumb:hover {
    background: #8c8f94;
}

/* Popup tip styling */
.dealer-map-popup .leaflet-popup-tip {
    background: #2271b1;
}

/* Responsive design */
@media (max-width: 768px) {
    .ahi-dealer-wrap {
        flex-direction: column;
    }
    
    .ahi-left {
        width: 100%;
        max-height: 400px;
        border-right: none;
        border-bottom: 1px solid #eaeaea;
    }
    
    .ahi-map {
        width: 100%;
        height: 400px;
    }
    
    .ahi-filters {
        flex-direction: column;
    }
    
    .ahi-search-input,
    .ahi-filters select {
        width: 100%;
        min-width: 100%;
    }
    
    .ahi-btn {
        width: 100%;
    }
    
    .dealer-map-popup .leaflet-popup-content {
        min-width: 280px;
        max-width: 320px;
    }
    
    .dealer-popup-field {
        flex-direction: column;
        gap: 4px;
    }
    
    .dealer-popup-label {
        min-width: auto;
    }
    
    .ahi-dealer-search-input {
        padding-right: 45px;
    }
    
    .ahi-dealer-search-btn {
        width: 32px;
        height: 32px;
    }
    
    .ahi-dealer-search-btn svg {
        width: 18px;
        height: 18px;
    }
}


.ahi-tab {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ahi-tab img {
    width: 20px;
    height: 20px;
}
.ahi-tab:focus,
.ahi-tab:focus-visible,
.ahi-tab.active:focus,
.ahi-tab.active:focus-visible {
    outline: none !important;
    box-shadow: none !important; /* optional */
}

.dealer-wrapper {
    padding: 0 15px;
}

.dealer-header {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.dealer-title {
    font-size: 22px;
    color: #163d73; /* Dark blue like your design */
    margin: 0;
}

.dealer-icon-location,
.dealer-icon-phone,
.dealer-icon-email,
.dealer-icon-globe {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-size: contain;
}

.dealer-icon-location {
    background-image: url(../icons/location.png);
    position: absolute;
    left: -40px;
    top: 0;
}

.dealer-icon-phone {
    background-image: url('../icons/phone.png');
}

.dealer-icon-email {
    background-image: url('../icons/email.png');
}

.dealer-icon-globe {
    background-image: url('../icons/globe.png');
}
 
.dealer-contact-row {
    display: flex;
    gap: 40px;
    margin: 20px 0;
    font-weight: 500;
}

.dealer-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dealer-contact-item a {
    font-size: 15px;
    text-decoration: auto;
    color: #393a3b;
}

.leaflet-container a.leaflet-popup-close-button {
    font: 23px / 23px Tahoma, Verdana, sans-serif !important;
    color: #fff !important;
}


.ahi-required-note {
	color: #d0312d;
    font-weight: 500;
    font-size: 13px;
    align-self: center;
    position: absolute;
    right: 220px;
    top: 20px;
}
.ahi-filter-surface {
    position: relative;
}
button:focus {
    background: #333333 !important;
}