/* IMPORT FONT */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700;800&display=swap');

/* BASE */
.tbs-directory-container,
.tbs-directory-container * {
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}

/*CONTENEDOR DE FILTROS*/
.tbs-filter-container {
    text-align: -webkit-center;
}

/* CONTENEDOR PRINCIPAL */
.tbs-directory-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    width: 100%;
}
@media (max-width: 1100px) {
.tbs-directory-container {
    gap: 0px;
}
}

/* LEFT - listado (dos columnas) */
.tbs-left {
    width: 50%;
}

/* right - mapa */
.tbs-right {
    width: 50%;
    position: relative;
}

/* MAPA */
.tbs-map-container {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 14px 34px rgba(0,0,0,0.09);
    border: 1px solid rgba(0,0,0,0.03);
    height: 500px;
}

/* Map popup basic styling */
.tbs-map-popup { font-size: 14px; }
.tbs-map-popup img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; margin-right: 8px; vertical-align: middle; }
.tbs-map-rating { margin-top: 4px; font-weight: 700; color: #FF66C4; }

/* small helper when there are no locations */
.tbs-map-info { color: #444; }



/* FILTROS */
.tbs-filter-form {
    display: flex;
    gap: 12px;
    align-items: center;
    border-radius: 15px;
    box-shadow: 0px 0px 15px rgba(12, 12, 12, 0.17);
    padding: 20px!important;
    margin-bottom: 15px;
    max-width: 80%;
    background-color: white!important;
}

/* Selects (existing) */
.tbs-filter-form select {
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,0.08);
    background: #fff;
    font-size: 15px;
    min-width: 160px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}

.tbs-filter-btn {
    padding: 12px 20px!important;
    background: #FF66C4!important;
    color: white!important;
    border-radius: 15px!important;
    border: none!important;
    font-weight: 600!important;
    cursor: pointer;
    display: inline-flex;
    align-items: center!important;
    gap: 8px;
}

/* Botón Mejor valorados */
.tbs-sort-btn {
    padding: 12px 20px!important;
    background: #ffffff!important;
    color: #333!important;
    border-radius: 15px!important;
    border: 2px solid #FF66C4!important;
    font-weight: 600!important;
    cursor: pointer;
    display: inline-flex;
    align-items: center!important;
    gap: 8px;
    transition: all 0.3s ease;
}

/* Botón mobile: oculto en desktop */
@media (min-width: 1100px) {
.tbs-sort-btn-mobile {
    display: none!important;
}
}

@media (max-width: 1100px) {
    /* En mobile: mostrar el botón del formulario y ocultar el del header */
    .tbs-sort-btn-mobile {
        display: inline-flex;
    }
}

.tbs-sort-btn svg {
    width: 18px;
    height: 18px;
    fill: #FFB800;
}

.tbs-sort-btn:hover {
    background: #fff5fb!important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 102, 196, 0.15);
}

.tbs-sort-btn.active {
    background: #FF66C4!important;
    color: white!important;
    border-color: #FF66C4!important;
}

.tbs-sort-btn.active svg {
    fill: white;
}

/* Botón Limpiar filtros */
.tbs-clear-btn {
    font-size: 14px !important;
    padding: 10px 10px!important;
    color: red!important;
    border: 0px solid #ddd!important;
    font-weight: 600!important;
    cursor: pointer;
    display: inline-flex;
    align-items: center!important;
    gap: 8px;
    transition: all 0.3s ease;
}

.tbs-clear-btn svg {
    width: 16px;
    height: 16px;
    stroke: #666;
}

.tbs-clear-btn:hover {
    background-color: transparent!important;
    color: #333!important;
    transform: translateY(-1px);
}

.tbs-clear-btn:hover svg {
    stroke: #333;
}

/* SEARCH INPUT styled to match selects */
.tbs-search-input,
.tbs-location-input {
    padding: 12px 16px!important;
    border-radius: 14px!important;
    border: 1px solid rgba(0,0,0,0.08)!important;
    background: #fff!important;
    font-size: 15px!important;
    min-width: 220px!important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.05)!important;
}

/* Location wrap */
.tbs-location-wrap {
    position: relative;
}

/* Distance indicator in cards */
.tbs-distance {
    color: #666;
    font-size: 13px;
    margin: 4px 0;
    font-weight: 500;
}

/* Loader para las cards */
.tbs-cards-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.tbs-spinner {
    border: 4px solid rgba(255, 102, 196, 0.1);
    border-top: 4px solid #FF66C4;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: tbs-spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes tbs-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tbs-cards-loader p {
    color: #666;
    font-size: 15px;
    font-weight: 500;
    margin: 0;
}

/* Autocomplete dropdown */
.tbs-autocomplete-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(12,12,12,0.08);
    max-height: 300px;
    overflow-y: auto;
    z-index: 9999;
    border: 1px solid rgba(0,0,0,0.06);
}

.tbs-autocomplete-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    transition: background .12s;
}

.tbs-autocomplete-item:hover {
    background: #f7f7f7;
}

.tbs-autocomplete-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.tbs-autocomplete-name {
    font-weight: 600;
    font-size: 14px;
}

/* GRID DE CARDS: dos columnas */
.tbs-cards-wrap {
    display: grid;
    grid-template-columns: 50% 50%;
    gap: 20px 20px;
}

/* CARD */
.tbs-card {
    width: 100%;
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 12px 30px rgba(12,12,12,0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: 14px;
}

/* IMAGEN */
.tbs-card-img-wrap {
    width: 100%;
    height: 190px;
    overflow: hidden;
    border-radius: 18px;
}

.tbs-card-img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    display: block;
}

/* CUERPO */
.tbs-card-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tbs-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tbs-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    text-decoration: none;
}

.tbs-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #222;
}

.tbs-rating-star {
    color: #FFB400;
    font-size: 16px;
    line-height: 1;
}

.tbs-services-title { margin-top: 6px; font-weight: 600; font-size: 13px; color: #333; }
.tbs-services-list { margin: 6px 0 0 16px; padding: 0; list-style: disc; min-height: 80px;}
.tbs-services-list li { margin-bottom: 6px; font-size: 13px; color: #555; }

/* BOTON VER MÁS */
.tbs-view-more {
    margin-top: 6px;
    display: inline-block;
    width: max-content;
    padding: 8px 12px;
    background: #ff4fb1;
    color: #fff;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

/* Contenedor del contador y botón de ordenamiento */
.tbs-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 12px;
}

/* Contador */
.tbs-results-count {
    font-size: 14px;
    color: #7a7a7a;
    flex: 1;
}

/* Botón en el header: solo visible en desktop */
.tbs-results-header .tbs-sort-btn {
    flex-shrink: 0;
}

@media (max-width: 1100px) {
    .tbs-results-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .tbs-results-count {
        color: black;
        text-align: center;
    }
    
    /* En mobile el botón está en el formulario de filtros, ocultamos el reubicado */
    .tbs-results-header .tbs-sort-btn {
        display: none;
    }
}


/* RESPONSIVE */
@media (max-width: 1100px) {
    .tbs-directory-container { 
        flex-direction: column; 
    }
    .tbs-left, .tbs-right { width: 100%; }
    
    /* En mobile, el mapa aparece primero */
    .tbs-right {
        order: -1;
        margin-bottom: 20px;
    }
    
    .tbs-cards-wrap { grid-template-columns: 1fr 1fr; }
    .tbs-map-container { height: 420px; }
}
@media (max-width: 600px) {

    .tbs-cards-wrap { grid-template-columns: 1fr; }
    .tbs-map-container { height: 320px; }

    .tbs-filter-form {
        display: grid;
        gap: 12px;
        max-width: 100%;
    }

}
/* ================================================
   POPUP DE FILTROS MOBILE (Sticky Header + Modal)
   ================================================ */

/* Header flotante - oculto en desktop */
.tbs-mobile-filter-header {
    display: none;
}

.tbs-filter-modal-overlay {
    display: none;
}

.tbs-filter-close-btn {
    display: none!important;
}

@media (max-width: 1100px) {
    /* Formulario del home: siempre visible en mobile */
    .tbs-home-filter-container {
        position: relative !important;
        transform: none !important;
        pointer-events: auto !important;
        overflow-y: visible !important;
    }
    
    /* .tbs-home-filter-container .tbs-filter-form {
        padding: 0 !important;
    } */
    
    /* Header flotante sticky */
    .tbs-mobile-filter-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        left: 0;
        right: 0;
        z-index: 99998;
        background: white;
        padding: 15px 20px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        cursor: pointer;
        user-select: none;
        margin-bottom: 20px;
    }
    
    .tbs-mobile-filter-summary {
        display: flex;
        align-items: center;
        gap: 10px;
        flex: 1;
        font-size: 14px;
        font-weight: 500;
        color: #333;
    }
    
    .tbs-mobile-filter-summary svg {
        flex-shrink: 0;
        color: #FF66C4;
    }
    
    .tbs-filter-chevron {
        flex-shrink: 0;
        color: #666;
        transition: transform 0.3s ease;
    }
    
    .tbs-mobile-filter-header.active .tbs-filter-chevron {
        transform: rotate(180deg);
    }
    
    /* Overlay oscuro */
    .tbs-filter-modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    
    .tbs-filter-modal-overlay.active {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }
    
    /* Contenedor de filtros como modal */
    .tbs-filter-container {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100000;
        background: white;
        overflow-y: auto;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        pointer-events: none;
    }
    
    .tbs-filter-container.active {
        transform: translateY(0);
        pointer-events: auto;
    }
    
    /* Formulario dentro del modal */
    .tbs-filter-form {
        padding: 20px;
        padding-top: 60px; /* Espacio para el botón cerrar */
        padding-bottom: 30px;
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    /* Botón cerrar (X) en la esquina superior derecha */
    .tbs-filter-close-btn {
        display: block!important;
        position: fixed;
        top: 15px;
        right: 15px;
        z-index: 100001;
        background: transparent;
        border: none!important;
        padding: 8px;
        cursor: pointer;
        color: #333!important;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    .tbs-filter-close-btn:hover {
        color: transparent!important;
    }
    
    .tbs-filter-container.active .tbs-filter-close-btn {
        opacity: 1;
        pointer-events: auto;
    }
    
    /* Botón Buscar más prominente en el modal */
    .tbs-filter-container.active .tbs-filter-btn {
        margin-top: 10px;
        padding: 15px;
        font-size: 16px;
        font-weight: 600;
    }
}
/* ================================================
   Google Places Autocomplete Dropdown
   ================================================ */
/* Asegurar que el dropdown de sugerencias de Google Places est� visible sobre el modal */
.pac-container {
    z-index: 100002 !important;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.pac-container .pac-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.pac-container .pac-item:hover {
    background-color: #f5f5f5;
}

.pac-container .pac-item-selected,
.pac-container .pac-item-selected:hover {
    background-color: #FF66C4;
    color: white;
}

.pac-container .pac-icon {
    margin-right: 8px;
}

.pac-container .pac-item-query {
    font-weight: 500;
    color: #333;
}

.pac-item-selected .pac-item-query {
    color: white;
}

/* ================================================
   Enhanced Map InfoWindow Popup
   ================================================ */
.tbs-map-popup-enhanced {
    min-width: 280px;
    max-width: 320px;
    padding: 12px;
    font-family: 'Poppins', sans-serif;
}

.tbs-popup-container {
    display: flex;
    gap: 12px;
}

.tbs-popup-left {
    flex-shrink: 0;
}

.tbs-popup-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

.tbs-popup-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

/* Primera fila: nombre + rating */
.tbs-popup-row-1 {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.tbs-popup-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    line-height: 1.3;
}

.tbs-popup-name:hover {
    color: #FF66C4;
    text-decoration: underline;
}

.tbs-popup-rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.tbs-popup-rating-number {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.tbs-popup-rating-star {
    font-size: 16px;
    color: #FFB800;
}

/* Segunda fila: ubicación */
.tbs-popup-row-2 {
    font-size: 13px;
    color: #333;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.tbs-popup-row-2 svg {
    color: #333;
}

/* Tercera fila: categorías */
.tbs-popup-row-3 {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    font-weight: 500;
}

/* Ajustar el InfoWindow de Google Maps para mejor visualizaci�n */
.gm-style .gm-style-iw-c {
    padding: 0 !important;
    border-radius: 8px !important;
    max-width: 340px !important;
    max-height: none !important;
}

.gm-style .gm-style-iw-d {
    overflow: visible !important;
    max-height: none !important;
}

.gm-style .gm-style-iw-t::after {
    background: white;
}
/* Botón de cerrar más pequeño */
.gm-style-iw button.gm-ui-hover-effect {
    width: 28px !important;
    height: 28px !important;
    top: 4px !important;
    right: 4px !important;
}

.gm-style-iw button.gm-ui-hover-effect img {
    width: 12px !important;
    height: 12px !important;
}

/* ========================================
   POPUP FIJO EN LA PARTE INFERIOR DEL MAPA
   ======================================== */
.tbs-right {
    position: relative;
}

.tbs-map-popup-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    padding: 20px;
    transform: translateY(100%);
    transition: none; /* Sin transición al cerrar */
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.tbs-map-popup-bottom.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease; /* Transición solo al abrir */
}

.tbs-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.05)!important;
    border: none!important;
    border-radius: 50%!important;
    width: 32px!important;
    height: 32px;
    display: flex!important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s!important;
    padding: 0!important;
    color: #666!important;
}

.tbs-popup-close:hover {
    background: rgba(0,0,0,0.1)!important;
    color: #333!important;
}

.tbs-map-popup-content {
    padding-right: 40px;
}

/* Reutilizar estilos existentes del popup */
.tbs-map-popup-bottom .tbs-popup-container {
    display: flex;
    gap: 12px;
}

.tbs-map-popup-bottom .tbs-popup-left {
    flex-shrink: 0;
}

.tbs-map-popup-bottom .tbs-popup-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    box-shadow: 0px 0px 5px #666!important;
}

.tbs-map-popup-bottom .tbs-popup-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.tbs-map-popup-bottom .tbs-popup-row-1 {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.tbs-map-popup-bottom .tbs-popup-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    line-height: 1.3;
}

.tbs-map-popup-bottom .tbs-popup-name:hover {
    color: #FF66C4;
    text-decoration: underline;
}

.tbs-map-popup-bottom .tbs-popup-rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.tbs-map-popup-bottom .tbs-popup-rating-number {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.tbs-map-popup-bottom .tbs-popup-rating-star {
    font-size: 16px;
    color: #FFB800;
}

.tbs-map-popup-bottom .tbs-popup-row-2 {
    font-size: 13px;
    color: #333;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.tbs-map-popup-bottom .tbs-popup-row-2 svg {
    color: #333;
}

.tbs-map-popup-bottom .tbs-popup-row-3 {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    font-weight: 500;
}

.tbs-category-wrap {
    display: contents;
}

/* Mobile */
@media (max-width: 768px) {
    .tbs-map-popup-bottom {
        max-height: 180px;
        padding: 16px;
    }
    
    .tbs-map-popup-bottom .tbs-popup-thumb {
        width: 50px;
        height: 50px;
    }
    
    /* Botones más compactos en mobile */
    .tbs-sort-btn,
    .tbs-clear-btn {
        padding: 10px 16px!important;
        font-size: 14px!important;
        gap: 6px;
    }
    
    .tbs-sort-btn svg,
    .tbs-clear-btn svg {
        width: 14px;
        height: 14px;
    }
    .tbs-category-wrap {
        display:flex!important; 
        gap:10px;
    }
    
}