@font-face {
    font-family: 'Montserrat';
    src: url('../assets/fonts/Montserrat-Light.ttf') format('truetype');
    font-weight: 300;
}

@font-face {
    font-family: 'Montserrat';
    src: url('../assets/fonts/Montserrat-Regular.ttf') format('truetype');
    font-weight: 400;
}

@font-face {
    font-family: 'Montserrat';
    src: url('../assets/fonts/Montserrat-Medium.ttf') format('truetype');
    font-weight: 500;
}

@font-face {
    font-family: 'Montserrat';
    src: url('../assets/fonts/Montserrat-Bold.ttf') format('truetype');
    font-weight: 700;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #2DD4A8;
    --color-black: #000000;
    --color-white: #FFFFFF;
    --color-gray-light: #F5F5F5;
    --color-gray: #666666;
    --color-gray-dark: #333333;
}

html, body {
    height: 100%;
    width: 100%;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-weight: 400;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

#app {
    height: 100%;
    width: 100%;
}

/* Layout */

.three-column-layout {
    display: flex;
    height: 100%;
    width: 100%;
}

/* Filtros */

.filters-sidebar {
    width: 240px;
    height: 100%;
    background: var(--color-black);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    padding: 20px 16px;
    gap: 16px;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-gray-dark);
}

.logo {
    max-width: 100%;
    height: auto;
    max-height: 50px;
}

.filters-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-white);
    margin-bottom: 4px;
}

/* Selectores */

.filter-dropdown {
    width: 100%;
    position: relative;
}

.filter-dropdown select {
    display: none;
}

.custom-select {
    position: relative;
    width: 100%;
}

.select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    background: var(--color-black);
    border: 1px solid var(--color-gray-dark);
    border-radius: 4px;
    color: var(--color-white);
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s ease;
}

.select-trigger:hover {
    border-color: var(--color-primary);
}

.custom-select.open .select-trigger {
    border-color: var(--color-primary);
}

.select-trigger svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.custom-select.open .select-trigger svg {
    transform: rotate(180deg);
}

.select-options {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    background: var(--color-black);
    border: 1px solid var(--color-gray-dark);
    border-radius: 4px;
    list-style: none;
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
}

.custom-select.open .select-options {
    display: block;
}

.select-options li {
    padding: 10px 12px;
    color: var(--color-white);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.select-options li:hover {
    background: var(--color-gray-dark);
}

.select-options li.selected {
    background: var(--color-primary);
    color: var(--color-black);
}

.clear-filters-btn {
    width: 100%;
    padding: 10px 12px;
    background: var(--color-primary);
    border: none;
    border-radius: 4px;
    color: var(--color-black);
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.15s ease;
    margin-top: 8px;
}

.clear-filters-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.clear-filters-btn:active {
    transform: translateY(0);
}

/* Resultados */

.results-sidebar {
    width: 240px;
    height: 100%;
    background: var(--color-white);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid #e0e0e0;
}

.results-header {
    padding: 20px 16px;
    border-bottom: 2px solid var(--color-primary);
    flex-shrink: 0;
}

.results-header h2 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-gray-dark);
}

#results-count {
    color: var(--color-primary);
}

.results-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

.results-list::-webkit-scrollbar {
    width: 6px;
}

.results-list::-webkit-scrollbar-track {
    background: var(--color-gray-light);
}

.results-list::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 3px;
}

.results-list::-webkit-scrollbar-thumb:hover {
    background: #25b892;
}

.result-card {
    background: var(--color-white);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.result-card-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    flex-shrink: 0;
}

.result-card-content {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.result-card-tag {
    display: inline-block;
    background: var(--color-primary);
    color: var(--color-black);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    width: fit-content;
}

.result-card-tag--resource {
    background: #1a8a6e;
    color: var(--color-white);
}

.result-card-tag--company {
    background: #1a5c8a;
    color: var(--color-white);
}

.result-card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-black);
    line-height: 1.4;
    word-wrap: break-word;
}

.result-card-location {
    font-size: 10px;
    color: var(--color-gray);
    line-height: 1.3;
    word-wrap: break-word;
}

.no-results {
    padding: 30px 16px;
    text-align: center;
}

.no-results p {
    font-size: 13px;
    color: var(--color-gray);
    line-height: 1.5;
}

/* Mapa */

.map-main {
    flex: 1;
    height: 100%;
    position: relative;
    min-width: 0;
}

#map {
    width: 100%;
    height: 100%;
}

.zoom-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    background: var(--color-primary);
    border: 2px solid var(--color-primary);
    border-radius: 4px;
    font-size: 20px;
    font-weight: 700;
    color: var(--color-black);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.zoom-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.zoom-btn:active {
    transform: scale(0.95);
}

/* Popup */

.popup-card {
    position: absolute;
    width: 380px;
    max-width: calc(100% - 40px);
    background: var(--color-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 2000;
}

.popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: var(--color-white);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s ease;
}

.popup-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

.popup-image-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.popup-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

.popup-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.popup-tag {
    display: inline-block;
    background: var(--color-primary);
    color: var(--color-black);
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: fit-content;
}

.popup-tag--resource {
    background: #1a8a6e;
    color: var(--color-white);
}

.popup-tag--company {
    background: #1a5c8a;
    color: var(--color-white);
}

.popup-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-black);
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.popup-subtitle {
    font-size: 13px;
    color: var(--color-gray);
    font-weight: 500;
}

.popup-location {
    font-size: 12px;
    color: var(--color-gray);
    display: flex;
    align-items: center;
    gap: 6px;
}

.popup-link {
    display: block;
    background: var(--color-primary);
    color: var(--color-black);
    text-align: center;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    margin-top: 8px;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

.popup-link:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

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

/* Marcadores */

.custom-marker {
    background: none;
    border: none;
    overflow: visible !important;
    transition: transform 0.2s ease;
}

.custom-marker:hover {
    transform: scale(1.1);
}

.custom-marker div {
    filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));
}

.cluster-icon {
    width: 40px;
    height: 40px;
    background: var(--color-primary);
    color: var(--color-black);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.leaflet-tooltip {
    background: var(--color-black) !important;
    color: var(--color-white) !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 10px 14px !important;
    font-family: 'Montserrat', system-ui, sans-serif !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.leaflet-tooltip-top:before {
    border-top-color: var(--color-black) !important;
}

.leaflet-control-zoom {
    display: none;
}

/* Loader */

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--color-gray-light);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Google Translate */

.goog-te-banner-frame.skiptranslate {
    display: none !important;
}

body {
    top: 0 !important;
}

body.translated-ltr,
body.translated-rtl {
    top: 0 !important;
}

#google_translate_element {
    display: none !important;
}

.skiptranslate iframe {
    display: none !important;
}

.goog-te-balloon-frame,
iframe.goog-te-balloon-frame {
    display: none !important;
}

/* Selector de idiomas */

#language-selector {
    position: fixed;
    bottom: 40px;
    left: 0;
    width: 240px;
    z-index: 1001;
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 0 16px;
}

.lang-btn {
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.lang-btn:hover {
    opacity: 0.8;
}

.lang-btn.active {
    opacity: 1;
}

.lang-btn img {
    width: 32px;
    height: 24px;
    object-fit: cover;
    border-radius: 2px;
    display: block;
}

/* Responsive */

.mobile-btn {
    display: none;
}

.drawer-backdrop {
    display: none;
}

@media (max-width: 768px) {

    .three-column-layout {
        display: block;
        height: 100%;
    }

    .filters-sidebar,
    .results-sidebar {
        position: fixed;
        top: 0;
        height: 100%;
        width: 85%;
        max-width: 360px;
        z-index: 2000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
    }

    .filters-sidebar {
        left: 0;
        padding: 16px 12px;
    }

    .filters-sidebar.open {
        transform: translateX(0);
    }

    .results-sidebar {
        left: auto;
        right: 0;
        transform: translateX(100%);
    }

    .results-sidebar.open {
        transform: translateX(0);
    }

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

    .mobile-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        position: fixed;
        left: 16px;
        padding: 10px 14px;
        background: rgba(0, 0, 0, 0.85);
        border: 2px solid var(--color-primary);
        border-radius: 8px;
        color: var(--color-white);
        font-family: 'Montserrat', sans-serif;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        z-index: 1002;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        transition: all 0.2s ease;
        min-width: 110px;
    }

    .mobile-btn:active {
        transform: scale(0.95);
    }

    .mobile-btn svg {
        flex-shrink: 0;
    }

    .mobile-filters-btn {
        top: 16px;
    }

    .mobile-results-btn {
        top: 72px;
    }

    .mobile-results-count {
        color: var(--color-primary);
        font-weight: 700;
    }

    .drawer-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        z-index: 1999;
    }

    .drawer-backdrop.active {
        display: block;
    }

    #language-selector {
        position: fixed;
        top: auto;
        bottom: 20px;
        left: 16px;
        width: auto;
        transform: none;
        display: flex;
        flex-direction: row;
        gap: 8px;
        background: transparent;
        padding: 0;
        border-radius: 0;
        z-index: 1002;
        box-shadow: none;
    }

    .lang-btn {
        width: 32px;
        height: 32px;
    }

    .lang-btn img {
        width: 22px;
        height: 17px;
    }

    .zoom-controls {
        top: 16px;
        right: 16px;
    }

    .popup-card {
        width: calc(100% - 32px);
        max-width: 360px;
    }

    .logo {
        max-height: 40px;
    }

    .results-header {
        padding: 16px 12px;
    }
}