/* Blinker is enqueued from gym-locator.php (wp_enqueue_style) so it loads in
   parallel. If you are dropping this CSS in standalone, uncomment the import:
   @import url('https://fonts.googleapis.com/css2?family=Blinker:wght@400;600;700&display=swap');
*/

/* ============================================================
   Advanced Store Locator - Version 1.5
   Theme refresh to match approved design reference
   ============================================================ */

:root {
    --asl-amber: #F6AF32;
    --asl-amber-dark: #e09c22;
    --asl-amber-soft: #fef6e7;
    --asl-marker: #d64545;
    --asl-ink: #1f2937;
    --asl-body: #4b5563;
    --asl-muted: #6b7280;
    --asl-line: #e5e7eb;
    --asl-line-soft: #eef1f4;
    --asl-surface: #ffffff;
    --asl-canvas: #ffffff;
    --asl-field: #f5f6f8;
    --asl-radius: 12px;
    --asl-radius-sm: 8px;
    --asl-black: #000000;
    --asl-black-soft: #1a1a1a;
    --asl-font: 'Blinker', sans-serif;
}


/* ── Typography: scope Blinker to every plugin surface ───── */
.gym-locator-container,
.gym-locator-container button,
.gym-locator-container input,
#location-popup,
#location-popup button,
#turn-on-location-btn {
    font-family: var(--asl-font);
}

/* ── Layout ──────────────────────────────────────────────── */
.gym-locator-container {
    display: flex;
    gap: 18px;
    height: 70vh;
    overflow: hidden;
    margin: 0 auto;
    padding: 14px;
    background-color: var(--asl-canvas);
    border-radius: 16px;
    box-sizing: border-box;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.gym-locator-sidebar {
    width: 40%;
    max-width: 500px;
    background-color: var(--asl-surface);
    border: 1px solid var(--asl-line-soft);
    border-radius: var(--asl-radius);
    padding: 16px;
    overflow-y: auto;
    box-sizing: border-box;
    box-shadow: none;
}

.gym-locator-sidebar::-webkit-scrollbar {
    width: 6px;
}

.gym-locator-sidebar::-webkit-scrollbar-thumb {
    background: #d7dbe0;
    border-radius: 3px;
}

/* ── Search field ────────────────────────────────────────── */
.gym-locator-sidebar input[type="text"] {
    width: 100%;
    padding: 13px 14px;
    margin-bottom: 16px;
    border: 1px solid var(--asl-line);
    border-radius: var(--asl-radius-sm);
    background-color: var(--asl-field);
    font-size: 15px;
    color: var(--asl-ink);
    box-sizing: border-box;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.gym-locator-sidebar input[type="text"]::placeholder {
    color: #9aa1a9;
}

.gym-locator-sidebar input[type="text"]:focus {
    outline: none;
    background-color: var(--asl-surface);
    border-color: var(--asl-amber);
}

#gym-list {
    /* Room for the first card's overhanging number badge */
    margin-top: 4px;
    padding-top: 10px;
}

/* ── Nearest locations header ────────────────────────────── */
.nearest-location-title {
    background: var(--asl-amber-soft);
    border: 1px solid #f4e2bd;
    color: #8a6114;
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: var(--asl-radius-sm);
    text-align: center;
    box-shadow: none;
}

.nearest-location-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

/* ── Distance badge ──────────────────────────────────────── */
.distance-info {
    color: #8a6114;
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 10px !important;
    padding: 4px 10px;
    background-color: var(--asl-amber-soft);
    border-radius: 999px;
    display: inline-block;
}

/* ── Store card ──────────────────────────────────────────── */
.gym-item {
    position: relative;
    padding: 18px 16px 16px;
    background-color: var(--asl-surface);
    margin-bottom: 18px;
    border: 1px solid var(--asl-line-soft);
    border-radius: var(--asl-radius);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    cursor: pointer;
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
    overflow: visible;
}

.gym-item:hover {
    border-color: #e3e7eb;
    box-shadow: 0 6px 16px rgba(16, 24, 40, 0.08);
    transform: translateY(-2px);
}

.gym-item.active {
    border: 1px solid var(--asl-amber);
    box-shadow: 0 0 0 3px rgba(246, 175, 50, 0.15);
}

/* Numbered badge, top-left, tucked inside the card so the
   sidebar's overflow scrolling can never clip it */
.sidebar-marker-number {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -9px;
    left: 12px;
    width: 22px;
    height: 22px;
    background-color: var(--asl-amber);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.2);
    z-index: 2;
}

.gym-item h4 {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 700;
    color: var(--asl-ink);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Icon-prefixed detail rows */
.gym-item .gym-detail {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--asl-body);
}

.gym-item .gym-detail svg {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin-top: 2px;
    stroke: var(--asl-muted);
    fill: none;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gym-item .gym-detail a {
    color: var(--asl-body);
    text-decoration: none;
}

.gym-item .gym-detail a:hover {
    color: var(--asl-amber-dark);
}

/* ── Buttons ─────────────────────────────────────────────── */
.gym-buttons {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    margin-left: 0;
}

.gym-buttons > * {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--asl-radius-sm);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    margin: 0 !important;
    width: auto;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.gym-buttons svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Primary: Order Now */
.view-gym-btn {
    background-color: var(--asl-amber);
    border: 1px solid var(--asl-amber);
    color: #ffffff !important;
}

.view-gym-btn svg {
    stroke: #ffffff;
}

.view-gym-btn:hover {
    background-color: var(--asl-amber-dark);
    border-color: var(--asl-amber-dark);
    color: #ffffff !important;
}

/* Secondary: Get Directions - solid black */
.gym-buttons .get-directions-btn,
.gym-locator-sidebar .gym-buttons button.get-directions-btn {
    background-color: var(--asl-black) !important;
    border: 1px solid var(--asl-black) !important;
    color: #ffffff !important;
}

.gym-buttons .get-directions-btn svg {
    stroke: #ffffff !important;
}

.gym-buttons .get-directions-btn:hover,
.gym-locator-sidebar .gym-buttons button.get-directions-btn:hover {
    background-color: var(--asl-black-soft) !important;
    border-color: var(--asl-black-soft) !important;
    color: #ffffff !important;
}

/* Override the generic sidebar-button rule for card buttons */
.gym-locator-sidebar .gym-buttons button {
    width: auto;
    padding: 0 12px;
    font-size: 14px;
}

/* ── Map ─────────────────────────────────────────────────── */
.gym-locator-map {
    flex-grow: 1;
    height: auto;
    width: 100%;
    position: relative;
    border-radius: var(--asl-radius);
    overflow: hidden;
    border: 1px solid var(--asl-line-soft);
    z-index: 1 !important;
}

/* ── Markers ─────────────────────────────────────────────── */
.gym-marker {
    background-color: #f6af32 !important;
    border-radius: 50%;
    color: white;
    text-align: center;
    line-height: 30px;
    width: 34px !important;
    height: 34px !important;
    border: 3px solid white;
    font-size: 14px !important;
    box-shadow: 0 2px 6px rgba(16, 24, 40, 0.25);
}

.gym-marker .marker-number {
    color: white;
    font-weight: 700;
}

.user-location-marker {
    background-color: transparent;
    border: none;
}

.user-marker-dot {
    width: 20px;
    height: 20px;
    background-color: #3b82f6;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    70%  { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* ============================================================
   Floating "Turn on Location" button
   ============================================================ */
#turn-on-location-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99999;
    background-color: var(--asl-amber);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 13px 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(246, 175, 50, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    animation: floatIn 0.4s ease-out;
    width: auto !important;
    line-height: normal !important;
}

#turn-on-location-btn svg {
    width: 16px;
    height: 16px;
    stroke: #ffffff;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#turn-on-location-btn:hover {
    background-color: var(--asl-amber-dark);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(246, 175, 50, 0.5);
}

#turn-on-location-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(246, 175, 50, 0.35);
}

@keyframes floatIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Location permission popup
   ============================================================ */
#location-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.location-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 24, 39, 0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.location-popup-content {
    background: var(--asl-surface);
    padding: 40px 36px 30px;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 60px rgba(16, 24, 40, 0.22);
    animation: slideUp 0.4s ease-out;
    box-sizing: border-box;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* Circular amber pin badge */
.location-popup-icon {
    width: 66px;
    height: 66px;
    margin: 0 auto 22px;
    background-color: var(--asl-amber);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.location-popup-icon svg {
    width: 30px;
    height: 30px;
    stroke: #ffffff;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.location-popup-content h3 {
    margin: 0 0 12px;
    font-size: 23px;
    font-weight: 700;
    color: var(--asl-ink);
}

.location-popup-content p {
    margin: 0 0 26px;
    font-size: 15px;
    color: var(--asl-muted);
    line-height: 1.55;
}

.location-popup-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
}

#location-popup .btn-allow,
#location-popup .btn-deny {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: var(--asl-radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease;
}

#location-popup .btn-allow {
    background-color: var(--asl-amber) !important;
    border: 1px solid var(--asl-amber) !important;
    color: #ffffff !important;
}

#location-popup .btn-allow:hover {
    background-color: var(--asl-amber-dark) !important;
    border-color: var(--asl-amber-dark) !important;
    color: #ffffff !important;
}

#location-popup .btn-deny {
    background-color: var(--asl-black) !important;
    border: 1px solid var(--asl-black) !important;
    color: #ffffff !important;
}

#location-popup .btn-deny:hover {
    background-color: var(--asl-black-soft) !important;
    border-color: var(--asl-black-soft) !important;
    color: #ffffff !important;
}

/* Privacy reassurance line */
.location-popup-privacy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 20px 0 0 !important;
    font-size: 12.5px !important;
    color: #9aa1a9 !important;
}

.location-popup-privacy svg {
    width: 12px;
    height: 12px;
    stroke: var(--asl-amber);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

/* ============================================================
   ZIP search states
   ============================================================ */
.zip-search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    color: var(--asl-muted);
    font-size: 14px;
    gap: 12px;
}

.zip-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--asl-line);
    border-top-color: var(--asl-amber);
    border-radius: 50%;
    animation: zip-spin 0.7s linear infinite;
}

@keyframes zip-spin {
    to { transform: rotate(360deg); }
}

.zip-not-found {
    padding: 18px;
    margin-top: 10px;
    background: var(--asl-amber-soft);
    border: 1px solid #f4e2bd;
    border-radius: var(--asl-radius-sm);
    color: #8a6114;
    font-size: 14px;
    line-height: 1.5;
}

.zip-not-found p {
    margin: 4px 0;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
    .gym-locator-container {
        flex-direction: column-reverse;
        height: auto;
        gap: 14px;
        padding: 10px;
    }

    .gym-locator-sidebar {
        width: 100%;
        max-width: none;
        height: 100% !important;
    }

    .gym-locator-map {
        width: 100%;
        height: 60vh;
    }

    .location-popup-content {
        padding: 32px 26px 24px;
    }

    #turn-on-location-btn {
        bottom: 20px;
        right: 20px;
        font-size: 14px;
        padding: 12px 20px;
    }
}

@media (max-width: 768px) {
    .gym-locator-container {
        flex-direction: column-reverse;
        height: auto;
        overflow: hidden !important;
    }

    .gym-locator-sidebar {
        width: 100%;
        max-width: 100%;
        height: 45vh;
    }

    .gym-locator-map {
        width: 100%;
        height: 50vh;
    }

    .location-popup-content {
        padding: 28px 22px 22px;
    }

    .location-popup-content h3 {
        font-size: 21px;
    }

    .location-popup-icon {
        width: 58px;
        height: 58px;
        margin-bottom: 18px;
    }

    #turn-on-location-btn {
        bottom: 15px;
        right: 15px;
        font-size: 13px;
        padding: 11px 18px;
    }
}

@media (max-width: 480px) {
    .gym-locator-container {
        overflow: hidden !important;
        flex-direction: column-reverse;
    }

    .gym-locator-sidebar {
        width: 100%;
        height: 42vh;
        padding: 12px;
    }

    .gym-locator-map {
        width: 100%;
        height: 40vh;
    }

    /* Stack card buttons on very small screens */
    .gym-buttons {
        flex-direction: column;
    }

    .location-popup-content {
        padding: 24px 18px 20px;
    }

    #turn-on-location-btn {
        bottom: 10px;
        right: 10px;
        font-size: 13px;
        padding: 10px 16px;
    }
}