/*
Theme Name: Houzez Child
Theme URI: http://www.favethemes.com/
Author: Favethemes
Author URI: http://www.favethemes.com/
Description: Houzez Child Theme for NuovaVita Immobilien. Contains customized template overrides (date format fixes) and German translations.
Version: 1.4
Template: houzez
Tags: white, right-sidebar, left-sidebar, custom-colors, custom-menu, featured-images, post-formats, theme-options, translation-ready
License: GNU General Public License version 3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Text Domain: houzez
*/

/* Custom CSS for NuovaVita goes below
-------------------------------------- */

/* ===== Property Gallery V7 Fix ===== */

/* Ensure grid items stretch their children to full height */
.hs-gallery-v5-grid-item-01,
.hs-gallery-v5-grid-item-02 {
    min-height: 0; /* Required for CSS Grid to properly constrain children */
}

.hs-gallery-v5-grid-item-01 .property-banner-item,
.hs-gallery-v5-grid-item-02 .property-banner-item {
    height: 100%;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.hs-gallery-v5-grid-item-01 .property-banner-item a,
.hs-gallery-v5-grid-item-02 .property-banner-item a {
    display: block;
    height: 100%;
    width: 100%;
}

/* Ensure first grid item image fills entire cell with cover */
.hs-gallery-v5-grid-item-01 .property-banner-item a img.img-fluid {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Mobile: featured image proper display */
.property-detail-v7 .property-banner > .d-block.d-md-none {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.property-detail-v7 .property-banner > .d-block.d-md-none .property-featured-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Lightbox modal images */
.property-lightbox .lightbox-gallery .lightbox-slider .img-fluid {
    max-height: 80vh;
    object-fit: contain;
}

/* ===== Privacy: Hide Address & Map on Property Detail Pages ===== */

/* Hide the map section entirely on detail pages */
.property-address-wrap .block-map-wrap,
.property-address-wrap #houzez-single-listing-map,
.fw-property-address-wrap .block-map-wrap,
.fw-property-address-wrap #houzez-single-listing-map,
#houzez-single-listing-map,
#houzez-overview-listing-map,
.map-wrap {
    display: none !important;
}

/* Hide the "Address:" line in detail page address data (shows street) */
.property-address-wrap li:has(#address-label),
.fw-property-address-wrap li:has(#address-label) {
    display: none !important;
}

/* Fallback for browsers without :has() support - hide by matching strong#address-label parent */
#address-label {
    display: none !important;
}
#address-label + span {
    display: none !important;
}

/* Hide "Open on Google Maps" button on detail pages */
.property-address-wrap .hz-btn-map,
.fw-property-address-wrap .hz-btn-map {
    display: none !important;
}

/* Hide map tab in property media/banner navigation */
.map-media-tab,
#pills-map-tab,
#pills-map {
    display: none !important;
}

/* Hide map in property address tab view */
#property-address .block-map-wrap,
#property-address #houzez-single-listing-map {
    display: none !important;
}

/* ============================================================
   MOBILE & RESPONSIVE OPTIMIZATIONS
   Added: 2026-02-09
   ============================================================ */

/* --- Global: Prevent horizontal overflow on mobile --- */
html, body {
    overflow-x: hidden;
}

/* ===== MOBILE (max-width: 767px) ===== */
@media (max-width: 767px) {

    /* --- Header / Navigation --- */

    /* Header: allow logo to be visible, prevent clipping */
    #masthead {
        overflow: visible !important;
    }
    #masthead .elementor,
    #masthead .e-con,
    #masthead .e-con-inner {
        overflow: visible !important;
    }

    /* Fix mobile header: reset Elementor negative margin on logo widget-container
       Elementor post-18543.css sets margin: 0em 0em 0em -3em on element 591f2a6.
       We use margin shorthand + !important to fully override. */
    #masthead .elementor-element-591f2a6 > .elementor-widget-container,
    #masthead .elementor-widget-houzez_site_logo > .elementor-widget-container,
    #masthead .elementor-widget-image > .elementor-widget-container {
        margin: 0 !important;
        padding-left: 10px !important;
    }

    /* Logo widget: ensure proper positioning */
    #masthead .elementor-widget-houzez_site_logo,
    #masthead .elementor-widget-image {
        margin-left: 0 !important;
    }

    /* Logo image: constrain size */
    #masthead .elementor-widget-houzez_site_logo img,
    #masthead .favethemes-site-logo img,
    #masthead .elementor-widget-image img {
        max-height: 44px !important;
        max-width: 160px !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain;
    }

    /* Navigation container: remove -8em top margin that pushes nav out of view */
    #masthead .elementor-widget-navigation-menu {
        margin-top: 0 !important;
    }

    /* --- Mobile Navigation Dropdown: proper visibility --- */
    #masthead nav,
    #masthead .elementor-nav-menu--dropdown,
    #masthead .elementor-nav-menu__container {
        background: #004274 !important;
        z-index: 99990 !important;
        position: relative;
    }

    #masthead .elementor-nav-menu--dropdown li a,
    #masthead .elementor-nav-menu__container li a,
    #masthead nav ul li a {
        color: #fff !important;
        padding: 12px 20px !important;
        font-size: 16px !important;
        display: block !important;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    #masthead .elementor-nav-menu--dropdown li a:hover,
    #masthead .elementor-nav-menu__container li a:hover,
    #masthead nav ul li a:hover {
        background: rgba(255,255,255,0.1) !important;
    }

    /* Mobile header grid: stack vertically, centered */
    #masthead .e-con[data-settings*="hidden-desktop"] .e-con.e-con-inner {
        display: flex !important;
        flex-direction: column !important;
        align-items: center;
        gap: 8px;
        padding: 10px 16px !important;
    }

    /* Mobile header: hamburger toggle styling */
    #masthead .elementor-menu-toggle {
        margin: 0 auto;
    }

    /* Mobile header phone number: full width, centered */
    #masthead .elementor-widget-icon-list {
        width: 100%;
        text-align: center;
    }

    /* --- Property Detail Pages --- */

    /* Property featured image on mobile */
    .property-banner > .d-block.d-md-none {
        position: relative;
        aspect-ratio: 4/3;
        overflow: hidden;
    }

    .property-banner > .d-block.d-md-none .property-featured-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

    /* Image count badge on mobile */
    .property-image-count {
        position: absolute;
        bottom: 12px;
        left: 12px;
        background: rgba(0, 0, 0, 0.65);
        color: #fff;
        padding: 4px 10px;
        border-radius: 4px;
        font-size: 13px;
        z-index: 5;
    }

    /* Property title + price: stack vertically on mobile */
    .property-header-wrap {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .property-header-wrap .property-title-wrap {
        width: 100%;
    }

    .property-header-wrap .property-title-wrap .page-title {
        margin-right: 0 !important;
    }

    .property-header-wrap .property-title-wrap .page-title h1 {
        font-size: 22px !important;
        line-height: 1.3;
    }

    .property-header-wrap .property-price-wrap {
        text-align: left !important;
        width: 100%;
    }

    .property-price-wrap .item-price .price {
        font-size: 24px !important;
        font-weight: 700;
    }

    /* Property address on mobile */
    .item-address {
        font-size: 14px;
        word-break: break-word;
    }

    /* Property labels */
    .property-labels-wrap {
        flex-wrap: wrap;
    }

    /* Property detail sections - tighter spacing */
    .property-section-wrap .block-wrap {
        padding: 16px !important;
    }

    .property-section-wrap .block-title-wrap {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px;
    }

    .property-section-wrap .block-title-wrap h2 {
        font-size: 18px !important;
    }

    .property-section-wrap .block-title-wrap .small-text {
        font-size: 11px;
    }

    /* Property detail data list */
    .detail-wrap .detail-item {
        padding: 8px 0;
    }

    /* Property tools (favorite, share, print) - stack nicely */
    .property-item-tools {
        gap: 8px !important;
    }

    .property-item-tools .item-tool {
        min-width: 36px;
    }

    /* Property overview list */
    .property-overview-data .hz-overview-list {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px;
    }

    /* Property features list */
    .property-features-wrap .property-features-list {
        columns: 1 !important;
    }

    /* --- Navigation on Property Pages --- */
    .property-navigation-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .property-navigation-wrap .container {
        padding: 0 8px;
    }

    .property-navigation-wrap .nav-link {
        white-space: nowrap;
        font-size: 13px !important;
        padding: 10px 12px !important;
    }

    /* --- Agent / Contact Widget (Sidebar on desktop, below content on mobile) --- */
    .agent-module {
        margin-top: 20px;
    }

    .agent-module .agents-grid {
        grid-template-columns: 1fr !important;
    }

    /* Agent contact form */
    .houzez-agent-form textarea,
    .houzez-agent-form input[type="text"],
    .houzez-agent-form input[type="email"],
    .houzez-agent-form input[type="tel"] {
        font-size: 16px !important; /* Prevents iOS zoom on input focus */
    }

    /* --- Homepage / Listing Grid --- */

    /* Houzez grid builder cards */
    .grid-item {
        margin-bottom: 16px;
    }

    .grid-item .item-body {
        padding: 12px !important;
    }

    .grid-item .item-title h2,
    .grid-item .item-title a {
        font-size: 16px !important;
        line-height: 1.3;
    }

    .grid-item .item-address {
        font-size: 13px;
    }

    .grid-item .item-price .listing-price {
        font-size: 18px !important;
    }

    /* Property card V3 */
    .property-card-v3 .item-body {
        padding: 12px !important;
    }

    /* Houzez section titles */
    .hz-section-title h2 {
        font-size: 22px !important;
        line-height: 1.3;
    }

    .hz-section-title .hz-section-subtitle {
        font-size: 14px !important;
    }

    /* --- Cross-Links Partner Boxes --- */

    /* The cross-links use inline styles, so we need !important */
    div[style*="border-left:4px solid #C8A951"],
    div[style*="border-left: 4px solid #C8A951"] {
        padding: 15px 16px !important;
        margin: 20px 0 !important;
    }

    div[style*="border-left:4px solid #C8A951"] h3,
    div[style*="border-left: 4px solid #C8A951"] h3 {
        font-size: 17px !important;
        line-height: 1.3;
    }

    div[style*="border-left:4px solid #C8A951"] p,
    div[style*="border-left: 4px solid #C8A951"] p {
        font-size: 14px !important;
        line-height: 1.5;
    }

    /* --- WhatsApp Button: move to RIGHT side on mobile (chatbot stays left) --- */
    #nv-whatsapp-btn {
        left: auto !important;
        right: 16px !important;
        bottom: 24px !important;
        width: 45px !important;
        height: 45px !important;
        z-index: 99999 !important;
    }

    /* Property detail pages: 71px contact bar + scroll-up button clearance */
    .single-property #nv-whatsapp-btn {
        bottom: 145px !important;
    }

    /* Move WhatsApp button up when cookie banner is visible */
    .cmplz-cookiebanner:not(.cmplz-hidden) ~ #nv-whatsapp-btn,
    body.cmplz-show-banner #nv-whatsapp-btn {
        bottom: 80px !important;
    }
    body.cmplz-show-banner.single-property #nv-whatsapp-btn {
        bottom: 205px !important;
    }

    /* --- Chatbot Button: ensure it doesn't overlap body text --- */
    #nv-cb-bubble {
        bottom: 20px !important;
        left: 16px !important;
        width: 48px !important;
        height: 48px !important;
    }

    /* Property detail pages: above 71px contact bar */
    .single-property #nv-cb-bubble {
        bottom: 85px !important;
    }

    #nv-cb-tooltip {
        bottom: 34px !important;
        left: 72px !important;
    }

    .single-property #nv-cb-tooltip {
        bottom: 145px !important;
    }

    /* Property detail pages: scroll-up button above contact bar */
    .single-property .btn-back-to-top {
        position: fixed !important;
        bottom: 85px !important;
        right: 16px !important;
        z-index: 99998 !important;
    }

    /* Property detail pages: body padding for contact bar */
    .single-property {
        padding-bottom: 75px;
    }

    /* --- Footer --- */

    /* Footer: force single column on mobile */
    footer .e-con.e-con-inner[data-settings] {
        grid-template-columns: 1fr !important;
    }

    /* Footer logo: reset broken -35% left margin */
    footer .elementor-widget-image {
        margin-left: 0 !important;
    }

    footer .elementor-widget-image img {
        max-width: 200px;
        margin: 0 auto !important;
    }

    /* Footer text: center on mobile */
    footer .elementor-widget-text-editor {
        text-align: center;
    }

    /* Footer headings: center on mobile */
    footer .elementor-widget-heading .elementor-heading-title {
        text-align: center;
    }

    /* Footer icon lists: center on mobile */
    footer .elementor-widget-icon-list .elementor-icon-list-items {
        justify-content: center;
    }

    /* Footer icon boxes - stack vertically */
    footer .elementor-icon-box-wrapper {
        flex-direction: column !important;
        text-align: center;
    }

    footer .elementor-icon-box-wrapper .elementor-icon-box-icon {
        margin-bottom: 8px;
    }

    footer .elementor-icon-box-content {
        text-align: center;
    }

    footer .elementor-icon-box-content .elementor-icon-box-title {
        font-size: 15px !important;
    }

    footer .elementor-icon-box-content .elementor-icon-box-description {
        font-size: 13px !important;
        word-break: break-word;
    }

    /* Footer copyright bar */
    footer .elementor-icon-list--layout-inline .elementor-icon-list-items {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }

    footer .elementor-icon-list--layout-inline .elementor-icon-list-text {
        font-size: 13px;
    }

    /* Footer spacing */
    footer .e-con > .e-con-inner {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* Footer top margin: reduce on mobile (was 5em from Elementor) */
    footer > .e-con:first-child {
        margin-top: 2em !important;
    }

    /* --- Elementor General Mobile Fixes --- */

    /* Prevent Elementor sections from overflowing */
    .elementor-section,
    .elementor-container,
    .e-con,
    .e-con-inner {
        max-width: 100vw;
    }

    /* Elementor columns spacing on mobile */
    .elementor-column {
        margin-bottom: 16px;
    }

    /* Elementor headings */
    .elementor-widget-heading .elementor-heading-title {
        word-break: break-word;
    }

    /* Elementor text editor widget */
    .elementor-widget-text-editor {
        word-break: break-word;
    }

    /* --- Breadcrumb --- */
    .breadcrumb-wrap .breadcrumb {
        font-size: 12px;
        flex-wrap: wrap;
    }

    /* --- Forms (General) --- */

    /* Prevent iOS auto-zoom on input focus (font-size must be >= 16px) */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Houzez search form on mobile */
    .houzez-search-form .form-group {
        margin-bottom: 8px;
    }

    /* --- Immobilienangebote / Property Listing Page --- */

    /* Filter/sort bar */
    .listing-filter-wrap {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Property cards on listing pages */
    .item-wrap {
        margin-bottom: 16px;
    }

    /* --- Cookie Banner spacing --- */
    .cmplz-cookiebanner {
        max-width: 100vw !important;
        font-size: 13px !important;
    }

    .cmplz-cookiebanner .cmplz-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .cmplz-cookiebanner .cmplz-btn {
        width: 100%;
        text-align: center;
    }

    /* --- Houzez Property Carousel --- */
    .houzez-properties-carousel .item-wrap {
        width: 280px !important;
    }

    /* --- Tables on mobile --- */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    /* --- Images --- */
    img {
        max-width: 100%;
        height: auto;
    }

    /* --- Houzez Inquiry Form (Sidebar) --- */
    .houzez_elementor_inquiry_form .elementor-button {
        width: 100%;
    }

    /* --- Property Carousel V2 --- */
    .houzez-carousel-v2 .property-card-item {
        min-width: 260px;
    }

    /* --- Body bottom padding: space for floating buttons --- */
    body {
        padding-bottom: 70px;
    }
}

/* ===== SMALL MOBILE (max-width: 374px - iPhone SE / small phones) ===== */
@media (max-width: 374px) {

    /* Even tighter spacing for very small screens */
    .property-header-wrap .property-title-wrap .page-title h1 {
        font-size: 19px !important;
    }

    .property-price-wrap .item-price .price {
        font-size: 20px !important;
    }

    /* Cross-links box */
    div[style*="border-left:4px solid #C8A951"] h3,
    div[style*="border-left: 4px solid #C8A951"] h3 {
        font-size: 15px !important;
    }

    /* Smaller font for grid items */
    .grid-item .item-title h2,
    .grid-item .item-title a {
        font-size: 14px !important;
    }

    /* WhatsApp button even smaller on tiny screens */
    #nv-whatsapp-btn {
        width: 40px !important;
        height: 40px !important;
        right: 12px !important;
    }

    /* Immobilienbewertung calculator options */
    .nv-options-grid .nv-option {
        padding: 14px 10px !important;
    }

    .nv-options-grid .nv-option span {
        font-size: 12px !important;
    }
}

/* ===== FIX: Elementor Icon-Box stacked+circle icons oval → rund ===== */
/* Force equal width+height on stacked circle icons so they are perfectly round */
.elementor-view-stacked.elementor-shape-circle .elementor-icon {
    width: 2em;
    height: 2em;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
}

.elementor-view-stacked.elementor-shape-circle .elementor-icon svg {
    width: 1em;
    height: 1em;
}

/* ===== FIX: Elementor Icon-List ohne Icons - Bullet-Marker rund statt oval ===== */
.elementor-icon-list-items {
    list-style: none !important;
}

.elementor-icon-list-item:not(:has(.elementor-icon-list-icon))::before {
    content: "\2022";
    margin-right: 8px;
    font-size: 1.2em;
    line-height: 1;
    color: currentColor;
}

/* ===== TABLET PORTRAIT (max-width: 1024px) ===== */
@media (max-width: 1024px) {

    /* Property overview grid - 2 columns on tablet */
    .property-overview-data .hz-overview-list {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Cross-links - slightly tighter on tablet */
    div[style*="border-left:4px solid #C8A951"],
    div[style*="border-left: 4px solid #C8A951"] {
        padding: 18px 20px !important;
    }
}

/* ===== LANDSCAPE MOBILE (max-width: 880px, orientation: landscape) ===== */
@media (max-width: 880px) and (orientation: landscape) {

    /* Property banner in landscape mode */
    .property-banner > .d-block.d-md-none {
        aspect-ratio: 16/9;
        max-height: 50vh;
    }

    /* Exit intent popup - ensure it's not too tall */
    #nv-exit-popup {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ===== SAFE AREA (iPhone X+ notch / home indicator) ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {

    /* WhatsApp button respects safe area */
    @media (max-width: 767px) {
        #nv-whatsapp-btn {
            bottom: calc(24px + env(safe-area-inset-bottom)) !important;
        }
        .single-property #nv-whatsapp-btn {
            bottom: calc(145px + env(safe-area-inset-bottom)) !important;
        }
        .single-property #nv-cb-bubble {
            bottom: calc(85px + env(safe-area-inset-bottom)) !important;
        }
        .single-property #nv-cb-tooltip {
            bottom: calc(145px + env(safe-area-inset-bottom)) !important;
        }
        .single-property .btn-back-to-top {
            bottom: calc(85px + env(safe-area-inset-bottom)) !important;
        }
    }

    /* Footer respects safe area */
    footer .e-con:last-child {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {

    /* Larger tap targets */
    .property-item-tools .item-tool {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Remove hover effects that cause sticky behavior on touch */
    .grid-item:hover .item-body {
        transform: none;
    }

    /* Disable pulse animation on WhatsApp button (saves battery) */
    #nv-whatsapp-btn {
        animation: none !important;
    }

    /* Property navigation scroll hint */
    .property-navigation-wrap::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to right, transparent, rgba(255,255,255,0.9));
        pointer-events: none;
        z-index: 2;
    }

    .property-navigation-wrap {
        position: relative;
    }
}

/* ===== Objekt-ID auf Property-Seiten ausblenden (interne OnOffice-IDs) ===== */
.detail-wrap .detail-item:has(strong:is([data-label="Objekt-ID"], :lang(de))),
.property-overview-data li:has(strong:is([data-label="Property ID"])) {
    display: none !important;
}
/* Fallback: Objekt-ID Zeile via Text-Match verstecken */
.detail-wrap .detail-item strong {
    /* Marker fuer JS */
}

/* ===== "0 Immobilie" bei Stadtseiten-Karten ausblenden ===== */
/* Houzez city cards: hide property count when zero */
.hz-city-item .hz-city-count:empty,
.houzez-city-module .hz-city-meta:empty {
    display: none !important;
}

/* Fancybox Branding/Infobar ausblenden */
.fancybox__infobar,
.fancybox__footer,
a[href*="fancyapps"] {
    display: none !important;
}

/* Lightbox Logo weiss machen */
.lightbox-logo img {
    filter: brightness(0) invert(1);
}
