/*
 Theme Name:   Liberate custom views
 Theme URI:    http://wpastra.com/child-theme-creator/
 Description:  Vista customizada para editar y mostrar el contenido de los PODs sin limitaciones.
 Author:       Alfonso Rubio de Diego
 Author URI:   http://www.numantiasolutions.com
 Template:     astra
 Version:      1.0.0
 Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
 Text Domain:  liberate_custom_view
*/

/* ============================================
   BASE LAYOUT
   ============================================ */
/* Prevent horizontal scroll on mobile */
body,
html {
    overflow-x: hidden;
}

.property-container {
    padding: 0 20px;
    max-width: 100%;
    box-sizing: border-box;
}

/* ============================================
   HEADER SECTION
   ============================================ */
.property-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 10px 20px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    align-items: end;
}

.property-title {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
}

.property-price {
    grid-column: 3;
    grid-row: 1;
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
}

/* Badges */
.badge {
    padding: 0 6px;
    text-transform: uppercase;
    font-size: 0.6rem;
    font-weight: bold;
    border-radius: 3px;
    display: inline-block;
    justify-self: start;
}

.badge-location {
    grid-column: 1;
    grid-row: 1;
    background: #0073aa;
    color: white;
}

.badges-operative {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    gap: 5px;
    justify-self: end;
}

.badge-venta {
    background: #28a745;
    color: white;
}

.badge-alquiler {
    background: #007bff;
    color: white;
}

/* ============================================
   MAIN GRID
   ============================================ */
.property-grid,
.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.property-grid {
    grid-template-columns: 60% 40%;
}

.details-grid {
    margin-top: 20px;
}

/* ============================================
   GALLERY SECTION
   ============================================ */
.featured-image img,
.main-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.featured-image img:hover,
.main-image:hover {
    opacity: 0.9;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.gallery-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.gallery-thumb:hover {
    transform: scale(1.05);
    opacity: 0.8;
}

/* ============================================
   INFO BOX (Reusable Component)
   ============================================ */
.info-box {
    margin-bottom: 20px;
}

.section-title {
    margin: 0 0 10px;
}

.section-title+hr {
    margin: 0 0 15px;
    border: none;
    border-top: 1px solid #eee;
}

/* ============================================
   FEATURES SECTION
   ============================================ */
.features-grid {
    display: flex;
    gap: 30px;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.features-list li {
    margin-bottom: 8px;
}

/* ============================================
   TAGS LIST (Extras)
   ============================================ */
.tags-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tags-list li {
    background: #eef;
    color: #335;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
}

/* ============================================
   PROPERTY INFO (Right Column)
   ============================================ */
.property-info {
    border-radius: 8px;
    margin-bottom: 20px;
}

/* ============================================
   MAP
   ============================================ */
.map-container {
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.google-maps {
    width: 100%;
    height: 300px;
    border: none;
    border-radius: 8px;
}

/* ============================================
   CTA BUTTON
   ============================================ */
.cta-box {
    margin: 20px 0;
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    overflow-x: hidden;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.modal-prev,
.modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 16px;
    color: white;
    font-size: 20px;
    font-weight: bold;
    background-color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    user-select: none;
}

.modal-prev {
    left: 0;
    border-radius: 0 3px 3px 0;
}

.modal-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.modal-thumbs {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    max-width: 80%;
    overflow-x: auto;
    padding-bottom: 10px;
}

.modal-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.modal-thumb.active {
    border-color: white;
}

/* Hide scrollbar */
.modal-thumbs::-webkit-scrollbar {
    display: none;
}

.modal-thumbs {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {

    .property-grid,
    .details-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        flex-direction: column;
        gap: 15px;
    }

    .property-header {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
    }

    .badge-location {
        grid-column: 1;
        justify-self: start;
    }

    .badges-operative {
        grid-column: 2;
        justify-self: end;
    }

    .property-price {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .google-maps {
        height: 250px;
    }
}

/**
*****************************************************************
* Estilos de archive-property.php para los no encontrados
*****************************************************************
* Este es el que generará el listado de propiedades disponibles para 
* que el usuario pueda seleccionarlas.
*****************************************************************
**/
.no-results-inmuebles {
    width: 100%;
    text-align: center;
    padding: 60px 20px;
    border-radius: 8px;
    border: 1px dashed #ccc;
    margin: 20px 0;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.no-results-inmuebles h2 {
    color: #333;
    margin-bottom: 15px;
}

.sugerencias-busqueda {
    text-align: left;
    margin: 20px auto;
    color: #666;
}

.archive-inmuebles-action-area {
    margin-top: 50px;
}