/* Heredamos variables de landing.css, pero añadimos específicas si es necesario */
:root { --nav-height: 80px; }
body { background-color: white; color: var(--text-dark); padding-top: var(--nav-height); }

/* --- ESTILOS ESPECÍFICOS PARA LA PÁGINA DE BÚSQUEDA --- */

/* --- FIJAR LA BARRA SUPERIOR SOLO EN SEARCH.HTML --- */
.search-nav {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 100 !important; 
    background-color: var(--bg-dark) !important;
    margin-top: 0 !important;
}

/* Evitar que el contenido se esconda debajo de la barra recién fijada */
.search-bar-wrapper {
    margin-top: 80px; 
    position: relative;
    z-index: 90; 
}

.search-layout {
    padding-top: 20px; 
}

/* --- BARRA INTERACTIVA Y COMPACT-SEARCH --- */
.compact-search { flex: 1; display: flex; justify-content: center; }

.search-pill {
    display: flex; align-items: center; gap: 10px;
    border: 1px solid #ddd; border-radius: 40px;
    padding: 5px 5px 5px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    font-size: 0.9rem; transition: 0.3s;
    background: white;
}
.search-pill:hover { box-shadow: 0 4px 10px rgba(0,0,0,0.1); }

.pill-section { position: relative; cursor: pointer; }

.pill-section.location {
    cursor: pointer;
    z-index: 10; 
}

/* Inputs Transparentes (El pointer-events: none hace que el clic pase a .pill-section) */
#headerLocation {
    border: none; outline: none; font-weight: 600; width: 120px;
    font-size: 0.9rem; color: var(--text-dark); text-overflow: ellipsis; background: transparent; 
    pointer-events: none; cursor: pointer;
}

.mini-date {
    border: none; outline: none; font-family: 'Inter'; font-size: 0.85rem;
    color: var(--text-grey); width: 130px; cursor: pointer; text-align: center;
}

/* --- DROPDOWN DE DESTINOS (POP-UP) --- */
.location-dropdown { 
    position: absolute; top: 150%; left: 0; width: 300px; 
    background: white; border-radius: 20px; padding: 20px 15px; 
    box-shadow: 0 15px 40px rgba(0,0,0,0.15); display: none; flex-direction: column; gap: 5px; 
    z-index: 300; color: var(--text-dark); animation: fadeInDown 0.2s ease forwards; 
    border: 1px solid #f1f5f9; cursor: default;
}
.location-dropdown.active { display: flex; }
.dropdown-header { font-size: 0.8rem; font-weight: 800; text-transform: uppercase; color: #94a3b8; padding-left: 15px; margin-bottom: 10px; letter-spacing: 1px;}
.loc-option { 
    padding: 12px 15px; border-radius: 12px; font-size: 0.95rem; font-weight: 600; 
    cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 12px;
}
.loc-icon { background: #f1f5f9; padding: 8px; border-radius: 10px; font-size: 1rem; }
.loc-option:hover { background: #f8fafc; color: var(--brand-teal); }
.loc-option:hover .loc-icon { background: white; box-shadow: 0 4px 10px rgba(0,0,0,0.05);}


/* --- HEADER DROPDOWN HUÉSPEDES (HACIA ABAJO) --- */
.header-dropdown {
    position: absolute;
    top: 150%; 
    left: 50%; transform: translateX(-50%);
    width: 280px;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 1px solid #eee;
    display: none;
    flex-direction: column; gap: 15px;
    z-index: 300;
}
.header-dropdown.active { display: flex; animation: fadeInDown 0.2s ease; }

.guest-row { display: flex; justify-content: space-between; align-items: center; }
.guest-label p { font-weight: 600; font-size: 0.9rem; margin-bottom: 0; }
.guest-label span { font-size: 0.8rem; color: #888; }

.h-counter-btn {
    width: 28px; height: 28px; border-radius: 50%; border: 1px solid #ddd;
    background: white; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.h-counter-btn:hover { border-color: black; }
.h-count-value { font-weight: 600; width: 20px; text-align: center; font-size: 0.9rem; }

.divider { color: #ddd; height: 20px; border-left: 1px solid #ddd; }
.search-icon-btn {
    background: var(--brand-orange); 
    border: none; width: 35px; height: 35px;
    border-radius: 50%; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s;
}
.search-icon-btn:hover { transform: scale(1.05); background: var(--brand-teal); } 

/* =========================================
   ESTILOS CALENDARIO FLATPICKR CUSTOM
========================================= */
.flatpickr-calendar {
    border-radius: 24px !important;
    border: 1px solid #f1f5f9 !important;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15) !important;
    padding: 10px !important;
    font-family: 'Inter', sans-serif !important;
    margin-top: 25px !important; 
}
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange, .flatpickr-day.selected.inRange, .flatpickr-day.startRange.inRange, .flatpickr-day.endRange.inRange, .flatpickr-day.selected:focus, .flatpickr-day.startRange:focus, .flatpickr-day.endRange:focus, .flatpickr-day.selected:hover, .flatpickr-day.startRange:hover, .flatpickr-day.endRange:hover, .flatpickr-day.selected.prevMonthDay, .flatpickr-day.startRange.prevMonthDay, .flatpickr-day.endRange.prevMonthDay, .flatpickr-day.selected.nextMonthDay, .flatpickr-day.startRange.nextMonthDay, .flatpickr-day.endRange.nextMonthDay {
    background: var(--brand-teal) !important;
    border-color: var(--brand-teal) !important;
}
.flatpickr-day.inRange, .flatpickr-day.prevMonthDay.inRange, .flatpickr-day.nextMonthDay.inRange, .flatpickr-day.today.inRange, .flatpickr-day.prevMonthDay.today.inRange, .flatpickr-day.nextMonthDay.today.inRange, .flatpickr-day:hover, .flatpickr-day.prevMonthDay:hover, .flatpickr-day.nextMonthDay:hover, .flatpickr-day:focus, .flatpickr-day.prevMonthDay:focus, .flatpickr-day.nextMonthDay:focus {
    background: #f0fdfa !important; 
    border-color: #f0fdfa !important;
}
.flatpickr-months .flatpickr-month {
    background: transparent !important;
    color: var(--text-dark) !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months {
    font-weight: 800 !important;
}
.flatpickr-weekday {
    color: var(--text-grey) !important;
    font-weight: 700 !important;
}

/* Layout y Grid */
.search-layout { display: grid; grid-template-columns: 280px 1fr; gap: 40px; max-width: 1400px; margin: 0 auto; padding: 40px 5%; min-height: 100vh; }
.filters-sidebar { position: sticky; top: 120px; height: fit-content; padding-right: 20px; }
.filters-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.reset-btn { background: none; border: none; text-decoration: underline; cursor: pointer; color: var(--text-grey); }
.filter-block { border-top: 1px solid #eee; padding: 20px 0; }
.filter-block h4 { margin-bottom: 15px; font-weight: 600; }
.price-display { color: var(--text-dark); font-weight: 600; font-size: 1.1rem; margin-bottom: 15px;}
.price-display span { color: var(--brand-orange); }

/* Custom Slider */
.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: #e2e8f0;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--brand-teal); 
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.checkbox-row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; cursor: pointer; font-size: 0.95rem; color: #444; }
.checkbox-row input { accent-color: var(--brand-teal); transform: scale(1.2); }

.results-header { margin-bottom: 30px; display: flex; justify-content: space-between; align-items: center;} 
.results-header h1 { font-size: 1.8rem; color: var(--text-dark); margin: 0;}
.result-count { color: var(--text-grey); font-weight: 500;}

.properties-grid-search { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 30px; }

/* POST CARD DINÁMICO */
.post-card {
    background: white; border: 1px solid #e2e8f0; border-radius: 16px; padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03); transition: 0.3s; cursor: pointer;
    display: flex; flex-direction: column;
}
.post-card:hover { box-shadow: 0 15px 30px rgba(0,0,0,0.08); transform: translateY(-5px); border-color: rgba(30, 132, 88, 0.3);} 

.img-box {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 15px;
}
.img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.post-card:hover .img-box img { transform: scale(1.05); }

/* Botón Favoritos en la tarjeta */
.heart-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.2s;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 10;
}

.heart-btn:hover {
    transform: scale(1.1);
    color: var(--brand-magenta); 
}

.card-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 5px;
    display: flex; justify-content: space-between; align-items: center;
}
.rating-pill { font-size: 0.9rem; font-weight: 600; color: var(--text-dark);}
.card-location { color: var(--text-grey); font-size: 0.9rem; margin-bottom: 12px;}
.amenities-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 15px;}
.amenity-pill { background: rgba(30, 132, 88, 0.1); color: var(--brand-teal); padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; }
.pill-orange { background: rgba(227, 105, 42, 0.1); color: var(--brand-orange); }

.card-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #f1f5f9; padding-top: 15px;}
.card-price { font-size: 1.1rem; font-weight: 900; color: var(--text-dark); }
.btn-details {
    background: var(--brand-orange);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}
.btn-details:hover { background: var(--brand-teal); }

@keyframes fadeInDown { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* =========================================
   MODAL (POPUP) STYLES
========================================= */
.property-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);backdrop-filter: blur(5px);
    z-index: 1000; display: none; justify-content: center; align-items: center; padding: 20px;
}
.property-modal-overlay.active { display: flex; animation: fadeIn 0.3s ease; }

.property-modal-content {
    background: white; width: 100%; max-width: 900px; height: 90vh;
    border-radius: 20px; position: relative; overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-close-btn {
    position: absolute; top: 20px; left: 20px;
    background: white; border: none; width: 40px; height: 40px;
    border-radius: 50%; font-size: 1.5rem; cursor: pointer; z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: flex; align-items: center; justify-content: center;
}

.modal-gallery { position: relative; width: 100%; height: 450px; background: #f0f0f0; }
#modalMainImage { width: 100%; height: 100%; object-fit: cover; }

.gallery-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8); border: none;
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
    font-size: 1.2rem; display: flex; align-items: center; justify-content: center; transition: 0.2s;
}
.gallery-nav:hover { background: white; transform: translateY(-50%) scale(1.1); }
.gallery-nav.prev { left: 20px; } .gallery-nav.next { right: 20px; }

.gallery-counter {
    position: absolute; bottom: 20px; right: 20px;
    background: rgba(0,0,0,0.7); color: white;
    padding: 5px 12px; border-radius: 20px; font-size: 0.8rem;
}

.modal-body { padding: 30px; }
.modal-header-info h2 { font-size: 2rem; margin-bottom: 5px; color: var(--text-dark); }
.modal-meta { display: flex; gap: 15px; color: var(--text-grey); font-size: 1rem; margin-bottom: 15px; }
.modal-rating { color: black; font-weight: 600; }
.modal-price-box { margin-bottom: 25px; }
.price-tag { font-size: 1.8rem; font-weight: 800; color: var(--brand-teal); }
.price-tag small { font-size: 1rem; font-weight: 500; color: var(--text-grey); }

.modal-divider { border: 0; border-top: 1px solid #eee; margin: 20px 0; }
.modal-description h3 { margin-bottom: 10px; color: var(--text-dark); }
.modal-description p { line-height: 1.6; color: #444; }

.modal-amenities-section {
    display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 30px;
    background: #f8fafc; padding: 20px; border-radius: 12px;
}
.amenity-column h4 { margin-bottom: 15px; color: var(--text-dark); }
.amenity-column ul { list-style: none; padding: 0; }
.amenity-column li { margin-bottom: 8px; font-size: 0.95rem; color: #555; display: flex; align-items: center; gap: 8px; }

.modal-footer {
    position: sticky; bottom: 0; background: white; border-top: 1px solid #eee;
    padding: 20px 30px; display: flex; justify-content: space-between; align-items: center;
}
.total-price-preview p { font-size: 0.8rem; color: #717171; margin-bottom: 2px;}
.total-price-preview span { font-size: 1.5rem; font-weight: 800; color: var(--text-dark);}

.btn-reserve {
    background: var(--brand-orange); 
    color: white; border: none; padding: 14px 40px;
    border-radius: 10px; font-size: 1.1rem; font-weight: 700;
    cursor: pointer; transition: 0.3s;
}
.btn-reserve:hover { 
    background: var(--brand-teal); 
    box-shadow: 0 5px 15px rgba(30, 132, 88, 0.4); 
}

/* =========================================
   --- TARJETAS RECOMENDADAS (TOP 3) ---
========================================= */
.post-card.recommended-card { border: 2px solid rgba(187, 24, 99, 0.4); position: relative; }
.post-card.recommended-card:hover { transform: translateY(-8px) scale(1.02); box-shadow: 0 25px 50px rgba(187, 24, 99, 0.15); border-color: var(--brand-magenta); }
.badge-recommended { position: absolute; top: 15px; left: 15px; background: linear-gradient(135deg, #FFD700, var(--brand-magenta)); color: #020617; padding: 6px 14px; border-radius: 8px; font-size: 0.75rem; font-weight: 900; z-index: 10; box-shadow: 0 4px 15px rgba(187, 24, 99, 0.4); display: flex; align-items: center; gap: 5px; letter-spacing: 0.5px; text-transform: uppercase; animation: fadeIn 0.5s ease; }


/* --- ANIMACIÓN PREMIUM PARA EL MODAL --- */
@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(60px); }
    100% { opacity: 1; transform: translateY(0); }
}

.property-modal-overlay.active .property-modal-content {
    animation: slideUpFade 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.property-modal-content {
    opacity: 0;
}

/* RESPONSIVE MEDIA QUERIES */
@media (max-width: 900px) {
    .search-layout { grid-template-columns: 1fr; padding-top: 120px; }
    .filters-sidebar { position: relative; top: 0; padding: 0; order: -1; border-bottom: 1px solid #eee; padding-bottom: 20px;}
    .results-header { flex-direction: column; align-items: flex-start; gap: 10px;}
    .properties-grid-search { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
    .auth-modal { padding: 25px; }
}

@media (max-width: 768px) {
    .modal-amenities-section { grid-template-columns: 1fr; }
    .modal-gallery { height: 300px; }
    .modal-header-info h2 { font-size: 1.5rem; }
    .compact-search { display: none; } 
}