/* ApoGuru Map - ASL-Style Design */
:root {
    --apo-primary: #c60060;
    --apo-primary-dark: #a8004f;
    --apo-primary-light: #e8337f;
    --apo-text: #333;
    --apo-text-light: #666;
    --apo-border: #e0e0e0;
    --apo-bg: #fff;
    --apo-bg-light: #f8f8f8;
}

.apoguru-map-wrapper {
    position: relative;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* === Controls Bar === */
.apoguru-map-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
    background: var(--apo-bg);
    border-bottom: 1px solid var(--apo-border);
}

/* Row 1: Search */
.apoguru-controls-row1 {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

/* Row 2: Category + Radius */
.apoguru-controls-row2 {
    display: flex;
    gap: 24px;
    align-items: flex-end;
}

.apoguru-control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.apoguru-control-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--apo-primary);
}

/* Search */
.apoguru-control-search {
    flex: 1;
}

.apoguru-search-box {
    display: flex;
}

.apoguru-search-box input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--apo-border);
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.apoguru-search-box input:focus {
    border-color: var(--apo-primary);
}

/* Location button */
.apoguru-locate-btn {
    padding: 10px 14px;
    border: none;
    background: var(--apo-bg);
    border-top: 2px solid var(--apo-border);
    border-bottom: 2px solid var(--apo-border);
    color: var(--apo-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.apoguru-locate-btn:hover {
    background: #fef0f5;
}

.apoguru-locate-btn.apoguru-locate-active {
    background: var(--apo-primary);
    color: #fff;
}

/* Search/submit button */
.apoguru-search-btn {
    padding: 10px 16px;
    border: none;
    background: var(--apo-primary);
    color: #fff;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.apoguru-search-btn:hover {
    background: var(--apo-primary-dark);
}

.apoguru-search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Category Pills */
.apoguru-control-category {
    flex-shrink: 0;
}

.apoguru-category-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.apoguru-pill {
    padding: 8px 16px;
    border: 2px solid var(--apo-border);
    border-radius: 4px;
    background: var(--apo-bg);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--apo-text);
}

.apoguru-pill:hover {
    border-color: var(--apo-primary);
    color: var(--apo-primary);
}

.apoguru-pill-active {
    background: var(--apo-primary);
    border-color: var(--apo-primary);
    color: #fff;
}

.apoguru-pill-active:hover {
    background: var(--apo-primary-dark);
    color: #fff;
}

/* Radius Slider */
.apoguru-control-radius {
    flex: 1;
    min-width: 200px;
    max-width: 350px;
}

.apoguru-radius-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.apoguru-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--apo-primary) 0%, var(--apo-primary) 50%, var(--apo-border) 50%);
    outline: none;
    cursor: pointer;
}

.apoguru-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--apo-primary);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.apoguru-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--apo-primary);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.apoguru-radius-label {
    font-size: 12px;
    color: var(--apo-text-light);
    text-align: right;
}

/* === Two-column layout: List LEFT, Map RIGHT === */
.apoguru-map-layout {
    display: flex;
    gap: 0;
    border: 1px solid var(--apo-border);
    overflow: hidden;
    background: var(--apo-bg);
}

.apoguru-list-col {
    width: 420px;
    min-width: 340px;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--apo-border);
    background: var(--apo-bg);
}

.apoguru-map-col {
    flex: 1;
    min-width: 0;
}

#apoguru-map {
    border-radius: 0;
    border: none;
    z-index: 1;
}

/* Count bar */
.apoguru-map-count {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: var(--apo-primary);
}

/* === Store list === */
.apoguru-store-list {
    flex: 1;
    overflow-y: auto;
    max-height: 500px;
}

.apoguru-list-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--apo-border);
    cursor: pointer;
    transition: background 0.15s;
}

.apoguru-list-item:hover {
    background: #fef0f5;
}

.apoguru-list-item-active {
    background: #fce4ed;
    border-left: 4px solid var(--apo-primary);
    padding-left: 12px;
}

.apoguru-list-item-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.apoguru-list-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--apo-text);
}

.apoguru-list-address {
    font-size: 13px;
    color: var(--apo-text-light);
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.apoguru-list-address::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    min-width: 14px;
    margin-top: 2px;
    background: var(--apo-primary);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z'/%3E%3C/svg%3E") no-repeat center;
}

.apoguru-list-phone {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.apoguru-list-phone::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    min-width: 14px;
    background: var(--apo-primary);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z'/%3E%3C/svg%3E") no-repeat center;
}

.apoguru-list-phone a {
    color: var(--apo-primary);
    text-decoration: none;
}

.apoguru-list-email {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.apoguru-list-email::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    min-width: 14px;
    background: var(--apo-primary);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E") no-repeat center;
}

.apoguru-list-email a {
    color: var(--apo-text-light);
    text-decoration: none;
    font-size: 12px;
    word-break: break-all;
}

.apoguru-list-category {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--apo-text-light);
}

.apoguru-list-category::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    min-width: 14px;
    background: var(--apo-primary);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M17.63 5.84C17.27 5.33 16.67 5 16 5L5 5.01C3.9 5.01 3 5.9 3 7v10c0 1.1.9 1.99 2 1.99L16 19c.67 0 1.27-.33 1.63-.84L22 12l-4.37-6.16z'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M17.63 5.84C17.27 5.33 16.67 5 16 5L5 5.01C3.9 5.01 3 5.9 3 7v10c0 1.1.9 1.99 2 1.99L16 19c.67 0 1.27-.33 1.63-.84L22 12l-4.37-6.16z'/%3E%3C/svg%3E") no-repeat center;
}

/* Store actions row */
.apoguru-list-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.apoguru-list-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.apoguru-list-btn-route {
    background: var(--apo-primary);
    color: #fff;
}

.apoguru-list-btn-route:hover {
    background: var(--apo-primary-dark);
    color: #fff;
    text-decoration: none;
}

.apoguru-list-btn-website {
    background: var(--apo-bg);
    color: var(--apo-text);
    border: 1px solid var(--apo-border);
}

.apoguru-list-btn-website:hover {
    border-color: var(--apo-primary);
    color: var(--apo-primary);
    text-decoration: none;
}

.apoguru-list-btn-details {
    background: var(--apo-bg);
    color: var(--apo-text);
    border: 1px solid var(--apo-border);
}

.apoguru-list-btn-details:hover {
    border-color: var(--apo-primary);
    color: var(--apo-primary);
    text-decoration: none;
}

.apoguru-list-distance {
    font-size: 12px;
    font-weight: 600;
    color: var(--apo-text-light);
    margin-left: auto;
    white-space: nowrap;
}

/* === Popup === */
.apoguru-popup {
    font-size: 13px;
    line-height: 1.5;
    max-width: 280px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.apoguru-popup strong {
    font-size: 14px;
    color: var(--apo-text);
    display: block;
    margin-bottom: 2px;
}

.apoguru-popup a {
    color: var(--apo-primary);
}

.apoguru-popup-links {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
}

.apoguru-popup-links a {
    font-weight: 600;
    font-size: 13px;
}

.apoguru-distance {
    color: var(--apo-primary);
    font-size: 12px;
    font-weight: 500;
}

/* === Custom Marker Clusters (Magenta) === */
.marker-cluster-small {
    background-color: rgba(198, 0, 96, 0.2);
}
.marker-cluster-small div {
    background-color: rgba(198, 0, 96, 0.5);
}
.marker-cluster-medium {
    background-color: rgba(198, 0, 96, 0.3);
}
.marker-cluster-medium div {
    background-color: rgba(198, 0, 96, 0.6);
}
.marker-cluster-large {
    background-color: rgba(198, 0, 96, 0.4);
}
.marker-cluster-large div {
    background-color: rgba(198, 0, 96, 0.7);
}
.marker-cluster div {
    width: 32px;
    height: 32px;
    margin-left: 4px;
    margin-top: 4px;
    text-align: center;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    line-height: 32px;
}
.marker-cluster {
    background-clip: padding-box;
    border-radius: 50%;
}

/* === Custom Store Marker === */
.apoguru-store-marker {
    background: none;
    border: none;
}

.apoguru-store-marker-inner {
    width: 28px;
    height: 36px;
    position: relative;
}

.apoguru-store-marker-inner svg {
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3));
}

/* === Loading Spinner === */
.apoguru-list-loading {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
    line-height: 1.6;
}

.apoguru-spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid var(--apo-border);
    border-top-color: var(--apo-primary);
    border-radius: 50%;
    animation: apoguru-spin 0.7s linear infinite;
    margin-bottom: 10px;
}

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

/* === Scrollbar Styling === */
.apoguru-store-list::-webkit-scrollbar {
    width: 6px;
}

.apoguru-store-list::-webkit-scrollbar-track {
    background: var(--apo-bg-light);
}

.apoguru-store-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.apoguru-store-list::-webkit-scrollbar-thumb:hover {
    background: var(--apo-primary-light);
}

.apoguru-store-list {
    scrollbar-width: thin;
    scrollbar-color: #ccc var(--apo-bg-light);
}

/* === No Results === */
.apoguru-no-results {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.apoguru-no-results-icon {
    font-size: 40px;
    margin-bottom: 10px;
    opacity: 0.4;
}

.apoguru-no-results-text {
    font-size: 14px;
    line-height: 1.5;
}

.apoguru-no-results-hint {
    font-size: 12px;
    color: #bbb;
    margin-top: 6px;
}

/* === User location pulse === */
.apoguru-user-location {
    background: none;
    border: none;
}

.apoguru-pulse {
    width: 20px;
    height: 20px;
    background: rgba(0, 122, 255, 0.6);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.4);
    animation: apoguru-pulse-anim 2s infinite;
}

@keyframes apoguru-pulse-anim {
    0% { box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(0, 122, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 122, 255, 0); }
}

/* === Focus States (Accessibility) === */
.apoguru-search-box input:focus,
.apoguru-locate-btn:focus-visible,
.apoguru-search-btn:focus-visible,
.apoguru-pill:focus-visible,
.apoguru-slider:focus-visible,
.apoguru-list-btn:focus-visible {
    outline: 2px solid var(--apo-primary);
    outline-offset: 2px;
}

.apoguru-list-item:focus-within {
    background: #fef0f5;
}

/* === Responsive === */
@media (max-width: 900px) {
    .apoguru-map-layout {
        flex-direction: column;
    }

    .apoguru-list-col {
        width: 100%;
        min-width: 0;
        border-right: none;
        border-bottom: 1px solid var(--apo-border);
        order: 2;
    }

    .apoguru-map-col {
        order: 1;
    }

    .apoguru-store-list {
        max-height: 350px;
    }

    .apoguru-controls-row2 {
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .apoguru-map-controls {
        padding: 12px;
    }

    .apoguru-controls-row2 {
        flex-direction: column;
        gap: 12px;
    }

    .apoguru-control-radius {
        max-width: 100%;
    }

    .apoguru-store-list {
        max-height: 300px;
    }

    .apoguru-list-col {
        min-width: 0;
    }

    /* Bigger touch targets on mobile */
    .apoguru-pill {
        padding: 10px 16px;
        font-size: 13px;
        min-height: 44px;
    }

    .apoguru-search-box input {
        padding: 12px 14px;
        font-size: 16px; /* prevents iOS zoom */
    }

    .apoguru-locate-btn,
    .apoguru-search-btn {
        padding: 12px 16px;
        min-width: 44px;
        min-height: 44px;
    }

    .apoguru-slider {
        height: 12px;
    }

    .apoguru-slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }

    .apoguru-slider::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }

    .apoguru-list-btn {
        padding: 8px 14px;
        min-height: 36px;
    }
}
