/*
Theme Name: Middlemen Theme
Theme URI: http://middlemen.it
Author: Roberto Rubellini | Proteina CReativa srl
Author URI: http://proteinacreativa.com
Description: Tema WordPress personalizzato per Middlemen Immobiliare - Milano.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: middlemen-theme
*/

/* --- 1. FONTS & RESET --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #023264;
    --primary-rgb: 2, 50, 100;
    --secondary: #ffffff;
    --accent: #c5a059;
    /* Elegant Gold */
    --accent-rgb: 197, 160, 89;
    --text: #1e293b;
    --text-muted: #64748b;
    --heading-color: #023264;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --border: #e2e8f0;
    --radius: 8px;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-nav: 'Outfit', sans-serif;
    --font-ui: 'Inter', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 30px rgba(2, 50, 100, 0.08);
}

html {
    font-size: 106.25%;
}

/* Property detail template 2 */
.property-v2-page {
    background: #f5f7fa;
    min-height: 80vh;
    padding: 28px 0 64px;
}

.property-v2-container {
    max-width: 1180px;
}

.property-v2-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin: 0 0 18px;
    color: #59708a;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.property-v2-breadcrumb a {
    color: #023264;
    text-decoration: none;
}

.property-v2-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
}

.property-v2-main {
    min-width: 0;
}

.property-v2-hero {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #dbe4ef;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
}

.property-v2-hero img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 180ms ease, transform 180ms ease;
}

.property-v2-hero:hover img {
    filter: brightness(0.88) contrast(1.08);
    transform: scale(1.015);
}

.property-v2-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 0;
    background: rgba(2, 50, 100, 0.78);
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease;
    z-index: 2;
    opacity: 0;
    visibility: hidden;
}

.property-v2-hero:hover .property-v2-nav,
.property-v2-hero:focus-within .property-v2-nav {
    opacity: 1;
    visibility: visible;
}

.property-v2-nav:hover {
    background: #023264;
    border-color: #ffffff;
}

.property-v2-nav svg {
    width: 22px;
    height: 22px;
}

.property-v2-nav-prev {
    left: 16px;
}

.property-v2-nav-next {
    right: 16px;
}

.property-v2-thumbs {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: #023264 #dbe4ef;
}

.property-v2-thumb {
    flex: 0 0 126px;
    width: 126px;
    height: 86px;
    padding: 0;
    border: 2px solid transparent;
    background: #dbe4ef;
    cursor: pointer;
    overflow: hidden;
    scroll-snap-align: start;
}

.property-v2-thumb.active {
    border-color: #023264;
}

.property-v2-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.property-v2-panel {
    background: #ffffff;
    border: 1px solid #e0e7ef;
    padding: 22px;
    box-shadow: 0 18px 42px rgba(2, 50, 100, 0.08);
}

.property-v2-sidebar {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.property-v2-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 12px;
}

.property-v2-badges span {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 4px 7px;
    background: #edf3fa;
    color: #023264;
    font-size: 0.62rem;
    font-weight: 900;
    text-transform: uppercase;
}

.property-v2-badges span:first-child {
    background: var(--accent);
    color: #ffffff;
}

.property-v2-panel h1 {
    margin: 0 0 8px;
    color: #023264;
    font-family: var(--font-heading);
    font-size: clamp(1.45rem, 2vw, 2.15rem);
    line-height: 1.08;
    letter-spacing: 0;
}

.property-v2-panel h2 {
    margin: 0 0 8px;
    color: #023264;
    font-family: var(--font-heading);
    font-size: 1rem;
    line-height: 1.12;
}

.property-v2-phone-block {
    margin: 8px 0 24px;
    padding-top: 14px;
    border-top: 1px solid #e0e7ef;
}

.property-v2-phone-block h2 {
    margin-bottom: 18px;
}

.property-v2-phone,
.contact-phone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 42px;
    margin-bottom: 0;
    padding: 12px 14px;
    background: #023264;
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 1.55rem;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: 0;
}

.property-v2-phone {
    width: 100%;
}

.property-v2-phone svg,
.contact-phone svg {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
}

.property-v2-phone:hover,
.contact-phone:hover {
    background: var(--accent);
    color: #ffffff;
}

.property-v2-contact-copy {
    margin: 0 0 18px;
    color: #51677f;
    font-size: 0.9rem;
    line-height: 1.45;
}

.property-v2-location {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #4e647d;
    font-size: 0.84rem;
    margin-bottom: 16px;
}

.property-v2-location svg {
    width: 18px;
    height: 18px;
    color: var(--accent);
    flex: 0 0 auto;
}

.property-v2-price {
    margin-bottom: 20px;
    color: var(--accent);
    font-family: var(--font-heading);
    font-size: clamp(1.45rem, 2vw, 2.25rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
}

.property-v2-consultant {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    margin-bottom: 22px;
    border-top: 1px solid #e5edf5;
    border-bottom: 1px solid #e5edf5;
}

.property-v2-consultant img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 50%;
}

.property-v2-consultant strong,
.property-v2-consultant span {
    display: block;
}

.property-v2-consultant strong {
    color: #023264;
    font-size: 0.9rem;
}

.property-v2-consultant span {
    color: #62758b;
    font-size: 0.72rem;
    font-weight: 700;
}

.property-v2-form {
    display: grid;
    gap: 9px;
}

.property-v2-cf7-form > p {
    margin: 0;
}

.property-v2-cf7-form > p:first-child {
    display: grid;
    gap: 9px;
}

.property-v2-cf7-form > p:first-child > br {
    display: none;
}

.property-v2-cf7-form .property-v2-consent {
    display: block;
}

.property-v2-cf7-form .property-v2-consent p,
.property-v2-cf7-form .property-v2-consent .wpcf7-list-item {
    margin: 0;
}

.property-v2-cf7-form .property-v2-consent .wpcf7-form-control-wrap,
.property-v2-cf7-form .property-v2-consent .wpcf7-acceptance,
.property-v2-cf7-form .property-v2-consent .wpcf7-list-item {
    display: block;
    width: 100%;
}

.property-v2-cf7-form .property-v2-consent label {
    display: grid;
    width: 100%;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.property-v2-cf7-form .property-v2-consent label input {
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
}

.property-v2-cf7-form .property-v2-consent .wpcf7-list-item-label {
    color: #53687f;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.35;
    text-transform: none;
}

.property-v2-contact-panel > .property-v2-secondary-btn {
    margin-top: 9px;
}

.property-v2-form label {
    display: grid;
    gap: 4px;
    margin: 0;
}

.property-v2-form label span {
    color: #51677f;
    font-size: 0.64rem;
    font-weight: 900;
    text-transform: uppercase;
}

.property-v2-form input,
.property-v2-form textarea {
    width: 100%;
    border: 1px solid #d4deea;
    background: #ffffff;
    padding: 6px 9px;
    color: #023264;
}

.property-v2-form input {
    height: 36px;
}

.property-v2-form textarea {
    min-height: 104px;
    resize: vertical;
    line-height: 1.45;
}

.property-v2-form input[readonly] {
    background: #f4f7fb;
    color: #53687f;
    cursor: default;
}

.property-v2-form .property-v2-consent {
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.property-v2-form .property-v2-consent input {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--accent);
}

.property-v2-form .property-v2-consent span {
    color: #53687f;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.35;
    text-transform: none;
}

.property-v2-form .property-v2-consent a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.property-v2-primary-btn,
.property-v2-secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 38px;
    border-radius: 0;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
}

.property-v2-primary-btn {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.property-v2-form input.property-v2-primary-btn {
    width: 100%;
    height: 38px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.property-v2-form input.property-v2-primary-btn:hover {
    background: #b28e4b;
    border-color: #b28e4b;
}

.property-v2-secondary-btn {
    border: 1px solid #023264;
    background: #ffffff;
    color: #023264;
}

.property-v2-secondary-btn:hover {
    background: #023264;
    color: #ffffff;
}

.property-v2-privacy {
    margin: 12px 0 0;
    color: #718397;
    font-size: 0.68rem;
    line-height: 1.45;
}

.property-v2-section {
    margin-top: 42px;
    color: #23364c;
}

.property-v2-title-block {
    margin-top: 24px;
    padding-bottom: 26px;
    border-bottom: 1px solid #d7e1ec;
}

.property-v2-title-block span {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.property-v2-title-block h1 {
    margin: 0 0 12px;
    color: #023264;
    font-family: var(--font-heading);
    font-size: clamp(1.55rem, 2.1vw, 2.35rem);
    line-height: 1.12;
}

.property-v2-title-price {
    color: var(--accent);
    font-family: var(--font-heading);
    font-size: clamp(1.45rem, 2.4vw, 2.35rem);
    font-weight: 800;
    line-height: 1;
}

.property-v2-section h2 {
    margin: 0 0 18px;
    color: #023264;
    font-family: var(--font-heading);
    font-size: 1.65rem;
    line-height: 1.1;
}

.property-v2-map-section #detail-map {
    height: 420px;
    min-height: 420px;
    border: 1px solid #d7e1ec;
}

.property-v2-specs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid #d7e1ec;
    border-left: 1px solid #d7e1ec;
}

.property-v2-specs>div {
    min-height: 104px;
    padding: 16px;
    border-right: 1px solid #d7e1ec;
    border-bottom: 1px solid #d7e1ec;
    background: #ffffff;
}

.property-v2-spec-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.property-v2-spec-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    color: var(--accent);
    flex: 0 0 auto;
}

.property-v2-specs>div>strong {
    display: block;
}

.property-v2-specs span {
    color: #667b93;
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1;
}

.property-v2-specs strong {
    color: #023264;
    font-size: 1.14rem;
    line-height: 1.25;
}

.property-v2-details-sidebar .property-v2-details-main,
.property-details-sidebar .standard-details-main {
    display: none;
}

.property-v2-details-central .property-v2-sidebar-details,
.property-details-central .contact-sidebar-details {
    display: none;
}

.property-v2-sidebar-details {
    margin: 0;
    padding: 18px;
}

.property-v2-sidebar-details h2 {
    margin-bottom: 10px;
}

.property-v2-specs-compact {
    grid-template-columns: minmax(0, 1fr);
}

.property-v2-specs-compact > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 0;
    padding: 9px 10px;
}

.property-v2-specs-compact > div > .property-v2-compact-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.61rem;
    line-height: 1.25;
}

.property-v2-specs-compact .property-v2-spec-icon {
    width: 15px;
    height: 15px;
}

.property-v2-specs-compact > div > strong {
    font-size: 0.82rem;
    line-height: 1.25;
    text-align: right;
}

@media (max-width: 960px) {
    .property-v2-layout {
        grid-template-columns: 1fr;
    }

    .property-v2-main {
        order: 1;
    }

    .property-v2-panel {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .property-v2-sidebar {
        order: 2;
        margin-top: 28px;
    }

    .property-v2-details-sidebar .property-v2-details-main {
        display: block;
        margin-top: 24px;
    }

    .property-v2-details-sidebar .property-v2-sidebar-details {
        display: none;
    }

    .property-v2-details-sidebar .property-v2-details-main h2 {
        margin-bottom: 10px;
        font-size: 1.25rem;
    }

    .property-v2-details-sidebar .property-v2-details-main .property-v2-specs {
        grid-template-columns: minmax(0, 1fr);
    }

    .property-v2-details-sidebar .property-v2-details-main .property-v2-specs > div {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 12px;
        min-height: 0;
        padding: 9px 10px;
    }

    .property-v2-details-sidebar .property-v2-details-main .property-v2-spec-heading {
        margin-bottom: 0;
    }

    .property-v2-details-sidebar .property-v2-details-main .property-v2-specs > div > strong {
        font-size: 0.82rem;
        text-align: right;
    }
}

.middlemen-pdf-brochure {
    display: none;
}

@media print {
    @page {
        size: A4;
        margin: 10mm;
    }

    body {
        background: #ffffff !important;
        color: #1e293b !important;
        margin: 0 !important;
    }

    body * {
        visibility: hidden !important;
    }

    .middlemen-pdf-brochure,
    .middlemen-pdf-brochure * {
        visibility: visible !important;
    }

    .middlemen-pdf-brochure {
        display: block !important;
        position: absolute;
        inset: 0 auto auto 0;
        width: 100%;
        font-family: var(--font-body);
        background: #ffffff;
        color: #1e293b;
    }

    .middlemen-pdf-brochure h1,
    .middlemen-pdf-brochure h2,
    .middlemen-pdf-brochure p {
        orphans: 3;
        widows: 3;
    }

    body::after,
    .site-header,
    .site-footer,
    .share-modal {
        display: none !important;
    }

    .pdf-cover,
    .pdf-page {
        box-sizing: border-box;
        min-height: 267mm;
        background: #ffffff;
        page-break-after: always;
    }

    .pdf-page:last-child {
        page-break-after: auto;
    }

    .pdf-cover {
        position: relative;
        overflow: hidden;
        border: 1px solid #e2e8f0;
    }

    .pdf-cover::before {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: 62mm;
        background: #023264;
        z-index: 0;
    }

    .pdf-cover::after {
        content: "";
        position: absolute;
        top: -40mm;
        right: -35mm;
        width: 116mm;
        height: 116mm;
        border: 1px solid rgba(197, 160, 89, 0.32);
        border-radius: 50%;
        z-index: 0;
    }

    .pdf-brand-row {
        position: relative;
        z-index: 1;
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        padding: 14mm 14mm 9mm;
        color: #ffffff;
    }

    .pdf-brand {
        font-family: var(--font-heading);
        font-size: 24pt;
        line-height: 1;
        font-weight: 800;
    }

    .pdf-brand-subtitle {
        margin-top: 3mm;
        color: rgba(255, 255, 255, 0.78);
        font-size: 7.5pt;
        letter-spacing: 0.18em;
        text-transform: uppercase;
    }

    .pdf-ref {
        border: 1px solid rgba(197, 160, 89, 0.78);
        color: #c5a059;
        padding: 3mm 4mm;
        font-size: 8.5pt;
        font-weight: 800;
        text-transform: uppercase;
    }

    .pdf-hero-grid {
        position: relative;
        z-index: 1;
        display: grid;
        grid-template-columns: 74mm 1fr;
        gap: 10mm;
        align-items: end;
        padding: 0 14mm;
    }

    .pdf-hero-copy {
        padding: 11mm 0 8mm;
    }

    .pdf-kicker {
        display: inline-block;
        margin-bottom: 6mm;
        border-left: 3px solid #c5a059;
        padding-left: 3mm;
        color: #c5a059;
        font-size: 8pt;
        font-weight: 800;
        letter-spacing: 0.12em;
        text-transform: uppercase;
    }

    .pdf-hero-copy h1 {
        margin: 0;
        color: #ffffff !important;
        font-family: var(--font-heading);
        font-size: 27pt !important;
        line-height: 0.98;
    }

    .pdf-location {
        margin-top: 7mm;
        color: #59708a;
        font-size: 8.2pt;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .pdf-price {
        margin-top: 5mm;
        color: #c5a059;
        font-family: var(--font-heading);
        font-size: 19pt;
        font-weight: 800;
    }

    .pdf-hero-image {
        height: 116mm;
        border: 5px solid #ffffff;
        background: #e2e8f0;
        box-shadow: 0 14px 28px rgba(2, 50, 100, 0.18);
    }

    .pdf-hero-image img,
    .pdf-photo-strip img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

    .pdf-photo-strip {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 3mm;
        padding: 9mm 14mm 0;
    }

    .pdf-photo-strip img {
        height: 27mm;
        border: 1px solid #ffffff;
        background: #e2e8f0;
    }

    .pdf-page {
        padding: 12mm 14mm;
        border-top: 8mm solid #023264;
    }

    .pdf-section-heading {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        margin-bottom: 9mm;
        border-bottom: 2px solid #023264;
        padding-bottom: 4mm;
    }

    .pdf-section-heading span {
        color: #023264;
        font-family: var(--font-heading);
        font-size: 18pt;
        font-weight: 800;
    }

    .pdf-section-heading strong {
        color: #c5a059;
        font-size: 8pt;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .pdf-details-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 4mm;
    }

    .pdf-detail-card {
        min-height: 21mm;
        border: 1px solid #e2e8f0;
        border-top: 3px solid #c5a059;
        padding: 4mm;
        background: #f8fafc;
        page-break-inside: avoid;
    }

    .pdf-detail-card span {
        display: block;
        margin-bottom: 2mm;
        color: #64748b;
        font-size: 7.5pt;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .pdf-detail-card strong {
        color: #023264;
        font-family: var(--font-heading);
        font-size: 12pt;
        line-height: 1.15;
    }

    .pdf-description {
        margin-top: 10mm;
        padding: 8mm;
        background: #023264;
        color: #ffffff;
        page-break-inside: avoid;
    }

    .pdf-description h2 {
        margin: 0 0 4mm;
        color: #c5a059 !important;
        font-family: var(--font-heading);
        font-size: 17pt !important;
    }

    .pdf-description p {
        margin: 0;
        color: #ffffff;
        font-size: 10.5pt;
        line-height: 1.55;
    }

    .pdf-floor-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6mm;
    }

    .pdf-floor-grid figure {
        margin: 0;
        border: 1px solid #e2e8f0;
        padding: 5mm;
        background: #f8fafc;
        page-break-inside: avoid;
    }

    .pdf-floor-grid img {
        display: block;
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 110mm;
        margin: 0 auto;
        object-fit: contain;
        background: #ffffff;
    }
}

@media (max-width: 640px) {
    .property-v2-page {
        padding-top: 18px;
    }

    .property-v2-title-block h1 {
        font-size: clamp(1.35rem, 7vw, 1.8rem);
        line-height: 1.16;
    }

    .property-v2-panel {
        padding: 22px;
    }

    .property-v2-thumbs {
        gap: 10px;
    }

    .property-v2-thumb {
        flex-basis: 108px;
        width: 108px;
        height: 74px;
    }

    .floor-plan-container {
        min-height: 280px;
        padding: 18px;
    }

    .floor-plan-slide {
        min-height: 244px;
    }

    .floor-plan-nav {
        width: 38px;
        height: 38px;
    }

    .floor-plan-nav-prev {
        left: 10px;
    }

    .floor-plan-nav-next {
        right: 10px;
    }

    .floor-plan-thumb {
        flex-basis: 92px;
        width: 92px;
        height: 66px;
    }

    .property-v2-specs {
        grid-template-columns: 1fr;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--heading-color);
}

button,
input,
select,
textarea {
    font-family: var(--font-ui);
}

/* --- 2. LAYOUT UTILITIES --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 16px;
    text-align: center;
    position: relative;
    padding-bottom: 12px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--accent);
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 48px auto;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-ui);
    padding: 14px 28px;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius);
    transition: var(--transition);
    cursor: pointer;
    border: none;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--secondary);
}

.btn-primary:hover {
    background-color: #011d3b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 50, 100, 0.2);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background-color: var(--primary);
    color: var(--secondary);
    transform: translateY(-2px);
}

.btn-accent {
    background-color: var(--accent);
    color: var(--secondary);
}

.btn-accent:hover {
    background-color: #b08d4b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(197, 160, 89, 0.3);
}

.btn-outline {
    background-color: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background-color: var(--bg-alt);
    border-color: var(--text-muted);
}

/* --- 3. HEADER & NAVIGATION --- */
.site-header {
    background-color: #023264;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
}

.site-header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.site {
    padding-top: 90px;
}

body.admin-bar .site-header {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .site-header {
        top: 46px;
    }
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 90px;
}

.logo {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.logo a {
    display: flex;
    align-items: center;
}

.site-header .logo img {
    width: auto;
    max-width: 280px;
    height: auto;
    max-height: 50px;
    object-fit: contain;
}

.logo img.middlemen-site-logo-svg {
    width: 280px;
    height: auto;
}

.logo img.middlemen-site-logo-svg,
.footer-logo img.middlemen-site-logo-svg {
    filter: brightness(0) invert(1);
}

.main-navigation {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
    align-items: center;
}

.nav-menu a {
    font-family: var(--font-nav);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--secondary);
    position: relative;
}

.nav-menu a:hover {
    color: var(--accent);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: var(--transition);
}

.nav-menu a:hover::after,
.nav-menu .current-menu-item a::after {
    width: 100%;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.lang-switch {
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 6px 12px;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.75);
}

.lang-switch a,
.lang-switch .active,
.lang-switch a.active {
    color: var(--secondary);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 2.15rem;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    color: var(--secondary);
    cursor: pointer;
}

/* --- 4. HERO SECTION --- */
.hero {
    height: 80vh;
    min-height: 550px;
    position: relative;
    background-size: cover;
    background-position: bottom center;
    display: flex;
    align-items: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(2, 50, 100, 0.85) 40%, rgba(2, 50, 100, 0.4) 100%);
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 650px;
    color: var(--secondary);
}

.hero h1 {
    font-size: 3.5rem;
    color: var(--secondary);
    margin-bottom: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 36px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

.hero-cta {
    display: flex;
    gap: 16px;
}

/* --- 5. 30 ANNI NARRATIVE SECTION --- */
.history-section {
    background-color: var(--bg-alt);
    position: relative;
    overflow: hidden;
}

.history-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.history-text h3 {
    color: var(--accent);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 12px;
}

.history-text h2 {
    font-size: 2.5rem;
    margin-bottom: 24px;
    font-weight: 800;
}

.history-text p {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.history-image {
    position: relative;
}

.image-frame {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.image-frame::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    z-index: -1;
}

.badge-30years {
    position: absolute;
    bottom: -20px;
    right: -20px;
    background-color: var(--primary);
    color: var(--secondary);
    padding: 24px;
    border-radius: 50%;
    width: 120px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--accent);
}

.badge-30years .num {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    font-family: var(--font-heading);
}

.badge-30years .lbl {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* --- 5B. STATIC CONTENT PAGES --- */
.page-hero {
    min-height: 0;
    position: relative;
    display: flex;
    align-items: center;
    padding: 40px 0 70px;
    background-image: none !important;
    background-color: var(--bg);
    background-size: cover;
    background-position: center;
}

.page-hero > .wp-block-group__inner-container {
    width: 100%;
}

.page-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(2, 50, 100, 0.88), rgba(2, 50, 100, 0.38));
    display: none;
}

.page-hero-content {
    position: relative;
    z-index: 2;
    max-width: 760px;
    color: var(--text);
    transform: translateX(32px);
}

.page-hero-content span,
.page-hero-content > .wp-block-group__inner-container > p:first-child {
    display: block;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    margin-bottom: 14px;
}

.page-hero-content h1 {
    color: var(--heading-color);
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 18px;
}

.page-hero-content p {
    color: var(--text-muted);
    font-size: 1.15rem;
    max-width: 680px;
}

.page-hero-content .btn {
    margin-top: 26px;
}

.page-narrative {
    background: var(--bg);
}

.page-split.page-split {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    gap: 56px;
    align-items: center;
}

.page-split h2 {
    font-size: 2.35rem;
    margin-bottom: 20px;
}

.page-split p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 18px;
}

.page-image-panel {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    aspect-ratio: 4 / 3;
}

.page-image-panel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-band {
    background: var(--primary);
    color: var(--secondary);
    overflow: visible;
}

.page-values {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.page-values > div,
.page-values > .wp-block-group {
    border-left: 2px solid var(--accent);
    padding-left: 20px;
    min-width: 0;
}

.page-values strong {
    display: block;
    color: var(--secondary);
    font-size: 2.8rem;
    line-height: 1;
    font-family: var(--font-heading);
}

.page-values span,
.page-values > .wp-block-group > .wp-block-group__inner-container > p:last-child,
.page-values > .wp-block-group > p:last-child {
    display: block;
    color: rgba(255, 255, 255, 0.76);
    margin-top: 10px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.page-next-step {
    background: var(--bg-alt);
}

.proposal-type-sections {
    display: grid;
    gap: 54px;
}

.proposal-type-heading {
    display: flex;
    align-items: center;
    gap: 22px;
    margin: 0 0 24px;
}

.proposal-type-heading h2 {
    flex: 0 0 auto;
    margin: 0;
    color: var(--accent);
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .14em;
    line-height: 1.35;
    text-transform: uppercase;
}

.proposal-type-heading span {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(var(--accent-rgb), .65), rgba(var(--accent-rgb), .08));
}

@media (max-width: 600px) {
    .proposal-type-sections {
        gap: 40px;
    }

    .proposal-type-heading {
        gap: 14px;
        margin-bottom: 18px;
    }

    .proposal-type-heading h2 {
        max-width: 78%;
        font-size: .8rem;
    }
}

.page-next-step-alt {
    border-top: 1px solid var(--border);
}

.page-next-step-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
}

.page-next-step-content > div {
    max-width: 760px;
}

.page-next-step-content span,
.page-next-step-content > .wp-block-group > .wp-block-group__inner-container > p:first-child {
    display: block;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.page-next-step-content h2 {
    font-size: 2rem;
    margin: 0;
}

.page-next-step-content .btn {
    flex: 0 0 auto;
}

.page-next-step-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 0 0 auto;
}

.page-next-step-content .wp-block-button.btn {
    padding: 0;
    background: transparent;
}

.page-next-step-content .wp-block-button.btn .wp-block-button__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: var(--radius);
    background: var(--primary);
    color: var(--secondary);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
}

.page-next-step-content .wp-block-button.btn .wp-block-button__link:hover {
    background: #011d3b;
    box-shadow: 0 4px 12px rgba(2, 50, 100, 0.2);
    transform: translateY(-2px);
}

.process-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
}

.process-grid article {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    background: var(--secondary);
    box-shadow: var(--shadow);
}

.process-grid article span {
    color: var(--accent);
    font-weight: 800;
    letter-spacing: 0.14em;
}

.process-grid article h2 {
    margin: 12px 0;
    font-size: 1.55rem;
}

.process-grid article p {
    color: var(--text-muted);
}

.seller-panel {
    background: var(--primary);
    color: var(--secondary);
    padding: 34px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.seller-panel h3 {
    color: var(--secondary);
    font-size: 1.55rem;
    margin-bottom: 32px;
}

.seller-panel p {
    color: rgba(255, 255, 255, 0.84);
    line-height: 1.7;
    margin-bottom: 14px;
}

.seller-panel p:last-child {
    margin-bottom: 0;
}

.seller-panel ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.seller-panel li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    padding-bottom: 14px;
    color: rgba(255, 255, 255, 0.82);
}

.module-list-section {
    background: var(--bg-alt);
}

.module-list-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.services-page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
}

.module-card {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.module-card span {
    display: inline-block;
    color: var(--accent);
    font-weight: 800;
    letter-spacing: 0.12em;
    margin-bottom: 14px;
}

.module-card h2 {
    font-size: 1.05rem;
    margin-bottom: 12px;
}

.module-card p {
    color: var(--text-muted);
    font-size: 0.94rem;
}

.module-download-btn {
    align-items: center;
    background: var(--primary);
    border-radius: 6px;
    color: #fff;
    display: inline-flex;
    font-weight: 800;
    gap: 10px;
    justify-content: center;
    margin-top: auto;
    min-height: 44px;
    padding: 10px 12px;
    text-decoration: none;
}

.module-download-btn:hover,
.module-download-btn:focus {
    background: var(--accent);
    color: #fff;
}

.service-card {
    min-height: 245px;
}

.guide-download-section {
    background: linear-gradient(180deg, var(--bg-alt), #fff);
}

.guide-download-box {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 420px);
    gap: 42px;
    align-items: center;
    background: var(--primary);
    color: var(--secondary);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 44px;
    overflow: hidden;
}

.guide-download-box::after {
    content: "";
    position: absolute;
    inset: auto -120px -180px auto;
    width: 360px;
    height: 360px;
    border: 1px solid rgba(197, 160, 89, 0.32);
    border-radius: 50%;
}

.guide-download-copy {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 30px;
    align-items: center;
}

.guide-cover {
    min-height: 250px;
    padding: 24px;
    border-radius: 6px;
    background: linear-gradient(145deg, #ffffff, #eef3f7);
    color: var(--primary);
    box-shadow: 16px 18px 0 rgba(197, 160, 89, 0.22), 0 18px 34px rgba(0, 0, 0, 0.24);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.guide-cover span {
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.guide-cover strong {
    display: block;
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: 1.75rem;
    line-height: 1.08;
}

.guide-cover small {
    color: var(--text-muted);
    font-weight: 700;
}

.guide-download-copy>div:last-child>span {
    display: block;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.guide-download-box h2 {
    color: var(--secondary);
    font-size: 2rem;
    margin-bottom: 14px;
}

.guide-download-box p {
    color: rgba(255, 255, 255, 0.78);
}

.guide-points {
    list-style: none;
    display: grid;
    gap: 10px;
    margin-top: 22px;
}

.guide-points li {
    color: rgba(255, 255, 255, 0.84);
    padding-left: 22px;
    position: relative;
}

.guide-points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

.guide-download-form {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--secondary);
    color: var(--text);
    border-radius: 6px;
    padding: 26px;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.18);
}

.guide-download-form h3 {
    font-size: 1.35rem;
    margin-bottom: 2px;
}

.guide-download-form p:not(.form-error) {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 6px;
}

.guide-download-form label:not(.privacy-check) {
    font-weight: 700;
    color: var(--primary);
}

.guide-download-form input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.form-error {
    display: none;
    color: #b91c1c;
    font-size: 0.85rem;
}

.guide-download-form input[type="email"]:invalid:not(:placeholder-shown)+.form-error {
    display: block;
}

.privacy-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: rgba(100, 116, 139, 0.82);
    font-size: 0.78rem;
    line-height: 1.45;
}

.privacy-check strong {
    display: block;
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 600;
}

.privacy-check small {
    display: block;
    margin-top: 2px;
    font-size: 0.72rem;
    line-height: 1.35;
}

.privacy-check a {
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.privacy-check a:hover {
    color: var(--primary);
}

.privacy-check input {
    margin-top: 3px;
    flex: 0 0 auto;
}

.valuation-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(2, 50, 100, 0.68);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    z-index: 3000;
}

.valuation-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.valuation-modal-card {
    position: relative;
    width: min(100%, 620px);
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: var(--secondary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 38px;
}

.valuation-modal-card h2 {
    margin-bottom: 26px;
}

.valuation-modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    border: 0;
    background: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.valuation-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.valuation-form .form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.valuation-form .form-group {
    margin: 0;
}

.valuation-form .form-group input,
.valuation-form .form-group textarea {
    width: 100%;
    border-color: var(--border);
    background: var(--bg-alt);
    color: var(--text);
    min-height: 48px;
    padding: 14px 16px;
}

.valuation-form .form-group textarea {
    min-height: 132px;
    resize: vertical;
}

.valuation-form .form-group input::placeholder,
.valuation-form .form-group textarea::placeholder {
    color: var(--text-muted);
}

.privacy-check-dark {
    color: var(--text-muted);
    margin-top: 2px;
    padding-top: 2px;
}

.privacy-page {
    background: var(--bg-alt);
}

.privacy-content {
    max-width: 900px;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 46px;
}

.privacy-content h1 {
    font-size: 2.35rem;
    margin-bottom: 8px;
}

.privacy-kicker {
    color: var(--accent);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 28px;
}

.privacy-content h2 {
    font-size: 1.25rem;
    margin: 28px 0 10px;
}

.privacy-content p,
.privacy-content li {
    color: var(--text-muted);
    font-size: 0.98rem;
}

.privacy-content ul {
    margin: 12px 0 0 20px;
}

/* --- 6. PROPOSTE ARCHIVE & FILTERS --- */
.proposte-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    width: calc(100vw - 48px);
    margin-left: calc(50% - 50vw + 24px);
}

.proposte-layout-contained {
    width: 100%;
    margin-left: 0;
}

/* Filters */
.filter-bar {
    background-color: var(--secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}

.archive-filter-bar {
    margin-bottom: 28px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.proposte-archive {
    padding-top: 32px;
}

.filter-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

.archive-filter-bar .filter-nav {
    margin-bottom: 0;
    border-bottom: 0;
    padding-bottom: 0;
}

.archive-filter-bar .archive-view-toggle {
    flex: 0 0 auto;
    margin: 0;
}

.filter-nav-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-tab {
    min-height: 44px;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 0.85rem;
    background: none;
    border: 1px solid var(--border);
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 999px;
    transition: var(--transition);
}

.filter-tab.active {
    border-color: var(--accent);
    background-color: var(--accent);
    color: var(--secondary);
}

.sort-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.sort-group select {
    min-width: 190px;
    padding: 10px 38px 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--bg-alt);
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23023264'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.sort-group select:focus {
    border-color: var(--accent);
    background-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-group select {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--bg-alt);
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23023264'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-group select:focus {
    border-color: var(--primary);
    background-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(2, 50, 100, 0.1);
}

.filter-actions {
    display: flex;
    gap: 12px;
}

/* Listings Grid */
.listings-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: start;
}

.listings-container.has-map {
    grid-template-columns: minmax(0, 1fr);
}

.listings-container.has-map .listings-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.listings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
}

.proposte-layout-cols-1 .listings-grid,
.proposte-layout-cols-1 .listings-container.has-map .listings-grid {
    grid-template-columns: minmax(0, 1fr);
}

.proposte-layout-cols-2 .listings-grid,
.proposte-layout-cols-2 .listings-container.has-map .listings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.proposte-layout-cols-3 .listings-grid,
.proposte-layout-cols-3 .listings-container.has-map .listings-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.proposte-layout-contained.proposte-layout-cols-3 .listings-grid,
.proposte-layout-contained.proposte-layout-cols-3 .listings-container.has-map .listings-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.archive-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 36px;
}

.archive-pagination .page-numbers {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--secondary);
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.archive-pagination .page-numbers.current,
.archive-pagination .page-numbers:hover,
.archive-pagination .page-numbers:focus {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--secondary);
}

.empty-listings {
    padding: 56px 32px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, var(--secondary), var(--bg-alt));
    text-align: center;
    box-shadow: var(--shadow);
}

.empty-listings-kicker,
.empty-suggestions-heading span {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.empty-listings h2 {
    margin-bottom: 10px;
    font-size: 1.65rem;
}

.empty-listings p {
    margin: 0 auto 24px;
    max-width: 600px;
    color: var(--text-muted);
}

.empty-suggestions {
    margin-top: 40px;
}

.empty-suggestions-heading {
    margin-bottom: 20px;
    text-align: center;
}

.empty-suggestions-heading h2 {
    font-size: 1.5rem;
}

.property-card {
    background-color: var(--secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
}

.property-card[hidden] {
    display: none !important;
}

.property-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(2, 50, 100, 0.15);
    color: inherit;
    filter: contrast(1.03) brightness(1.02);
}

.card-img-wrapper {
    position: relative;
    padding-top: 66.67%;
    /* 3:2 Aspect Ratio */
    overflow: hidden;
}

.card-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.property-card:hover .card-img-wrapper img {
    transform: scale(1.05);
    filter: brightness(0.92) contrast(1.06);
}

.card-badges {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    z-index: 10;
}

.card-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background-color: var(--primary);
    color: var(--secondary);
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 10;
}

.card-badges .card-badge {
    position: static;
}

.card-price {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background-color: var(--secondary);
    color: var(--primary);
    padding: 6px 14px;
    font-size: 0.95rem;
    font-weight: 800;
    border-radius: 4px;
    box-shadow: var(--shadow);
    z-index: 10;
}

.card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-tag {
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.card-heading-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.card-heading-meta .card-tag {
    margin-bottom: 0;
}

.card-reference {
    flex: 0 0 auto;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.card-content h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    font-weight: 700;
    color: var(--heading-color);
}

.card-excerpt {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-specs {
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: auto;
    min-height: 38px;
    font-size: 0.86rem;
    color: var(--text-muted);
}

.card-spec-item {
    display: flex;
    align-items: center;
    flex: 1 1 0;
    gap: 5px;
    min-width: 0;
}

.card-spec-item svg {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    stroke: var(--primary);
}

.card-spec-item span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-details-link {
    align-self: stretch;
    display: flex;
    justify-content: center;
    margin-top: 18px;
    padding: 11px 16px;
    border: 1px solid var(--primary);
    border-radius: 0;
    color: var(--primary);
    background: var(--secondary);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-align: center;
}

.card-details-link:hover,
.card-details-link:focus {
    color: var(--secondary);
    background: var(--primary);
    border-color: var(--primary);
}

.property-card:hover .card-details-link,
.property-card:focus .card-details-link {
    color: var(--secondary);
    background: var(--primary);
    border-color: var(--primary);
}

.map-property-popup {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    width: 250px;
    color: var(--primary);
    text-decoration: none;
}

.map-property-popup img {
    width: 88px;
    height: 66px;
    object-fit: cover;
}

.map-property-popup-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.map-property-popup-copy:first-child {
    grid-column: 1 / -1;
}

.map-property-popup strong {
    color: var(--primary);
    font-size: 0.95rem;
    line-height: 1.25;
}

.map-property-popup .map-property-popup-price {
    color: var(--accent);
    font-weight: 800;
}

.map-property-popup small {
    color: var(--text-muted);
    line-height: 1.35;
}

/* Interactive Map Container */
.map-sidebar {
    display: none;
    position: relative;
    width: 100%;
    height: min(720px, calc(100vh - 150px));
    min-height: 560px;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(2, 50, 100, 0.08);
    background-color: var(--bg-alt);
}

.map-sidebar #sidebar-map {
    width: 100%;
    height: 100%;
}

.map-sidebar .leaflet-tile-pane {
    filter: none;
}

.middlemen-map-pin {
    width: 20px;
    height: 20px;
    border: 3px solid #c5a059;
    border-radius: 50%;
    background: #023264;
    box-shadow: 0 6px 14px rgba(5, 59, 106, 0.35);
    transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.custom-div-icon.is-rental .middlemen-map-pin {
    background: #023264;
}

.custom-div-icon.is-sale .middlemen-map-pin {
    background: #023264;
}

.custom-div-icon.is-highlighted .middlemen-map-pin {
    border-color: #ffffff;
    background: var(--accent);
    box-shadow: 0 8px 20px rgba(var(--accent-rgb), 0.42);
    transform: scale(1.28);
}

.map-toggle-btn {
    display: none;
}

.archive-view-toggle {
    display: flex;
    justify-self: center;
    gap: 8px;
    margin: 0 auto 18px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--secondary);
}

.archive-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 1 auto;
    min-height: 40px;
    padding: 8px 18px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.archive-view-btn svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.archive-view-btn svg circle:first-child,
.archive-view-btn[data-view="list"] svg circle {
    fill: currentColor;
    stroke: none;
}

.archive-view-btn.active {
    background: var(--primary);
    color: var(--secondary);
}

.listings-container.has-map.is-map-view .listings-grid-wrapper {
    display: none;
}

.listings-container.has-map.is-map-view .map-sidebar {
    display: block;
}

/* --- 7. PROPERTY DETAIL PAGE (SCHEDA) --- */
.property-detail-header {
    margin-bottom: 32px;
}

.detail-header-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
}

.detail-title h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.detail-location {
    font-size: 1.1rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-location svg {
    width: 20px;
    height: 20px;
    stroke: var(--accent);
}

.detail-price-box {
    text-align: right;
}

.detail-price-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.detail-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}

/* Gallery Slider */
.property-gallery {
    position: relative;
    margin-bottom: 48px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.gallery-main {
    height: 60vh;
    min-height: 400px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
}

.gallery-slide.active {
    opacity: 1;
    z-index: 2;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 180ms ease, transform 180ms ease;
}

.gallery-main:hover .gallery-slide.active img {
    filter: brightness(0.88) contrast(1.08);
    transform: scale(1.015);
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 10;
    pointer-events: none;
}

.gallery-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    pointer-events: auto;
}

.gallery-btn:hover {
    background-color: var(--primary);
}

.gallery-btn:hover svg {
    stroke: var(--secondary);
}

.gallery-btn svg {
    width: 24px;
    height: 24px;
    stroke: var(--primary);
    stroke-width: 2;
}

.gallery-thumbs {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
}

.gallery-thumb {
    width: 100px;
    height: 70px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: var(--transition);
    scroll-snap-align: start;
}

.gallery-thumb.active,
.gallery-thumb:hover {
    opacity: 1;
    border-color: var(--primary);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Detail Content Grid */
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 48px;
    align-items: start;
}

.detail-main h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 12px;
}

.detail-description {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-muted);
    text-align: justify;
    margin-bottom: 40px;
    overflow: hidden;
    transition: max-height 0.36s ease;
}

.detail-description-collapsed {
    margin-bottom: 12px;
}

.detail-read-more {
    display: inline-flex;
    margin: 10px 0 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-weight: 800;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.detail-description p {
    margin-bottom: 16px;
}

/* Technical Specs Table/Grid */
.specs-table {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 48px;
    background-color: var(--bg-alt);
    padding: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.spec-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.spec-row:nth-child(even) {
    /* Balance column styling */
}

.spec-label {
    font-weight: 600;
    color: var(--primary);
}

.spec-value {
    color: var(--text);
    font-weight: 500;
}

/* Floor Plans Section */
.floor-plans-section {
    margin-bottom: 48px;
}

.floor-plan-gallery {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.floor-plan-container {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    background-color: var(--secondary);
    min-height: 360px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.floor-plan-slide {
    display: none;
    width: 100%;
    min-height: 312px;
    align-items: center;
    justify-content: center;
}

.floor-plan-slide.active {
    display: flex;
}

.floor-plan-slide img {
    max-width: 100%;
    max-height: 450px;
    object-fit: contain;
}

.floor-plan-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.94);
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    z-index: 2;
}

.floor-plan-nav:hover {
    background: var(--primary);
    color: var(--secondary);
}

.floor-plan-nav svg {
    width: 22px;
    height: 22px;
}

.floor-plan-nav-prev {
    left: 16px;
}

.floor-plan-nav-next {
    right: 16px;
}

.floor-plan-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--border);
}

.floor-plan-thumb {
    flex: 0 0 108px;
    width: 108px;
    height: 76px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    background: var(--bg-alt);
    cursor: pointer;
    overflow: hidden;
    opacity: 0.72;
    transition: var(--transition);
}

.floor-plan-thumb.active,
.floor-plan-thumb:hover {
    border-color: var(--primary);
    opacity: 1;
}

.floor-plan-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 640px) {
    .floor-plan-container {
        min-height: 280px;
        padding: 18px;
    }

    .floor-plan-slide {
        min-height: 244px;
    }

    .floor-plan-nav {
        width: 38px;
        height: 38px;
    }

    .floor-plan-nav-prev {
        left: 10px;
    }

    .floor-plan-nav-next {
        right: 10px;
    }

    .floor-plan-thumb {
        flex-basis: 92px;
        width: 92px;
        height: 66px;
    }
}

/* Action Buttons Bar */
.action-buttons-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 48px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 24px 0;
}

/* Map Section */
.detail-map-section {
    margin-bottom: 48px;
}

#detail-map {
    height: 350px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

/* Contact Sidebar */
.contact-sidebar {
    background-color: var(--primary);
    color: var(--secondary);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.contact-sidebar h3 {
    color: var(--secondary);
    font-size: 1.5rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.contact-sidebar p {
    color: rgba(255, 255, 255, 0.80);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.contact-sidebar .contact-phone {
    width: 100%;
    background: var(--secondary);
    color: var(--primary);
}

.contact-sidebar .contact-phone:hover {
    background: var(--accent);
    color: var(--secondary);
}

.contact-sidebar-details {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.contact-sidebar-details > div {
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.contact-sidebar-details p {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 0.75rem;
}

.contact-sidebar-details p span {
    color: rgba(255, 255, 255, 0.72);
}

.contact-sidebar-details p strong {
    color: var(--secondary);
    text-align: right;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--secondary);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    background-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.contact-form button {
    margin-top: 8px;
    background-color: var(--accent);
    color: var(--secondary);
    border: none;
    font-weight: 700;
}

.contact-form button:hover {
    background-color: #b08d4b;
}

/* Share Modal */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(2, 50, 100, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    z-index: 2000;
}

.share-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.share-card {
    background-color: var(--secondary);
    padding: 40px;
    border-radius: var(--radius);
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    position: relative;
    transform: scale(0.9);
    transition: var(--transition);
}

.share-modal.open .share-card {
    transform: scale(1);
}

body.modal-open {
    overflow: hidden;
}

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: rgba(2, 24, 42, 0.88);
}

.image-lightbox.open {
    display: flex;
}

.image-lightbox img {
    display: block;
    max-width: min(1180px, 94vw);
    max-height: 88vh;
    object-fit: contain;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.image-lightbox-close {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: rgba(2, 50, 100, 0.72);
    color: #ffffff;
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
}

.image-lightbox-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: rgba(2, 50, 100, 0.72);
    color: #ffffff;
    cursor: pointer;
    transform: translateY(-50%);
}

.image-lightbox-nav:hover,
.image-lightbox-close:hover {
    background: rgba(2, 50, 100, 0.95);
}

.image-lightbox-nav svg {
    width: 18px;
    height: 18px;
}

.image-lightbox-prev {
    left: 14px;
}

.image-lightbox-next {
    right: 14px;
}

.about-gallery-section { background: var(--bg-alt); }
.about-gallery-heading { margin-bottom: 24px; text-align: center; }
.about-gallery-heading > span { display: block; margin-bottom: 8px; color: var(--accent); font-size: .8rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.about-gallery-heading h2 { margin: 0; font-size: 2rem; }
.about-gallery { max-width: 1050px; margin: 0 auto; outline: none; }
.about-gallery-stage { position: relative; overflow: hidden; aspect-ratio: 3 / 2; border-radius: var(--radius); background: var(--primary); box-shadow: var(--shadow-lg); }
.about-gallery-slide { position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; opacity: 0; visibility: hidden; transition: opacity 220ms ease, visibility 220ms ease; }
.about-gallery-slide.active { opacity: 1; visibility: visible; }
.about-gallery-slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.about-gallery-nav { position: absolute; top: 50%; z-index: 3; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; transform: translateY(-50%); border: 1px solid rgba(255,255,255,.82); border-radius: 50%; background: rgba(2,50,100,.82); color: #fff; cursor: pointer; opacity: 0; visibility: hidden; transition: opacity 180ms ease, visibility 180ms ease, background-color 180ms ease; }
.about-gallery:hover .about-gallery-nav,
.about-gallery:focus-within .about-gallery-nav { opacity: 1; visibility: visible; }
.about-gallery-nav:hover { background: var(--accent); }
.about-gallery-nav svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.about-gallery-prev { left: 20px; }
.about-gallery-next { right: 20px; }
.about-gallery-lightbox .image-lightbox-nav {
    width: 54px;
    height: 54px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #023264;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}

.about-gallery-lightbox .image-lightbox-nav:hover {
    background: var(--accent);
}

.about-gallery-lightbox .image-lightbox-nav svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.about-gallery-lightbox .image-lightbox-prev { left: 28px; }
.about-gallery-lightbox .image-lightbox-next { right: 28px; }

/* Property pages intentionally avoid bold typography. */
.single-immobile .site-main * {
    font-weight: 400 !important;
}

.share-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.share-card h3 {
    margin-bottom: 24px;
    text-align: center;
}

.share-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.share-option:hover {
    background-color: var(--bg-alt);
    border-color: var(--primary);
    color: var(--primary);
}

.share-option svg {
    width: 24px;
    height: 24px;
    fill: var(--primary);
}

.share-link-copy {
    display: flex;
    gap: 8px;
}

.share-link-copy input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    background-color: var(--bg-alt);
    color: var(--text-muted);
    outline: none;
}

/* --- 8. VENDERE CON NOI & CONTATTI PAGES --- */
.contact-section-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 64px;
    align-items: start;
}

.contact-info-panel h2 {
    font-size: 2.2rem;
    margin-bottom: 24px;
}

.contact-info-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 40px;
}

.info-item {
    display: flex;
    gap: 16px;
}

.info-icon {
    width: 48px;
    height: 48px;
    background-color: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--primary);
}

.info-content h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.info-content p {
    color: var(--text-muted);
}

.contact-form-panel {
    background-color: var(--bg-alt);
    padding: 48px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.contact-form-panel h3 {
    margin-bottom: 24px;
    font-size: 1.5rem;
}

.contact-form-panel .wp-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    margin: 0;
}

.contact-form-panel .wp-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    margin: 0;
}

.contact-form-panel .wp-form .form-group {
    min-width: 0;
    margin: 0;
}

.contact-form-panel .wpcf7,
.valuation-modal-card .wpcf7 {
    width: 100%;
}

.contact-form-panel .wpcf7-form,
.valuation-modal-card .wpcf7-form {
    margin: 0;
}

.contact-form-panel .wpcf7-form-control-wrap,
.valuation-modal-card .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

.contact-form-panel .wp-form .wpcf7-submit,
.valuation-modal-card .valuation-form .wpcf7-submit {
    width: 100%;
}

.contact-form-panel .privacy-check .wpcf7-list-item,
.valuation-modal-card .privacy-check .wpcf7-list-item {
    margin: 0;
}

.contact-form-panel .privacy-check .wpcf7-list-item label,
.valuation-modal-card .privacy-check .wpcf7-list-item label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.contact-form-panel .privacy-check .wpcf7-list-item-label,
.valuation-modal-card .privacy-check .wpcf7-list-item-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wpcf7 form .wpcf7-response-output {
    margin: 18px 0 0;
}

.contact-form-panel .wp-form input,
.contact-form-panel .wp-form textarea,
.contact-form-panel .wp-form select {
    display: block;
    width: 100%;
    margin: 0;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--secondary);
    outline: none;
    transition: var(--transition);
}

.contact-form-panel .wp-form input:focus,
.contact-form-panel .wp-form textarea:focus,
.contact-form-panel .wp-form select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 50, 100, 0.1);
}

.contact-form-panel .wp-form input::placeholder,
.contact-form-panel .wp-form textarea::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.contact-form-panel .wp-form input::-webkit-input-placeholder,
.contact-form-panel .wp-form textarea::-webkit-input-placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.contact-form-panel .wp-form .privacy-check input[type="checkbox"] {
    width: auto;
}

.contact-form-panel .wp-form input.wpcf7-submit {
    display: inline-flex;
    width: 100%;
    background-color: var(--primary);
    color: var(--secondary);
    border-color: var(--primary);
    cursor: pointer;
}

.contact-form-panel .wp-form input.wpcf7-submit:hover {
    background-color: #011d3b;
    border-color: #011d3b;
}

/* --- 9. FOOTER --- */
.site-footer {
    background-color: var(--primary);
    color: var(--secondary);
    padding: 60px 0 24px 0;
    border-top: 4px solid var(--accent);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 48px;
}

.footer-col h3 {
    color: var(--secondary);
    font-size: 1.2rem;
    margin-bottom: 24px;
    font-weight: 700;
}

.footer-col p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.footer-logo img {
    width: auto;
    max-width: 260px;
    height: auto;
    max-height: 72px;
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    display: inline-block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--accent);
    transform: translateX(4px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

/* --- 9B. ALTERNATIVE HOME HP TEMPLATE --- */
.home-template-hp {
    --hp-blue: #023264;
    --hp-blue-dark: #023264;
    --hp-gold: #cfa85a;
    --hp-ink: #023264;
    --hp-muted: #6d8296;
    --hp-ice: #edf3f7;
}

.home-template-hp .site-header {
    background-color: #edf3f7;
}

.home-template-hp .logo img.middlemen-site-logo-raster {
    filter: none;
}

.home-template-hp .logo img.middlemen-site-logo-svg {
    filter: none;
}

.home-template-hp .nav-menu a {
    color: #526b82;
}

.home-template-hp .nav-menu a:hover {
    color: var(--hp-blue);
}

.home-template-hp .lang-switch {
    border-color: rgba(13, 71, 117, 0.24);
    color: #526b82;
}

.home-template-hp .lang-switch .active,
.home-template-hp .lang-switch a.active,
.home-template-hp .lang-switch a {
    color: var(--hp-blue);
}

.home-hp {
    color: var(--hp-ink);
    background: #ffffff;
}

.home-hp .container {
    max-width: 1100px;
}

.home-hp-hero {
    position: relative;
    min-height: 600px;
    overflow: hidden;
    background: var(--hp-blue);
    color: #ffffff;
    display: flex;
    align-items: flex-start;
}

.home-hp-hero-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 48px;
    align-items: center;
    padding-top: 86px;
}

.home-hp-kicker {
    display: inline-block;
    margin-bottom: 18px;
    color: rgba(255, 255, 255, 0.58);
    font-family: var(--font-ui);
    font-size: 0.68rem;
    letter-spacing: 0.42em;
    text-transform: uppercase;
}

.home-hp-kicker-gold {
    color: var(--hp-gold);
}

.home-hp-copy h1 {
    max-width: 640px;
    margin: 0;
    color: #ffffff;
    font-size: clamp(2.35rem, 4vw, 3.9rem);
    font-weight: 800;
    line-height: 1.02;
}

.home-hp-copy h1 span {
    display: block;
    color: var(--hp-gold);
}

.home-hp-copy p {
    max-width: 520px;
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 1.08rem;
    line-height: 1.55;
}

.home-hp-hero-link {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 250px;
    height: 52px;
    padding: 0 30px;
    background: var(--hp-gold);
    color: #ffffff;
    font-size: 0.9rem;
}

.home-hp-hero-link:hover {
    background: #bd9241;
    color: #ffffff;
}

.home-hp-skyline {
    position: absolute;
    z-index: 1;
    left: 50%;
    bottom: -5px;
    width: min(1050px, 92vw);
    transform: translateX(-50%);
    pointer-events: none;
}

.home-hp-section {
    padding: 88px 0;
}

.home-hp-story-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 500px;
    gap: 86px;
    align-items: center;
}

.home-hp-story-copy h2,
.home-hp-proposals h2,
.home-hp-sell h2 {
    margin: 0 0 24px;
    color: var(--hp-ink);
    font-size: clamp(2.1rem, 3vw, 3.2rem);
    line-height: 1.08;
}

.home-hp-story-copy p {
    max-width: 530px;
    color: var(--hp-muted);
    font-size: 1rem;
    line-height: 1.7;
}

.home-hp-story-lead {
    margin-top: 0;
}

.home-hp-text-link {
    display: inline-flex;
    margin-top: 8px;
    color: var(--hp-gold);
    border-bottom: 1px solid currentColor;
}

.home-hp-stats {
    padding: 28px 32px 22px;
    border: 1px solid rgba(13, 71, 117, 0.14);
    border-radius: 14px;
    background: #f4f8fb;
    text-align: center;
}

.home-hp-stats img {
    width: auto;
    max-width: 240px;
    max-height: 92px;
    margin: 0 auto 22px;
}

.home-hp-stats img.middlemen-site-logo-raster {
    filter: none;
}

.home-hp-stats img.middlemen-site-logo-svg {
    filter: none;
}

.home-hp-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 92px;
    justify-content: center;
    border-top: 1px solid rgba(13, 71, 117, 0.12);
}

.home-hp-stat strong {
    color: var(--hp-ink);
    font-family: var(--font-heading);
    font-size: 3.3rem;
    line-height: 1;
}

.home-hp-stat span {
    color: #607789;
    font-size: 0.7rem;
    line-height: 1.35;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.home-hp-proposals {
    background: var(--hp-ice);
}

.home-hp-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
    margin-top: 34px;
}

.home-hp-card {
    overflow: hidden;
    min-height: 290px;
    background: #ffffff;
    border: 1px solid rgba(13, 71, 117, 0.12);
    border-radius: 18px;
    box-shadow: 0 14px 32px rgba(13, 71, 117, 0.08);
    color: var(--hp-ink);
    text-align: center;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease, border-color 180ms ease;
}

.home-hp-card-fuori-milano {
    display: none;
}

.home-hp-card img {
    width: 100%;
    height: 205px;
    object-fit: cover;
}

.home-hp-card span {
    display: block;
    max-width: 220px;
    min-height: 0;
    margin: 22px auto 20px;
    color: var(--hp-ink);
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1.12;
}

.home-hp-card:hover {
    transform: translateY(-4px);
    border-color: rgba(13, 71, 117, 0.26);
    box-shadow: 0 18px 40px rgba(13, 71, 117, 0.14);
    filter: contrast(1.04) brightness(1.02);
}

.home-hp-sell {
    padding: 88px 0;
    background: var(--hp-blue);
    color: #ffffff;
}

.home-hp-sell-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 470px;
    gap: 88px;
    align-items: center;
}

.home-hp-sell h2 {
    color: #ffffff;
}

.home-hp-sell p {
    max-width: 560px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 1.08rem;
    font-weight: 400;
    line-height: 1.7;
}

.home-hp-valuation {
    display: grid;
    gap: 16px;
    padding: 36px 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 34px;
    background: rgba(8, 55, 96, 0.66);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.08);
}

.home-hp-valuation h3 {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: 0.95rem;
}

.home-hp-valuation input,
.home-hp-valuation textarea {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: #213344;
    color: #ffffff;
    padding: 16px 18px;
}

.home-hp-valuation input::placeholder,
.home-hp-valuation textarea::placeholder {
    color: rgba(255, 255, 255, 0.44);
}

.home-hp-valuation button {
    height: 52px;
    border: 0;
    border-radius: 8px;
    background: var(--hp-gold);
    color: #ffffff;
    cursor: pointer;
}

.home-hp-valuation .wpcf7-form,
.home-hp-valuation .valuation-form {
    display: grid;
    gap: 16px;
}

.home-hp-valuation .valuation-form .form-row {
    grid-template-columns: 1fr;
    gap: 16px;
}

.home-hp-valuation .valuation-form .form-group input,
.home-hp-valuation .valuation-form .form-group textarea {
    border-color: rgba(255, 255, 255, 0.12);
    background: #213344;
    color: #ffffff;
}

.home-hp-valuation .privacy-check,
.home-hp-valuation .privacy-check a,
.home-hp-valuation .wpcf7-not-valid-tip,
.home-hp-valuation .wpcf7-response-output {
    color: #ffffff;
}

.home-hp-valuation .wpcf7-form p,
.home-hp-valuation .privacy-check p {
    margin: 0;
}

.home-hp-valuation .privacy-check .wpcf7-list-item {
    margin: 0;
}

.home-hp-valuation .privacy-check .wpcf7-list-item label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.home-hp-valuation .privacy-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 3px 0 0;
    padding: 0;
    flex: 0 0 16px;
}

.home-hp-valuation .privacy-check .wpcf7-list-item-label {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.home-hp-valuation .privacy-check strong,
.home-hp-valuation .privacy-check small,
.home-hp-valuation .privacy-check a {
    color: #ffffff;
}

.home-hp-valuation .wpcf7 form .wpcf7-response-output,
.home-hp-valuation .wpcf7-response-output {
    margin: 0;
}

.home-hp-valuation input[type="submit"] {
    height: 52px;
    border: 0;
    border-radius: 8px;
    background: var(--hp-gold);
    color: #ffffff;
    cursor: pointer;
}

.home-template-hp .site-footer {
    background: var(--hp-ice);
    color: var(--hp-muted);
    border-top: 0;
}

.home-template-hp .footer-col h3,
.home-template-hp .footer-col p,
.home-template-hp .footer-links a,
.home-template-hp .footer-bottom {
    color: var(--hp-muted);
}

.home-template-hp .footer-col h3 {
    color: var(--hp-gold);
    font-size: 0.68rem;
    letter-spacing: 0.34em;
    text-transform: uppercase;
}

.home-template-hp .footer-logo img.middlemen-site-logo-raster {
    filter: none;
}

@media (min-width: 1025px) {
    .site-header .logo img {
        max-width: 310px;
        max-height: 56px;
    }

    .logo img.middlemen-site-logo-svg {
        width: 310px;
    }
}

.home-template-hp .footer-logo img.middlemen-site-logo-svg {
    filter: none;
}

.home-template-hp .footer-bottom {
    border-top-color: rgba(13, 71, 117, 0.25);
}

/* --- 10. MEDIA QUERIES --- */
@media (max-width: 1360px) {
    .listings-container.has-map .listings-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .site-header {
        position: fixed !important;
        top: 0;
        right: 0;
        left: 0;
        z-index: 10000;
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    body.admin-bar .site-header {
        top: 32px;
    }

    .home-hp-hero-inner,
    .home-hp-story-grid,
    .home-hp-sell-grid {
        grid-template-columns: 1fr;
        gap: 44px;
    }
    .home-hp-hero {
        min-height: 570px;
    }
    .home-hp-hero-link {
        justify-self: start;
    }
    .home-hp-stats {
        max-width: 560px;
    }
    .home-hp-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
    .module-list-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .listings-container {
        grid-template-columns: 1fr;
    }

    .listings-container.has-map {
        grid-template-columns: 1fr;
    }

    .listings-grid,
    .listings-container.has-map .listings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .proposte-layout.proposte-layout-cols-3 .listings-grid,
    .proposte-layout.proposte-layout-cols-3 .listings-container.has-map .listings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .proposte-layout {
        width: 100%;
        margin-left: 0;
    }

    .map-sidebar {
        position: relative;
        top: auto;
        height: 420px;
        min-height: 320px;
    }

    .map-toggle-btn {
        display: none;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .contact-sidebar {
        position: relative;
        top: 0;
        max-height: none;
        overflow: visible;
        margin-top: 32px;
    }
}

@media (max-width: 768px) {
    .about-gallery-heading h2 { font-size: 1.65rem; }
    .about-gallery-stage { border-radius: 10px; }
    .about-gallery-nav { width: 42px; height: 42px; opacity: 1; visibility: visible; }
    .about-gallery-prev { left: 10px; }
    .about-gallery-next { right: 10px; }
    .about-gallery-lightbox .image-lightbox-nav { width: 46px; height: 46px; }
    .about-gallery-lightbox .image-lightbox-prev { left: 8px; }
    .about-gallery-lightbox .image-lightbox-next { right: 8px; }

    .property-v2-nav,
    .gallery-nav {
        display: none !important;
    }

    .page-next-step-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .page-next-step-actions .btn {
        width: 100%;
        text-align: center;
    }

    .home-hp-card-fuori-milano {
        display: block;
    }

    .page-hero {
        padding: 32px 0 52px;
    }

    .page-hero-content {
        transform: none;
    }

    .valuation-form .form-row {
        grid-template-columns: 1fr;
    }

    .archive-filter-bar {
        margin-bottom: 22px;
    }

    .archive-filter-bar .filter-nav {
        gap: 12px;
    }

    .archive-filter-bar .archive-view-toggle {
        width: 100%;
        margin-top: 2px;
        padding: 12px 0 0;
        border: 0;
        border-top: 1px solid var(--border);
        border-radius: 0;
        background: transparent;
    }

    .archive-filter-bar .filter-nav-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .archive-filter-bar .filter-tab {
        min-height: 40px;
        padding: 8px 10px;
    }

    .archive-filter-bar .sort-group {
        align-items: center;
        flex-direction: row;
    }

    .archive-filter-bar .sort-group select {
        flex: 1;
        min-width: 0;
    }

    .logo img,
    .logo img.middlemen-site-logo-svg {
        width: 220px;
        max-width: 58vw;
    }

    .home-template-hp .menu-toggle {
        color: var(--hp-blue);
    }
    .home-template-hp .nav-menu {
        background-color: #edf3f7;
        border-top-color: rgba(13, 71, 117, 0.15);
    }
    .home-template-hp .nav-menu a {
        color: var(--hp-blue);
    }
    .home-hp-hero {
        min-height: 560px;
    }
    .home-hp-hero-inner {
        padding-top: 56px;
    }
    .home-hp-copy h1 {
        font-size: clamp(2.2rem, 9vw, 3rem);
    }
    .home-hp-copy p {
        font-size: 1rem;
    }
    .home-hp-hero-link {
        width: 100%;
        min-width: 0;
    }
    .home-hp-section,
    .home-hp-sell {
        padding: 56px 0;
    }
    .home-hp-card {
        min-height: 0;
    }
    .home-hp-card img {
        height: 34vw;
        min-height: 130px;
        max-height: 180px;
    }
    .home-hp-card span {
        min-height: 0;
        margin: 16px auto 16px;
        padding: 0 10px;
        font-size: 1rem;
    }
    .home-hp-story-copy h2,
    .home-hp-proposals h2,
    .home-hp-sell h2 {
        font-size: clamp(1.9rem, 8vw, 2.55rem);
    }
    .home-hp-stat {
        min-height: 86px;
    }
    .home-hp-stat strong {
        font-size: 1.9rem;
    }
    .filter-nav {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-nav-tabs {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
    }

    .filter-tab {
        flex: 1;
    }

    .sort-group {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .sort-group select {
        width: 100%;
    }

    .archive-view-toggle {
        width: 100%;
    }

    .archive-view-btn {
        flex: 1;
        padding: 8px 10px;
        font-size: 0.82rem;
    }

    .listings-container.has-map .map-sidebar {
        display: none;
    }

    .listings-container.has-map.is-map-view .listings-grid-wrapper {
        display: none;
    }

    .listings-container.has-map.is-map-view .map-sidebar {
        display: block;
        height: 68vh;
        min-height: 420px;
    }

    .listings-grid,
    .listings-container.has-map .listings-grid {
        grid-template-columns: 1fr;
    }

    .proposte-layout.proposte-layout-cols-1 .listings-grid,
    .proposte-layout.proposte-layout-cols-2 .listings-grid,
    .proposte-layout.proposte-layout-cols-3 .listings-grid,
    .proposte-layout.proposte-layout-cols-1 .listings-container.has-map .listings-grid,
    .proposte-layout.proposte-layout-cols-2 .listings-container.has-map .listings-grid,
    .proposte-layout.proposte-layout-cols-3 .listings-container.has-map .listings-grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .history-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .page-split.page-split,
    .process-grid,
    .page-values,
    .guide-download-box {
        grid-template-columns: 1fr !important;
    }

    .page-values {
        width: 100%;
        overflow: visible;
    }

    .page-next-step-content {
        align-items: flex-start;
        flex-direction: column;
        gap: 24px;
    }

    .guide-download-copy {
        grid-template-columns: 1fr;
    }

    .guide-cover {
        max-width: 240px;
    }

    .page-hero-content h1 {
        font-size: 2.35rem;
    }

    .history-image {
        max-width: 500px;
        margin: 0 auto;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #023264;
        padding: 24px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
        border-top: 1px solid rgba(255, 255, 255, 0.18);
        gap: 16px;
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-right {
        display: none;
    }

    .detail-header-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .detail-price-box {
        text-align: left;
    }

    .specs-table {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .contact-form-panel .wp-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .contact-section-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .home-hp-kicker {
        letter-spacing: 0.26em;
    }
    .home-hp-stats {
        padding: 24px 20px;
        border-radius: 12px;
    }
    .home-hp-stats img {
        max-width: 210px;
        max-height: 86px;
    }
    .home-hp-valuation {
        padding: 30px 20px;
        border-radius: 24px;
    }
    .module-list-grid {
        grid-template-columns: 1fr;
    }

    .hero-cta {
        flex-direction: column;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .badge-30years {
        display: none;
    }
}

@media (max-width: 782px) {
    body.admin-bar .site-header {
        top: 46px;
    }
}

/* --- 11. PRINT / PDF EXPORT STYLING --- */
@media print {
    body {
        background-color: #ffffff;
        color: #000000;
        font-size: 11pt;
        line-height: 1.4;
    }

    .site-header,
    .site-footer,
    .action-buttons-bar,
    .contact-sidebar,
    .detail-map-section,
    .gallery-nav,
    .gallery-thumbs,
    #detail-map,
    .map-sidebar,
    .filter-bar,
    .btn,
    .share-modal {
        display: none !important;
    }

    .container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .detail-grid {
        display: block !important;
    }

    .detail-main {
        width: 100% !important;
    }

    /* PDF Header with Brand Name */
    .property-detail-header {
        border-bottom: 2px solid #023264;
        padding-bottom: 12px;
        margin-bottom: 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .property-detail-header::before {
        content: 'MIDDLEMEN | AGENZIA IMMOBILIARE MILANO';
        font-family: 'Outfit', sans-serif;
        font-weight: 800;
        font-size: 14pt;
        color: #023264;
    }

    .detail-title h1 {
        font-size: 20pt !important;
        margin-top: 10px;
        color: #023264 !important;
    }

    .detail-price {
        font-size: 18pt !important;
        color: #023264 !important;
    }

    /* Gallery image - print just the first/active one */
    .property-gallery {
        height: 250px !important;
        margin-bottom: 20px !important;
        box-shadow: none !important;
        border: 1px solid #cccccc;
    }

    .gallery-main {
        height: 250px !important;
        min-height: 250px !important;
    }

    .gallery-slide {
        display: none;
    }

    .gallery-slide.active {
        display: block !important;
        opacity: 1 !important;
    }

    .gallery-slide img {
        height: 250px !important;
        object-fit: cover !important;
    }

    /* Table specs */
    .specs-table {
        display: table !important;
        width: 100% !important;
        border-collapse: collapse !important;
        background-color: transparent !important;
        border: none !important;
        padding: 0 !important;
        margin-bottom: 30px !important;
    }

    .spec-row {
        display: table-row !important;
        border-bottom: 1px solid #cccccc !important;
    }

    .spec-label,
    .spec-value {
        display: table-cell !important;
        padding: 8px 12px !important;
    }

    .spec-label {
        font-weight: bold !important;
        color: #023264 !important;
    }

    /* Description */
    .detail-description {
        margin-bottom: 30px !important;
        page-break-inside: avoid;
    }

    /* Floor Plan */
    .floor-plans-section {
        page-break-before: always;
        text-align: center;
        margin-top: 40px;
    }

    .floor-plan-container {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    .floor-plan-slide {
        display: flex !important;
        min-height: 0 !important;
        margin-bottom: 20px !important;
        page-break-inside: avoid;
    }

    .floor-plan-slide img {
        max-width: 100% !important;
        max-height: 400px !important;
        width: auto !important;
    }

    .floor-plan-nav,
    .floor-plan-thumbs {
        display: none !important;
    }

    /* Add a footer with agency coordinates on print */
    body::after {
        content: 'Middlemen S.r.l. - Via M. Buonarroti, 7 - Milano - middlemen@middlemen.it - www.middlemen.it';
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        text-align: center;
        font-size: 8pt;
        color: #666666;
        border-top: 1px solid #cccccc;
        padding-top: 10px;
    }
}

.nav-menu a {display:inline-block;line-height:1;}
.main-navigation{padding:0 10px;}
#detail-map .leaflet-bottom.leaflet-right{z-index:900;}

.property-video-section {
    margin-top: 34px;
}

.property-video-embed {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius);
    background: #000;
    aspect-ratio: 16 / 9;
}

.property-video-embed iframe,
.property-video-embed video,
.property-video-embed .wp-video,
.property-video-embed .mejs-container {
    display: block;
    width: 100% !important;
    height: 100% !important;
    border: 0;
}

/* Loader transizioni Elenco/Mappa e categorie immobili */
.archive-transition-loader[hidden] {
    display: none !important;
}

.archive-transition-loader {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.archive-transition-loader.is-visible {
    opacity: 1;
}

.archive-transition-loader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    color: #023264;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.archive-classic-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(2, 50, 100, 0.16);
    border-top-color: #023264;
    border-radius: 50%;
    animation: middlemen-spinner-rotate 0.75s linear infinite;
}

@keyframes middlemen-spinner-rotate {
    to { transform: rotate(360deg); }
}

.archive-loader-logo {
    position: relative;
    width: min(280px, 62vw);
}

.archive-loader-logo > img,
.archive-loader-logo-fill img {
    display: block;
    width: 100%;
    height: auto;
}

.archive-loader-logo > img {
    opacity: 0.2;
}

.archive-loader-logo-fill {
    position: absolute;
    inset: 0;
    overflow: hidden;
    width: 0;
    filter: sepia(1) saturate(2.8) hue-rotate(354deg) brightness(0.9);
    animation: middlemen-logo-fill 1.15s ease-in-out infinite;
}

.archive-loader-logo-fill img {
    width: min(280px, 62vw);
    max-width: none;
}

@keyframes middlemen-logo-fill {
    0% { width: 0; }
    55%, 75% { width: 100%; }
    100% { width: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.archive-classic-spinner {
		animation-duration: 1.5s;
	}

    .archive-loader-logo-fill {
        width: 100%;
        animation: none;
    }
}
@media (max-width:1024px){
	.home-hp-section.home-hp-story .home-hp-story-grid > div {margin-left:auto !important;margin-right:auto !important;}
	.home-hp-stats {min-width: 55vw;}
}

@media print {
    body * {
        visibility: hidden !important;
    }

    body::after {
        display: none !important;
    }

    .middlemen-pdf-brochure,
    .middlemen-pdf-brochure * {
        visibility: visible !important;
    }

    .middlemen-pdf-brochure {
        display: block !important;
        position: absolute !important;
        inset: 0 auto auto 0 !important;
        width: 100% !important;
        print-color-adjust: exact !important;
        -webkit-print-color-adjust: exact !important;
    }

    .middlemen-pdf-brochure .pdf-cover,
    .middlemen-pdf-brochure .pdf-cover::before,
    .middlemen-pdf-brochure .pdf-cover::after,
    .middlemen-pdf-brochure .pdf-page,
    .middlemen-pdf-brochure .pdf-details-grid,
    .middlemen-pdf-brochure .pdf-floor-grid,
    .middlemen-pdf-brochure .pdf-photo-strip,
    .middlemen-pdf-brochure .pdf-hero-grid {
        visibility: visible !important;
    }
}
