@font-face {
    font-family: 'Arquitecta';
    src: url('../assets/fonts/ArquitectaLight.otf') format('opentype');
    font-weight: 300;
}

@font-face {
    font-family: 'Arquitecta';
    src: url('../assets/fonts/Arquitecta.otf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'Arquitecta';
    src: url('../assets/fonts/ArquitectaMedium.otf') format('opentype');
    font-weight: 500;
}

@font-face {
    font-family: 'Arquitecta';
    src: url('../assets/fonts/ArquitectaBold.otf') format('opentype');
    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: 'Arquitecta', system-ui, sans-serif;
    font-weight: 400;
}

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

#main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
}

/* ── Filtros ── */

#filters {
    display: flex;
    gap: 12px;
    padding: 14px 20px;
    background: var(--color-black);
    flex-wrap: wrap;
    flex-shrink: 0;
    align-items: center;
}

#filters .logo {
    height: 40px;
    width: auto;
    margin-right: 12px;
}

.custom-select {
    position: relative;
    min-width: 200px;
}

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

.select-trigger:hover { border-color: var(--color-primary); }
.custom-select.open .select-trigger { border-color: var(--color-primary); }
.custom-select.open .select-trigger svg { transform: rotate(180deg); }
.select-trigger svg { flex-shrink: 0; transition: transform 0.2s ease; }

.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 14px;
    color: var(--color-white);
    font-size: 14px;
    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 {
    padding: 10px 20px;
    background: var(--color-primary);
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Arquitecta', system-ui, sans-serif;
    font-weight: 500;
    cursor: pointer;
    color: var(--color-black);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

#clear-filters:hover { opacity: 0.9; transform: translateY(-1px); }
#clear-filters:active { transform: translateY(0); }

/* ── Mapa ── */

#map-container {
    flex: 1;
    position: relative;
    min-height: 0;
}

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

.banner {
    position: absolute;
    bottom: 20px;
    left: 20px;
    height: 50px;
    width: auto;
    z-index: 1000;
    background: var(--color-white);
    padding: 6px 10px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ── 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)); }

/* ── Tooltips ── */

.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: 'Arquitecta', 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; }

/* ── Sidebar ── */

.sidebar {
    width: 520px;
    height: 100%;
    background: var(--color-white);
    box-shadow: -2px 0 12px rgba(0,0,0,0.15);
    overflow-y: auto;
    position: relative;
    z-index: 1000;
    flex-shrink: 0;
    transition: margin-right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.hidden { margin-right: -520px; }

.close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0,0,0,0.5);
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--color-white);
    z-index: 1001;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover { background: rgba(0,0,0,0.8); }

/* ── Hero del sidebar ── */

.sb-hero {
    position: relative;
    height: 220px;
    overflow: hidden;
    flex-shrink: 0;
}

.sb-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.sb-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    gap: 8px;
}

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

.sb-title {
    color: var(--color-white);
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

/* ── Cuerpo del sidebar ── */

.sb-body {
    display: flex;
    gap: 0;
}

.sb-main {
    flex: 1;
    padding: 24px;
    min-width: 0;
    border-right: 1px solid var(--color-gray-light);
}

.sb-section {
    margin-bottom: 24px;
}

.sb-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-gray);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--color-primary);
    display: inline-block;
}

.sb-text {
    color: var(--color-gray-dark);
    font-size: 14px;
    line-height: 1.7;
    font-weight: 300;
    white-space: pre-line;
}

.sb-details summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sb-details summary::after {
    content: '▾';
    font-size: 14px;
    color: var(--color-gray);
}

.sb-details[open] summary::after {
    content: '▴';
}

.sb-details .sb-text {
    margin-top: 10px;
}

.sb-video {
    width: 100%;
    border-radius: 6px;
    margin-top: 8px;
}

/* ── Ficha lateral ── */

.sb-aside {
    width: 200px;
    flex-shrink: 0;
    padding: 24px 16px;
    background: var(--color-gray-light);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sb-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.sb-field:last-of-type {
    border-bottom: none;
}

.sb-field-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-gray);
}

.sb-field-value {
    font-size: 13px;
    color: var(--color-gray-dark);
    font-weight: 400;
    line-height: 1.5;
}

.sb-price {
    background: var(--color-black);
    color: var(--color-white);
    padding: 14px;
    border-radius: 6px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sb-price-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-gray);
}

.sb-price-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-primary);
}

.sb-price-note {
    font-size: 10px;
    color: var(--color-gray);
    line-height: 1.4;
}

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

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

/* ── 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); } }

/* ── Sin resultados ── */

.no-results {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--color-white);
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    text-align: center;
    z-index: 1000;
}

.no-results.hidden { display: none; }

.no-results p {
    font-size: 18px;
    color: var(--color-gray-dark);
    margin-bottom: 16px;
}

.no-results button {
    padding: 10px 20px;
    background: var(--color-primary);
    border: none;
    border-radius: 4px;
    font-family: 'Arquitecta', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: var(--color-black);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.no-results button:hover { transform: translateY(-1px); }
.no-results button:active { transform: translateY(0); }

/* ── Tag recurso turístico (verde oscuro) ── */
.sb-type-tag--resource {
    background: #1a8a6e;
    color: var(--color-white);
}

/* ── Link en ficha lateral ── */
.sb-field-link {
    font-size: 13px;
    color: var(--color-primary);
    word-break: break-all;
    text-decoration: none;
}

.sb-field-link:hover {
    text-decoration: underline;
}

.hidden {
    display: none !important;
}