/* Full Viewport Layout with Header */
body,
html {
    height: 100%;
    overflow: hidden;
    /* Prevent body scroll */
}

.main {
    height: 100%;
    display: flex;
    flex-direction: column;
}


.marketplace-container {
    height: calc(100vh - 70px);
    /* Adjust based on navbar height */
    overflow: hidden;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Layout Transitions */
.layout-contained {
    max-width: 1320px !important;
    margin: 0 auto;
    border-right: 1px solid #e3e6ed;
    border-left: 1px solid #e3e6ed;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.05);
}

.layout-grid .map-panel {
    display: none;
}

.layout-grid .list-panel {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
}

.layout-grid #project-list .col-6 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    transition: all 0.3s ease;
}

/* Restore: Grid layout SHOULD force vertical cards for better 3-column fit */
.layout-grid .project-card .col-md-4 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    height: 180px !important;
}

.layout-grid .project-card .col-md-8 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

.layout-grid .project-card .img-fluid {
    border-radius: 0.375rem 0.375rem 0 0 !important;
}

@media (max-width: 1200px) {
    .layout-grid #project-list .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 768px) {
    .layout-grid #project-list .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* CARD DENSITY MODES */

/* 2. Detailed Mode (Image Left - The default mostly) */
.card-detailed .project-card .row {
    flex-direction: row;
}

/* 3. Compact Mode (Mini cards) */
.card-compact .project-card .row {
    flex-direction: row;
}

.card-compact .project-card .col-md-4 {
    display: none;
    /* Hide big image */
}

.card-compact .project-card .col-md-8 {
    flex: 0 0 100%;
    max-width: 100%;
}

.card-compact .project-card .card-body {
    padding: 0.75rem !important;
}

.card-compact .project-card .card-text {
    display: none;
    /* Hide description */
}

.card-compact .project-card .flex-1 {
    display: none !important;
}

.card-compact .project-card h5 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem !important;
}

.card-compact .project-card .border-top {
    padding-top: 0.5rem !important;
    margin-top: 0.5rem !important;
}

/* View Switcher Styles */
.view-switcher-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1040;
}

.view-btn {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(227, 230, 237, 0.8);
    color: #5e6e82;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s;
}

.view-btn:hover {
    background: #fff;
    color: #2c7be5;
}

.view-btn.active,
.card-btn.active {
    background: #2c7be5;
    color: #fff;
    border-color: #2c7be5;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Left Panel (List) */
.list-panel {
    height: 100%;
    overflow-y: auto;
    border-right: 1px solid #e3e6ed;
    background: #f9fafd;
    z-index: 10;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
}

/* Right Panel (Map) */
.map-panel {
    height: 100%;
    padding: 0;
    position: relative;
    pointer-events: auto !important;
}

#map {
    height: 100%;
    width: 100%;
    z-index: 1;
    user-select: none !important;
}

/* Allow Leaflet to manage its own cursors */
.leaflet-grab {
    cursor: grab;
}

.leaflet-grabbing {
    cursor: grabbing;
}

/* Map Legend/Counter Overlay */
.map-overlay-counter,
.map-legend {
    position: absolute;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.map-overlay-counter {
    top: 20px;
    left: 60px;
}

.map-legend {
    bottom: 30px;
    right: 10px;
    min-width: 140px;
}

.legend-icon-container {
    width: 24px;
    height: 24px;
}

.project-card {
    transition: transform 0.2s;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Locate Button Style */
.leaflet-control-locate {
    background-color: #fff;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer;
    width: 36px !important;
    height: 36px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.leaflet-control-locate:hover {
    background-color: #f8f9fa;
}

/* Suggestions Dropdown */
.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #e3e6ed;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.suggestion-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid #f9fafd;
}

.suggestion-item:hover {
    background-color: #f0f2f5;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Force Icon Size if CSS overrides it */
.leaflet-marker-icon {
    max-width: none !important;
    max-height: none !important;
}

.custom-project-icon {
    height: 30px !important;
    width: 30px !important;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.25));
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-project-icon:hover {
    transform: scale(1.15) translateY(-2px);
    z-index: 1000 !important;
}

/* --- MARKETPLACE MAP LAYERS --- */

/* 3. Base Clusters (Overrides de Leaflet) */
.marker-cluster div {
    width: 34px !important;
    height: 34px !important;
    margin-left: 5px;
    margin-top: 5px;
    text-align: center;
    border-radius: 50%;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 4. Pines Personalizados (Forma de Gota) */
.custom-map-marker {
    background: none;
    border: none;
}

.marker-pin {
    width: 30px;
    height: 30px;
    border-radius: 50% 50% 50% 0;
    position: absolute;
    transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -15px 0 0 -15px;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

/* Efecto Hover en el Pin */
.custom-map-marker:hover .marker-pin {
    transform: rotate(-45deg) scale(1.1);
}

/* Icono dentro del pin (corregir rotación) */
.marker-pin i {
    transform: rotate(45deg);
    font-size: 14px;
    margin-top: 2px;
}

/* Variantes de Color para Pines */
.marker-pin.zenit {
    background-color: #f5803e;
    border: 2px solid #fff;
}

.marker-pin.zenit i {
    color: white;
}

.marker-pin.external {
    background-color: #6c757d;
    border: 2px solid #fff;
}

.marker-pin.external i {
    color: white;
}



/* Mobile Toggle */
.mobile-view-toggle {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    display: none;
}

@media (max-width: 991.98px) {
    .mobile-view-toggle {
        display: flex;
    }

    .list-panel {
        display: none;
        /* Hidden by default on mobile, shown via toggle */
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1020;
    }

    .list-panel.active {
        display: block;
    }

    .map-panel {
        height: 100%;
        width: 100%;
    }
}


/*
.marker-cluster-large {
    background-color: #FFD7A2 !important;
    color: #ffffff !important;
}

.marker-cluster-large div {
    background-color: #FFD7A2 !important;
    color: #ffffff !important;
}

.marker-cluster-large div::after {
    border-color: #FFD7A2 !important;
}

.marker-cluster-large div::before {
    border-color: #FFD7A2 !important;
}

.marker-cluster-large div:hover {
    background-color: #FFD7A2 !important;
}

.marker-cluster-large div:hover::after {
    border-color: #FFD7A2 !important;
}

.marker-cluster-large div:hover::before {
    border-color: #4A8C45 !important;
}

.marker-cluster-medium {
    background-color: #FFF6CB !important;
    color: #ffffff !important;
}

.marker-cluster-medium div {
    background-color: #FFF6CB !important;
    color: #ffffff !important;
}

.marker-cluster-medium div::after {
    border-color: #FFF6CB !important;
}

.marker-cluster-medium div::before {
    border-color: #FFF6CB !important;
}

.marker-cluster-medium div:hover {
    background-color: #FFF6CB !important;
}

.marker-cluster-medium div:hover::after {
    border-color: #FFF6CB !important;
}

.marker-cluster-medium div:hover::before {
    border-color: #FFF6CB !important;
}

.marker-cluster-small {
    background-color: #E7F8ED !important;
    color: #ffffff !important;
}

.marker-cluster-small div {
    background-color: #E7F8ED !important;
    color: #ffffff !important;
}

.marker-cluster-small div::after {
    border-color: #E7F8ED !important;
}

.marker-cluster-small div::before {
    border-color: #E7F8ED !important;
}

.marker-cluster-small div:hover {
    background-color: #E7F8ED !important;
}

.marker-cluster-small div:hover::after {
    border-color: #E7F8ED !important;
}

.marker-cluster-small div:hover::before {
    border-color: #E7F8ED !important;
}
    */