/* ================================================================
   tahotelmap.css  —  TeAcerca Mapa de Alojamientos
   ================================================================ */

/* ---- SECCIÓN PRINCIPAL ---- */
.tahm-section {
    background: linear-gradient(135deg, #ad1457 0%, #c2185b 50%, #e91e8c 100%);
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

/* Textura de fondo con baja opacidad */
.tahm-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('/modules/tahotelmap/views/img/textura.png') center/cover no-repeat;
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
}

/* Círculo decorativo */
.tahm-section::after {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.tahm-section > * {
    position: relative;
    z-index: 1;
}

.tahm-section-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    gap: 60px;
}

/* ---- COLUMNA DE TEXTO ---- */
.tahm-text-col {
    flex: 1;
    min-width: 0;
}

.tahm-eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #46a74e;
    margin-bottom: 12px;
}

.tahm-title {
    font-size: 36px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    margin: 0 0 16px;
}

.tahm-desc {
    font-size: 16px;
    color: rgba(255,255,255,.7);
    line-height: 1.7;
    margin: 0 0 32px;
    max-width: 460px;
}

.tahm-btn-open {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #46a74e;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 6px 24px rgba(70,167,78,.35);
    position: relative;
}

.tahm-btn-open:hover {
    background: #3a8e42;
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(70,167,78,.45);
}

.tahm-btn-open:active {
    transform: translateY(0);
}

.tahm-btn-icon {
    width: 20px; height: 20px;
    flex-shrink: 0;
}

.tahm-badge {
    background: #fff;
    color: #46a74e;
    border-radius: 50px;
    padding: 2px 9px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.5;
    margin-left: 4px;
}

/* ---- COLUMNA PREVIEW ---- */
.tahm-preview-col {
    flex: 0 0 380px;
}

.tahm-map-preview {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 20px;
    padding: 28px 32px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    backdrop-filter: blur(8px);
    overflow: hidden;
}

.tahm-map-preview::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='400' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='60' cy='70' r='3' fill='rgba(70,167,78,.5)'/%3E%3Ccircle cx='180' cy='40' r='3' fill='rgba(70,167,78,.5)'/%3E%3Ccircle cx='280' cy='110' r='3' fill='rgba(70,167,78,.5)'/%3E%3Ccircle cx='340' cy='55' r='3' fill='rgba(70,167,78,.5)'/%3E%3Cline x1='60' y1='70' x2='180' y2='40' stroke='rgba(255,255,255,.1)' stroke-width='1'/%3E%3Cline x1='180' y1='40' x2='280' y2='110' stroke='rgba(255,255,255,.1)' stroke-width='1'/%3E%3Cline x1='280' y1='110' x2='340' y2='55' stroke='rgba(255,255,255,.1)' stroke-width='1'/%3E%3C/svg%3E") center/cover no-repeat;
    opacity: .5;
    pointer-events: none;
}

/* ---- Contador de alojamientos ---- */
.tahm-counter-block {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 18px;
}

.tahm-counter-number {
    font-size: 56px;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    letter-spacing: -2px;
}

.tahm-counter-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tahm-counter-label span:first-child {
    font-size: 13px;
    font-weight: 700;
    color: #46a74e;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.tahm-counter-label span:last-child {
    font-size: 13px;
    color: rgba(255,255,255,.6);
    font-weight: 400;
}

.tahm-counter-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    background: rgba(70,167,78,.2);
    border: 1.5px solid rgba(70,167,78,.4);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: tahmPulse 2.5s infinite;
}

.tahm-counter-icon svg {
    width: 24px; height: 24px;
    fill: #46a74e;
    stroke: none;
}

@keyframes tahmPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(70,167,78,.4); }
    50%       { box-shadow: 0 0 0 10px rgba(70,167,78,0); }
}

.tahm-preview-cta {
    position: relative;
    z-index: 1;
    background: rgba(70,167,78,.15);
    border: 1px solid rgba(70,167,78,.5);
    color: #fff;
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background .2s, border-color .2s;
}

.tahm-preview-cta:hover {
    background: rgba(70,167,78,.3);
    border-color: rgba(70,167,78,.8);
}

/* ================================================================
   MODAL
   ================================================================ */
.tahm-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    z-index: 99999;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    backdrop-filter: blur(4px);
    overflow-y: auto;
}

.tahm-modal-overlay.tahm-open {
    display: flex;
}

.tahm-modal-box {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 1180px;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0,0,0,.4);
    animation: tahmSlideIn .25s ease;
    overflow: hidden;
    margin: auto;
}

@keyframes tahmSlideIn {
    from { opacity: 0; transform: translateY(-20px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Cabecera modal ---- */
.tahm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(90deg, #ad1457, #c2185b);
    color: #fff;
    flex-shrink: 0;
}

.tahm-modal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
}

.tahm-modal-header-left svg {
    width: 22px; height: 22px;
    fill: #46a74e;
    stroke: none;
}

.tahm-modal-count {
    font-size: 13px;
    font-weight: 500;
    background: rgba(255,255,255,.15);
    border-radius: 20px;
    padding: 3px 12px;
}

.tahm-modal-close {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}

.tahm-modal-close:hover {
    background: rgba(255,255,255,.3);
}

/* ---- Cuerpo modal ---- */
.tahm-modal-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 520px;
}

/* ---- Lista de hoteles ---- */
.tahm-hotel-list {
    width: 340px;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: 1px solid #f0f0f0;
    background: #fafafa;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tahm-hotel-list::-webkit-scrollbar { width: 4px; }
.tahm-hotel-list::-webkit-scrollbar-track { background: transparent; }
.tahm-hotel-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.tahm-hotel-card {
    background: #fff;
    border-radius: 14px;
    border: 2px solid transparent;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .15s;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.tahm-hotel-card:hover,
.tahm-hotel-card.tahm-active {
    border-color: #46a74e;
    box-shadow: 0 4px 20px rgba(70,167,78,.2);
    transform: translateY(-2px);
}

.tahm-hotel-card.tahm-active {
    background: #f4fbf5;
}

.tahm-card-img {
    width: 100%;
    height: 130px;
    overflow: hidden;
}

.tahm-card-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .3s;
    display: block;
}

.tahm-hotel-card:hover .tahm-card-img img {
    transform: scale(1.04);
}

.tahm-card-info {
    padding: 14px;
}

.tahm-card-name {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
    line-height: 1.3;
}

.tahm-card-location,
.tahm-card-phone {
    font-size: 12px;
    color: #666;
    margin: 0 0 5px;
    display: flex;
    align-items: flex-start;
    gap: 5px;
    line-height: 1.4;
}

.tahm-card-location svg,
.tahm-card-phone svg {
    width: 12px; height: 12px;
    flex-shrink: 0;
    margin-top: 2px;
    fill: none;
    stroke: #46a74e;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tahm-card-location svg path,
.tahm-card-location svg circle {
    fill: none;
    stroke: #46a74e;
    stroke-width: 2;
}

.tahm-card-phone svg path {
    fill: none;
    stroke: #46a74e;
    stroke-width: 2;
}

.tahm-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.tahm-btn-rooms {
    flex: 1;
    background: #1a1a2e;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    transition: background .2s;
    white-space: nowrap;
}

.tahm-btn-rooms:hover {
    background: #0f3460;
}

.tahm-btn-map {
    background: #46a74e;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background .2s;
    white-space: nowrap;
}

.tahm-btn-map:hover {
    background: #3a8e42;
}

.tahm-btn-map svg {
    width: 12px; height: 12px;
    fill: #fff;
    stroke: none;
}

/* ---- Modo solo mapa (sin lista lateral) ---- */
.tahm-modal-body.tahm-map-only {
    min-height: 600px;
}

/* ---- Mapa ---- */
.tahm-map-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
}

#tahmMap {
    flex: 1;
    width: 100%;
    min-height: 520px;
}

.tahm-map-legend {
    padding: 8px 16px;
    font-size: 11px;
    color: #999;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    text-align: center;
    flex-shrink: 0;
}

/* ---- Popup Leaflet personalizado ---- */
.tahm-popup {
    font-family: inherit;
    min-width: 200px;
}

.tahm-popup-name {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 6px;
    line-height: 1.3;
}

.tahm-popup-address {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}

.tahm-popup-link {
    display: block;
    background: #46a74e;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    transition: background .2s;
}

.tahm-popup-link:hover {
    background: #3a8e42;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 900px) {
    .tahm-section-inner {
        flex-direction: column;
        gap: 32px;
    }
    .tahm-preview-col {
        flex: none;
        width: 100%;
        max-width: 460px;
    }
    .tahm-title { font-size: 28px; }
}

@media (max-width: 768px) {
    .tahm-modal-box {
        border-radius: 14px;
        min-height: auto;
    }
    .tahm-modal-body {
        flex-direction: column;
        min-height: auto;
        overflow: visible;
    }
    .tahm-hotel-list {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
        max-height: 320px;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 10px;
        padding: 12px;
    }
    .tahm-hotel-card {
        flex: 0 0 260px;
    }
    .tahm-map-container {
        min-height: 300px;
    }
    #tahmMap {
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    .tahm-section { padding: 40px 0; }
    .tahm-section-inner { padding: 0 16px; }
    .tahm-title { font-size: 24px; }
    .tahm-btn-open { font-size: 14px; padding: 12px 22px; }
    .tahm-modal-overlay { padding: 0; }
    .tahm-modal-box { border-radius: 0; }
}
