/* 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 .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 {
    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;
    backdrop-filter: blur(10px);
}

.search-field {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 200px;
    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-shrink: 0;
    min-width: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.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-wrapper {
    width: 100%;
    height: 600px;
    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);
    padding: var(--spacing-3) 0;
    border-top: 1px solid var(--border);
}

.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),
#ridesMap .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),
#ridesMap .leaflet-popup-content {
    margin: var(--spacing-3);
    line-height: 1.5;
}

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

.map-wrapper :global(.leaflet-popup-close-button),
#ridesMap .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),
#ridesMap .leaflet-popup-close-button:hover {
    color: var(--foreground);
}

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

.map-wrapper :global(.marker-cluster div),
#ridesMap .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 {
        width: 100%;
        min-width: unset;
    }

    .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-description {
        font-size: 1rem;
        margin: calc(var(--spacing-3) * -1) auto var(--spacing-6);
    }

    .map-wrapper {
        height: 450px;
    }

    .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;
}
