/**
 * MAPBOX ESTILOS CSS
 * Estilos para popups y marcadores
 */

/* ============================================
   MARCADORES
   ============================================ */

.mapbox-marker {
    cursor: pointer;
}

.mapbox-marker:hover {
    filter: brightness(1.1);
}

/* ============================================
   POPUP BASE
   ============================================ */

.mapbox-custom-popup {
    max-width: 320px !important;
    z-index: 9999 !important;
}

.mapbox-custom-popup .mapboxgl-popup-content {
    padding: 0 !important;
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25) !important;
}

/* TEMA FUTURISTA - Contenedor Mapbox negro */
[data-tema="futurista"] .mapboxgl-popup-content {
    background: var(--tema-fondo-tarjeta, #0a0a0a) !important;
    border: 1px solid var(--tema-borde-color, rgba(0, 247, 255, 0.5)) !important;
}

[data-tema="futurista"] .mapboxgl-popup-tip {
    border-top-color: var(--tema-fondo-tarjeta, #0a0a0a) !important;
    border-bottom-color: var(--tema-fondo-tarjeta, #0a0a0a) !important;
}

.mapbox-custom-popup .mapboxgl-popup-close-button {
    font-size: 20px;
    color: white;
    right: 8px;
    top: 8px;
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
    z-index: 10;
}

.mapbox-custom-popup .mapboxgl-popup-tip {
    border-top-color: white !important;
}

/* FUTURISTA - Flecha negra */
html[data-tema="futurista"] .mapbox-custom-popup .mapboxgl-popup-tip {
    border-top-color: #0a0a0a !important;
}

/* ============================================
   CONTENIDO DEL POPUP
   ============================================ */

.mapbox-popup-content {
    font-family: 'Inter', sans-serif;
    width: 300px;
    max-width: 100%;
}

.mapbox-popup-header {
    background: var(--tema-gradiente-primario, linear-gradient(135deg, #1e90ff, #4169e1));
    color: white;
    padding: 12px 15px;
}

.mapbox-popup-header--rental {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
}

.mapbox-popup-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.mapbox-popup-type {
    font-size: 0.75rem;
    opacity: 0.9;
}

.mapbox-popup-image {
    width: 100%;
    height: 170px;
    overflow: hidden;
    background: #f0f0f0;
}

.mapbox-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mapbox-popup-body {
    padding: 12px 15px;
    background: var(--tema-fondo-tarjeta, #ffffff);
}

.mapbox-popup-address {
    color: var(--tema-texto-secundario, #666);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.mapbox-popup-address i {
    color: var(--tema-primario, #1e90ff);
    margin-right: 6px;
}

.mapbox-popup-price {
    background: rgba(var(--tema-primario-rgb, 30, 144, 255), 0.1);
    border: 1px solid rgba(var(--tema-primario-rgb, 30, 144, 255), 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    text-align: center;
    margin-bottom: 12px;
}

.mapbox-popup-price-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--tema-primario, #1e90ff);
}

.mapbox-popup-deposit {
    font-size: 0.75rem;
    color: var(--tema-texto-secundario, #666);
    text-align: center;
    margin-bottom: 12px;
}

.mapbox-popup-services {
    font-size: 0.85rem;
    color: var(--tema-texto-secundario, #666);
    margin-top: 4px;
    margin-bottom: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.mapbox-popup-services i {
    color: var(--tema-primario, #1e90ff);
}

.mapbox-popup-actions {
    display: flex;
    gap: 8px;
}

.mapbox-popup-btn {
    flex: 1;
    padding: 10px 15px;
    border-radius: 20px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.mapbox-popup-btn.primary {
    background: var(--tema-gradiente-primario, linear-gradient(135deg, #1e90ff, #4169e1));
    color: white;
}

/* ============================================
   TEMA FUTURISTA - POPUP MAPBOX
   ============================================ */

html[data-tema="futurista"] .mapbox-custom-popup .mapbox-popup-header,
html[data-tema="futurista"] .mapbox-popup-header {
    background: #0a0a0a !important;
    border-bottom: 1px solid rgba(0, 247, 255, 0.4) !important;
}

html[data-tema="futurista"] .mapbox-custom-popup .mapbox-popup-title,
html[data-tema="futurista"] .mapbox-popup-title {
    color: #00f7ff !important;
    text-shadow: 0 0 8px rgba(0, 247, 255, 0.5) !important;
}

html[data-tema="futurista"] .mapbox-custom-popup .mapbox-popup-type,
html[data-tema="futurista"] .mapbox-popup-type {
    color: #00f7ff !important;
    text-shadow: 0 0 6px rgba(0, 247, 255, 0.4) !important;
    opacity: 1 !important;
}

html[data-tema="futurista"] .mapbox-custom-popup .mapbox-popup-body,
html[data-tema="futurista"] .mapbox-popup-body {
    background: #0a0a0a !important;
}

html[data-tema="futurista"] .mapbox-custom-popup .mapbox-popup-address,
html[data-tema="futurista"] .mapbox-popup-address {
    color: #ffffff !important;
}

html[data-tema="futurista"] .mapbox-custom-popup .mapbox-popup-address i,
html[data-tema="futurista"] .mapbox-popup-address i {
    color: #00f7ff !important;
    text-shadow: 0 0 8px rgba(0, 247, 255, 0.5) !important;
}

html[data-tema="futurista"] .mapbox-custom-popup .mapbox-popup-price,
html[data-tema="futurista"] .mapbox-popup-price {
    background: #0a0a0a !important;
    border: 1px solid rgba(0, 247, 255, 0.4) !important;
}

html[data-tema="futurista"] .mapbox-custom-popup .mapbox-popup-price-amount,
html[data-tema="futurista"] .mapbox-popup-price-amount {
    color: #00f7ff !important;
    text-shadow: 0 0 10px rgba(0, 247, 255, 0.5) !important;
}

html[data-tema="futurista"] .mapbox-custom-popup .mapbox-popup-deposit,
html[data-tema="futurista"] .mapbox-popup-deposit {
    color: #00f7ff !important;
    text-shadow: 0 0 8px rgba(0, 247, 255, 0.4) !important;
}

html[data-tema="futurista"] .mapbox-custom-popup .mapbox-popup-btn.primary,
html[data-tema="futurista"] .mapbox-popup-btn.primary {
    background: transparent !important;
    border: 1px solid #00f7ff !important;
    color: #00f7ff !important;
    text-shadow: 0 0 6px rgba(0, 247, 255, 0.4) !important;
    box-shadow: 0 0 10px rgba(0, 247, 255, 0.3) !important;
}

html[data-tema="futurista"] .mapbox-custom-popup .mapbox-popup-btn.primary:hover,
html[data-tema="futurista"] .mapbox-popup-btn.primary:hover {
    background: rgba(0, 247, 255, 0.1) !important;
    box-shadow: 0 0 20px rgba(0, 247, 255, 0.5) !important;
}

/* ============================================
   CONTROLES DEL MAPA
   ============================================ */

.mapboxgl-ctrl-group {
    border-radius: 8px !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .mapbox-popup-content {
        width: 280px;
    }
    .mapbox-popup-image {
        height: 140px;
    }
}

/* ============================================
   GOOGLE MAPS INFOWINDOW — reset de estilos
   ============================================ */

/* Elimina el padding interior que Google agrega al InfoWindow */
.gm-style-iw-d {
    overflow: hidden !important;
    padding: 0 !important;
    max-height: none !important;
}

.gm-style-iw-c {
    padding: 0 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    max-width: 300px !important;
}

/* Cierra el botón por defecto de Google */
.gm-style-iw-tc::after {
    background: var(--tema-gradiente-primario, linear-gradient(135deg, #1e90ff, #4169e1));
}

.gm-style-iw-d .mapbox-popup-content {
    width: 100%;
    min-width: 260px;
    max-width: 300px;
}

/* ============================================
   POPUP CORREDOR
   ============================================ */

.corredor-mapbox-popup .mapboxgl-popup-content {
    padding: 0 !important;
    border-radius: 12px !important;
}

.corredor-mapbox-popup .mapboxgl-popup-tip {
    border-top-color: white !important;
}

/* ============================================
   TEMA NOCTURNO - POPUP MAPBOX
   ============================================ */

html[data-tema="nocturno"] .mapboxgl-popup-content {
    background: var(--tema-fondo-tarjeta, #161b22) !important;
    border: 1px solid var(--tema-borde-color, rgba(79, 195, 247, 0.2)) !important;
}

html[data-tema="nocturno"] .mapboxgl-popup-tip {
    border-top-color: var(--tema-fondo-tarjeta, #161b22) !important;
    border-bottom-color: var(--tema-fondo-tarjeta, #161b22) !important;
}

html[data-tema="nocturno"] .mapbox-popup-header {
    background: var(--tema-gradiente-primario, linear-gradient(135deg, #1a73e8, #4fc3f7)) !important;
}

html[data-tema="nocturno"] .mapbox-popup-body {
    background: var(--tema-fondo-tarjeta, #161b22) !important;
}

html[data-tema="nocturno"] .mapbox-popup-address {
    color: var(--tema-texto-secundario, #8b949e) !important;
}

html[data-tema="nocturno"] .mapbox-popup-deposit {
    color: var(--tema-texto-secundario, #8b949e) !important;
}

html[data-tema="nocturno"] .mapbox-popup-image {
    background: #21262d !important;
}

html[data-tema="nocturno"] .mapboxgl-ctrl-group {
    background: #161b22 !important;
    border: 1px solid rgba(79, 195, 247, 0.2) !important;
}

html[data-tema="nocturno"] .mapboxgl-ctrl-group button {
    background-color: #161b22 !important;
}

html[data-tema="nocturno"] .mapboxgl-ctrl-group button:hover {
    background-color: #21262d !important;
}

/* ============================================
   TEMA NATURAL - POPUP MAPBOX
   ============================================ */

html[data-tema="natural"] .mapboxgl-popup-content {
    background: rgba(0, 0, 0, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(12px) !important;
}

html[data-tema="natural"] .mapboxgl-popup-tip {
    border-top-color: rgba(0, 0, 0, 0.75) !important;
    border-bottom-color: rgba(0, 0, 0, 0.75) !important;
}

html[data-tema="natural"] .mapbox-popup-header {
    background: var(--tema-gradiente-primario, linear-gradient(135deg, #4CAF50, #2E7D32)) !important;
}

html[data-tema="natural"] .mapbox-popup-body {
    background: transparent !important;
}

html[data-tema="natural"] .mapbox-popup-address {
    color: rgba(255, 255, 255, 0.85) !important;
}

html[data-tema="natural"] .mapbox-popup-deposit {
    color: rgba(255, 255, 255, 0.75) !important;
}

html[data-tema="natural"] .mapbox-popup-title,
html[data-tema="natural"] .mapbox-popup-type {
    color: #ffffff !important;
}

html[data-tema="natural"] .mapbox-popup-price-amount {
    color: #4CAF50 !important;
}

html[data-tema="natural"] .mapboxgl-ctrl-group {
    background: rgba(0, 0, 0, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(8px) !important;
}

html[data-tema="natural"] .mapboxgl-ctrl-group button {
    background-color: transparent !important;
    color: white !important;
}

/* ============================================
   FUTURISTA - CONTROLES MAPBOX
   ============================================ */

html[data-tema="futurista"] .mapboxgl-ctrl-group {
    background: #0a0a0a !important;
    border: 1px solid rgba(0, 247, 255, 0.3) !important;
    box-shadow: 0 0 10px rgba(0, 247, 255, 0.15) !important;
}

html[data-tema="futurista"] .mapboxgl-ctrl-group button {
    background-color: #0a0a0a !important;
}

html[data-tema="futurista"] .mapboxgl-ctrl-group button:hover {
    background-color: rgba(0, 247, 255, 0.1) !important;
}
