/* ================================================
   Map V2 - GSF Hotels
   Dark theme map with glassmorphism info cards
   ================================================ */

/* --- Container del mapa --- */
#map.map {
    border-radius: 16px !important;
    overflow: hidden;
    height: 520px !important;
    border: 1px solid rgba(160, 196, 218, 0.12);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}

/* --- Info cards glassmorphism --- */
.marker_info {
    background: rgba(35, 44, 55, 0.92) !important;
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid rgba(160, 196, 218, 0.15);
    border-radius: 14px !important;
    padding: 0 !important;
    overflow: hidden;
    width: 280px !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4) !important;
    font-family: 'Red Hat Display', sans-serif !important;
}

.marker_info img {
    width: 100% !important;
    height: 150px !important;
    object-fit: cover;
    display: block;
    border-radius: 0 !important;
}

.marker_info h3 {
    font-family: 'Red Hat Display', sans-serif !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #fff !important;
    margin: 14px 16px 6px !important;
    line-height: 1.3 !important;
}

.marker_info span {
    display: block;
    font-size: 13px !important;
    color: rgba(255, 255, 255, 0.65) !important;
    line-height: 1.5 !important;
    padding: 0 16px !important;
    margin-bottom: 12px !important;
}

.marker_tools {
    padding: 0 16px 12px !important;
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap;
}

.btn_infobox_get_directions,
.btn_infobox_phone {
    font-family: 'Red Hat Display', sans-serif !important;
    font-size: 12px !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    background: rgba(160, 196, 218, 0.1) !important;
    border: 1px solid rgba(160, 196, 218, 0.2) !important;
    color: #A0C4DA !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn_infobox_get_directions:hover,
.btn_infobox_phone:hover {
    background: rgba(160, 196, 218, 0.2) !important;
}

.btn_infobox {
    display: block !important;
    text-align: center !important;
    padding: 10px 16px !important;
    background: linear-gradient(135deg, #A0C4DA, #7EB0C4) !important;
    color: #1A2230 !important;
    font-family: 'Red Hat Display', sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    border-radius: 0 0 14px 14px !important;
    transition: opacity 0.2s ease;
    letter-spacing: 0.02em;
}

.btn_infobox:hover {
    opacity: 0.8; !important;
    color: #1A2230 !important;
    text-decoration: none !important;
}

/* --- InfoBox close button --- */
.infoBox > img[src*="close.gif"] {
    width: 24px !important;
    height: 24px !important;
    opacity: 0.7 !important;
    filter: invert(1) !important;
    top: 8px !important;
    right: 8px !important;
    cursor: pointer;
}

/* --- Google Maps UI overrides --- */
.gm-style .gm-style-iw {
    background: transparent !important;
    box-shadow: none !important;
}

/* Zoom controls dark theme */
.gm-control-active,
.gmp-sv-sv-normal button {
    background: #2F3A48 !important;
    color: #A0C4DA !important;
    border: 1px solid rgba(160, 196, 218, 0.15) !important;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    #map.map {
        height: 380px !important;
        border-radius: 12px !important;
    }
    .marker_info {
        width: 240px !important;
    }
}

/* --- Fix4: infobox completo --- */

/* Card completo sin corte */
.marker_info {
    width: 280px !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.infoBox {
    overflow: visible !important;
    max-height: none !important;
}

.infoBox > div {
    overflow: visible !important;
    max-height: none !important;
}

/* Botones full-width en dos columnas iguales */
.marker_info .marker_tools {
    padding: 0 16px 12px !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.marker_info .marker_tools form,
.marker_info .marker_tools form[style] {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.marker_info .btn_infobox_get_directions,
.marker_info a.btn_infobox_phone {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    padding: 8px 6px 8px 22px !important;
    position: relative !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}

.marker_info .btn_infobox_get_directions::before,
.marker_info a.btn_infobox_phone::before {
    position: absolute !important;
    left: 6px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 13px !important;
    color: #A0C4DA !important;
}

.marker_info .marker_tools form button {
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.marker_info .btn_infobox {
    box-sizing: border-box !important;
    width: 100% !important;
}

/* --- Fix5: imagen flush con rounded --- */
.marker_info {
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 14px !important;
}

.marker_info img {
    display: block !important;
    width: 100% !important;
    height: 160px !important;
    object-fit: cover !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 14px 14px 0 0 !important;
}

/* Quitar padding top del infoBox wrapper */
.infoBox > div {
    padding: 0 !important;
    margin: 0 !important;
}

/* El infoBox pone un div wrapper con padding */
.infoBox > div > div {
    padding: 0 !important;
    margin: 0 !important;
}

/* --- Fix6: imagen flush top --- */
.marker_info {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.marker_info img {
    margin-top: 0 !important;
    position: relative !important;
    top: 0 !important;
}

/* InfoBox library wrappers */
.infoBox {
    padding: 0 !important;
}

.infoBox > div,
.infoBox > div > div,
.infoBox > div > div > div {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

/* Eliminar cualquier borde o espacio en el top */
.marker_info:first-child {
    margin-top: 0 !important;
}

.marker_info > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* --- Fix7: gap superior definitivo --- */

/* Anular height fijo de style.css */
.marker_info {
    height: auto !important;
    overflow: hidden !important;
}

/* Anular padding-right del infoBox */
.infoBox {
    padding: 0 !important;
}

/* El botón de cerrar (img) que InfoBox inyecta como primer hijo */
.infoBox > img {
    position: absolute !important;
    z-index: 10 !important;
    top: 8px !important;
    right: 8px !important;
    width: 20px !important;
    height: 20px !important;
    cursor: pointer !important;
    filter: invert(1) brightness(2) !important;
    opacity: 0.7 !important;
    transition: opacity 0.2s ease !important;
}



/* El div wrapper de contenido del InfoBox */
.infoBox > div:last-child {
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    border-radius: 14px !important;
}

/* --- Fix8: close button moderno --- */
.infoBox > img {
    position: absolute !important;
    z-index: 100 !important;
    top: 10px !important;
    right: 10px !important;
    width: 28px !important;
    height: 28px !important;
    cursor: pointer !important;
    filter: none !important;
    opacity: 0.9 !important;
    transition: opacity 0.2s ease, transform 0.2s ease !important;
    background: none !important;
    border: none !important;
}

.infoBox > img:hover {
    opacity: 1 !important;
    transform: scale(1.1) !important;
}

/* --- Fix9: close button z-index --- */
.infoBox {
    position: absolute !important;
}

.infoBox > img {
    position: absolute !important;
    z-index: 99999999 !important;
    top: 8px !important;
    right: 8px !important;
    width: 28px !important;
    height: 28px !important;
    cursor: pointer !important;
    filter: none !important;
    opacity: 0.9 !important;
    background: none !important;
    border: none !important;
}

.infoBox > img:hover {
    opacity: 1 !important;
    transform: scale(1.1) !important;
}

/* Bajar el z-index del marker_info */
.marker_info {
    z-index: 1 !important;
}

/* --- Fix10: botones fit-content --- */
.marker_info .marker_tools {
    grid-template-columns: auto 1fr !important;
}

.marker_info .btn_infobox_get_directions {
    white-space: nowrap !important;
    width: auto !important;
}

.marker_info a.btn_infobox_phone {
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 11px !important;
}

/* --- Fix11: Google Maps UI controls dark theme --- */

/* Zoom buttons */
.gm-style-mtc {
    background: #2F3A48 !important;
    border-radius: 10px !important;
    border: 1px solid rgba(160, 196, 218, 0.2) !important;
    overflow: hidden !important;
}

.gm-style-mtc button {
    background: #2F3A48 !important;
    color: #A0C4DA !important;
    border: none !important;
}

.gm-style-mtc button:hover {
    background: #3E4B5D !important;
}

/* Separador blanco entre zoom buttons */
.gm-style-mtc + .gm-style-mtc {
    margin-top: 0 !important;
}

/* Todos los botones de control */
.gmnoprint > div > button,
.gmnoprint button,
.gm-control-active,
.gm-svg-img,
.gmnoprint div {
    background: #2F3A48 !important;
    color: #A0C4DA !important;
}

.gmnoprint > div > button:hover,
.gmnoprint button:hover,
.gm-control-active:hover {
    background: #3E4B5D !important;
}

/* Zoom container - quitar separador blanco */
.gmnoprint[controlwidth],
.gmnoprint[role="menubar"] {
    background: transparent !important;
}

/* Fullscreen button */
.gm-fullscreen-control {
    background: #2F3A48 !important;
    border-radius: 10px !important;
    border: 1px solid rgba(160, 196, 218, 0.2) !important;
}

.gm-fullscreen-control:hover {
    background: #3E4B5D !important;
}

.gm-fullscreen-control img {
    filter: invert(0.7) sepia(0.3) saturate(2) hue-rotate(170deg) !important;
}

/* Street view / Pegman */
.gm-svg-img[src*="pegman"],
.gm-sv-sv-normal {
    background: #2F3A48 !important;
    border-radius: 10px !important;
    border: 1px solid rgba(160, 196, 218, 0.2) !important;
}

/* Iconos SVG de Google Maps en color accent */
.gm-control-active > img,
.gmnoprint img {
    filter: invert(0.7) sepia(0.3) saturate(2) hue-rotate(170deg) !important;
}

/* Separador entre botones de zoom */
.gmnoprint > div > div {
    background-color: rgba(160, 196, 218, 0.15) !important;
}
