/* Getrix Sync — Frontend styles
 *
 * All visual values are driven by CSS custom properties emitted by
 * AppearanceCssGenerator (wp_head). Fallbacks below ensure the plugin
 * still renders when no appearance settings have been saved.
 */

/* ------------------------------------------------------------------
 * Listing (new wrapper used by property-list.php)
 * ------------------------------------------------------------------ */
.gx-listing {
    font-family: var(--gx-font-family, inherit);
    color: var(--gx-color-text, #1a1a1a);
}

.gx-listing__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: var(--gx-card-gap, 24px);
    font-size: 14px;
    color: var(--gx-color-muted, #6b7280);
}

.gx-listing__count strong {
    color: var(--gx-color-text, #1a1a1a);
    font-weight: 700;
}

.gx-listing__switch {
    display: inline-flex;
    gap: 4px;
    padding: var(--gx-switch-track-padding, 4px);
    background: var(--gx-switch-track-bg, #e7e7e4);
    border-radius: var(--gx-switch-track-radius, 12px);
}

.gx-listing__switch-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--gx-switch-icon-color, #6b7280);
    width: var(--gx-switch-btn-size, 36px);
    height: var(--gx-switch-btn-size, 36px);
    border-radius: var(--gx-switch-btn-radius, 8px);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s, border-radius 0.15s;
}

.gx-listing__switch-btn[aria-pressed="true"] {
    background: var(--gx-switch-active-bg, #ffffff);
    color: var(--gx-switch-active-color, #1E4D36);
    border-radius: var(--gx-switch-active-radius, 999px);
    box-shadow: var(--gx-switch-active-shadow, 0 1px 3px rgba(0,0,0,0.12));
}

.gx-listing__sort-wrap {
    position: relative;
    margin-left: auto;
}

.gx-listing__sort {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--gx-switch-track-bg, #e7e7e4);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    border: none;
    border-radius: var(--gx-switch-track-radius, 12px);
    color: var(--gx-color-text, #1a1a1a);
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    height: var(--gx-switch-btn-size, 36px);
    padding: 0 32px 0 12px;
    transition: background 0.15s, box-shadow 0.15s;
}

.gx-listing__sort:focus {
    outline: 2px solid var(--gx-switch-active-color, #1E4D36);
    outline-offset: 2px;
}

.gx-listing__grid {
    display: grid;
    grid-template-columns: repeat(var(--gx-grid-cols, 4), 1fr);
    gap: var(--gx-card-gap, 24px);
}

@media (max-width: 1024px) {
    .gx-listing__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Mobile: single column, hide layout switch and sort, force vertical card even if list view was selected. */
    .gx-listing__grid {
        grid-template-columns: 1fr !important;
    }
    .gx-listing__switch {
        display: none !important;
    }
    /* Even when list layout was picked on desktop, render vertical on mobile. */
    .gx-listing.is-layout-list .gx-card--wide {
        flex-direction: column;
    }
    .gx-listing.is-layout-list .gx-card--wide .gx-card__media {
        flex: initial;
        aspect-ratio: var(--gx-card-aspect-ratio, 16 / 9);
    }
}

.gx-listing.is-layout-list .gx-listing__grid {
    grid-template-columns: 1fr;
}

.gx-listing__empty {
    padding: 1rem;
    color: var(--gx-color-muted, #6b7280);
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ------------------------------------------------------------------
 * Property list (legacy class names kept for compat — Phase 2 replaces)
 * ------------------------------------------------------------------ */
.gx-property-list__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--gx-card-gap, 24px);
}

.gx-property-list--list .gx-property-list__grid {
    grid-template-columns: 1fr;
}

.gx-property-list__empty {
    padding: 1rem;
}

/* Legacy property card */
.gx-property-card {
    border: var(--gx-card-border-width, 1px) solid var(--gx-color-border, #e5e7eb);
    border-radius: var(--gx-radius-card, 12px);
    background: var(--gx-color-bg, #ffffff);
    box-shadow: var(--gx-card-shadow, 0 1px 2px rgba(0,0,0,0.05));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: var(--gx-font-family, inherit);
    color: var(--gx-color-text, #1a1a1a);
}

.gx-property-card__media {
    overflow: hidden;
    aspect-ratio: var(--gx-card-aspect-ratio, 16 / 9);
}

.gx-property-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gx-property-card__content {
    padding: var(--gx-card-padding, 20px);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.gx-property-card__title {
    margin: 0 0 0.5rem;
    font-size: var(--gx-title-size-card, 18px);
    font-weight: var(--gx-title-weight, 700);
    text-transform: var(--gx-title-transform, uppercase);
    line-height: 1.3;
}

.gx-property-card__title a {
    text-decoration: none;
    color: inherit;
}

.gx-property-card__title a:hover {
    text-decoration: underline;
}

.gx-property-card__meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: var(--gx-body-size, 14px);
    color: var(--gx-color-muted, #6b7280);
    margin-bottom: 0.5rem;
}

.gx-property-card__price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gx-color-price, #1E4D36);
    margin-bottom: 0.75rem;
}

.gx-property-card__badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--gx-radius-pill, 999px);
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--gx-color-badge-bg, #ffffff);
    color: var(--gx-color-badge-text, #1a1a1a);
}

.gx-property-card__badge--reserved {
    background: #fff8e5;
    color: #7a5a00;
}

.gx-property-card__actions {
    margin-top: auto;
}

.gx-property-card__cta {
    display: inline-block;
    font-size: var(--gx-body-size, 14px);
    color: var(--gx-color-primary, #1E4D36);
}

/* ------------------------------------------------------------------
 * New card system (Phase 2 will consume these — already available
 * for the admin live preview).
 * ------------------------------------------------------------------ */
.gx-card {
    position: relative;
    background: var(--gx-color-bg, #ffffff);
    color: var(--gx-color-text, #1a1a1a);
    border: var(--gx-card-border-width, 1px) solid var(--gx-color-border, #e5e7eb);
    border-radius: var(--gx-radius-card, 12px);
    box-shadow: var(--gx-card-shadow, 0 1px 2px rgba(0,0,0,0.05));
    overflow: hidden;
    font-family: var(--gx-font-family, inherit);
    font-size: var(--gx-body-size, 14px);
    display: flex;
}

.gx-card--vertical {
    flex-direction: column;
}

.gx-card__media {
    position: relative;
    aspect-ratio: var(--gx-card-aspect-ratio, 16 / 9);
    overflow: hidden;
    background: var(--gx-color-surface, #f5f5f3);
}

.gx-card__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gx-card__image--placeholder {
    width: 100%;
    height: 100%;
    background:
        linear-gradient(135deg, #d5dcd6 0%, #b4c0b6 50%, #9fb0a1 100%);
}

.gx-card__badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    z-index: 1;
}

.gx-card__badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--gx-radius-pill, 999px);
    background: var(--gx-color-badge-bg, #ffffff);
    color: var(--gx-color-badge-text, #1a1a1a);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.gx-card__badge--sold {
    background: var(--gx-color-badge-sold-bg, #f5c800);
    color: var(--gx-color-badge-sold-text, #1a1a1a);
    padding: 6px 18px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    font-style: italic;
    border-radius: 4px 0 0 4px;
}

.gx-card__status {
    position: absolute;
    top: 14px;
    right: -8px;
    z-index: 2;
}

.gx-card--clickable {
    cursor: pointer;
}

.gx-card--clickable::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Ensure interactive elements inside a clickable card stay above the overlay */
.gx-card--clickable a,
.gx-card--clickable button {
    position: relative;
    z-index: 2;
}

.gx-card__body {
    padding: var(--gx-card-padding, 20px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

/* Vertical card rhythm: body gap handles spacing; divider gets extra top margin to
 * separate the meta block from the excerpt above. CTA inherits margin-top:auto from
 * the base rule so it bottom-aligns across cards regardless of which optional
 * sections are rendered. */
.gx-card--vertical .gx-card__divider { margin-top: 12px; margin-bottom: 0; }

.gx-card__title {
    margin: 0;
    font-size: var(--gx-title-size-card, 18px);
    font-weight: var(--gx-title-weight, 700);
    text-transform: var(--gx-title-transform, uppercase);
    line-height: 1.2;
    letter-spacing: 0.3px;
}

/* Title color is driven by a dedicated card variable so admins can tune it independently. */
.gx-card__title {
    color: var(--gx-card-title-color, var(--gx-color-text, #1a1a1a));
}

.gx-card__title a,
.gx-card__title a:visited,
.gx-card__title a:hover,
.gx-card__title a:focus {
    color: inherit;
    text-decoration: none;
}

.gx-card__price {
    font-size: var(--gx-card-price-size, 24px);
    font-weight: var(--gx-card-price-weight, 700);
    color: var(--gx-color-price, #1E4D36);
    white-space: nowrap;
    line-height: 1.1;
}

.gx-card__location {
    margin: 0;
    color: var(--gx-card-location-color, var(--gx-color-muted, #6b7280));
    font-size: var(--gx-card-location-size, 13px);
}

.gx-card__excerpt {
    margin: 0;
    color: var(--gx-card-excerpt-color, var(--gx-color-muted, #6b7280));
    font-size: var(--gx-card-excerpt-size, 14px);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gx-card__divider {
    height: 1px;
    background: var(--gx-color-border, #e5e7eb);
    margin: 6px 0;
}

.gx-card__meta {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 18px;
    color: var(--gx-color-text, #1a1a1a);
    font-size: 13px;
}

.gx-card__meta li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gx-card__meta-icon {
    color: var(--gx-color-primary, #1E4D36);
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.gx-card__meta-icon svg {
    width: 18px;
    height: 18px;
}

.gx-card__cta {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    background: var(--gx-color-primary, #1E4D36);
    color: #ffffff;
    border-radius: var(--gx-radius-button, 999px);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.15s ease;
}

.gx-card__cta:hover,
.gx-card__cta:focus {
    background: var(--gx-color-primary-hover, #163826);
    color: #ffffff;
}

/* Wide (horizontal) card — used by list view.
 * Rules are authored here so that Phase 2 templates can drop in without CSS churn.
 */
.gx-card--wide {
    flex-direction: row;
    align-items: stretch;
}

.gx-card--wide .gx-card__media {
    position: relative;
    flex: 0 0 var(--gx-card-wide-media-width, 320px);
    aspect-ratio: var(--gx-card-wide-media-ratio, 4 / 3);
    align-self: stretch;
}

.gx-card--wide .gx-card__image,
.gx-card--wide .gx-card__image--placeholder {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

.gx-card--wide .gx-card__body {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "price    cta"
        "title    title"
        "loc      loc"
        "excerpt  excerpt"
        "divider  divider"
        "meta     meta";
    gap: 6px 24px;
    align-items: start;
}

.gx-card--wide .gx-card__price    { grid-area: price; align-self: start; }
.gx-card--wide .gx-card__cta      { grid-area: cta; align-self: start; margin-top: 0; }
.gx-card--wide .gx-card__title    { grid-area: title; }
.gx-card--wide .gx-card__location { grid-area: loc; }
.gx-card--wide .gx-card__excerpt  { grid-area: excerpt; }
.gx-card--wide .gx-card__divider  { grid-area: divider; margin: 8px 0 0; }
.gx-card--wide .gx-card__meta     { grid-area: meta; }

@media (max-width: 768px) {
    .gx-card--wide {
        flex-direction: column;
    }
    .gx-card--wide .gx-card__media {
        flex: initial;
        aspect-ratio: var(--gx-card-aspect-ratio, 16 / 9);
    }
    .gx-card--wide .gx-card__body {
        grid-template-columns: 1fr;
        grid-template-areas:
            "price"
            "title"
            "loc"
            "excerpt"
            "divider"
            "meta"
            "cta";
    }
    .gx-card--wide .gx-card__cta { align-self: stretch; }
}

/* ------------------------------------------------------------------
 * Single property (new layout)
 * ------------------------------------------------------------------ */
.gx-single {
    font-family: var(--gx-font-family, inherit);
    color: var(--gx-color-text, #1a1a1a);
    font-size: var(--gx-body-size, 14px);
}

.gx-single__header {
    margin-bottom: 24px;
}

.gx-single__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.gx-single__title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.gx-single__title-row .gx-single__title {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.gx-single__title-row .gx-single__price-inline {
    flex: 0 0 auto;
    text-align: right;
    white-space: nowrap;
    font-size: clamp(20px, 2.4vw, 28px);
    font-weight: 700;
    color: var(--gx-color-price, #1E4D36);
    line-height: 1.2;
}

@media (max-width: 640px) {
    .gx-single__title-row {
        flex-direction: column;
        gap: 6px;
    }
    .gx-single__title-row .gx-single__price-inline {
        text-align: left;
    }
}

.gx-single__badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: var(--gx-radius-pill, 999px);
    background: var(--gx-color-badge-bg, #ffffff);
    color: var(--gx-color-badge-text, #1a1a1a);
    border: 1px solid var(--gx-color-border, #e5e7eb);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.gx-single__badge--sold {
    background: var(--gx-color-badge-sold-bg, #f5c800);
    color: var(--gx-color-badge-sold-text, #1a1a1a);
    border-color: transparent;
}

.gx-single__badge--ref {
    background: var(--gx-color-surface, #f5f5f3);
    color: var(--gx-color-muted, #6b7280);
    border-color: var(--gx-color-border, #e5e7eb);
}

.gx-single__title {
    margin: 0 0 8px;
    font-size: clamp(22px, 3vw, 32px);
    font-weight: var(--gx-title-weight, 700);
    text-transform: var(--gx-title-transform, uppercase);
    letter-spacing: 0.4px;
    line-height: 1.2;
}

.gx-single__location-row {
    display: flex;
    align-items: stretch; /* stretch children so their min-heights line up */
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

p.gx-single__location,
.gx-single__location-row p.gx-single__location,
.gx-single .gx-single__location-row p.gx-single__location {
    margin: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    padding-bottom: 0 !important;
}

.gx-single__location {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gx-color-muted, #6b7280);
    font-size: 14px;
    line-height: 1;
    min-height: 40px; /* match .gx-single__map-trigger rendered box (38 + 2×1 border) */
    box-sizing: border-box;
}

.gx-single__location svg {
    display: block;
    flex-shrink: 0;
}

.gx-single__map-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    min-height: 38px;
    border-radius: var(--gx-radius-button, 999px);
    border: 1px solid var(--gx-color-border, #e5e7eb);
    background: var(--gx-color-bg, #ffffff);
    color: var(--gx-color-text, #1a1a1a);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.gx-single__map-trigger:hover,
.gx-single__map-trigger:focus-visible {
    background: var(--gx-color-surface, #f5f5f3);
    border-color: var(--gx-color-muted, #6b7280);
    outline: none;
}

.gx-single__map-trigger > * {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    flex-shrink: 0;
}

.gx-single__map-trigger .gx-single__map-trigger-label {
    line-height: 1;
}

.gx-single__map-trigger svg {
    display: block;
    width: 14px;
    height: 14px;
}

.gx-single__map-trigger .gx-single__map-trigger-icon {
    color: var(--gx-color-primary, #1E4D36);
}

.gx-single__map-trigger .gx-single__map-trigger-ext {
    color: var(--gx-color-muted, #6b7280);
}

/* Hero gallery: 1 big + 2 thumbs (Airbnb-style ~60/40) */
.gx-single__gallery {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 12px;
    margin-bottom: 32px;
    border-radius: var(--gx-radius-card, 12px);
    overflow: hidden;
}

.gx-single__gallery--no-thumbs {
    grid-template-columns: 1fr;
}

.gx-single__gallery-hero {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--gx-color-surface, #f5f5f3);
}

.gx-single__gallery-hero img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gx-single__gallery-hero:hover img {
    transform: scale(1.02);
}

.gx-single__gallery-thumbs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
    /* Stretch to match hero height — hero drives the row height via its aspect-ratio */
    align-self: stretch;
}

.gx-single__gallery-thumb {
    position: relative;
    display: block;
    overflow: hidden;
    background: var(--gx-color-surface, #f5f5f3);
    flex: 1 1 0;
    min-height: 0;
}

.gx-single__gallery-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gx-single__gallery-more {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    letter-spacing: 0.3px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .gx-single__gallery {
        grid-template-columns: 1fr;
    }
    .gx-single__gallery-hero {
        aspect-ratio: 16 / 9;
    }
    .gx-single__gallery-thumbs {
        flex-direction: row;
        aspect-ratio: unset;
    }
    .gx-single__gallery-thumb {
        aspect-ratio: 4 / 3;
    }
}

/* Quick stats bar — below gallery */
.gx-single__stats-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
    background: none;
    border: none;
    border-radius: 0;
    overflow: visible;
    padding: 0;
}

.gx-single__stats-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--gx-color-text, #1a1a1a);
    border: none;
    padding: 0;
}

.gx-single__stats-icon {
    display: inline-flex;
    align-items: center;
    color: var(--gx-color-primary, #1E4D36);
    flex-shrink: 0;
}

.gx-single__stats-value {
    white-space: nowrap;
}

.gx-single__floorplans-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--gx-radius-button, 999px);
    border: 1px solid var(--gx-color-border, #e5e7eb);
    background: var(--gx-color-bg, #ffffff);
    color: var(--gx-color-text, #1a1a1a);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.gx-single__floorplans-trigger:hover,
.gx-single__floorplans-trigger:focus-visible {
    background: var(--gx-color-surface, #f5f5f3);
    border-color: var(--gx-color-muted, #6b7280);
    outline: none;
}

.gx-single__floorplans-trigger svg {
    color: var(--gx-color-primary, #1E4D36);
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .gx-single__stats-bar {
        gap: 16px;
    }
}

/* Hidden container that hosts the floor-plans gallery data for the lightbox */
.gx-floorplans-gallery {
    display: none !important;
}

/* Layout: main + sticky sidebar.
 * overflow:visible is intentional — sticky sidebar breaks if any ancestor
 * (including this grid) has overflow other than visible. */
.gx-single,
.gx-single__layout {
    overflow: visible;
}

.gx-single__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 32px;
    align-items: start;
}

@media (max-width: 960px) {
    .gx-single__layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

.gx-single__main {
    min-width: 0;
}

/* Sidebar */
.gx-single__sidebar {
    position: sticky;
    top: 32px;
    align-self: start;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    padding: 24px;
    background: var(--gx-color-bg, #ffffff);
    border: 1px solid var(--gx-color-border, #e5e7eb);
    border-radius: var(--gx-radius-card, 12px);
    box-shadow: var(--gx-card-shadow, 0 1px 2px rgba(0, 0, 0, 0.05));
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gx-single__price {
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gx-color-border, #e5e7eb);
}

.gx-single__price-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--gx-color-price, #1E4D36);
    line-height: 1.1;
}

.gx-single__ref {
    margin: 0;
    font-size: 13px;
    color: var(--gx-color-muted, #6b7280);
}

.gx-single__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: var(--gx-color-primary, #1E4D36);
    color: #ffffff;
    border-radius: var(--gx-radius-button, 999px);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.15s ease;
}

.gx-single__cta:hover,
.gx-single__cta:focus {
    background: var(--gx-color-primary-hover, #163826);
    color: #ffffff;
}

.gx-single__contact {
    /* Admin-supplied shortcode (CF7, WPForms, etc.) */
}

.gx-single__contact-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gx-single__contact-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--gx-color-text, #1a1a1a);
}

.gx-single__contact-subtitle {
    margin: 0;
    font-size: 13px;
    color: var(--gx-color-muted, #6b7280);
    line-height: 1.5;
}

.gx-single__quick-contact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gx-single__contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--gx-radius-button, 999px);
    border: 1px solid var(--gx-color-border, #e5e7eb);
    background: var(--gx-color-bg, #ffffff);
    color: var(--gx-color-text, #1a1a1a);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.gx-single__contact-btn:hover {
    background: var(--gx-color-surface, #f5f5f3);
    border-color: var(--gx-color-muted, #6b7280);
}

.gx-single__contact-btn--whatsapp {
    background: #25D366;
    border-color: #25D366;
    color: #fff;
}

.gx-single__contact-btn--whatsapp:hover {
    background: #1ebe5a;
    border-color: #1ebe5a;
    color: #fff;
}

/* Disabled contact CTAs for terminal situations (sold/rented) */
.gx-single__cta.is-disabled,
.gx-single__contact-btn.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.gx-single__contact-section--unavailable .gx-single__badge {
    display: block;
    margin: 0 auto 10px;
    text-align: center;
    width: fit-content;
}

/* Main content sections (divider at section level, not title level) */
.gx-single__section {
    margin-bottom: 32px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--gx-color-border, #e5e7eb);
}

.gx-single__section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.gx-single__section-title {
    margin: 0 0 20px 0;
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gx-color-primary, #1E4D36);
    padding-bottom: 0;
    border-bottom: none;
}

.gx-single__location-map {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 320px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--gx-color-border, #e5e7eb);
}

.gx-single__location-map iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 640px) {
    .gx-single__location-map {
        min-height: 260px;
    }
}

.gx-single__description-body {
    line-height: 1.7;
    color: var(--gx-color-text, #1a1a1a);
    transition: max-height 0.25s ease;
}

.gx-single__description-body.is-clamped {
    max-height: 8em;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent);
            mask-image: linear-gradient(to bottom, black 60%, transparent);
}

.gx-single__read-more {
    margin-top: 8px;
    appearance: none;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    color: var(--gx-color-primary, #1E4D36);
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.gx-single__read-more:hover,
.gx-single__read-more:focus-visible {
    text-decoration: underline;
    outline: none;
}

/* Specs grid — 2-column card layout, icon + content row */
.gx-single__specs-grid {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.gx-single__spec {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 14px;
    background: var(--gx-color-surface, #f5f5f3);
    border: 1px solid var(--gx-color-border, #e5e7eb);
    border-radius: var(--gx-radius-card, 12px);
}

.gx-single__spec dt,
.gx-single__spec dd {
    display: block;
    margin: 0;
    margin-inline: 0;
    margin-inline-start: 0;
    padding: 0;
    padding-inline: 0;
    padding-inline-start: 0;
    text-align: left;
    text-indent: 0;
    float: none;
    width: auto;
}

.gx-single__spec dt {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gx-color-muted, #6b7280);
    line-height: 1.2;
}

.gx-single__spec-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: var(--gx-color-primary, #1E4D36);
    flex-shrink: 0;
}

.gx-single__spec-icon svg {
    display: block;
    width: 16px;
    height: 16px;
}

.gx-single__spec-label {
    display: inline-block;
    line-height: 1.2;
}

.gx-single__spec dd {
    font-size: 15px;
    font-weight: 700;
    color: var(--gx-color-text, #1a1a1a);
    line-height: 1.3;
}

@media (max-width: 640px) {
    .gx-single__specs-grid {
        grid-template-columns: 1fr;
    }
}

/* Services grid — 2-column checklist (check only, no circle) */
.gx-single__services-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 24px;
}

.gx-single__service-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--gx-color-text, #1a1a1a);
    line-height: 1.3;
}

.gx-single__service-check {
    color: var(--gx-color-primary, #1E4D36);
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .gx-single__services-grid {
        grid-template-columns: 1fr;
    }
}

/* Admin-configured extra shortcode section (free content below services) */
.gx-single__extra-body {
    color: var(--gx-color-text, #1a1a1a);
    line-height: 1.6;
}

/* Amenities list (legacy — kept for compat) */
.gx-single__amenities-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px 24px;
}

.gx-single__amenities-list li {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--gx-color-text, #1a1a1a);
}

.gx-single__amenities-list svg {
    color: var(--gx-color-primary, #1E4D36);
    flex-shrink: 0;
}

/* Map */
.gx-single__map-frame,
.gx-single__video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--gx-radius-card, 12px);
    overflow: hidden;
    border: 1px solid var(--gx-color-border, #e5e7eb);
}

.gx-single__map-frame iframe,
.gx-single__video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Floor plans */
.gx-single__floor-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.gx-single__floor-plans-grid img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: var(--gx-color-surface, #f5f5f3);
    border-radius: var(--gx-radius-card, 12px);
}

/* Lightbox */
.gx-gallery {
    position: fixed;
    inset: 0;
    z-index: 10001;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.gx-gallery[aria-hidden="false"] {
    pointer-events: auto;
    opacity: 1;
}

.gx-gallery__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
}

.gx-gallery__stage {
    position: absolute;
    inset: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    z-index: 1;
}

.gx-gallery__image {
    max-width: 100%;
    max-height: calc(100vh - 140px);
    object-fit: contain;
    display: block;
    border-radius: 4px;
}

.gx-gallery__caption {
    color: #fff;
    margin-top: 12px;
    font-size: 14px;
    text-align: center;
}

.gx-gallery__counter {
    position: absolute;
    top: 16px;
    left: 16px;
    color: #fff;
    font-size: 14px;
    opacity: 0.75;
}

.gx-gallery__close,
.gx-gallery__nav {
    position: absolute;
    appearance: none;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    z-index: 2;
}

.gx-gallery__close:hover,
.gx-gallery__nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.gx-gallery__close {
    top: 16px;
    right: 16px;
}

.gx-gallery__nav {
    top: 50%;
    transform: translateY(-50%);
}

.gx-gallery__nav--prev { left: 16px; }
.gx-gallery__nav--next { right: 16px; }

body.gx-gallery-open {
    overflow: hidden;
}

/* ------------------------------------------------------------------
 * Responsive tuning (mobile-first overrides)
 * ------------------------------------------------------------------ */
@media (max-width: 960px) {
    .gx-single__sidebar {
        position: static;
        top: auto;
    }
}

@media (max-width: 768px) {
    .gx-listing__toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }
    .gx-single__title {
        font-size: 22px;
    }
    .gx-single__section-title {
        font-size: 14px;
    }
    .gx-single__section {
        margin-bottom: 28px;
    }
    .gx-single__gallery {
        gap: 8px;
    }
    .gx-single__gallery-hero {
        aspect-ratio: 16 / 9;
    }
    .gx-single__gallery-thumb {
        min-height: 72px;
    }
    .gx-single__sidebar {
        padding: 18px;
    }
    .gx-single__price-value {
        font-size: 24px;
    }
    .gx-gallery__stage {
        padding: 48px 12px;
    }
    .gx-gallery__nav,
    .gx-gallery__close {
        width: 38px;
        height: 38px;
        font-size: 22px;
    }
    .gx-gallery__counter {
        font-size: 12px;
    }
}

/* Mobile filter button — hidden on desktop, shown on mobile/tablet */
.gx-filter-bar__mobile-btn {
    box-sizing: border-box;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    padding: 0 20px;
    height: 40px;
    border-radius: 999px;
    background: var(--gx-color-primary, #1E4D36);
    color: #ffffff;
    font-family: var(--gx-font-family, inherit);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
    text-decoration: none;
    user-select: none;
    transition: background 0.15s;
}

.gx-filter-bar__mobile-btn:hover {
    background: var(--gx-color-primary-hover, #163826);
}

.gx-filter-bar__mobile-btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* SVG inside mobile-btn */
.gx-filter-bar__mobile-btn svg {
    display: block;
    flex-shrink: 0;
    pointer-events: none;
}

/* Sheet basic filters — hidden on desktop, shown on mobile via override */
.gx-filter-sheet__mobile-only {
    display: none;
    border-bottom: 1px solid var(--gx-color-border, #e5e7eb);
    margin-bottom: 24px;
    padding-bottom: 8px;
}

@media (max-width: 768px) {
    /* On mobile: 16px side margins, ignore any custom width */
    .gx-filter-bar {
        display: flex;
        width: calc(100% - 32px) !important;
        max-width: none !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    .gx-filter-bar__glass-wrap {
        padding: 6px;
        width: 100%;
        box-sizing: border-box;
    }
    /* Inner stretches full width, single child (mobile-btn) */
    .gx-filter-bar__inner {
        width: 100%;
        padding: 4px;
        gap: 0;
        justify-content: center;
    }
    /* Pill fields and desktop-only elements: hidden on mobile */
    .gx-filter-bar__pill,
    .gx-filter-bar__advanced,
    .gx-filter-bar__search,
    .gx-filter-bar__search-btn {
        display: none !important;
    }
    /* Mobile "Filtri" button — full-width rounded pill */
    .gx-filter-bar__mobile-btn {
        display: inline-flex !important;
        width: 100%;
        padding: 0 24px;
        height: 40px;
        font-size: 13px;
        font-weight: 600;
        gap: 8px;
        justify-content: center;
    }
    /* Show basic filters inside sheet on mobile */
    .gx-filter-sheet__mobile-only {
        display: block;
    }
    .gx-filter-bar--fixed-bottom {
        bottom: 12px;
        left: 50%;
        transform: translateX(-50%);
    }

    .gx-filter-sheet__panel {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gx-filter-sheet__panel,
    .gx-filter-sheet__backdrop,
    .gx-single__gallery-hero img,
    .gx-gallery,
    .gx-card__cta,
    .gx-single__cta {
        transition: none !important;
    }
}

/* ------------------------------------------------------------------
 * Property single (legacy — kept for reference, superseded by .gx-single)
 * ------------------------------------------------------------------ */
.gx-property-single {
    margin-bottom: 2rem;
    font-family: var(--gx-font-family, inherit);
}

.gx-property-single__location {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.5rem;
    color: var(--gx-color-muted, #6b7280);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.gx-property-single__location span + span::before {
    content: "·";
    margin-right: 0.5rem;
}

.gx-property-single__gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.gx-property-single__gallery-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    border-radius: var(--gx-radius-card, 12px);
}

.gx-property-single__body {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    align-items: start;
    margin-bottom: 2rem;
}

.gx-property-single__details { order: 2; }
.gx-property-single__description {
    order: 1;
    line-height: 1.7;
}

@media (max-width: 768px) {
    .gx-property-single__body {
        grid-template-columns: 1fr;
    }
    .gx-property-single__details    { order: 1; }
    .gx-property-single__description { order: 2; }
}

.gx-property-single__spec-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.4rem 1rem;
    margin: 0;
    font-size: 0.9rem;
    background: var(--gx-color-surface, #f5f5f3);
    border: 1px solid var(--gx-color-border, #e5e7eb);
    border-radius: var(--gx-radius-card, 12px);
    padding: 1rem;
}

.gx-property-single__spec-list dt {
    font-weight: 600;
    color: var(--gx-color-text, #1a1a1a);
    white-space: nowrap;
}

.gx-property-single__spec-list dd {
    margin: 0;
    color: var(--gx-color-text, #1a1a1a);
}

.gx-property-single__video-link {
    font-size: 0.875rem;
}

.gx-property-single__floor-plans {
    margin-top: 2rem;
}

.gx-property-single__floor-plans-title {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

/* ------------------------------------------------------------------
 * Filter bar (pill) + advanced sheet
 * ------------------------------------------------------------------ */
.gx-filter-bar {
    display: inline-flex;
    align-items: center;
    font-family: var(--gx-font-family, inherit);
    font-size: 13px;
    color: var(--gx-color-text, #1a1a1a);
    /* Width driven by shortcode attr — falls back to auto */
    width: var(--gx-filter-bar-width, auto);
    max-width: 100%;
}

.gx-filter-bar--fixed-bottom {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 9999;
    isolation: isolate;
}

.gx-filter-bar--inline {
    position: static;
    margin: 0 auto 24px;
}

/* Inner row — transparent flex container spacing pill + action buttons */
.gx-filter-bar__inner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    width: 100%;
}

/* Glass outer ring — wraps the solid pill, blur applies only to this padding layer */
.gx-filter-bar__glass-wrap {
    padding: 8px;
    border-radius: calc(var(--gx-radius-pill, 999px) + 8px);
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(16px) saturate(1.6);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.06);
    width: 100%;
    box-sizing: border-box;
}

/* White pill — holds filter selects; action buttons sit outside with gap */
.gx-filter-bar__pill {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 3px 3px 3px 4px;
    background: var(--gx-filter-bar-bg, #ffffff);
    border: 1px solid var(--gx-filter-bar-border, #e8e8e6);
    border-radius: var(--gx-radius-pill, 999px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.04);
    flex: 1 1 auto;
    min-width: 0;
}

.gx-filter-bar__field {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    min-height: 30px;
    position: relative;
    cursor: pointer;
}

.gx-filter-bar__icon {
    color: var(--gx-color-primary, #1E4D36);
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.gx-filter-bar__select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    font: inherit;
    font-size: 13px;
    color: inherit;
    padding-right: 18px;
    cursor: pointer;
    min-width: 90px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='9' height='5' viewBox='0 0 9 5'><path d='M1 1l3.5 3 3.5-3' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 2px center;
}

.gx-filter-bar__select:focus {
    outline: none;
}

.gx-filter-bar__divider {
    width: 1px;
    height: 16px;
    background: var(--gx-color-border, #e5e7eb);
    opacity: 0.7;
    flex-shrink: 0;
}

/*
 * Submit button wrapper — invisible, zero-size, only used for form submission.
 * The visual circle lives on the inner .gx-filter-bar__search span.
 */
.gx-filter-bar__search-btn {
    all: unset;
    display: contents;
    cursor: pointer;
}

/*
 * Desktop action elements (search circle + advanced filters circle).
 * These are <span> elements so no browser/theme button reset applies.
 */
.gx-filter-bar__advanced,
.gx-filter-bar__search {
    box-sizing: border-box;
    cursor: pointer;
    width: var(--gx-filter-btn-size, 36px);
    height: var(--gx-filter-btn-size, 36px);
    min-width: var(--gx-filter-btn-size, 36px);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
    position: relative;
    overflow: visible;
    text-decoration: none;
    user-select: none;
}

.gx-filter-bar__advanced:focus-visible,
.gx-filter-bar__search:focus-visible {
    outline: 2px solid var(--gx-color-primary, #1E4D36);
    outline-offset: 2px;
}

/* SVG inside action spans */
.gx-filter-bar__advanced svg,
.gx-filter-bar__search svg {
    display: block;
    flex-shrink: 0;
    pointer-events: none;
}

/* Active-filters badge on advanced/mobile buttons */
.gx-filter-bar__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #e53e3e;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    pointer-events: none;
    box-sizing: border-box;
}

/* Inline variant used inside mobile-btn (no absolute positioning) */
.gx-filter-bar__badge--inline {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    top: auto;
    right: auto;
    margin-left: 4px;
}

.gx-filter-bar__badge[hidden],
.gx-filter-bar__badge--inline[hidden] {
    display: none !important;
}

.gx-filter-bar__advanced {
    background: var(--gx-filter-adv-bg, #f0f0ee);
    color: var(--gx-filter-adv-icon, #4b5563);
}

.gx-filter-bar__advanced:hover {
    background: var(--gx-color-border, #e5e7eb);
    color: var(--gx-color-text, #1a1a1a);
}

.gx-filter-bar__search {
    background: var(--gx-color-primary, #1E4D36);
    color: #ffffff;
}

.gx-filter-bar__search:hover {
    background: var(--gx-color-primary-hover, #163826);
}

/* Advanced filters sheet */
.gx-filter-sheet {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    visibility: hidden;
}

.gx-filter-sheet.is-open {
    pointer-events: auto;
    visibility: visible;
}

.gx-filter-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: var(--gx-filter-sheet-overlay, rgba(0, 0, 0, 0.45));
    opacity: 0;
    transition: opacity 0.25s ease;
    cursor: pointer;
}

.gx-filter-sheet.is-open .gx-filter-sheet__backdrop {
    opacity: 1;
}

.gx-filter-sheet__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(var(--gx-filter-sheet-width, 380px), 90vw);
    background: #fff;
    color: var(--gx-color-text, #1a1a1a);
    font-family: var(--gx-font-family, inherit);
    display: flex;
    flex-direction: column;
    transform: translateX(110%) !important;
    transition: transform 0.3s cubic-bezier(.2,.8,.2,1);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.15);
}

@media (max-width: 640px) {
    .gx-filter-sheet__panel {
        width: 100%;
    }
}

.gx-filter-sheet.is-open .gx-filter-sheet__panel {
    transform: translateX(0) !important;
}

.gx-filter-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gx-color-border, #e5e7eb);
}

.gx-filter-sheet__title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.gx-filter-sheet__close {
    appearance: none;
    background: transparent;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--gx-color-muted, #6b7280);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.gx-filter-sheet__close:hover {
    background: var(--gx-color-surface, #f5f5f3);
    color: var(--gx-color-text, #1a1a1a);
}

.gx-filter-sheet__body {
    padding: 20px 24px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    /* Re-enable vertical panning inside the scroll area (the page sets touch-action: none). */
    touch-action: pan-y;
}

.gx-filter-sheet__group {
    margin-bottom: 24px;
}

.gx-filter-sheet__label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.gx-filter-sheet__select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gx-color-border, #e5e7eb);
    border-radius: 8px;
    background: #fff;
    font: inherit;
}

.gx-filter-sheet__checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 14px;
    cursor: pointer;
}

.gx-filter-sheet__checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--gx-color-primary, #1E4D36);
}

.gx-filter-sheet__checkboxes {
    display: flex;
    flex-direction: column;
}

.gx-filter-sheet__checkboxes.is-collapsible {
    max-height: 220px;
    overflow: hidden;
    position: relative;
    -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
            mask-image: linear-gradient(to bottom, #000 70%, transparent);
}

.gx-filter-sheet__checkboxes.is-collapsible.is-expanded {
    max-height: none;
    -webkit-mask-image: none;
            mask-image: none;
}

.gx-filter-sheet__show-all {
    display: inline-block;
    margin-top: 8px;
    color: var(--gx-color-primary, #1E4D36);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    font-size: 13px;
}

.gx-filter-sheet__show-all:hover {
    opacity: 0.75;
}

.gx-filter-sheet__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 480px) {
    .gx-filter-sheet__row {
        grid-template-columns: 1fr;
    }
}

.gx-filter-sheet__input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gx-color-border, #e5e7eb);
    border-radius: 8px;
    background: #fff;
    font: inherit;
}

.gx-filter-sheet__footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--gx-color-border, #e5e7eb);
}

.gx-filter-sheet__btn {
    flex: 1 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    border: 1px solid transparent !important;
    cursor: pointer !important;
    padding: 12px 20px !important;
    border-radius: 999px !important;
    font: inherit !important;
    font-weight: 600 !important;
    transition: background 0.15s, color 0.15s, border-color 0.15s !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.gx-filter-sheet__btn--secondary {
    background: transparent !important;
    color: var(--gx-color-text, #1a1a1a) !important;
    border-color: var(--gx-color-border, #e5e7eb) !important;
}

.gx-filter-sheet__btn--secondary:hover {
    background: var(--gx-color-surface, #f5f5f3) !important;
    border-color: var(--gx-color-muted, #6b7280) !important;
}

.gx-filter-sheet__btn--primary {
    background: var(--gx-color-primary, #1E4D36) !important;
    color: #ffffff !important;
}

.gx-filter-sheet__btn--primary:hover {
    background: var(--gx-color-primary-hover, #163826) !important;
}

html.gx-sheet-open,
body.gx-sheet-open {
    overflow: hidden !important;
    /* Prevent iOS/Android touch scroll chaining to the page behind the sheet. */
    touch-action: none;
    overscroll-behavior: contain;
}

/* Loading + error states */
.gx-listing.is-loading .gx-listing__grid:not(:has(.gx-card--skeleton)) {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.2s;
}

.gx-listing.is-loading .gx-listing__grid:has(.gx-card--skeleton) {
    opacity: 1;
    pointer-events: none;
}

/* Skeleton cards */
@keyframes gx-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.gx-card--skeleton {
    border-radius: var(--gx-card-radius, 12px);
    overflow: hidden;
    background: var(--gx-color-surface, #f5f5f3);
    pointer-events: none;
    user-select: none;
}

.gx-card--skeleton .gx-card__media {
    width: 100%;
    padding-bottom: 66%;
    display: block;
    background: linear-gradient(90deg, #e8e8e6 25%, #f0f0ee 50%, #e8e8e6 75%);
    background-size: 800px 100%;
    animation: gx-shimmer 1.4s infinite linear;
}

.gx-card--skeleton .gx-card__body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gx-card--skeleton .gx-skel-line {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, #e8e8e6 25%, #f0f0ee 50%, #e8e8e6 75%);
    background-size: 800px 100%;
    animation: gx-shimmer 1.4s infinite linear;
}

.gx-card--skeleton .gx-skel-line--title   { width: 70%; height: 18px; }
.gx-card--skeleton .gx-skel-line--price   { width: 40%; }
.gx-card--skeleton .gx-skel-line--loc     { width: 55%; }
.gx-card--skeleton .gx-skel-line--short   { width: 85%; }
.gx-card--skeleton .gx-skel-line--shorter { width: 60%; }

.gx-listing.is-error::after {
    content: "Errore nel caricamento.";
    display: block;
    padding: 12px;
    color: #b91c1c;
}

.gx-listing__more-wrap {
    text-align: center;
    margin-top: 32px;
}

.gx-listing__more-wrap[hidden] {
    display: none;
}

.gx-listing__load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    border-radius: 999px;
    background: var(--gx-color-primary, #1E4D36);
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: background 0.15s, opacity 0.15s;
    appearance: none;
}

.gx-listing__load-more:hover {
    background: var(--gx-color-primary-hover, #163826);
}

.gx-listing__load-more[aria-busy="true"] {
    opacity: 0.65;
    pointer-events: none;
}

.gx-listing__sentinel {
    height: 1px;
    width: 100%;
}

/* ------------------------------------------------------------------
 * Property carousel
 * ------------------------------------------------------------------ */
.gx-property-carousel {
    position: relative;
    overflow: hidden;
}

.gx-property-carousel__track {
    display: flex;
    transition: transform 0.4s ease;
}

.gx-property-carousel__slide {
    flex: 0 0 100%;
    min-width: 0;
}

.gx-property-carousel__prev,
.gx-property-carousel__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--gx-color-border, #e5e7eb);
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.gx-property-carousel__prev { left: 0.5rem; }
.gx-property-carousel__next { right: 0.5rem; }

.gx-property-carousel__prev:hover,
.gx-property-carousel__next:hover {
    background: #fff;
}

/* ------------------------------------------------------------------
 * Card hover animations — gated by body class .gx-hover-enabled
 * set from admin appearance setting `card_hover_animations`.
 * Pure CSS; respects prefers-reduced-motion.
 * ------------------------------------------------------------------ */
.gx-card__media {
    overflow: hidden;
}

.gx-card__image {
    transition: transform 0.4s ease;
    will-change: transform;
}

.gx-hover-enabled .gx-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gx-hover-enabled .gx-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.10);
}

.gx-hover-enabled .gx-card:hover .gx-card__image {
    transform: scale(1.06);
}

@media (prefers-reduced-motion: reduce) {
    .gx-hover-enabled .gx-card,
    .gx-card__image {
        transition: none;
    }
    .gx-hover-enabled .gx-card:hover {
        transform: none;
    }
    .gx-hover-enabled .gx-card:hover .gx-card__image {
        transform: none;
    }
}

/* ------------------------------------------------------------------
 * Shared dialog component (native <dialog>, top-layer)
 * Immune to ancestor transform / overflow / stacking-context.
 * ------------------------------------------------------------------ */
.gx-dialog {
    margin: auto;
    padding: 0;
    border: none;
    background: var(--gx-color-bg, #ffffff);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
    width: min(720px, calc(100vw - 32px));
    max-width: min(720px, calc(100vw - 32px));
    max-height: min(90vh, 900px);
    overflow: hidden;
    color: var(--gx-color-text, #1a1a1a);
    font-family: var(--gx-font-family, inherit);
    font-size: var(--gx-body-size, 14px);
}

.gx-dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(2px);
            backdrop-filter: blur(2px);
}

.gx-dialog:not([open]) {
    display: none;
}

.gx-dialog__inner {
    display: flex;
    flex-direction: column;
    max-height: inherit;
    min-height: 0;
}

.gx-dialog__header {
    position: relative;
    padding: 20px 56px 16px 24px;
    border-bottom: 1px solid var(--gx-color-border, #e5e7eb);
    flex-shrink: 0;
}

.gx-dialog__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--gx-color-section-title, #1a1a1a);
    line-height: 1.3;
}

.gx-dialog__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 0;
    appearance: none;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    color: var(--gx-color-muted, #6b7280);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.gx-dialog__close:hover,
.gx-dialog__close:focus-visible {
    background: var(--gx-color-surface, #f5f5f3);
    color: var(--gx-color-text, #1a1a1a);
    outline: none;
}

.gx-dialog__body {
    padding: 20px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1 1 auto;
    min-height: 0;
}

.gx-dialog__footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gx-color-border, #e5e7eb);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.gx-dialog__footer-meta {
    color: var(--gx-color-muted, #6b7280);
    font-size: 14px;
}

.gx-dialog__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--gx-radius-button, 999px);
    background: var(--gx-color-primary, #1E4D36);
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.15s ease;
}

.gx-dialog__cta:hover,
.gx-dialog__cta:focus-visible {
    background: var(--gx-color-primary-hover, #163826);
    color: #ffffff;
    outline: none;
}

/* Map dialog — iframe fills the body */
.gx-dialog--map .gx-dialog__body {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.gx-dialog--map .gx-dialog__map-frame {
    position: relative;
    flex: 1 1 auto;
    min-height: 320px;
}

.gx-dialog--map .gx-dialog__map-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 320px;
    border: 0;
}

body.gx-dialog-open {
    overflow: hidden;
}

@media (max-width: 600px) {
    .gx-dialog {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        max-height: calc(100dvh - 48px);
        border-radius: 14px;
        margin: auto;
    }
    .gx-dialog__header {
        padding: 16px 52px 12px 18px;
    }
    .gx-dialog__body {
        padding: 16px 18px;
    }
    .gx-dialog__footer {
        padding: 12px 18px;
    }
    .gx-dialog--map .gx-dialog__map-frame {
        min-height: 260px;
    }
}

/* ------------------------------------------------------------------
 * Sticky CTA (mobile only) — mirrors the sidebar contact button
 * ------------------------------------------------------------------ */
.gx-single__sticky-cta {
    display: none;
}

@media (max-width: 960px) {
    .gx-single__sticky-cta {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.96);
        -webkit-backdrop-filter: blur(8px);
                backdrop-filter: blur(8px);
        border-top: 1px solid var(--gx-color-border, #e5e7eb);
        z-index: 90;
        transform: translateY(0);
        transition: transform 0.25s ease;
    }
    .gx-single__sticky-cta.is-hidden {
        transform: translateY(110%);
        pointer-events: none;
    }
    .gx-single__sticky-cta .gx-single__cta {
        width: 100%;
        margin: 0;
    }
    /* Prevent the fixed CTA from covering the end of the page */
    .gx-single {
        padding-bottom: 96px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gx-single__sticky-cta {
        transition: none;
    }
}

/* ------------------------------------------------------------------
 * Energy certification card (.gx-single__energy-*)
 * ------------------------------------------------------------------ */

/* Header row: h2 (standard section title) + icon on the right */
.gx-single__energy-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.gx-single__energy-head .gx-single__section-title {
    margin-bottom: 0;
}

.gx-single__energy-icon {
    color: var(--gx-color-primary, #1E4D36);
    flex-shrink: 0;
}

.gx-single__energy-card {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.gx-single__energy-subtitle {
    font-size: 11px;
    font-weight: 600;
    color: var(--gx-color-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hero row: class box + IPE */
.gx-single__energy-hero {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}

.gx-single__energy-class-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border-radius: 10px;
    padding: 18px 24px;
    min-width: 110px;
}

.gx-single__energy-class-label {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gx-single__energy-class-value {
    font-size: 52px;
    font-weight: 900;
    color: #fff;
    line-height: 1;
}

.gx-single__energy-ipe {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gx-single__energy-ipe-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gx-color-text, #1a1a1a);
}

.gx-single__energy-ipe-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gx-color-text, #1a1a1a);
    line-height: 1.2;
}

.gx-single__energy-ipe-unit {
    font-size: 14px;
    font-weight: 500;
    color: var(--gx-color-muted, #6b7280);
}

/* Scale wrapper — needs overflow visible so labels outside the bar are not clipped */
.gx-single__energy-scale-wrap {
    overflow: visible;
}

/* Horizontal bar scale */
.gx-single__energy-scale {
    display: flex;
    gap: 5px;
    /* extra top/bottom space so absolutely-positioned labels don't get cut */
    margin-top: 22px;
    margin-bottom: 22px;
}

.gx-single__energy-step {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    height: 44px;
    border: 3px solid transparent;
    box-sizing: border-box;
    cursor: default;
    transition: height 0.15s, border-color 0.15s;
}

.gx-single__energy-step.is-active {
    height: 52px;
    border-color: #1a1a1a;
}

.gx-single__energy-step--a4 { background: #006B27; }
.gx-single__energy-step--a3 { background: #1A8C3A; }
.gx-single__energy-step--a2 { background: #30A64A; }
.gx-single__energy-step--a1 { background: #5BBD5E; }
.gx-single__energy-step--a  { background: #89D169; }
.gx-single__energy-step--b  { background: #B6E34A; }
.gx-single__energy-step--c  { background: #DDED2B; }
.gx-single__energy-step--d  { background: #F7D622; }
.gx-single__energy-step--e  { background: #F5A00A; }
.gx-single__energy-step--f  { background: #E85F10; }
.gx-single__energy-step--g  { background: #C01B1B; }

/* Class name centred inside the bar */
.gx-single__energy-step-label {
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    line-height: 1;
}

/* "Attuale" — absolutely below the bar, centred on it */
.gx-single__energy-step-current {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 9px;
    font-weight: 700;
    color: var(--gx-color-primary, #1E4D36);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    pointer-events: none;
}

/* Exempt / awaiting state pill */
.gx-single__energy-state {
    display: flex;
    align-items: center;
}

.gx-single__energy-state-label {
    display: inline-block;
    padding: 8px 20px;
    background: var(--gx-color-surface, #f5f5f3);
    border: 1px solid var(--gx-color-border, #e5e7eb);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    color: var(--gx-color-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Divider */
.gx-single__energy-divider {
    border-top: 1px solid var(--gx-color-border, #e5e7eb);
}

/* Extra data rows (IPR, seasons) */
.gx-single__energy-rows {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gx-single__energy-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gx-single__energy-row dt {
    font-size: 14px;
    font-weight: 500;
    color: var(--gx-color-text, #1a1a1a);
}

.gx-single__energy-row dd {
    font-size: 14px;
    font-weight: 700;
    color: var(--gx-color-primary, #1E4D36);
    margin: 0;
}

@media (max-width: 640px) {
    .gx-single__energy-hero {
        gap: 16px;
    }

    .gx-single__energy-class-box {
        padding: 14px 20px;
        min-width: 90px;
    }

    .gx-single__energy-class-value {
        font-size: 40px;
    }

    .gx-single__energy-ipe-value {
        font-size: 20px;
    }
}
