/* GeoStore Locator Pro - Multi-Theme & Responsive Styling */
:root {
    --wplm-accent: #6366f1;
    /* Dynamic */
    --wplm-bg: #ffffff;
    --wplm-text-main: #1e293b;
    --wplm-text-muted: #64748b;
    --wplm-shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --wplm-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --wplm-radius-sm: 8px;
    --wplm-radius-md: 12px;
    --wplm-radius-lg: 20px;
}

/* === BASE CONTAINER & AUTO-HEIGHT === */
.wplm-main-container {
    width: 100%;
    margin: 20px auto;
    font-family: var(--wplm-font-family, 'Inter', system-ui, -apple-system, sans-serif);
    color: var(--wplm-text-main);
    display: flex;
    flex-direction: column;
    min-height: var(--wplm-base-height, 500px);
}

.wplm-map-wrapper {
    flex: 1;
    min-height: var(--wplm-base-height, 500px);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

#wplm-map {
    width: 100%;
    height: 100%;
    min-height: inherit;
    background: #f1f5f9;
}

/* === CLASSIC LAYOUT (BOXED) === */
.wplm-layout-classic {
    border: 1px solid #cbd5e1;
    border-radius: var(--wplm-radius-sm);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    background: #fff;
    overflow: hidden;
}

.wplm-classic-header {
    background: #f8fafc;
    padding: 20px 30px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.wplm-classic-branding h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--wplm-text-main);
}

.wplm-classic-search {
    display: flex;
    gap: 0;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
    width: 350px;
}

.wplm-classic-search input {
    flex: 1;
    border: none !important;
    padding: 10px 15px;
    font-size: 14px;
    outline: none !important;
    box-shadow: none !important;
}

.wplm-classic-search button {
    background: var(--wplm-accent);
    color: #fff;
    border: none;
    padding: 0 20px;
    font-weight: 600;
    cursor: pointer;
}

/* === FLOATING SEARCH (MODERN) === */
.wplm-floating-search {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wplm-search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-radius: 100px;
    padding: 6px;
    box-shadow: var(--wplm-shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.wplm-search-box input {
    flex: 1;
    border: none !important;
    background: transparent;
    padding: 10px 25px;
    font-size: 16px;
    font-family: Inter, sans-serif;
    outline: none !important;
    box-shadow: none !important;
}

.wplm-search-box button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--wplm-accent);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.wplm-search-box button:hover {
    transform: scale(1.05);
}

/* === MODERN LAYOUT (CARD OVERLAY) === */
.wplm-layout-modern .wplm-results-card {
    background: #fff;
    border-radius: var(--wplm-radius-md);
    padding: 15px;
    box-shadow: var(--wplm-shadow-xl);
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    animation: wplm-fade-up 0.3s ease-out;
}

@keyframes wplm-fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === SIDEBAR LAYOUTS === */
.wplm-layout-sidebar-left,
.wplm-layout-sidebar-right {
    height: var(--wplm-base-height, 600px);
    max-width: 1280px;
    background: #fff;
    border-radius: var(--wplm-radius-md);
    overflow: hidden;
    box-shadow: var(--wplm-shadow-xl);
    border: 1px solid #e2e8f0;
}

@media (min-width: 769px) {
    .wplm-layout-sidebar-left .wplm-map-wrapper,
    .wplm-layout-sidebar-right .wplm-map-wrapper {
        flex-direction: row !important;
        height: 100%;
    }
}

.wplm-sidebar {
    width: 380px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    z-index: 10;
}

.wplm-layout-sidebar-left .wplm-sidebar {
    border-right: 1px solid #e2e8f0;
}

.wplm-layout-sidebar-right .wplm-sidebar {
    border-left: 1px solid #e2e8f0;
}

.wplm-sidebar-header {
    padding: 25px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.wplm-sidebar-header h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 800;
}

.wplm-sidebar-search {
    display: flex;
    gap: 8px;
}

.wplm-sidebar-search input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
}

.wplm-sidebar-search button {
    background: var(--wplm-accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    width: 44px;
    cursor: pointer;
}

.wplm-sidebar-meta {
    padding: 10px 25px;
    background: #f1f5f9;
    font-size: 11px;
    font-weight: 700;
    color: var(--wplm-text-muted);
    text-transform: uppercase;
}

.wplm-location-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.wplm-list-item {
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
}

.wplm-list-item:hover {
    border-color: var(--wplm-accent);
    background: #f8fafc;
}

.wplm-list-item.is-active {
    background: #eff6ff;
    border-color: var(--wplm-accent);
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.1);
}

.wplm-list-item h4 {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* Distance badge shown after proximity search */
.wplm-distance-badge {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 2px 9px;
    background: color-mix(in srgb, var(--wplm-accent) 12%, transparent);
    color: var(--wplm-accent);
    border: 1px solid color-mix(in srgb, var(--wplm-accent) 30%, transparent);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.wplm-list-item p {
    margin: 4px 0;
    font-size: 13px;
    color: var(--wplm-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.wplm-directions-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 15px;
    background: var(--wplm-accent);
    color: #fff;
    border-radius: 6px;
    font-size: 12px;
    text-decoration: none;
    font-weight: 600;
}

/* === HORIZONTAL LAYOUTS (LIST TOP/BOTTOM) === */
.wplm-layout-list-top,
.wplm-layout-list-bottom {
    height: auto;
    max-width: 1200px;
    box-shadow: var(--wplm-shadow-xl);
    border-radius: var(--wplm-radius-md);
    border: 1px solid #e2e8f0;
}

.wplm-layout-list-top .wplm-sidebar {
    width: 100%;
    border-bottom: 1px solid #e2e8f0;
}

.wplm-layout-list-bottom .wplm-sidebar {
    width: 100%;
    order: 2;
    border-top: 1px solid #e2e8f0;
}

.wplm-layout-list-top .wplm-location-list,
.wplm-layout-list-bottom .wplm-location-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    max-height: 400px;
}

/* === INFO WINDOW STYLING === */
.gm-style .gm-style-iw-c {
    padding: 0 !important;
    border-radius: var(--wplm-radius-md) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

.wplm-info-window {
    padding: 20px;
    max-width: 280px;
}

.wplm-info-window h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: var(--wplm-accent);
}

/* === STANDALONE ZIP SEARCH === */
.wplm-zip-search-wrapper {
    width: 100%;
    margin: 40px auto;
    display: flex;
    justify-content: center;
}

.wplm-zip-search-container {
    width: 100%;
    max-width: 600px;
    display: flex;
    background: #fff;
    border-radius: 100px;
    padding: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: var(--wplm-shadow-lg);
}

.wplm-zip-search-container input {
    flex: 1;
    border: none;
    padding: 12px 25px;
    font-size: 17px;
    outline: none;
    font-family: 'Outfit', sans-serif;
}

.wplm-zip-search-container button {
    background: var(--wplm-accent);
    color: #fff;
    border-radius: 100px;
    padding: 0 35px;
    font-weight: 700;
    border: none;
    cursor: pointer;
}

#wplm-location-alert {
    width: 100%;
    padding: 10px 20px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 13px;
    text-align: center;
}

/* === RESPONSIVE MEDIA QUERIES === */
@media (max-width: 1024px) {
    .wplm-sidebar {
        width: 320px;
    }
}

@media (max-width: 768px) {

    .wplm-layout-sidebar-left,
    .wplm-layout-sidebar-right {
        display: flex;
        flex-direction: column;
        height: auto !important;
    }

    .wplm-sidebar {
        width: 100%;
        order: 2;
        border: none !important;
        min-height: 380px;  /* guarantees ~3 cards are always visible */
        max-height: 650px;
        overflow-y: auto;
    }

    /* Sidebar search stays inline on mobile: [input][pin][search] */
    .wplm-sidebar-search {
        display: flex !important;
        flex-direction: row !important;
        gap: 6px !important;
        align-items: center !important;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .wplm-sidebar-search input {
        flex: 1 !important;
        height: 44px !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 10px !important;
        text-align: left !important;
        font-size: 15px !important;
        padding: 0 14px !important;
        width: auto !important;
    }

    .wplm-sidebar-search .wplm-locate-me-btn,
    .wplm-sidebar-search #wplm-sidebar-btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        border-radius: 10px !important;
        flex-shrink: 0 !important;
    }

    /* Hide the "Use My Current Location" label inside sidebar — icon only */
    .wplm-sidebar-search .wplm-locate-me-btn::after {
        content: none !important;
    }

    .wplm-map-wrapper {
        height: auto !important;
        min-height: 400px !important;
        flex: none;
        display: flex;
        flex-direction: column !important;
    }

    #wplm-map {
        height: 400px !important;
        width: 100%;
        order: 1;
    }

    .wplm-classic-header {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
    }

    .wplm-classic-search {
        width: 100%;
    }

    /* Only zip-search, classic, and floating search go column on mobile */
    .wplm-zip-search-container, .wplm-classic-search, .wplm-search-box {
        flex-direction: column !important;
        gap: 10px !important;
        padding: 10px !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .wplm-zip-search-container input, .wplm-sidebar-search input, .wplm-classic-search input, .wplm-search-box input {
        width: 100% !important;
        height: 48px !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px !important;
        text-align: center !important;
        font-size: 16px !important;
    }

    .wplm-locate-me-btn, #wplm-zip-button, #wplm-sidebar-btn {
        width: 100% !important;
        height: 48px !important;
        border-radius: 12px !important;
        justify-content: center !important;
        font-weight: 700 !important;
        display: flex !important;
        align-items: center !important;
        margin: 0 !important;
    }

    .wplm-locate-me-btn::after {
        content: " Use My Current Location";
        margin-left: 8px;
        font-size: 14px;
    }

    /* ── Compact location cards on mobile ── */
    .wplm-location-list {
        padding: 10px !important;
    }

    .wplm-list-item {
        padding: 11px 13px !important;
        margin-bottom: 8px !important;
        border-radius: 10px !important;
    }

    /* Title + distance badge on same row, wrapping gracefully */
    .wplm-list-item h4 {
        font-size: 13px !important;
        margin: 0 0 6px 0 !important;
        flex-wrap: wrap;
        gap: 6px;
        line-height: 1.3;
    }

    .wplm-distance-badge {
        font-size: 10px !important;
        padding: 2px 7px !important;
        align-self: flex-start;
        margin-top: 1px;
    }

    .wplm-list-item p {
        font-size: 12px !important;
        margin: 3px 0 !important;
        line-height: 1.4;
    }

    /* Smaller Directions button */
    .wplm-list-item .wplm-directions-btn {
        margin-top: 8px !important;
        padding: 5px 13px !important;
        font-size: 11px !important;
        border-radius: 6px !important;
        display: inline-block !important;
    }

    /* Sidebar header tighter on mobile */
    .wplm-sidebar-header {
        padding: 15px !important;
    }

    .wplm-sidebar-header h3 {
        font-size: 15px !important;
        margin-bottom: 10px !important;
    }
}

/* === PRO FEATURES === */
.wplm-locate-me-btn {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: var(--wplm-text-muted);
    border-radius: 8px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
}

.wplm-locate-me-btn:hover {
    background: #f1f5f9;
    color: var(--wplm-accent);
    border-color: var(--wplm-accent);
}

.wplm-locate-me-btn:active {
    transform: scale(0.95);
    background: #e2e8f0;
}

.wplm-locate-me-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wplm-classic-search .wplm-locate-me-btn {
    border: none;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    border-radius: 0;
    height: auto;
    background: transparent;
}

.wplm-search-box .wplm-locate-me-btn {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    margin-right: 5px;
}

.wplm-zip-search-container .wplm-locate-me-btn {
    background: transparent;
    border: none;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    border-radius: 0;
    height: auto;
    margin: 0 10px;
}

.spin {
    animation: wplm-spin 1s linear infinite;
}

@keyframes wplm-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}