/* =====================================================
   Immobiliare Style v6
   ===================================================== */
:root {
    --im-red:    #e2001a;
    --im-red-h:  #b8001a;
    --im-blue:   #003580;
    --im-bluebg: #e8f0fa;
    --im-line:   #e0e0e0;
    --im-muted:  #666;
    --im-dark:   #1a1a1a;
    --im-white:  #fff;
    --im-r:      6px;
    --im-sb:     360px;   /* larghezza colonna form */
}

/* ── Sfondo bianco, azzera padding tema ── */
.im-single,
body.single-es_property .site-main,
body.single-es_property .entry-content { background: #fff !important; padding: 0 !important; }

/* ── Nasconde il titolo che Hello Elementor stampa SOPRA il contenuto ── */
body.single-es_property .entry-title,
body.single-es_property h1.entry-title,
body.single-es_property .page-title { display: none !important; }

/* ════════════════════════════════════════
   LAYOUT PRINCIPALE: 2 colonne
   ════════════════════════════════════════ */
.im-top {
    display: flex;
    align-items: flex-start;
    width: 100%;
    border-bottom: 1px solid var(--im-line);
}

/* Colonna sinistra */
.im-top__left {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Colonna destra – sticky */
.im-top__right {
    width: var(--im-sb);
    flex: 0 0 var(--im-sb);
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
    background: var(--im-white);
    box-sizing: border-box;
    /* scrollbar sottile */
    scrollbar-width: thin;
    scrollbar-color: var(--im-line) transparent;
}
.im-top__right::-webkit-scrollbar { width: 4px; }
.im-top__right::-webkit-scrollbar-thumb { background: var(--im-line); border-radius: 2px; }

@media (max-width: 960px) {
    .im-top { flex-direction: column; }
    .im-top__right {
        width: 100%;
        position: static;
        max-height: none;
        overflow-y: visible;
        border-top: 1px solid var(--im-line);
    }
}

/* ════════════════════════════════════════
   GALLERIA: foto grande + strip thumb sotto
   ════════════════════════════════════════ */
.im-top__gallery { width: 100%; }

.es-gallery {
    display: flex;
    flex-direction: column;
    background: #111;
    width: 100%;
}

/* ── Foto principale ── */
.es-gallery__image {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    overflow: hidden;
    flex-shrink: 0;
}
/* tutti i figli diretti si sovrappongono alla foto */
.es-gallery__image > * {
    position: absolute;
    inset: 0;
}
.es-gallery__image > a { display: block; }
.es-gallery__image-background {
    width: 100%; height: 100%;
    background-size: cover !important;
    background-position: center !important;
    transition: transform .35s ease;
}
.es-gallery__image:hover .es-gallery__image-background { transform: scale(1.02); }

/* Contatore foto */
.es-gallery__foto-count {
    position: absolute !important;
    inset: auto !important;
    bottom: 10px; right: 10px;
    background: rgba(0,0,0,.58); color: #fff;
    font-size: 13px; font-weight: 600;
    padding: 5px 12px; border-radius: 20px;
    display: flex; align-items: center; gap: 5px;
    z-index: 4; pointer-events: none;
    width: auto; height: auto;
}

/* Badge etichette */
.es-gallery .es-badges {
    position: absolute !important; inset: auto !important;
    top: 10px; left: 10px; z-index: 5;
    list-style: none; margin: 0; padding: 0;
    display: flex; gap: 5px; flex-wrap: wrap;
    width: auto; height: auto;
}
.es-gallery .es-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 4px 9px; border-radius: 3px; }
.es-gallery .es-badge a { color: inherit; text-decoration: none; }

/* Controlli (salva/condividi) */
.es-gallery .es-control-wrap,
.es-gallery .es-property__control {
    position: absolute !important; inset: auto !important;
    top: 10px; right: 10px; z-index: 5;
    display: flex; gap: 6px;
    width: auto; height: auto;
}

/* ── Strip thumbnail ── */
.es-gallery__thumbs {
    display: flex;
    height: 80px;
    gap: 3px;
    background: #111;
    flex-shrink: 0;
    overflow: hidden;
}
.es-gallery__thumb {
    flex: 1 1 0;
    min-width: 0;
    position: relative;
    overflow: hidden;
    background: #333;
    cursor: pointer;
}
.es-gallery__thumb--empty { cursor: default; background: #222; }
.es-gallery__thumb > a { display: block; width: 100%; height: 100%; }
.es-gallery__thumb-inner {
    width: 100%; height: 100%;
    background-size: cover !important;
    background-position: center !important;
    transition: transform .28s ease;
}
.es-gallery__thumb:hover .es-gallery__thumb-inner { transform: scale(1.08); }
/* Overlay "+N" */
.es-gallery__thumb-count {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.52); color: #fff;
    font-size: 20px; font-weight: 700; z-index: 2; pointer-events: none;
}

/* ════════════════════════════════════════
   INFO ANNUNCIO (sotto galleria, col. sx)
   ════════════════════════════════════════ */
.im-top__info {
    padding: 18px 20px 20px;
    border-top: 1px solid var(--im-line);
}

/* Terms */
.es-listing__terms { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.es-listing__terms li a {
    display: inline-block; background: var(--im-bluebg); color: var(--im-blue);
    font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px;
    text-decoration: none; text-transform: uppercase; letter-spacing: .4px;
}
.es-listing__terms li a:hover { background: var(--im-blue); color: #fff; }

/* Titolo */
.im-title { font-size: 22px; font-weight: 700; color: var(--im-dark); margin: 4px 0 6px; line-height: 1.3; }

/* Indirizzo */
.im-address { font-size: 14px; color: var(--im-muted); margin: 0 0 12px; }
.im-address::before { content: "📍 "; }

/* Meta */
.es-listing__meta { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 14px; }
.es-listing__meta > div { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--im-dark); }
.es-listing__meta > div svg,
.es-listing__meta > div .es-meta-icon { width: 17px; height: 17px; opacity: .55; flex-shrink: 0; }
.es-listing__meta > div b { font-weight: 600; }

/* Prezzo + price_note */
.im-price-block {
    display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
    padding-top: 12px; border-top: 1px solid var(--im-line);
}
.im-price-block .es-price,
.im-price-block .es-property__price { font-size: 26px; font-weight: 800; color: var(--im-red); }
.im-price-note {
    font-size: 13px; color: var(--im-muted);
    background: #f5f5f5; padding: 3px 10px; border-radius: 20px;
    white-space: nowrap;
}

/* ════════════════════════════════════════
   FORM BOX (colonna destra)
   ════════════════════════════════════════ */
.im-form-box {
    margin: 16px;
    border: 1px solid var(--im-line);
    border-radius: var(--im-r);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
}
.im-form-box__title {
    background: var(--im-dark); color: #fff;
    font-size: 13px; font-weight: 700; letter-spacing: .6px;
    text-transform: uppercase; margin: 0;
    padding: 12px 16px;
}
.im-form-box__body { padding: 0; }

/* Form spostato via JS */
.im-form-box #request_form {
    margin: 0 !important;
    padding: 16px !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: transparent !important;
}
.im-form-box .es-property-section__title { display: none !important; }
.im-form-box .es-property-section__content { padding: 0 !important; }

/* Tutti i campi del form */
.im-top__right input[type="text"],
.im-top__right input[type="email"],
.im-top__right input[type="tel"],
.im-top__right input[type="url"],
.im-top__right textarea,
.im-top__right select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--im-line);
    border-radius: 4px;
    padding: 9px 11px;
    font-size: 14px;
    color: var(--im-dark);
    background: var(--im-white);
    font-family: inherit;
    transition: border-color .15s;
    margin-bottom: 8px;
    display: block;
    /* impedisce overflow orizzontale */
    max-width: 100%;
    min-width: 0;
}
.im-top__right input:focus,
.im-top__right textarea:focus { outline: none; border-color: var(--im-blue); }
.im-top__right textarea { resize: vertical; min-height: 80px; }
.im-top__right label { font-size: 13px; color: var(--im-muted); display: block; margin-bottom: 3px; }

/* Submit */
.im-top__right input[type="submit"],
.im-top__right button[type="submit"] {
    width: 100% !important; box-sizing: border-box !important;
    background: var(--im-red) !important; color: #fff !important;
    border: none !important; border-radius: var(--im-r) !important;
    padding: 13px 16px !important; font-size: 15px !important;
    font-weight: 700 !important; cursor: pointer !important;
    font-family: inherit !important; display: block !important;
    text-align: center !important; transition: background .15s !important;
    margin-top: 6px !important;
}
.im-top__right input[type="submit"]:hover,
.im-top__right button[type="submit"]:hover { background: var(--im-red-h) !important; }

/* Testo disclaimer */
.im-top__right .es-terms,
.im-top__right .es-request-form__disclaimer { font-size: 11px; color: var(--im-muted); margin-top: 8px; line-height: 1.4; }

/* ════════════════════════════════════════
   SEZIONI (descrizione, mappa, ecc.)
   ════════════════════════════════════════ */
.im-body { max-width: 860px; margin: 0 auto; padding: 0 20px 60px; }

/* Nav prev/next */
.es-properties-navbar {
    display: flex; justify-content: space-between;
    padding: 12px 0; border-bottom: 1px solid var(--im-line); font-size: 13px;
}
.es-properties-navbar a { color: var(--im-blue); text-decoration: none; font-weight: 600; }
.es-properties-navbar a:hover { text-decoration: underline; }

/* Sezione generica */
.im-sections .es-property-section { padding: 24px 0; border-bottom: 1px solid var(--im-line); }
.im-sections .es-property-section__title {
    font-size: 17px; font-weight: 700; color: var(--im-dark);
    margin: 0 0 14px; padding-bottom: 8px;
    border-bottom: 2px solid var(--im-red); display: inline-block;
}
.im-sections .es-property-section p { font-size: 15px; line-height: 1.75; color: #333; }

/* Form nella posizione originale: nascosto, JS lo sposta */
.im-sections #request_form { display: none !important; }

/* Tabella */
.es-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.es-table th { background: #f6f6f6; color: var(--im-muted); font-weight: 600; text-align: left; padding: 9px 13px; border: 1px solid var(--im-line); }
.es-table td { padding: 9px 13px; border: 1px solid var(--im-line); color: var(--im-dark); }
.es-table tr:nth-child(even) td { background: #fafafa; }

/* Mappa */
.im-sections .es-map-wrap,
.im-sections .es-map { border-radius: var(--im-r); overflow: hidden; min-height: 280px; }

/* utility */
.es-hidden { display: none !important; }


.im-form-box #request_form {
    padding: 16px !important;
    box-sizing: border-box;
}

.im-top__right .es-terms,
.im-top__right p { 
    word-break: break-word;
    overflow-wrap: break-word;
	border-left: none;
}

:root {
    --im-sb: 400px;
}

.single-properties .elementor-heading-title,
.single-properties h1.entry-title,
.single-properties .entry-header { 
    display: none !important; 
}

.single-properties .im-body { max-width: 100%; padding: 0 20px 60px; }

.single-properties .page-content{
	margin-top: 50px;
}

.single-properties .im-form-box {
	margin-top:0px;
}

.single-properties .entry-content .es-btn, .single-properties  .es-btn, .single-properties  .widget .es-btn, .single-properties  button.es-btn, .single-properties  input.es-btn {
    line-height: inherit;
    height: auto;
}

.single-properties .es-request-form{
	padding-top: 0px;
}