.cgn-locator-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    width: 100%;
    box-sizing: border-box;
}
.cgn-locator-sidebar {
    flex: 1 1 380px;
    display: flex;
    flex-direction: column;
    max-height: 700px;
}
.cgn-locator-map-container {
    flex: 2 1 500px;
}
.cgn-map-canvas {
    width: 100%;
    min-height: 550px;
    background-color: #f0f0f0;
}
.cgn-search-container {
    display: flex;
    border: 1px solid #111111;
    background: #ffffff;
    margin-bottom: 1rem;
}
.cgn-address-input {
    flex: 1;
    padding: 14px 18px;
    border: none;
    outline: none;
    font-size: 14px;
}
.cgn-btn-locate {
    background: #000000;
    color: #ffffff;
    border: none;
    padding: 0 16px;
    cursor: pointer;
    display: grid;
    place-items: center;
}
.cgn-status-text {
    font-size: 13px;
    color: #666666;
    margin-bottom: 1.5rem;
}
.cgn-dealer-feed {
    flex: 1;
    overflow-y: auto;
}
.cgn-dealer-card {
    padding: 20px;
    border: 1px solid #e5e5e5;
    margin-bottom: 12px;
    cursor: pointer;
}
.cgn-dealer-card:hover {
    border-color: #000000;
    background: #fafafa;
}
.cgn-dealer-card h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    text-transform: uppercase;
    color: #000000;
}
.cgn-dealer-card p {
    margin: 0;
    font-size: 13px;
    color: #666666;
}
.cgn-card-distance {
    margin-top: 10px !important;
    font-size: 12px !important;
    color: #111111 !important;
    font-weight: 600;
}
.cgn-concierge-panel {
    padding: 30px;
    background: #fdfdfd;
    border-left: 2px solid #000000;
}
.cgn-concierge-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #000000;
    color: #ffffff;
    text-transform: uppercase;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
}
.gm-style-iw-c {
    background-color: #000000 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.gm-style-iw-d {
    overflow: hidden !important;
    padding: 24px !important;
}
.gm-ui-hover-effect {
    top: 6px !important;
    right: 6px !important;
    background: #111111 !important;
    border-radius: 0 !important;
}
.gm-ui-hover-effect span {
    background-color: #ffffff !important;
}
.cgn-info-window {
    color: #ffffff;
}
.cgn-iw-title {
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    border-bottom: 1px solid #222222;
    padding-bottom: 8px;
}
.cgn-iw-address {
    font-size: 13px;
    color: #aaaaaa;
    margin: 0 0 15px 0;
}
.cgn-iw-directions {
    display: inline-block;
    padding: 10px 16px;
    background: #ffffff;
    color: #000000;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
}
.gm-style-iw-tc::after {
    background: #000000 !important;
}

/* --- Modern Dealer Card Updates --- */
.cgn-dealer-card {
    background: #ffffff;
    border: 1px solid #eaeaea;
    padding: 24px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.cgn-dealer-card:hover {
    border-color: #cccccc;
}

.cgn-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 12px;
}

.cgn-card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800; /* Increased from 500 to a heavy, brutalist font weight */
    letter-spacing: 1px;
    color: #111111;
}

.cgn-card-distance {
    font-size: 0.9rem;
    font-weight: 600;
    color: #000000;
}

/* Contact List & Icons */
.cgn-contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cgn-contact-list li {
    display: flex;
    align-items: center; /* Aligns the icon perfectly with the text row */
    margin-bottom: 14px;
    font-size: 1rem;
    color: #222222;
}

.cgn-contact-list li:last-child {
    margin-bottom: 0;
}

.cgn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.cgn-text {
    line-height: 1.4;
    font-weight: 400;
}

.cgn-text a {
    color: #222222;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cgn-text a:hover {
    color: #cc0000;
}

/* Prevent Elementor/Theme from distorting map tiles */
#cgn-map-canvas img {
    max-width: none !important;
    background: transparent !important;
}

/* --- Modern Dealer Card Updates --- */
.cgn-card-logo {
    max-width: 150px;
    max-height: 50px;
    object-fit: contain;
    margin-bottom: 15px;
    display: block;
}

.cgn-dealer-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 0;
    padding: 24px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.cgn-dealer-card:hover {
    border-color: #cccccc;
}

.cgn-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 15px;
}

.cgn-card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: 1px;
    color: #111111;
}

.cgn-card-distance {
    font-size: 0.9rem;
    font-weight: 600;
    color: #000000;
}

.cgn-contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cgn-contact-list li {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
    font-size: 1rem;
    color: #222222;
}

.cgn-contact-list li:last-child {
    margin-bottom: 0;
}

.cgn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.cgn-text {
    line-height: 1.4;
    font-weight: 400;
}

.cgn-text a {
    color: #222222;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cgn-text a:hover {
    color: #cc0000;
}

/* --- Dark Theme InfoWindow Overrides --- */
.gm-style .gm-style-iw-c {
    background-color: #050505 !important;
    border-radius: 0 !important; 
    padding: 24px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5) !important;
}

.gm-style .gm-style-iw-tc::after {
    background: #050505 !important;
}

.gm-style-iw-c button[title="Close"] {
    filter: invert(1) grayscale(100%) brightness(200%) !important;
    top: 10px !important;
    right: 10px !important;
}

.cgn-info-window {
    color: #a0a0a0;
    font-family: sans-serif;
    min-width: 220px;
}

.cgn-iw-logo {
    max-width: 120px;
    max-height: 40px;
    margin-bottom: 15px;
    display: block;
}

.cgn-iw-title {
    color: #4a4a4a;
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.cgn-iw-divider {
    height: 1px;
    background-color: #222222;
    margin-bottom: 15px;
}

.cgn-iw-address, .cgn-iw-contact {
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.4;
}

.cgn-iw-contact strong {
    color: #ffffff;
}

.cgn-iw-btn {
    display: block;
    background: #ffffff;
    color: #000000;
    text-align: center;
    padding: 12px 15px;
    text-decoration: none;
    font-weight: 700;
    font-size: 12px;
    margin-top: 20px;
    transition: background-color 0.2s;
}

.cgn-iw-btn:hover {
    background: #e0e0e0;
}

/* --- Modernized Brutalist Vertical Scrollbar --- */

/* 1. Target the scrollable dealer list container specifically */
#cgn-dealer-list {
    scrollbar-width: thin;          /* Firefox fallback */
    scrollbar-color: #000000 #f1f1f1; /* Firefox fallback */
}

/* 2. Width of the entire vertical track */
#cgn-dealer-list::-webkit-scrollbar {
    width: 6px;
    background-color: #f5f5f5;
}

/* 3. The background track path */
#cgn-dealer-list::-webkit-scrollbar-track {
    background-color: #f1f1f1;
    border-radius: 0 !important; /* Forces sharp rectangular edge */
    border-left: 1px solid #e5e5e5;
}

/* 4. The moving scroll handle (Thumb) */
#cgn-dealer-list::-webkit-scrollbar-thumb {
    background-color: #000000;   /* Solid pristine black */
    border-radius: 0 !important; /* Forces sharp rectangular edge */
    transition: background-color 0.2s ease;
}

/* 5. Subtle active hover depth state */
#cgn-dealer-list::-webkit-scrollbar-thumb:hover {
    background-color: #222222;
}

/* --- Eliminating Map Whitespace via Flexbox --- */

/* 1. Force the main layout container to establish an equal-height row */
.cgn-locator-container {
    display: flex;
    flex-direction: row;
    align-items: stretch; /* Forces both columns to match height perfectly */
    gap: 30px;            /* Keeps your clean gutter spacing between columns */
    width: 100%;
}

/* 2. Style the left panel containing search and the scrolling list */
.cgn-locator-sidebar {
    width: 35%;           /* Adjust width to match your exact desktop layout */
    display: flex;
    flex-direction: column;
}

/* 3. Ensure the scrolling list uses its container boundary */
#cgn-dealer-list {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 15px; /* Adds a clean 15px layout gutter before the scrollbar */
    scrollbar-width: auto;
    scrollbar-color: #000000 #f1f1f1;
}

/* 4. Force the map canvas container to dynamically fill all vertical space */
#cgn-map-canvas {
    flex-grow: 1;         /* Fills remaining width horizontally */
    height: 100% !important; /* Spans the exact calculated height of the parent wrapper */
    min-height: 500px;    /* Prevents collapsing on smaller tablet screens */
}

/* --- "On Display" Button --- */
.cgn-display-btn {
    display: inline-block;
    background: #111111;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 24px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    margin-top: 25px;
    transition: background 0.2s ease;
}

.cgn-display-btn:hover {
    background: #cc0000;
}

/* --- Refined Rectangular Modal System --- */
#cgn-dealer-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#cgn-dealer-modal.is-active {
    opacity: 1;
    pointer-events: all;
}

/* Dimmed backdrop to bring focus to the floating module */
.cgn-modal-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Muted dark transparent layer */
}

/* The Floating Rectangular Container */
.cgn-modal-container {
    position: relative;
    width: 90%;
    max-width: 900px; /* Elegant desktop boundary */
    background: #ffffff !important; /* Solid pristine white background */
    border-radius: 0 !important;   /* Hard sharp edges */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3); /* Pronounced luxury shadow drop */
    z-index: 10;
    padding: 40px; /* Internal content padding */
}

/* Modal Close Button - Locked precisely to the top right corner of the white container */
.cgn-modal-close {
    position: absolute;
    top: 0;
    right: 0;
    background: #111111 !important;
    border: none !important;
    width: 40px !important;
    height: 40px !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    padding: 0 !important;
}

.cgn-modal-close svg {
    display: none !important;
}

.cgn-modal-close::before,
.cgn-modal-close::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 1.5px;
    background-color: #ffffff !important;
}

.cgn-modal-close::before { transform: rotate(45deg); }
.cgn-modal-close::after { transform: rotate(-45deg); }

.cgn-modal-close:hover {
    background: #cc0000 !important;
}

/* Split Modal Interior Content */
.cgn-modal-split {
    display: flex;
    gap: 45px;
    align-items: flex-start;
}

.cgn-modal-left {
    flex: 0 0 380px;
}

/* Strip borders on the internal replica card since the master container is now white */
.cgn-modal-card-replica {
    background: #ffffff;
    border: none !important;
    padding: 0;
}

.cgn-modal-right {
    flex: 1;
}

.cgn-modal-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #111111;
    margin: 0 0 20px 0;
    letter-spacing: 0.5px;
}

/* Compact Image Grid */
.cgn-modal-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 15px;
}

.cgn-modal-product-item {
    display: block;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.cgn-modal-product-item:hover {
    transform: translateY(-2px);
}

.cgn-modal-product-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Mobile Layout Adaptation */
@media (max-width: 900px) {
    .cgn-modal-container {
        padding: 30px 20px;
        max-height: 85vh;
        overflow-y: auto;
    }
    .cgn-modal-split { 
        flex-direction: column; 
        gap: 30px; 
    }
    .cgn-modal-left { 
        width: 100%; 
        flex: none;
    }
}

/* Split Modal Layout */
.cgn-modal-split {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.cgn-modal-left {
    flex: 0 0 450px;
}

.cgn-modal-card-replica {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    padding: 30px;
}

.cgn-modal-right {
    flex: 1;
    padding-top: 10px;
}

.cgn-modal-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #000;
    margin: 0 0 30px 0;
}

/* Product Grid */
.cgn-modal-products-grid {
    display: grid;
    /* Reduced the minimum column width from 140px down to 70px */
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); 
    gap: 15px;
}

.cgn-modal-product-item {
    display: block;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.cgn-modal-product-item:hover {
    transform: translateY(-3px);
}

.cgn-modal-product-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    mix-blend-mode: multiply; /* Ensures product backgrounds blend perfectly if they aren't completely transparent */
}

/* --- Mobile Layout Optimization --- */
@media (max-width: 900px) {
    /* 1. Constrain the container to the viewport and make its content scrollable */
    .cgn-modal-container {
        width: 92% !important;
        max-height: 85vh !important;
        padding: 40px 24px 24px 24px !important;
        display: flex;
        flex-direction: column;
    }

    /* 2. Wrap internal content in an independent scroll container */
    .cgn-modal-split { 
        flex-direction: column; 
        gap: 35px; 
        overflow-y: auto;
        flex-grow: 1;
        padding-right: 5px;
        scrollbar-width: thin;
    }
    
    .cgn-modal-left { 
        width: 100%; 
        flex: none;
    }

    /* 3. Keep the close button cleanly pinned inside the top-right container edge */
    .cgn-modal-close { 
        position: absolute !important;
        top: 0 !important; 
        right: 0 !important; 
        z-index: 99; 
    }
}

/* --- Dealer Status Typography Styling --- */
.cgn-prime-status {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #cc0000; /* Distinct crisp signature accent red */
    letter-spacing: 1px;
    margin-top: 4px;
    margin-bottom: 8px;
}

/* --- Scale Down Google Close Button --- */
.gm-style-iw-c button.gm-ui-hover-effect {
    width: 24px !important;
    height: 24px !important;
    top: 8px !important;
    right: 8px !important;
    min-width: 24px !important;
    min-height: 24px !important;
}

/* Scale down the inner close icon */
.gm-style-iw-c button.gm-ui-hover-effect span {
    width: 14px !important;
    height: 14px !important;
    margin: 5px !important; /* Centers the smaller icon */
}

/* --- Tighten Top Spacing inside the Info Window --- */
.cgn-info-window {
    padding: 0 5px 5px 5px !important; /* Strips excess padding so the logo can slide up */
}

/* Gently compress the logo size to clear more vertical room */
.cgn-iw-logo {
    max-height: 30px !important;
    margin-top: 5px !important;
    margin-bottom: 5px !important;
}

/* Bring the title closer to the logo */
.cgn-iw-title {
    margin: 4px 0 6px 0 !important;
}

/* Reduce the margin around the divider line */
.cgn-iw-divider {
    margin-top: 5px !important;
    margin-bottom: 8px !important;
}