/* SLIDER / HERO - Embla carousel per galleria foto */

/* Base Embla (sostituisce swiper-bundle.css per questi caroselli) */
.embla__container {
    display: flex;
}

.embla__slide {
    flex: 0 0 100%;
    min-width: 0;
}

.embla__prev,
.embla__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.annuncio-slider {
    margin-top: calc(var(--header-h, 130px) - var(--slider-top, 130px));
    margin-bottom: 45px;
    transition: margin-top 0.3s ease;
}

.annuncio-slider .annuncio-swiper {
    position: relative;
    overflow: hidden;
    cursor: grab;
}

.annuncio-slider .annuncio-swiper:active {
    cursor: grabbing;
}

.annuncio-slider .annuncio-swiper .embla__slide {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.annuncio-slider .annuncio-swiper .embla__slide.is-selected {
    opacity: 1 !important;
}

.annuncio-slider .annuncio-swiper .embla__slide {
    flex: 0 0 100%;
    max-width: 100%;
    overflow: hidden;
}

.annuncio-slider .annuncio-swiper .embla__slide img {
    height: calc(100vh - var(--header-h, 130px));
    width: 100%;
    object-fit: contain;
    transition: height 0.3s ease;
    display: block;
    margin: 0 auto;
}

/* HERO PEEK (desktop): la slide centrale è larga quanto l'immagine (flex: auto),
   così l'immagine object-fit: contain la riempie tutta (niente barre nere/bianche)
   e le foto precedente/successiva spuntano ai lati riempiendo lo spazio rimasto.
   Su mobile la slide resta al 100% come prima. */
@media only screen and (min-width: 1200px) {
    .annuncio-slider .annuncio-swiper .embla__slide {
        flex: 0 0 auto;
        max-width: 100%;
    }

    .annuncio-slider .annuncio-swiper .embla__slide img {
        width: auto;
        height: calc(100vh - var(--header-h, 130px));
        max-width: 100%;
    }
}

/* Prima immagine del carosello hero: margine negativo di 1px per eliminare
   l'artefatto/bordo sul lato sinistro della prima foto. Solo da tablet in su. */
@media only screen and (min-width: 769px) {
    .annuncio-slider .annuncio-swiper .embla__container .embla__slide:first-child {
        margin-left: -1px;
    }
}

.annuncio-swiper .embla__prev,
.annuncio-swiper .embla__next {
    width: 35px;
    height: 35px;
    border: 1px solid #ffffff;
    border-radius: 99px;
    color: #ffffff;
    background-color: transparent;
}

.annuncio-swiper .embla__prev {
    left: 10px;
}

.annuncio-swiper .embla__next {
    right: 10px;
}

.annuncio-swiper .embla__prev:hover,
.annuncio-swiper .embla__next:hover {
    border: 1px solid #303041;
    background-color: #303041;
}

.annuncio-swiper .embla__prev svg,
.annuncio-swiper .embla__next svg {
    width: 16px;
    height: 16px;
}

/* PLANIMETRIA - Embla slider per planimetrie (multiple foto) */

.planimetria-slider {
    background-color: #ffffff;
}

.planimetria-slider .planimetria-swiper {
    position: relative;
    overflow: hidden;
}

.planimetria-slider .embla__slide,
.planimetria-slider .item {
    display: flex;
    justify-content: center;
    align-items: center;
}

.planimetria-slider .embla__prev,
.planimetria-slider .embla__next {
    color: #262D3F;
    width: 44px;
    height: 44px;
    background: rgba(38, 45, 63, 0.08);
    border-radius: 50%;
    transition: background 0.2s;
}

.planimetria-slider .embla__prev {
    left: 20px;
}

.planimetria-slider .embla__next {
    right: 20px;
}

.planimetria-slider .embla__prev:hover,
.planimetria-slider .embla__next:hover {
    background: rgba(38, 45, 63, 0.18);
}

.planimetria-slider .embla__prev svg,
.planimetria-slider .embla__next svg {
    width: 16px;
    height: 16px;
}

.planimetria-slider .embla__dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 25px;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 10;
}

.planimetria-slider .embla__dot {
    background: #262D3F;
    opacity: 0.35;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: opacity 0.2s;
}

.planimetria-slider .embla__dot.is-selected {
    opacity: 1;
}

.container-iframe-3d {
    position: relative;
    overflow: hidden;
    max-width: 100%;
}

@media (max-width: 768px) {

    .planimetria-slider .embla__prev,
    .planimetria-slider .embla__next {
        width: 36px;
        height: 36px;
    }

    .planimetria-slider .embla__prev {
        left: 5px;
        right: auto;
    }

    .planimetria-slider .embla__next {
        right: 5px;
        left: auto;
    }

    .planimetria-slider .embla__prev svg,
    .planimetria-slider .embla__next svg {
        width: 14px;
        height: 14px;
    }

}

.itemCustom {
    position: relative;
}

/* Bottone telefono rotante sopra l'hero: apre la gallery fullscreen.
   Solo mobile: nascosto da 769px in su. */

.itemCustom .hero-rotate-phone {
    display: none;
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 3;
    width: 42px;
    height: 42px;
    padding: 0;
    margin: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid #ffffff;
    border-radius: 99px;
    background-color: rgba(48, 48, 65, 0.55);
    color: #ffffff;
    cursor: pointer;
    box-shadow: none;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.itemCustom .hero-rotate-phone:hover,
.itemCustom .hero-rotate-phone:focus {
    border-color: #303041;
    background-color: #303041;
    color: #ffffff;
}

.itemCustom .hero-rotate-phone-icon {
    width: 20px;
    height: 20px;
    transform-origin: 50% 50%;
    animation: hero-phone-rotate 2.8s ease-in-out infinite;
}

@keyframes hero-phone-rotate {
    0%,
    20% {
        transform: rotate(0deg);
    }

    40%,
    70% {
        transform: rotate(-90deg);
    }

    90%,
    100% {
        transform: rotate(0deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .itemCustom .hero-rotate-phone-icon {
        animation: none;
    }
}

@media only screen and (max-width: 768px) {
    .itemCustom .hero-rotate-phone {
        display: flex;
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }

    .itemCustom .hero-rotate-phone-icon {
        width: 17px;
        height: 17px;
    }
}

.itemCustom .immo_status {
    position: absolute;
    margin: 0;
    z-index: 2;
}

/* ROW-MOB & SIDEBAR - Layout classes */

.row-mob {
    margin-top: 3px;
}

.order-element-mobile {
    display: flex;
    flex-direction: column;
}

.order-mobile {
    order: 2;
}

/* Sidebar annuncio */
.annuncio-sidebar {
    margin-bottom: 20px;
    padding: 20px !important;
    margin-left: 37px;
    box-shadow: 0 0 5px 5px rgba(0, 0, 0, 0.05);
}

/* ≤980px: rimuovi l'indent a sinistra quando la sidebar va a capo */
@media only screen and (max-width: 980px) {
    .annuncio-sidebar {
        margin-left: 0;
    }
}

.agente-sidebar h1 {
    font-size: 16px;
    margin-bottom: 0;
    margin-top: 10px;
}

.agente-sidebar h4 {
    font-size: 14px;
}

.agente-sidebar .sidebar-contatti {
    display: flex;
    flex-direction: column;
    row-gap: 5px;
    margin-bottom: 5px;
}

.sidebar-contatti a {
    font-size: 12px;
}

.sidebar-cta a {
    font-size: 12px;
}

.agente-sidebar .custom-product-cta {
    font-size: 12px;
    width: 100%;
    padding: 10px 0;
    text-align: center;
    margin-top: 5px;
}

.agente-sidebar .sidebar-cta {
    display: flex;
    flex-direction: column;
}

.agente-sidebar-content img {
    width: 180px;
}

.agente-sidebar-content .not-thumbnail {
    width: 180px;
    height: 180px;
    display: flex;
}

.agente-sidebar-content .not-thumbnail img {
    padding: 20px;
}

.not-thumbnail {
    background-color: #262D3F;
}

.not-thumbnail img {
    object-fit: contain !important;
    padding: 70px;
}

/* ROW-MOB INTERNAL - Elementi dentro row-mob */

.title-annunci-after-desc {
    font-size: 17px;
    text-transform: uppercase;
}

/* I titoli di sezione (PLANIMETRIA, VIRTUAL TOUR, ...) restano sempre in
   maiuscolo e su una riga anche da tradotti; la sottolineatura segue il testo.
   Sostituisce le larghezze fisse in px di .desc-title-* (sotto e nella media query). */
h4.title-annunci-after-desc[class*="desc-title-"] {
    width: -moz-fit-content;
    width: fit-content;
    max-width: 100%;
    white-space: nowrap;
}

.divider-annunci-after-desc {
    border-bottom: 2px solid #ececec;
    margin-bottom: 30px;
}

.section-panel-element {
    display: flex;
    flex-direction: column;
    padding-bottom: 30px;
    width: 100%;
    max-width: 690px;
}

.planimetria-container {
    position: relative;
    overflow: hidden;
}

.planimetria-container .overPlan {
    inset: 0 0 30px;
    width: 100%;
    height: auto;
}

.section-panel-element .panel-element {
    display: grid;
    grid-template-columns: 1.5fr 2fr;
    border-bottom: 1px solid #ececec;
}

.section-panel-element .panel-element p {
    margin: 4.6px 0;
    font-size: 13.86px;
    min-width: 0;
}

.section-panel-element .panel-element .element-desc {
    color: #282828 !important;
    overflow-wrap: break-word;
    word-break: break-word;
}

.section-panel-element .panel-element .element-title {
    color: #666 !important;
}

.desc-title-specifiche {
    border-bottom: 2px solid rgba(0, 0, 0, .1);
    margin-bottom: -2px;
    width: 100px;
    padding-bottom: 8px;
}

.desc-title-costi {
    border-bottom: 2px solid rgba(0, 0, 0, .1);
    margin-bottom: -2px;
    width: 51px;
    padding-bottom: 8px;
}

.desc-title-effi {
    border-bottom: 2px solid rgba(0, 0, 0, .1);
    margin-bottom: -2px;
    width: 217px;
    padding-bottom: 8px;
}

.desc-title-plani {
    border-bottom: 2px solid rgba(0, 0, 0, .1);
    margin-bottom: -2px;
    width: 122px;
    padding-bottom: 8px;
}

.desc-title-virtual {
    border-bottom: 2px solid rgba(0, 0, 0, .1);
    margin-bottom: -2px;
    width: 129px;
    padding-bottom: 8px;
}

.desc-title-video {
    border-bottom: 2px solid rgba(0, 0, 0, .1);
    margin-bottom: -2px;
    width: 87px;
    padding-bottom: 8px;
}

.desc-title-posi {
    border-bottom: 2px solid rgba(0, 0, 0, .1);
    margin-bottom: -2px;
    width: 260px;
    padding-bottom: 8px;
}

.custom-annunci .cta-modal {
    margin-bottom: 28px;
}

.custom-annunci .cta-modal .ctas {
    display: grid;
    grid-template-columns: repeat(4, 168px);
}

.custom-annunci .cta-modal .ctas a {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 14px !important;
    line-height: 26px;
    color: #000000;
}

.custom-annunci .cta-modal .ctas a:hover {
    cursor: pointer;
    border-bottom: 1px solid #2b6481;
    color: #2b6481;
}

.custom-annunci .annuncio-spec {
    display: grid;
    grid-template-columns: repeat(5, auto);
    column-gap: 10px;
    margin-bottom: 76px;
}

.custom-annunci .annuncio-spec p {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    gap: 10px;
}

.custom-annunci .price p {
    font-weight: 600;
    font-size: 21px;
    line-height: 26px;
    margin-bottom: 0;
}

.box-reverse {
    display: flex;
}

.price-only-mobile {
    display: none;
}

.only-mobile-cta {
    display: none;
}

.desc-after-title {
    max-width: 420px;
}

.box-actions .favorite-container-btn {
    display: flex;
    justify-content: center;
    margin: 10px 0;
}

.box-actions .favorite-container-btn .favorite-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 0;
    border: 1px solid #262D3F;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    color: #262D3F;
    transition: box-shadow 0.2s ease-in-out;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    text-align: center;
}

.box-actions .favorite-container-btn .favorite-btn:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.box-actions .favorite-container-btn .favorite-btn .heart-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.custom-product-cta-immo-back {
    cursor: pointer;
}

.share-content-list {
    display: grid;
    grid-template-columns: 1fr;
    padding: 0px 10px;
}

.share-list-object {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-top: 1px solid #d5d5d5;
    font-size: 20px;
    cursor: pointer;
}

.share-list-object i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
    width: 22px;
    margin-right: 0;
}

.custom-annunci .share {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    gap: 10px;
}

.custom-annunci .share:hover {
    cursor: pointer;
}

.openmodal:hover {
    cursor: pointer;
}

.openmodal-gallery {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    color: #303041;
    font-size: 13px;
}

.openmodal-gallery span {
    margin-top: -4px;
}

.hide-for-mobile {
    display: block;
}

@media only screen and (max-width: 1000px) {

    .annuncio-slider .annuncio-swiper .embla__slide img {
        height: 45vh !important;
        object-fit: cover;
    }
}

@media only screen and (orientation: landscape) and (max-width: 1000px) {
    .annuncio-slider .annuncio-swiper .embla__slide {
        flex: 0 0 auto;
        max-width: 100%;
    }

    .annuncio-slider .annuncio-swiper .embla__slide img {
        width: auto;
        height: calc(100vh - var(--header-h, 130px)) !important;
        max-width: 100%;
        object-fit: contain !important;
    }
}

@media only screen and (max-width: 600px) {

    /* .annuncio-slider .annuncio-swiper .embla__slide img {
        height: 60vh !important;
        object-fit: cover;
    } */

    .annuncio-swiper .embla__prev,
    .annuncio-swiper .embla__next {
        width: 30px;
        height: 30px;
    }

    .annuncio-swiper .embla__prev svg,
    .annuncio-swiper .embla__next svg {
        width: 12px;
        height: 12px;
    }

    .itemCustom .immo_status {
        bottom: -40px;
    }

    .row-mob {
        width: 100vw;
        padding-right: 30px;
    }

    .agente-sidebar {
        margin-left: 0;
        margin-right: 30px;
    }

    .order-element-mobile {
        display: flex;
        flex-direction: column;
    }

    .order-mobile {
        order: 2;
    }

    .annuncio-sidebar {
        margin-right: 30px;
    }

    .agente-sidebar-content .not-thumbnail {
        justify-content: center;
        align-items: center;
    }

    .agente-sidebar-content .not-thumbnail img {
        padding: 0px;
        width: 140px;
        height: 50px;
    }

    .title-annunci-after-desc {
        font-size: 15.6px;
    }

    .desc-title-specifiche {
        width: 94px;
    }

    .desc-title-costi {
        width: 50px;
    }

    .desc-title-effi {
        width: 205px;
    }

    .desc-title-plani {
        width: 114px;
    }

    .desc-title-virtual {
        width: 124px;
    }

    .desc-title-video {
        width: 82px;
    }

    .desc-title-posi {
        width: 240px;
    }

    .custom-annunci .annuncio-spec {
        grid-template-columns: 1fr 1fr;
        row-gap: 46px;
        margin-bottom: 30px;
    }

    .custom-annunci .annuncio-spec p {
        padding-left: 34px;
    }

    .custom-annunci .panel .panel-element {
        grid-template-columns: 1fr auto;
    }

    .custom-annunci .panel .panel-element .element-desc {
        line-height: 22px;
    }

    .custom-annunci .panel .panel-element .element-title {
        line-height: 22px;
        margin-bottom: 30px;
    }

    .cta-modal {
        padding-left: 16px;
        padding-right: 16px;
    }

    .custom-annunci .cta-modal .ctas {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        column-gap: 12px;
        row-gap: 20px;
    }

    .custom-annunci .cta-modal .ctas a {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 9px;
        border-radius: 5px;
        box-shadow: 0 0 15px rgb(0 0 0 / 20%);
        flex: 1 1 90px;
        max-width: 130px;
        margin: 0;
    }

    .custom-annunci .cta-modal .ctas:has(> a:nth-of-type(4):last-of-type) {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        column-gap: 16px;
        row-gap: 20px;
        max-width: 260px;
        margin: 0 auto;
    }

    .custom-annunci .cta-modal .ctas:has(> a:nth-of-type(4):last-of-type) a {
        width: auto;
        max-width: none;
        margin: 0;
    }

    .price-only-mobile {
        display: block;
        margin-bottom: 40px;
    }

    .price-only-mobile p {
        font-weight: 600;
        font-size: 21px;
        line-height: 26px;
        margin-bottom: 0;
    }

    .only-mobile-cta {
        display: block !important;
        text-align: center;
    }

    .desc-after-title {
        width: 100%;
    }

    .box-reverse {
        flex-direction: row-reverse;
    }

    .box-reverse img {
        padding-right: 34px;
    }

    .hide-for-mobile {
        display: none !important;
    }

    .custom-annunci .share {
        justify-content: center;
        margin-bottom: 50px;
    }
}

/* ============================================================
   MODALE ANNUNCIO (Planimetria / Virtual Tour / Video HD / Foto)
   Spostato da style.css — dedicato a single-annunci.php
   ============================================================ */

#Planimetria {
    height: 100%;
}

/* Barra bianca di 6px sotto i tab Virtual Tour, Video HD e Foto (stessa altezza),
   esclusa la Planimetria. */
#VirtualTour,
#VideoHD {
    height: 100%;
    background: #fff;
    box-sizing: border-box;
    padding-bottom: 6px;
}

/* Attenzione: il tab ha già box-sizing:border-box + padding-bottom:6px, quindi il
   contenuto è già ridotto a (100% - 6px). Usare height:100% (NON calc(100% - 6px))
   evita di sottrarre 6px due volte, che ingrandirebbe la barra bianca a 12px. */
#VirtualTour iframe,
#VideoHD iframe {
    height: 100%;
}

.annuncio-modal-content header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0px 0px 10px 0px rgb(0 0 0 / 30%);
    background-color: #fff;
    flex-shrink: 0;
}

.annuncio-modal-content {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    z-index: 99;
    display: flex;
    flex-direction: column;
}

.annuncio-modal-content header button {
    margin: 0;
}

.annuncio-modal-content .modal-body {
    background-color: #222222;
    flex: 1;
    min-height: 0;
    position: relative;
}

.annuncio-modal-content .modal-body iframe {
    width: 100%;
    height: 100%;
    display: block;
}

.annuncio-modal-content .modal-body .embla,
.annuncio-modal-content .modal-body .embla__container,
.annuncio-modal-content .modal-body .embla__slide {
    height: 100%;
}

.annuncio-modal-content .close-modal {
    padding: 8px;
    font-size: 25px;
    font-weight: 800;
    margin-right: 50px;
}

.annuncio-modal-content .close-modal:hover {
    cursor: pointer;
}

.annuncio-modal-content .tab {
    display: none;
}

/* GALLERIA FULLSCREEN (click su foto slider) */

.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: #000;
    z-index: 99999;
    flex-direction: column;
}

.gallery-modal.active {
    display: flex;
    overflow: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.gallery-modal.active::-webkit-scrollbar {
    display: none;
}

.gallery-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    /* background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent); */
}

.gallery-modal-counter {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.gallery-close {
    color: #fff;
    font-size: 36px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    user-select: none;
    transition: opacity 0.2s;
}

.gallery-close:hover {
    opacity: 0.7;
}

.gallery-swiper {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gallery-swiper .embla__container {
    align-items: center;
    height: 100%;
}

.gallery-swiper .embla__slide {
    flex: 0 0 auto;
    max-width: 100%;
    min-width: 0;
}

.gallery-slide {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Stessa logica dell'hero: slide larga quanto l'immagine, object-fit: contain
   (tutta visibile, niente barre nere/bianche), foto adiacenti che spuntano ai lati.
   Altezza in percentuale (non 100vh) come il carosello "foto": in landscape mobile
   le unità viewport sull'img non coincidono con l'altezza reale della modale e fanno
   sbordare/clippare male le foto adiacenti (la centrale, centrata, resta comunque ok). */
.gallery-slide img {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

/* Stessa trasparenza/opacità del carosello hero: sfondo scuro #222222 + opacity 0.6
   sulle foto adiacenti, piena opacità e sfondo trasparente su quella selezionata. */
.gallery-swiper .embla__slide {
    background-color: #fff;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.gallery-swiper .embla__slide.is-selected {
    background-color: transparent !important;
    opacity: 1 !important;
}

.gallery-modal .embla__prev,
.gallery-modal .embla__next {
    color: #fff;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 50%;
    transition: background 0.2s;
    top: 50%;
    transform: translateY(-50%);
}

.gallery-modal .embla__next {
    right: 20px;
}

.gallery-modal .embla__prev {
    left: 20px;
}

.gallery-modal .embla__prev:hover,
.gallery-modal .embla__next:hover {
    background: rgba(0, 0, 0, 0.6);
}

.gallery-modal .embla__prev svg,
.gallery-modal .embla__next svg {
    width: 18px;
    height: 18px;
}

/* Le regole "mobile portrait" (sfondo bianco, slide a larghezza piena, immagine
   contenuta) valgono SOLO in verticale. In landscape (orizzontale) la gallery usa
   la stessa logica degli altri caroselli: immagine centrale intera con object-fit
   contain + foto adiacenti che spuntano ai lati. */
@media (max-width: 768px) and (orientation: portrait) {

    .gallery-modal .embla__prev,
    .gallery-modal .embla__next {
        width: 36px;
        height: 36px;
        top: auto;
        bottom: 80px;
        transform: none;
    }

    .gallery-modal .embla__next {
        right: 40%;
    }

    .gallery-modal .embla__prev {
        left: 40%;
    }

    .gallery-modal .embla__prev svg,
    .gallery-modal .embla__next svg {
        width: 14px;
        height: 14px;
    }

    .gallery-close {
        font-size: 30px;
    }

    .gallery-modal-header {
        padding: 10px 16px;
    }

    /* SFONDO BIANCO */
    .gallery-modal {
        background: #fff;
    }

    /* IMMAGINE CONTENUTA E CENTRATA */
    .gallery-slide {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 100% !important;
        width: 100%;
    }

    .gallery-slide img {
        width: auto !important;
        height: auto !important;
        max-width: 100% !important;
        max-height: calc(100vh - 120px) !important;
        object-fit: contain;
    }

    /* NAVIGAZIONE E CONTATORE SU SFONDO BIANCO */
    .gallery-modal-header {
        /* background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), transparent); */
    }

    .gallery-modal-counter,
    .gallery-close {
        color: #000;
    }

    .gallery-modal .embla__prev,
    .gallery-modal .embla__next {
        background: rgba(0, 0, 0, 0.12);
        color: #000;
    }
}

/* FORZATURA ORIZZONTALE — attiva solo quando la gallery viene aperta dall'icona
   telefono e il browser non supporta screen.orientation.lock (es. iOS Safari).
   La modale viene ruotata di 90° in senso orario con le dimensioni del viewport
   invertite: il contenuto si vede diritto girando il telefono in senso antiorario,
   cioè nel verso suggerito dall'animazione dell'icona. */

.gallery-modal.force-landscape {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: 100vh;
    height: 100vw;
    transform-origin: center center;
    transform: translate(-50%, -50%) rotate(90deg);
    background: #000;
}

@supports (width: 100dvh) {
    .gallery-modal.force-landscape {
        width: 100dvh;
        height: 100dvw;
    }
}

/* Nel frame ruotato il device è ancora "portrait" per le media query, quindi le
   regole mobile-portrait qui sopra vanno annullate: dentro la modale si deve
   vedere la stessa resa dell'orizzontale reale. */

.gallery-modal.force-landscape .gallery-modal-header {
    position: absolute;
}

.gallery-modal.force-landscape .gallery-modal-counter,
.gallery-modal.force-landscape .gallery-close {
    color: #fff;
}

.gallery-modal.force-landscape .gallery-swiper {
    height: 100%;
}

.gallery-modal.force-landscape .gallery-slide img {
    width: auto !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
}

.gallery-modal.force-landscape .embla__prev,
.gallery-modal.force-landscape .embla__next {
    width: 44px;
    height: 44px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
}

.gallery-modal.force-landscape .embla__prev {
    left: 20px;
    right: auto;
}

.gallery-modal.force-landscape .embla__next {
    right: 20px;
    left: auto;
}

.gallery-modal.force-landscape .embla__prev svg,
.gallery-modal.force-landscape .embla__next svg {
    width: 18px;
    height: 18px;
}

/* Telefono in verticale: niente barra bianca sotto i tab Foto/Video HD/Virtual Tour
   della modale annuncio (in orizzontale e desktop la barra resta di 6px). */
@media (max-width: 768px) and (orientation: portrait) {

    #VirtualTour,
    #VideoHD {
        padding-bottom: 0;
    }

    #VirtualTour iframe,
    #VideoHD iframe {
        height: 100%;
    }

    .gallery-slider {
        padding-bottom: 0;
    }

    .gallery-slider .gallery-swiper {
        height: 100%;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .gallery-modal::after {
        display: none;
    }

    /* Header in overlay (non occupa spazio, non spinge l'immagine in basso) */
    .gallery-modal-header {
        position: absolute;
    }

    /* Carosello a tutta altezza dello schermo */
    .gallery-swiper {
        height: 100%;
        flex: none;
        min-height: 0;
    }

    .gallery-modal .gallery-slide img {
        height: 100%;
    }
}

.modal-body #Planimetria img {
    width: 80vw;
    height: 86vh;
    object-fit: contain;
    margin: 0 auto;
}

/* FOTO TAB - Carousel stile galleryModal dentro la modale annuncio */

#Foto {
    position: absolute;
    inset: 0;
}

.gallery-slider {
    position: relative;
    height: 100%;
    background: #fff;
    /* Barra bianca di 6px sotto il carosello Foto, uguale a Virtual Tour e Video HD. */
    box-sizing: border-box;
    padding-bottom: 6px;
}

/* Come VideoHD/VirtualTour: il tab ha già box-sizing:border-box + padding-bottom:6px,
   quindi il carosello va a height:100% del contenuto (barra bianca = 6px). */
.gallery-slider .gallery-swiper {
    height: 100%;
}

/* Come gli altri caroselli: immagine intera con object-fit: contain, slide
   larga quanto l'immagine (peek delle foto adiacenti ai lati). */
.annuncio-modal-content #Foto .gallery-slide img {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.gallery-slider .foto-counter {
    position: absolute;
    top: 16px;
    left: 20px;
    z-index: 10;
    display: inline-block;
    background: transparent !important;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 0;
    margin: 0;
}

.gallery-slider .embla__prev,
.gallery-slider .embla__next {
    color: #ffffff;
    width: 44px;
    height: 44px;
    background: rgba(38, 45, 63, 0.08);
    border-radius: 50%;
    transition: background 0.2s;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-slider .embla__next {
    right: 20px;
}

.gallery-slider .embla__prev {
    left: 20px;
}

.gallery-slider .embla__prev:hover,
.gallery-slider .embla__next:hover {
    background: rgba(38, 45, 63, 0.18);
}

.gallery-slider .embla__prev svg,
.gallery-slider .embla__next svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 768px) {

    .gallery-slider .foto-counter {
        color: #262D3F;
    }

    .gallery-slider .embla__prev,
    .gallery-slider .embla__next {
        color: #262D3F;
        width: 36px;
        height: 36px;
        top: auto;
        bottom: 30px;
        transform: none;
    }

    .gallery-slider .embla__next {
        right: 40%;
    }

    .gallery-slider .embla__prev {
        left: 40%;
    }

    .gallery-slider .embla__prev svg,
    .gallery-slider .embla__next svg {
        width: 14px;
        height: 14px;
    }
}

/* OVERLAY IFRAME (click-through Virtual Tour) */

.overlayIframe {
    display: none
}

.hideOverlayIframe {
    display: none !Important
}

/* HEADER MODALE - tab Planimetria/Virtual Tour/Video HD/Foto */

.custom-header-modal {
    padding: 0 25px
}

/* ============================================================
   LAYOUT MAIN CONTENT / INTRO / DESCRIZIONE
   Spostato da style.css — dedicato a single-annunci.php
   ============================================================ */

.custom-annunci .main-content {
    display: grid;
    grid-template-columns: 65% 35%;
}

.custom-annunci .main-content .annuncio-sidebar {
    padding-left: 37px;
}

@media only screen and (max-width: 980px) {

    .custom-annunci .main-content {
        grid-template-columns: 1fr;
    }

    .custom-annunci .main-content .annuncio-sidebar {
        padding: 0 30px 0 0;
    }
}

.custom-annunci .intro {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 24px;
    margin-bottom: 23px;
}

/* Le azioni in alto a destra (torna agli immobili / condividi / preferiti)
   non devono sforare nella sidebar con le stringhe tradotte piu' lunghe (es. tedesco) */
.custom-annunci .intro .box-actions {
    min-width: 0;
}

.custom-annunci .intro .box-actions > div:first-child {
    flex-wrap: wrap;
    justify-content: flex-end;
    white-space: normal;
}

.custom-annunci .title h3 {
    font-style: normal;
    font-family: "HomepageBaukasten Book" !important;
    font-weight: 400;
    font-size: 14px !important;
    color: #000;
    margin-bottom: 18px;
}

.custom-annunci .title h2 {
    font-style: normal;
    font-family: "HomepageBaukasten Book" !important;
    font-weight: 400;
    font-size: 20px !important;
    color: #000;
    margin-bottom: 3px;
}

.custom-annunci .title p {
    margin-bottom: 0
}

.custom-annunci .description .title {
    font-weight: 600;
    font-size: 16px !important;
    line-height: 19px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 0;
}

/*.custom-annunci .description .desc-read-more {*/
/*    max-height: 100px;*/
/*    height: auto;*/
/*    overflow: hidden;*/
/*}*/
.custom-annunci .description .read-more-btn,
.custom-annunci .description .read-less-btn {
    font-weight: 800;
    text-transform: uppercase;
}

.custom-annunci .description .read-more-btn:hover,
.custom-annunci .description .read-less-btn:hover {
    cursor: pointer;
}

.custom-annunci .description {
    margin-bottom: 28px;
}

.custom-annunci .panel .description {
    margin-bottom: 0;
}

.custom-annunci .description .border-bottom {
    border: 0.25px solid #DDDDDD;
    margin: 10px 0 30px;
}

/* LEGACY accordion/panel/altridati — markup non più presente nel template,
   conservato per compatibilità (era in style.css, sezione "CSS NUOVI ANNUNCI") */

.custom-annunci .accordion {
    background-color: #F2F2F2;
    color: #262D3F;
    cursor: pointer;
    padding: 17px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 19px;
    transition: 0.4s;
    text-transform: uppercase;
    border-radius: 5px;
    line-height: 0;
    font-weight: 600;
}

.custom-annunci .accordion-section .active,
.accordion:hover {
    background-color: #F2F2F2;
}

.custom-annunci .panel {
    padding: 0 18px;
    background-color: white;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
}

.custom-annunci .accordion-section .accordion:after {
    content: '\02795';
    font-size: 13px;
    color: #777;
    float: right;
    margin-left: 5px;
}

.custom-annunci .accordion-section .accordion.active:after {
    content: "\2796" !important;
}

.custom-annunci .panel .panel-element {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.custom-annunci .panel .panel-element .element-title {
    font-weight: 400;
    font-size: 16px;
    line-height: 38px;
    text-transform: uppercase;
    margin-bottom: 0;
}

.custom-annunci .panel .panel-element .element-desc {
    font-weight: 400;
    font-size: 16px;
    line-height: 38px;
    margin-bottom: 0;
}

.custom-annunci .altridati-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.custom-annunci .altridati-panel .element-icon {
    display: flex;
    align-items: center;
    gap: 5px;
}

.custom-annunci input[type="submit"] {
    margin-top: 10px;
}

/* Fix testo pannelli specifiche */

.section-panel-element p {
    text-align: left !important;
}

/* ============================================================
   MOBILE 600px — regole spostate da style.css (media vari)
   ============================================================ */

@media only screen and (max-width: 600px) {

    .custom-annunci .title h3 {
        font-size: 14px !important;
    }

    .custom-annunci .title h2 {
        font-size: 20px !important;
    }

    .custom-annunci .price {
        margin-bottom: 46px;
        display: none
    }

    .annuncio-modal-content .close-modal {
        margin-right: 20px;
    }

    .annuncio-modal-content button {
        font-size: 12px
    }

    .custom-annunci .accordion {
        font-size: 17px;
    }

    .section-panel-element .panel-element {
        grid-template-columns: 150px 1fr
    }

    .intro.has-status-banner {
        margin-top: 40px;
    }

    .element-title {
        text-align: left !important;
    }

    .overlayIframe {
        height: 100%;
        width: 100%;
        display: block;
        position: absolute;
        z-index: 10
    }

    .iframeCustom {
        z-index: 1;
        position: absolute !important;
    }

    .custom-header-modal {
        padding: 0px;
        padding-left: 10px;
    }

    .custom-header-modal .tablink {
        padding: 5px;
    }
}