/* Ensure layout is visible and maintains its structure */
.layout {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
    background-color: var(--background) !important;
}

.main {
    background-color: var(--background);
    flex: 1;
}

.hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    max-height: 900px;
    padding: var(--spacing-16) var(--spacing-8);
    margin-top: 0; /* Ensure no negative margin pushes it over header */
    background-image: url("../../assets/images/horse-trail-1.jpg");
    background-size: cover;
    background-position: center 40%;
    color: white;
    text-align: center;
    overflow: hidden;
}

/* Ensure header is always visible above hero - only override if needed */
body:not(.host-profile-form-page) .layout .header {
    position: sticky !important;
    top: 0 !important;
    z-index: 300 !important;
    background-color: var(--surface) !important;
}

/* Ensure desktop navigation is visible on desktop */
@media (min-width: 769px) {
    body .layout .header .desktop-nav {
        display: flex !important;
    }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.1) 100%
    );
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1000px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.hero-title {
    font-family: var(--font-family-heading);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    margin: 0;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    max-width: 650px;
    line-height: 1.6;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    margin: 0;
    opacity: 0.95;
}

.search-bar {
    position: relative;
    z-index: 10; /* Above USP badges so date dropdown is not covered */
    display: flex;
    gap: 12px;
    background-color: rgba(255, 255, 255, 0.98);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25), 0 10px 30px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 900px;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.search-field {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 200px;
    min-width: 200px;
    max-width: 100%;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.search-field:focus-within {
    border-color: hsl(205, 45%, 45%);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.search-icon {
    position: absolute;
    left: 16px;
    color: #6b7280;
    pointer-events: none;
    z-index: 1;
}

.search-input,
.search-select {
    padding: 14px 16px 14px 50px;
    width: 100%;
    border: none;
    background: transparent;
    font-size: 16px;
    outline: none;
    color: #1f2937;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-select {
    appearance: none;
    cursor: pointer;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
}

.search-button {
    flex: 0 0 auto;
    min-width: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Hero date: stretch with other fields so row stays balanced and centered */
.search-field-date {
    position: relative;
    flex: 1 1 200px;
    min-width: 200px;
    max-width: 100%;
}
.search-field-date .search-icon {
    top: 50%;
    transform: translateY(-50%);
}
.search-field-date.date-picker-one-box {
    flex-direction: row;
    align-items: stretch;
}
.date-picker-box {
    position: relative;
    flex: 1;
    min-width: 0;
}
.date-picker-display {
    width: 100%;
    cursor: pointer;
    background: var(--background, #fff);
    color: var(--foreground, #111);
}
.date-picker-display::placeholder {
    color: var(--muted-foreground, #6b7280);
}
.date-picker-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    padding: 12px;
    background: var(--card, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-lg, 10px);
    box-shadow: var(--shadow-lg, 0 10px 25px rgba(0,0,0,0.1));
    z-index: 100;
    min-width: 260px;
}
.date-picker-dropdown.is-open {
    display: block;
}
/* Date mode toggle – segmented control / slider style */
.date-mode-toggle {
    display: inline-flex;
    background: var(--muted, #f3f4f6);
    border: 2px solid var(--border, #e5e7eb);
    border-radius: 10px;
    padding: 4px;
    width: fit-content;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    min-height: 40px;
}

.date-mode-btn {
    padding: 8px 16px;
    min-height: 32px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--muted-foreground, #6b7280);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.date-mode-btn:hover:not(.active) {
    background: color-mix(in srgb, var(--muted) 70%, white);
    color: var(--foreground, #374151);
}

.date-mode-btn.active {
    background: hsl(205, 45%, 45%);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}
.date-picker-inner .date-input,
.date-picker-inner .form-control {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
}
.date-picker-range,
.date-picker-inner.date-picker-range,
.map-date-range-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.date-picker-range .date-input,
.date-picker-inner.date-picker-range .date-input,
.map-date-range-wrap .form-control {
    flex: 1;
    min-width: 0;
}
.date-range-sep {
    color: var(--muted-foreground, #6b7280);
    font-weight: 500;
    flex-shrink: 0;
}

/* Map filters: one date box + dropdown */
.date-picker-map .date-picker-box {
    width: 100%;
}
.date-picker-map .date-picker-display {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}
.date-picker-map .date-picker-dropdown {
    min-width: 100%;
    padding: 10px;
}
.date-picker-map .date-mode-toggle {
    margin-bottom: 8px;
    padding: 3px;
    min-height: 36px;
}
.date-picker-map .date-mode-btn {
    padding: 6px 12px;
    min-height: 28px;
    font-size: 0.8125rem;
}
.date-picker-map .date-picker-inner .form-control {
    font-size: 0.875rem;
}
.date-picker-map .map-date-range-wrap .form-control {
    flex: 1;
    min-width: 0;
}
.date-picker-map .date-range-sep {
    font-size: 12px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.trust-indicators {
    display: flex;
    gap: 48px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 40px;
    padding: 0 20px;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-2) var(--spacing-4);
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    backdrop-filter: blur(8px);
}

.trust-item svg {
    opacity: 0.95;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.trust-text {
    font-weight: 600;
    font-size: 0.95rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.3px;
    opacity: 0.95;
}

@media (max-width: 768px) {
    .trust-indicators {
        gap: 32px;
        margin-top: 32px;
    }

    .trust-item svg {
        width: 24px;
        height: 24px;
    }

    .trust-text {
        font-size: 0.85rem;
    }
}

.usp-badges {
    display: flex;
    gap: var(--spacing-4);
    flex-wrap: wrap;
    justify-content: center;
    margin-top: var(--spacing-2);
}

.usp-badge {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-2) var(--spacing-3);
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-8);
}

.featured-section {
    padding: var(--spacing-16) 0;
}

.section-title {
    font-family: var(--font-family-heading);
    font-size: 2.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: var(--spacing-12);
    color: var(--foreground);
}

.ride-card {
    background-color: var(--card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform var(--animation-duration-normal) ease,
        box-shadow var(--animation-duration-normal) ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.ride-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.ride-card-image {
    position: relative;
    width: 100%;
    padding-top: 66.66%; /* 3:2 aspect ratio */
    background-size: cover;
    background-position: center;
}

.ride-card-content {
    padding: var(--spacing-4);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.ride-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-2);
    margin-bottom: var(--spacing-2);
}

.ride-card-title {
    font-family: var(--font-family-heading);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    flex: 1;
    color: var(--card-foreground);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ride-card-rating {
    display: flex;
    align-items: center;
    gap: var(--spacing-1);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
    flex-shrink: 0;
}

.ride-card-star-icon {
    color: var(--warning);
    fill: var(--warning);
    width: 16px;
    height: 16px;
}

.ride-card-review-count {
    color: var(--muted-foreground);
    font-size: 0.8125rem;
}

.ride-card-location {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin: 0 0 var(--spacing-3);
}

.ride-card-location svg {
    flex-shrink: 0;
}

.ride-card-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: var(--spacing-3);
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--foreground);
}

.ride-card-price {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
}

.ride-card-duration {
    font-size: 0.875rem;
    color: var(--foreground);
}

.ride-card-button {
    margin-top: var(--spacing-4);
    width: 100%;
    height: 2.5rem;
}

/* Map Section */
.map-section {
    padding: var(--spacing-16) 0;
    background-color: var(--surface);
}

.map-description {
    text-align: center;
    font-size: 1.125rem;
    color: var(--muted-foreground);
    max-width: 700px;
    margin: calc(var(--spacing-4) * -1) auto var(--spacing-8);
    line-height: 1.6;
}

.map-section-row {
    align-items: flex-start;
}

.map-filters-sidebar {
    position: sticky;
    top: 100px;
    background-color: var(--card);
    padding: var(--spacing-6);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.map-filters-form .filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

.map-filters-form .filter-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
}

.map-filters-form .location-input-group {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

.map-filters-form .location-input-group .form-control {
    min-width: 0;
}

.map-filters-form .form-select,
.map-filters-form .form-control {
    padding: var(--spacing-2) var(--spacing-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

/* Match Find Rides page: 600px height for same aspect ratio */
.map-wrapper {
    width: 100%;
    height: 600px;
    min-height: 500px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background-color: var(--muted);
}

/* Custom Marker Styles */
.custom-marker {
    background: transparent;
    border: none;
}

.marker-container {
    position: relative;
    transition: transform var(--animation-duration-fast) ease-in-out;
}

.marker-container:hover {
    transform: scale(1.15);
    z-index: 1000 !important;
}

.marker-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--marker-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 1;
    transition: all var(--animation-duration-fast) ease-in-out;
}

.marker-container:hover .marker-icon {
    box-shadow: var(--shadow-lg);
    border-width: 4px;
}

.marker-icon svg {
    display: block;
}

.marker-tip {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 12px solid var(--marker-color);
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2));
}

/* Cluster Icon Styles */
.custom-cluster {
    background: transparent;
    border: none;
}

.cluster-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-foreground);
    font-weight: 600;
    font-size: 1rem;
    border: 3px solid white;
    box-shadow: var(--shadow-md);
    transition: all var(--animation-duration-fast) ease-in-out;
}

.cluster-icon:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

/* Popup Styles */
.custom-popup {
    font-family: var(--font-family-base);
}

.popup-content {
    font-family: var(--font-family-base);
    color: var(--foreground);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
    min-width: 280px;
}

.popup-image-container {
    width: 100%;
    height: 160px;
    border-radius: var(--radius);
    overflow: hidden;
    /* margin: calc(-1 * var(--spacing-3)) calc(-1 * var(--spacing-3)) 0; */
}

.popup-image {
    width: 100%;
    height: 100%;
}

.popup-image-placeholder {
    width: 100%;
    height: 160px;
    border-radius: var(--radius);
    background: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-foreground);
    margin: calc(-1 * var(--spacing-3)) calc(-1 * var(--spacing-3)) 0;
}

.popup-title {
    font-family: var(--font-family-heading);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: var(--foreground);
    line-height: 1.3;
}

.popup-rating {
    display: flex;
    align-items: center;
    gap: var(--spacing-1);
    color: var(--warning);
    font-size: 0.875rem;
}

.rating-value {
    font-weight: 600;
    color: var(--foreground);
}

.review-count {
    color: var(--muted-foreground);
}

.no-reviews {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.popup-badge {
    display: flex;
    align-items: center;
}

.popup-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

.detail-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    font-size: 0.875rem;
    color: var(--foreground);
}

.detail-item svg {
    color: var(--muted-foreground);
    flex-shrink: 0;
}

.popup-price {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-2);
}

.price-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-family-heading);
}

.price-label {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.popup-button {
    display: block;
    width: 100%;
    text-align: center;
    padding: var(--spacing-3) var(--spacing-4);
    background: var(--primary);
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: var(--radius);
    transition: all var(--animation-duration-fast) ease-in-out;
    box-shadow: var(--shadow);
}

.popup-button:hover {
    background: color-mix(in srgb, var(--primary) 90%, black);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.popup-button:active {
    transform: translateY(0);
}

/* Leaflet overrides for a cleaner look */
.map-wrapper :global(.leaflet-popup-content-wrapper) {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    background-color: var(--popup);
    padding: 0;
}

.map-wrapper :global(.leaflet-popup-content) {
    margin: 0;
    padding: 15px;
    line-height: 1.5;
}

.map-wrapper :global(.leaflet-popup-tip) {
    background-color: var(--popup);
}

.map-wrapper :global(.leaflet-popup-close-button) {
    color: var(--muted-foreground);
    padding: var(--spacing-2);
    width: 32px;
    height: 32px;
    font-size: 1.25rem;
    font-weight: 400;
    transition: color var(--animation-duration-fast);
}

.map-wrapper :global(.leaflet-popup-close-button:hover) {
    color: var(--foreground);
}

/* Cluster group styling overrides */
.map-wrapper :global(.marker-cluster) {
    background-color: transparent;
}

.map-wrapper :global(.marker-cluster div) {
    background-color: transparent;
}

/* Map Filters Styling */
.map-filters {
    background: var(--card);
    padding: var(--spacing-4);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-4);
    border: 1px solid var(--border);
}

.map-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
}

.map-filters label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: 0;
}

.map-filters .form-control-sm {
    padding: var(--spacing-2) var(--spacing-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--background);
    color: var(--foreground);
    font-size: 0.875rem;
    transition: all var(--animation-duration-fast) ease;
}

.map-filters .form-control-sm:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

.map-filters .btn-sm {
    padding: var(--spacing-2) var(--spacing-4);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all var(--animation-duration-fast) ease;
    margin-top: auto;
}

.map-filters .btn-outline-secondary {
    border-color: var(--border);
    color: var(--muted-foreground);
}

.map-filters .btn-outline-secondary:hover {
    background: var(--muted);
    border-color: var(--muted);
    color: var(--foreground);
}

@media (max-width: 768px) {
    .hero {
        min-height: 85vh;
        padding: var(--spacing-12) var(--spacing-4);
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .search-bar {
        flex-direction: column;
        padding: var(--spacing-3);
    }

    .search-field,
    .search-field-date {
        width: 100%;
        min-width: unset;
        flex: 1 1 auto;
    }

    .search-button {
        width: 100%;
    }

    .trust-indicators {
        gap: var(--spacing-4);
    }

    .trust-item {
        padding: var(--spacing-2) var(--spacing-3);
    }

    .map-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .map-filters .filter-group {
        width: 100%;
    }

    .map-filters .btn-sm {
        width: 100%;
    }

    .trust-text {
        font-size: 0.875rem;
    }

    .usp-badges {
        gap: var(--spacing-3);
    }

    .usp-badge {
        font-size: 0.8125rem;
        padding: var(--spacing-2);
    }

    .map-section {
        padding: var(--spacing-12) 0;
    }

    .map-filters-sidebar {
        position: static;
        margin-bottom: var(--spacing-4);
    }

    .map-description {
        font-size: 1rem;
        margin: calc(var(--spacing-3) * -1) auto var(--spacing-6);
    }

    /* Mobile popup styles - fixed width and height with scroll */
    #ridesMap2 .leaflet-popup-content-wrapper {
        max-width: 320px !important;
        width: 320px !important;
        max-height: 70vh !important;
        overflow: hidden;
    }

    #ridesMap2 .leaflet-popup {
        max-width: 320px !important;
        width: 320px !important;
    }

    #ridesMap2 .leaflet-popup-content {
        margin: 12px !important;
        font-size: 0.875rem;
        max-height: calc(70vh - 60px) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        padding-right: 4px;
    }

    /* Custom scrollbar for mobile */
    #ridesMap2 .leaflet-popup-content::-webkit-scrollbar {
        width: 4px;
    }

    #ridesMap2 .leaflet-popup-content::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 2px;
    }

    #ridesMap2 .leaflet-popup-content::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 2px;
    }

    #ridesMap2 .leaflet-popup-content::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

    #ridesMap2 .popup-content {
        padding: 0 !important;
    }

    #ridesMap2 .popup-button {
        padding: 10px 16px !important;
        font-size: 0.875rem !important;
    }

    .featured-section {
        padding: var(--spacing-12) 0;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: var(--spacing-8);
    }
}

@media (max-width: 576px) {
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions > * {
        width: 100%;
    }

    .trust-indicators {
        flex-direction: column;
        gap: var(--spacing-3);
    }

    .usp-badges {
        flex-direction: column;
        width: 100%;
    }

    .usp-badge {
        justify-content: center;
    }
}
.popup-button {
    color: #fff !important;
}

.leaflet-container a {
    color: #6f787f;
}

.map-wrapper {
    width: 100%;
    height: 600px;
    border-radius: var(--radius-lg);
    overflow: visible; /* Allow popups to show outside */
    box-shadow: var(--shadow-md);
    background-color: transparent;
    position: relative;
    pointer-events: auto;
}

.map-wrapper #ridesMap2 {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-lg);
    pointer-events: auto;
}

/* Ensure Leaflet map and panes receive clicks */
.map-wrapper .leaflet-container {
    pointer-events: auto !important;
}

.map-wrapper .leaflet-pane,
.map-wrapper .leaflet-marker-pane,
.map-wrapper .leaflet-marker-icon,
.map-wrapper .leaflet-popup-pane {
    pointer-events: auto !important;
}

/* Cluster icons must be clickable */
.map-wrapper .marker-cluster,
.map-wrapper .marker-cluster div {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Custom Marker Styles - minimal for functionality; ensure Leaflet icon wrapper is clickable */
.leaflet-marker-icon.custom-marker {
    pointer-events: auto !important;
    cursor: pointer !important;
}

.custom-marker {
    background: transparent;
    border: none;
    pointer-events: auto !important;
    cursor: pointer !important;
}

.marker-container {
    position: relative;
    pointer-events: auto !important;
    cursor: pointer !important;
}

.marker-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--marker-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    pointer-events: auto !important;
    cursor: pointer !important;
}

.marker-icon svg {
    display: block;
    pointer-events: none !important;
}

.marker-tip {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 12px solid var(--marker-color);
    pointer-events: none !important;
}

/* Popup Styles - minimal for functionality */
/* Let Leaflet handle popup styling by default */

/* Ensure popups are visible and above everything */
.leaflet-popup-pane {
    z-index: 2000 !important;
}

.leaflet-popup {
    z-index: 2001 !important;
}

.leaflet-popup-content-wrapper {
    z-index: 2002 !important;
}

/* Mobile styles – match Find Rides map height (500px on small screens) */
@media (max-width: 480px) {
    .map-wrapper {
        height: 500px;
        min-height: 400px;
        overflow: visible;
    }

    .map-wrapper #ridesMap2 {
        height: 100%;
    }
}

@media (max-width: 768px) {
    .map-wrapper {
        overflow: visible;
    }

    .map-wrapper #ridesMap2 {
        height: 100%;
    }
}
