/* ═══════════════════════════════════════════
   FF Map Widget v1.2.0
   Full Discovery Map Styles
   ═══════════════════════════════════════════ */

/* ─── Wrapper ─── */

.ffmw-map-wrapper {
    width: 100%;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ═══════════════════════════════════════════
   Top Bar — Mode Tabs + Search
   ═══════════════════════════════════════════ */

.ffmw-top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

/* ─── Mode Tabs ─── */

.ffmw-mode-tabs {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.ffmw-mode-tab {
    padding: 7px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.ffmw-mode-tab:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.ffmw-mode-tab.active {
    background: #1e293b;
    color: #fff;
    border-color: #1e293b;
}

.ffmw-mode-tab[data-mode="deals"].active {
    background: #059669;
    border-color: #059669;
}

.ffmw-mode-tab[data-mode="trending"].active {
    background: #dc2626;
    border-color: #dc2626;
}

.ffmw-mode-tab[data-mode="events"].active {
    background: #7c3aed;
    border-color: #7c3aed;
}

/* ─── Search ─── */

.ffmw-search-wrap {
    flex: 1;
    position: relative;
    min-width: 200px;
}

.ffmw-map-search {
    width: 100%;
    padding: 8px 36px 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: #fff;
    transition: border-color 0.15s;
}

.ffmw-map-search:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ffmw-map-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 16px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.ffmw-map-search-clear:hover {
    color: #475569;
}

/* ═══════════════════════════════════════════
   Main Content — Sidebar Layout
   ═══════════════════════════════════════════ */

.ffmw-main-content {
    height: 500px;
    display: flex;
    min-height: 400px;
}

.ffmw-layout-full .ffmw-main-content {
    height: 500px;
    display: block;
}

/* ─── Map Container ─── */

.ffmw-map-container {
    height: 100%;
    flex: 1;
    min-width: 0;
}

.ffmw-map {
    height: 500px;
    width: 100%;
    min-height: 400px;
}

/* ═══════════════════════════════════════════
   Filter Panel (Sidebar)
   ═══════════════════════════════════════════ */

.ffmw-filter-panel {
    width: 240px;
    flex-shrink: 0;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    padding: 16px;
    overflow-y: auto;
    max-height: 600px;
}

.ffmw-filter-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.ffmw-filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.ffmw-filter-heading {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Category Checkboxes ─── */

.ffmw-filter-categories {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 250px;
    overflow-y: auto;
}

.ffmw-filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #334155;
    transition: background 0.1s;
}

.ffmw-filter-checkbox:hover {
    background: #e2e8f0;
}

.ffmw-filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
    cursor: pointer;
}

.ffmw-filter-all {
    font-weight: 600;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
    margin-bottom: 4px;
}

/* ─── Feature Filters ─── */

.ffmw-feature-filters {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ffmw-feature-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #334155;
    transition: background 0.1s;
}

.ffmw-feature-filter:hover {
    background: #e2e8f0;
}

.ffmw-feature-filter input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
    cursor: pointer;
}

/* ─── Distance Filter ─── */

.ffmw-distance-filter {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ffmw-distance-filter label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #334155;
}

.ffmw-distance-filter label:hover {
    background: #e2e8f0;
}

.ffmw-distance-filter input[type="radio"] {
    accent-color: #3b82f6;
    cursor: pointer;
}

.ffmw-distance-section.ffmw-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.ffmw-distance-section.ffmw-disabled .ffmw-distance-hint {
    display: block;
}

.ffmw-distance-hint {
    display: none;
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
    margin: 0 0 8px 0;
}

/* ─── Reset Button ─── */

.ffmw-filter-reset {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
}

.ffmw-filter-reset:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* ─── Filter Loading ─── */

.ffmw-filter-loading {
    font-size: 12px;
    color: #94a3b8;
    font-style: italic;
    padding: 8px;
}

/* ─── Mobile Filter Toggle ─── */

.ffmw-filter-toggle {
    display: none;
    padding: 8px 16px;
    border: none;
    background: #1e293b;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.ffmw-filter-toggle.active {
    background: #475569;
}

/* ═══════════════════════════════════════════
   Bottom Bar
   ═══════════════════════════════════════════ */

.ffmw-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    gap: 12px;
    flex-wrap: wrap;
}

.ffmw-map-locate-btn {
    padding: 8px 16px;
    border: 1px solid #3b82f6;
    border-radius: 8px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.ffmw-map-locate-btn:hover {
    background: #3b82f6;
    color: #fff;
}

.ffmw-result-count {
    font-size: 13px;
    color: #64748b;
}

/* ═══════════════════════════════════════════
   Pins
   ═══════════════════════════════════════════ */

.ffmw-pin {
    background: none !important;
    border: none !important;
}

.ffmw-pin-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    transition: transform 0.15s ease;
}

.ffmw-pin:hover .ffmw-pin-inner {
    transform: scale(1.25);
}

.ffmw-pin-featured .ffmw-pin-inner {
    font-size: 28px;
    filter: drop-shadow(0 2px 6px rgba(245, 158, 11, 0.5));
}

.ffmw-pin-event .ffmw-pin-inner {
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(139, 92, 246, 0.4));
}

.ffmw-pin-deal .ffmw-pin-inner {
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(5, 150, 105, 0.4));
}

.ffmw-pin-trending .ffmw-pin-inner {
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(220, 38, 38, 0.4));
}

.ffmw-pin-user .ffmw-pin-inner {
    font-size: 28px;
}

.ffmw-pin-pulse {
    animation: ffmw-pulse 2s ease-in-out infinite;
}

@keyframes ffmw-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.15); }
}

/* ═══════════════════════════════════════════
   Popups
   ═══════════════════════════════════════════ */

.ffmw-popup-wrapper .leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 0;
}

.ffmw-popup-wrapper .leaflet-popup-content {
    margin: 0;
    min-width: 240px;
}

.ffmw-popup-wrapper .leaflet-popup-tip {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ffmw-popup {
    overflow: hidden;
    border-radius: 12px;
}

.ffmw-popup-img {
    width: 100%;
    height: 140px;
    overflow: hidden;
}

.ffmw-popup-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ffmw-popup-body {
    padding: 14px 16px;
}

.ffmw-popup-name {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.ffmw-popup-name a {
    color: #1e293b;
    text-decoration: none;
}

.ffmw-popup-name a:hover {
    color: #2563eb;
}

/* ─── Badges ─── */

.ffmw-popup-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 6px 0;
}

.ffmw-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.ffmw-badge-trending {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.ffmw-badge-bestof {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fcd34d;
}

.ffmw-badge-deal {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #6ee7b7;
}

.ffmw-badge-open {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #86efac;
}

.ffmw-badge-closed {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.ffmw-badge-event {
    background: #ede9fe;
    color: #6d28d9;
    border: 1px solid #c4b5fd;
}

.ffmw-badge-page {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* ─── Popup Details ─── */

.ffmw-popup-cat {
    display: inline-block;
    font-size: 12px;
    color: #64748b;
    margin: 2px 0;
}

.ffmw-popup-rating {
    margin: 4px 0;
    font-size: 13px;
}

.ffmw-stars {
    color: #f59e0b;
    font-size: 13px;
    letter-spacing: 1px;
}

.ffmw-popup-reviews {
    color: #94a3b8;
    font-size: 12px;
}

.ffmw-popup-event-date {
    font-weight: 600;
    color: #7c3aed;
    margin: 4px 0;
    font-size: 13px;
}

.ffmw-popup-venue {
    color: #64748b;
    font-size: 12px;
    margin: 2px 0;
}

.ffmw-popup-cost {
    color: #059669;
    font-weight: 600;
    font-size: 13px;
    margin: 4px 0;
}

.ffmw-popup-hours {
    color: #64748b;
    font-size: 12px;
    margin: 4px 0;
}

.ffmw-popup-deal-callout {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #059669;
    margin: 6px 0;
}

.ffmw-popup-address {
    font-size: 12px;
    margin: 4px 0;
}

.ffmw-popup-address a {
    color: #475569;
    text-decoration: none;
}

.ffmw-popup-address a:hover {
    color: #2563eb;
}

.ffmw-popup-phone {
    font-size: 12px;
    margin: 2px 0;
}

.ffmw-popup-phone a {
    color: #475569;
    text-decoration: none;
}

.ffmw-popup-phone a:hover {
    color: #2563eb;
}

.ffmw-popup-excerpt {
    color: #475569;
    font-size: 12px;
    line-height: 1.5;
    margin: 6px 0;
    padding-top: 6px;
    border-top: 1px solid #f1f5f9;
}

.ffmw-popup-amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 6px 0;
}

.ffmw-amenity-tag {
    background: #ecfdf5;
    color: #065f46;
    font-size: 10px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid #a7f3d0;
}

/* ─── Tier Badges ─── */

.ffmw-popup-tier {
    font-size: 11px;
    font-weight: 600;
    margin: 4px 0;
    padding: 2px 0;
}

.ffmw-tier-founding_member { color: #b45309; }
.ffmw-tier-premium         { color: #d97706; }
.ffmw-tier-community_plus  { color: #2563eb; }
.ffmw-tier-community       { color: #3b82f6; }
.ffmw-tier-free            { color: #94a3b8; }

/* ─── Action Buttons ─── */

.ffmw-popup-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.ffmw-popup-btn {
    display: inline-block;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none !important;
    text-align: center;
    transition: all 0.15s;
    cursor: pointer;
    line-height: 1.3;
}

.ffmw-btn-primary {
    background: #2563eb;
    color: #fff !important;
    flex: 1;
}

.ffmw-btn-primary:hover {
    background: #1d4ed8;
}

.ffmw-btn-directions {
    background: #f1f5f9;
    color: #475569 !important;
    border: 1px solid #e2e8f0;
}

.ffmw-btn-directions:hover {
    background: #e2e8f0;
    color: #1e293b !important;
}

/* Event variant */
.ffmw-popup-event .ffmw-btn-primary {
    background: #7c3aed;
}
.ffmw-popup-event .ffmw-btn-primary:hover {
    background: #6d28d9;
}

/* Page variant */
.ffmw-popup-page .ffmw-btn-primary {
    background: #059669;
}
.ffmw-popup-page .ffmw-btn-primary:hover {
    background: #047857;
}

/* ═══════════════════════════════════════════
   No Results
   ═══════════════════════════════════════════ */

.ffmw-no-results {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    color: #94a3b8;
    font-size: 16px;
    font-style: italic;
    text-align: center;
    padding: 40px 20px;
}

/* ═══════════════════════════════════════════
   Responsive — Tablet (< 900px)
   ═══════════════════════════════════════════ */

@media (max-width: 899px) {

    .ffmw-top-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .ffmw-mode-tabs {
        justify-content: center;
        flex-wrap: wrap;
    }

    .ffmw-main-content {
    height: 500px;
        flex-direction: column;
    }

    .ffmw-filter-panel {
        width: 100%;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        display: none;
    }

    .ffmw-filter-panel.ffmw-panel-open {
        display: block;
    }

    .ffmw-filter-toggle {
        display: block;
    }

    /* Make filter panel horizontal on tablet */
    .ffmw-filter-panel {
        display: none;
        padding: 12px 16px;
    }

    .ffmw-filter-panel.ffmw-panel-open {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .ffmw-filter-section {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }
}

/* ═══════════════════════════════════════════
   Responsive — Mobile (< 600px)
   ═══════════════════════════════════════════ */

@media (max-width: 599px) {

    .ffmw-mode-tabs {
        width: 100%;
    }

    .ffmw-mode-tab {
        flex: 1;
        text-align: center;
        padding: 8px 8px;
        font-size: 12px;
    }

    .ffmw-map {
    height: 500px;
        min-height: 300px;
    }

    .ffmw-filter-panel.ffmw-panel-open {
        grid-template-columns: 1fr;
    }

    .ffmw-bottom-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .ffmw-map-locate-btn {
        width: 100%;
    }

    .ffmw-popup-actions {
        flex-direction: column;
    }

    .ffmw-popup-btn {
        width: 100%;
        text-align: center;
    }

    .ffmw-popup-img {
        height: 100px;
    