/* ============================================
   WP Google Maps Plugin Overrides
   ============================================ */
.wpgmza_marker_holder {
    display: none !important;
}

.wpgmza_table_category { display: none !important; }
.wpgmza_table_marker { display: none; }
.wpgmza_table_address { display: none; }
.wpgmza_table_description { display: none; }

/* Custom numbered map markers */
.wpgmza_map img[src^="data:image/svg+xml"] {
    /* Ensure SVG markers render properly */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Google Maps Advanced Marker styling */
.wpgmza-google-icon-transform-fix img[src^="data:image/svg+xml"] {
    width: 42px !important;
    height: 56px !important;
}

.wpgmza-store-locator {
    position: relative !important;
    top: 0px !important;
    left: 0px !important;
}

.wpgmza-radius-container {
    display: none !important;
}

.wpgmza-popout-panel {
    display: none !important;
}

.wpgmza-directions-box {
    display: none !important;
}

/* Center the search component horizontally */
.wpgmza-store-locator {
    display: flex !important;
    justify-content: center !important;
}

label.wpgmza-address {
    display: none !important;
}

/* ============================================
   Search Input and Go Button Layout
   ============================================ */
.wpgmza-store-locator .wpgmza-address-container {
    display: inline-flex !important;
    align-items: stretch !important;
    gap: 0 !important;
    width: auto !important;
}

.wpgmza-store-locator input.wpgmza-address {
    flex: 0 1 auto !important;
    width: 400px !important;
    max-width: 400px !important;
    margin: 0 !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* Go Button Styling */
.wpgmza-go-button {
    background-color: #243672;
    color: white;
    font-size: 0.875rem; /* 14px */
    padding: 0.9375rem 1.25rem; /* 15px 20px */
    line-height: 1.125rem; /* 18px */
    font-weight: bold;
    text-transform: uppercase;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 0.5rem; /* 8px */
    border-bottom-right-radius: 0.5rem; /* 8px */
    transition: background-color 300ms ease-in-out;
    border: 1px solid #243672;
    border-left: none;
    cursor: pointer;
    white-space: nowrap;
    min-width: 80px;
    flex-shrink: 0;
}

.wpgmza-go-button:hover {
    background-color: #1e2d5f;
}

.wpgmza-go-button:active {
    background-color: #1a2650;
}

.location-search {
    padding-top: 40px;
    padding-bottom: 40px;
}

.location-search .wpgmza-search.wpgmza-aria-bridge {
    display: none !important;
}

.location-search .wpgmza-loading {
    display: none !important;
}

.location-search .wpgmza-reset {
    display: none !important;
}

/* ============================================
   Location Intro Section
   ============================================ */
.location-intro h2 {
    font-size: 67px;
    font-weight: 300;
}

/* ============================================
   Full Width Map Container
   ============================================ */
/* Break out of theme container constraints to achieve full browser width */
.locator-map {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    position: relative;
    left: 0;
    right: 0;
}

/* Ensure the map element itself fills the container */
.locator-map .wpgmza_map,
.locator-map #wpgmza_map {
    width: 100% !important;
    max-width: 100% !important;
    height: 600px; /* Default height - can be adjusted */
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure the inner map canvas/iframe fills completely */
.locator-map .wpgmza_map > div,
.locator-map #wpgmza_map > div {
    width: 100% !important;
    height: 100% !important;
}

.location-details {
    padding-left: 40px;
    padding-right: 40px;
}

/* ============================================
   Location Cards Container
   ============================================ */
.location-cards {
    margin-top: 35px;
    margin-bottom: 35px;
    counter-reset: location-number; /* Initialize counter for automatic numbering */
}

/* Hidden class for toggling visibility */
.hidden {
    display: none !important;
}

.is-hidden .location-cards {
    display: none;
}

/* Wrapper div for each location card with numbered marker */
.location-cards > div {
    position: relative;
}

/* Numbered map marker icon before each card */
.location-cards > div::before {
    counter-increment: location-number; /* Increment counter for each card */
    content: counter(location-number); /* Display the current counter value */
    width: 42px;
    height: 56px;
    color: white;
    font-weight: 900;
    text-align: center;
    line-height: 3;
    background-image: url('https://monarchpainting.com.au/wp-content/themes/monarch/dist/images/map-marker.png');
    background-size: contain;
    background-repeat: no-repeat;
    position: absolute;
    left: 38px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.cta.get-directions {
    color: white;
}

/* ============================================
   Location Card Styling
   ============================================ */
.location-card {
    width: 100%;
    min-height: 138px;
    background-color: #f5f5f5;
    padding-left: 75px;
    padding-right: 75px;
    padding-top: 20px;
    padding-bottom: 20px;
    margin-bottom: 4px;
    position: relative;
    display: grid;
    grid-template-columns: minmax(200px, 1fr) minmax(300px, 2fr) auto;
    gap: 20px;
    text-align: left;
    align-items: center; /* Vertically center all grid items */
}

/* Title container with store name and distance */
.location-card__title--container {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertically center the title and distance within this column */
    margin-left: 20px;
    font-size: 17px;
    align-self: stretch; /* Stretch to fill the grid cell height */
}

.location-card h6 {
    font-size: 17px;
    font-weight: 700;
    line-height: 19.21px;
    margin: 0;
    color: #000;
}

.location-card .location-card__distance {
    font-size: 14px;
    font-weight: bold;
    line-height: 22.4px;
    margin: 0;
    color: #000;
    text-align: left;
    padding-top: 10px;
}

/* Details container - vertically center content */
.location-card__details {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertically center the address and phone within this column */
    align-self: stretch; /* Stretch to fill the grid cell height */
}

/* Address and phone styling */
.location-card .location-card__address,
.location-card .location-card__phone {
    font-size: 14px;
    line-height: 22.4px;
    margin: 0;
    color: #000;
}

.location-card__phone {
    margin-bottom: 0;
}

.location-card__phone a {
    color: inherit;
    text-decoration: none;
    text-transform: none;
}

.location-card__phone a:hover {
    text-decoration: underline;
}

/* ============================================
   Directions CTA Container & Button
   ============================================ */
.directions-card__cta {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertically center the button within this column */
    align-self: stretch; /* Stretch to fill the grid cell height */
    padding: 0;
    margin: 0;
}

/* CTA Button Base Styles */
.cta {
    background-color: #243672;
    color: white;
    font-size: 0.875rem; /* 14px */
    padding: 0.9375rem 1.25rem; /* 15px 20px */
    line-height: 1.125rem; /* 18px */
    display: inline-block;
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    border-bottom-right-radius: 0.5rem; /* 8px */
    transition: background-color 300ms ease-in-out;
    min-width: 13.875rem; /* 222px */
    max-width: 100%;
    border: 1px solid #243672;
    cursor: pointer;
    text-decoration: none;
}

.cta:hover {
    background-color: #1e2d5f;
    color: white;
    text-decoration: none;
}

.cta:active,
.cta:visited {
    color: white;
}

.dataTables_paginate {
    /* 1. Enable Flexbox */
    display: flex;

    /* 2. Push children to opposite ends (main property) */
    justify-content: space-between;

    /* Optional: Ensure it takes the full width of its container */
    width: 100%;

    /* Optional: Add some padding for visual spacing */
    padding: 8px 0;
}

/* ============================================
   Info Window (Map Popup) Styling
   ============================================ */

/* Override Google Maps inner info window container styles */
/* Keep the outer container (.gm-style-iw, .gm-style-iw-c) for the pointer/arrow */
/* Only strip styling from the inner wrapper */
.gm-style-iw-d {
    overflow: visible !important;
    max-width: none !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Override default WPGMZA info window styles */
.wpgmza-infowindow {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Info window card styling - matches reference design */
.info-window--lite {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 320px;
    max-width: 400px;
    position: relative;
    padding: 0;
}

/* Numbered marker icon on the left */
.info-window__marker-icon {
    position: absolute;
    left: 20px;
    top: 30px;
    width: 42px;
    height: 56px;
    z-index: 1;
}

.info-window__marker-icon img {
    width: 100%;
    height: 100%;
    display: block;
}

/* Close button in top-right corner */
.info-window__close {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #999;
    transition: color 0.2s ease;
    z-index: 2;
}

.info-window__close:hover {
    color: #333;
}

.info-window__close svg {
    width: 100%;
    height: 100%;
}

/* Content area with left padding for marker icon */
.info-window__content {
    padding: 24px 24px 24px 80px;
}

/* Title section */
.info-window__title--container {
    margin-bottom: 16px;
}

.info-window--lite h6 {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 8px 0;
    color: #000;
}

.info-window__distance {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    color: #000;
}

/* Details section */
.info-window__details {
    margin-bottom: 20px;
}

.info-window__address,
.info-window__phone {
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 8px 0;
    color: #000;
}

.info-window__phone {
    margin-bottom: 0;
}

.info-window__phone a {
    color: #000;
    text-decoration: none;
}

.info-window__phone a:hover {
    text-decoration: underline;
}

/* CTA button */
.info-window__cta {
    margin-top: 20px;
}

.info-window--lite .cta.get-directions {
    width: 100%;
    display: block;
    text-align: center;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 4px;
    background-color: #243672;
    color: #ffffff !important;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.info-window--lite .cta.get-directions:hover {
    background-color: #1a2850;
}

/* ============================================
   Responsive Styles
   ============================================ */

/* Tablet and below (max-width: 1024px / 64em) */
@media only screen and (max-width: 64em) {
    .location-cards > div::before {
        width: 31px;
        height: 42px;
        line-height: 2.6;
        left: 25px;
        top: 25px;
        transform: none;
    }

    .location-card {
        display: block; /* Stack vertically on tablets */
        padding-top: 26px;
        padding-bottom: 26px;
        margin-bottom: 8px;
    }

    .location-card::before {
        width: 31px;
        height: 42px;
    }

    .location-card__details {
        margin-top: 10px; /* Add spacing between stacked elements */
    }

    .directions-card__cta {
        margin-top: 10px; /* Add spacing between stacked elements */
    }

    /* Tablet adjustments for search input and Go button */
    .wpgmza-store-locator input.wpgmza-address {
        width: 350px !important;
        max-width: 350px !important;
    }

    /* Adjust map height for tablets */
    .locator-map .wpgmza_map,
    .locator-map #wpgmza_map {
        height: 500px;
    }
}

/* Desktop and above (min-width: 1025px / 64.063em) */
@media only screen and (min-width: 64.063em) {
    .location-card h6 {
        font-size: 17px;
    }

    .location-card .location-card__address {
        padding-right: 10px;
    }
}

/* Mobile (max-width: 640px / 40em) */
@media only screen and (max-width: 40em) {
    .location-card h6 {
        display: inline-block;
    }

    .location-card .location-card__distance {
        float: right;
        position: absolute;
        right: 20px;
    }

    .location-card__title--container {
        display: flex;
    }

    /* Mobile adjustments for search input and Go button */
    .wpgmza-store-locator .wpgmza-address-container {
        width: 100% !important;
    }

    .wpgmza-store-locator input.wpgmza-address {
        width: calc(100% - 80px) !important;
        max-width: calc(100% - 80px) !important;
    }

    .wpgmza-go-button {
        min-width: 80px;
    }

    /* Adjust map height for mobile devices */
    .locator-map .wpgmza_map,
    .locator-map #wpgmza_map {
        height: 400px;
    }
}