/**
 * TGM Property Suite — Single Property Styles (REVISED)
 *
 * Design: BIJOU — small, elegant, jewel-like.
 * Audience: 55+ community — ALL FONTS SIZED FOR READABILITY.
 *
 * Changes from original:
 *   - Fonts bumped across the board (base 17px, descriptions 18px)
 *   - Gallery grid modal (Desert Star style)
 *   - No thumbnail strip
 *   - No hero badges overlay
 *   - Specs mini grid in About the Property
 *   - Premium Features sub-sections
 *   - About the Finances section
 *
 * @copyright 2026 Two Guys and a Mouse LLC. All rights reserved.
 * @license   Proprietary — unauthorized copying, modification, or distribution is strictly prohibited.
 * @package TGM_Property_Suite
 * @version 1.1.0
 */

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */

.tgm-single-property {
    --tgm-accent: #c75b2a;
    --tgm-accent-hover: #a94a1f;
    --tgm-accent-light: #fdf0ea;
    --tgm-text: #1a1a1a;
    --tgm-text-light: #555;
    --tgm-text-lighter: #888;
    --tgm-bg: #ffffff;
    --tgm-bg-light: #f8f8f8;
    --tgm-border: #e0e0e0;
    --tgm-radius: 8px;
    --tgm-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --tgm-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --tgm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --tgm-max-width: 1280px;

    font-family: var(--tgm-font);
    color: var(--tgm-text);
    font-size: 17px;
    line-height: 1.6;
    max-width: 100%;
    overflow-x: hidden;
}

/* Template-rendered: allow WPBakery row stretch (negative margins + 100vw) to work */
.tgm-single-property.tgm-template-rendered {
    overflow-x: visible;
    overflow: visible;
}

/* Ensure theme content wrappers don't clip WPBakery stretched rows */
.tgm-template-rendered .vc_row[data-vc-full-width="true"] {
    overflow: visible;
}


/* ============================================================
   PVA TOOLBAR
   ============================================================ */

.tgm-pva-toolbar {
    background: var(--tgm-bg);
    border-bottom: 1px solid var(--tgm-border);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: box-shadow 0.2s ease;
}

.admin-bar .tgm-pva-toolbar {
    top: 32px;
}

.tgm-pva-toolbar.tgm-scrolled {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.tgm-pva-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 20px;
    max-width: var(--tgm-max-width);
    margin: 0 auto;
    flex-wrap: wrap;
}

.tgm-pva-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    border: 1.5px solid var(--tgm-border);
    border-radius: 6px;
    background: var(--tgm-bg);
    color: var(--tgm-text);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-width: 72px;
    line-height: 1;
    font-family: var(--tgm-font);
}

.tgm-pva-btn:hover {
    border-color: var(--tgm-accent);
    color: var(--tgm-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(199, 91, 42, 0.15);
}

.tgm-pva-btn:active {
    transform: translateY(0);
}

.tgm-pva-btn svg {
    flex-shrink: 0;
}

.tgm-pva-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--tgm-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    line-height: 1.2;
}

.tgm-pva-btn-contact {
    background: var(--tgm-accent);
    border-color: var(--tgm-accent);
    color: #fff;
    min-width: 120px;
    padding: 10px 20px;
}

.tgm-pva-btn-contact:hover {
    background: var(--tgm-accent-hover);
    border-color: var(--tgm-accent-hover);
    color: #fff;
    box-shadow: 0 4px 12px rgba(199, 91, 42, 0.3);
}

.tgm-pva-btn-contact svg {
    stroke: #fff;
}


/* ============================================================
   HERO IMAGE — Natural size, no stretch
   ============================================================ */

.tgm-image-section {
    position: relative;
    max-width: var(--tgm-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.tgm-hero-link {
    display: block;
    position: relative;
    width: 100%;
    border-radius: var(--tgm-radius);
    overflow: hidden;
    cursor: pointer;
    outline: none;
}

.tgm-hero-link:focus-visible {
    box-shadow: 0 0 0 3px var(--tgm-accent);
}

/* Natural size — NO max-height, NO object-fit: cover */
.tgm-hero-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--tgm-radius);
    transition: opacity 0.2s ease;
}

.tgm-hero-link:hover .tgm-hero-img {
    opacity: 0.95;
}

.tgm-hero-photo-count {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(4px);
}

.tgm-hero-photo-count svg {
    stroke: #fff;
}

.tgm-hero-no-image {
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tgm-bg-light);
    border-radius: var(--tgm-radius);
    color: var(--tgm-text-lighter);
    font-size: 18px;
}

/* (Hidden gallery links removed in Section 7B — thumbnail viewer replaces GLightbox) */


/* ============================================================
   TWO-COLUMN CONTENT LAYOUT
   ============================================================ */

.tgm-property-content {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 40px;
    max-width: var(--tgm-max-width);
    margin: 0 auto;
    padding: 32px 20px 60px;
}

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

.tgm-property-sidebar {
    min-width: 0;
}


/* ============================================================
   PROPERTY HEADER — Price, Title, Location (no quick specs)
   ============================================================ */

.tgm-property-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--tgm-border);
}

.tgm-property-price {
    margin-bottom: 8px;
}

.tgm-price-amount {
    font-size: 40px;
    font-weight: 800;
    color: var(--tgm-text);
    letter-spacing: -0.5px;
}

/* Rental styles removed — sale only */

.tgm-property-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
    padding: 0;
    line-height: 1.2;
    color: var(--tgm-text);
}

.tgm-property-location {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 16px;
    color: var(--tgm-text-light);
    margin-bottom: 0;
}

.tgm-location-community {
    font-weight: 600;
    color: var(--tgm-accent);
}


/* ============================================================
   CONTENT SECTIONS
   ============================================================ */

.tgm-section {
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--tgm-border);
}

.tgm-section:last-child {
    border-bottom: none;
}

.tgm-section-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 20px;
    padding: 0;
    color: var(--tgm-text);
}

/* Description — big, readable */
.tgm-description-content {
    font-size: 18px;
    line-height: 1.8;
    color: var(--tgm-text);
}

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

.tgm-description-content p:last-child {
    margin-bottom: 0;
}


/* ============================================================
   TAG LIST (amenities, features)
   ============================================================ */

.tgm-tag-list {
    column-gap: 24px;
    row-gap: 0;
    margin-bottom: 16px;
}

/* Column count based on item count — set via data-columns in PHP */
.tgm-tag-list[data-columns="1"] { columns: 1; }
.tgm-tag-list[data-columns="2"] { columns: 2; }
.tgm-tag-list[data-columns="3"] { columns: 3; }
.tgm-tag-list[data-columns="4"] { columns: 4; }

/* Mobile: collapse to 1 column */
@media (max-width: 600px) {
    .tgm-tag-list[data-columns="2"],
    .tgm-tag-list[data-columns="3"],
    .tgm-tag-list[data-columns="4"] {
        columns: 1;
    }
}

.tgm-tag {
    display: flex;
    align-items: center;
    padding: 6px 0;
    background: none;
    border: none;
    border-radius: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--tgm-text);
    break-inside: avoid;
    width: 100%;
}

/* Premium Features sub-section */
.tgm-premium-block {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed var(--tgm-border);
}

.tgm-premium-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--tgm-accent);
    margin: 0 0 12px;
    padding: 0;
    letter-spacing: 0.3px;
}

/* ============================================================
 *  YOUR VIEW FROM HOME CARD
 * ============================================================ */

.tgm-view-lot-card {
    margin-top: 24px;
    background: linear-gradient(135deg, #fdf8f0 0%, #fef9f2 100%);
    border: 1px solid #e8d8bc;
    border-left: 4px solid var(--tgm-accent, #c75b2a);
    border-radius: 10px;
    padding: 20px 22px 18px;
}

.tgm-view-lot-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: var(--tgm-accent, #c75b2a);
}

.tgm-view-lot-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--tgm-accent, #c75b2a);
    margin: 0;
    padding: 0;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.tgm-view-features-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.tgm-view-feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(232, 216, 188, 0.6);
    border-radius: 8px;
    padding: 10px 14px;
}

.tgm-view-feature-item .tgm-icon {
    flex-shrink: 0;
    color: var(--tgm-accent, #c75b2a);
    opacity: 0.85;
}

.tgm-view-feature-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tgm-view-feature-title {
    font-size: 14px;
    font-weight: 700;
    color: #2a2a2a;
    line-height: 1.3;
}

.tgm-view-feature-subtitle {
    font-size: 12px;
    color: #7a6a55;
    line-height: 1.4;
}

/* "See the View" button */
.tgm-see-the-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 2px solid var(--tgm-accent, #c75b2a);
    border-radius: 24px;
    color: var(--tgm-accent, #c75b2a);
    font-size: 14px;
    font-weight: 700;
    font-family: var(--tgm-font);
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
    width: 100%;
    justify-content: center;
    margin-top: 4px;
}

.tgm-see-the-view-btn:hover {
    background: var(--tgm-accent, #c75b2a);
    color: #fff;
}

.tgm-see-the-view-btn svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.tgm-see-the-view-btn:hover svg {
    transform: scale(1.1);
}

/* ============================================================
 *  GALLERY VIEWER — TAB BAR
 * ============================================================ */

.tgm-gallery-tabs {
    display: flex;
    width: 100%;
    gap: 2px;
    padding: 0 4px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2px;
}

.tgm-gallery-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 14px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--tgm-font);
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.2px;
}

.tgm-gallery-tab:hover {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.8);
}

.tgm-gallery-tab.tgm-tab-active {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.tgm-gallery-tab svg {
    flex-shrink: 0;
    opacity: 0.8;
}

.tgm-gallery-tab.tgm-tab-active svg {
    opacity: 1;
}

.tgm-tag-premium {
    background: none;
    border: none;
    color: var(--tgm-accent);
    font-weight: 600;
}


/* ============================================================
   SPECS MINI GRID (About the Property)
   ============================================================ */

.tgm-specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.tgm-spec-card {
    background: none;
    border: none;
    border-radius: 0;
    padding: 8px 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tgm-spec-card-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--tgm-text);
    line-height: 1.2;
}

.tgm-spec-card-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--tgm-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* ============================================================
   FINANCE SECTION (About the Finances)
   ============================================================ */

.tgm-finance-card {
    background: var(--tgm-bg-light);
    border-radius: var(--tgm-radius);
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid var(--tgm-border);
}

.tgm-finance-card-title {
    font-size: 16px;
    font-weight: 700;
    padding: 14px 18px;
    margin: 0;
    background: var(--tgm-bg);
    border-bottom: 1px solid var(--tgm-border);
    color: var(--tgm-text);
}

.tgm-fee-row {
    display: flex;
    justify-content: space-between;
    padding: 14px 18px;
    font-size: 16px;
    border-bottom: 1px solid var(--tgm-border);
}

.tgm-fee-row:last-child {
    border-bottom: none;
}

.tgm-fee-total {
    font-weight: 700;
    background: var(--tgm-bg);
}

.tgm-fee-monthly {
    color: var(--tgm-accent);
    font-weight: 700;
    font-size: 17px;
}

.tgm-finance-summary {
    background: var(--tgm-bg);
}

.tgm-finance-row-large {
    display: flex;
    justify-content: space-between;
    padding: 14px 18px;
    font-size: 16px;
    font-weight: 700;
    border-bottom: 1px solid var(--tgm-border);
}

.tgm-finance-calc-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--tgm-bg);
    border: 2px solid var(--tgm-accent);
    border-radius: 6px;
    color: var(--tgm-accent);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--tgm-font);
    margin-top: 4px;
}

.tgm-finance-calc-btn:hover {
    background: var(--tgm-accent);
    color: #fff;
}

.tgm-finance-calc-btn:hover svg {
    stroke: #fff;
}


/* ============================================================
   SIDEBAR — Contact Card (sticky) — UNCHANGED
   ============================================================ */

.tgm-sidebar-card {
    position: sticky;
    top: 80px;
    background: var(--tgm-bg);
    border: 1px solid var(--tgm-border);
    border-radius: var(--tgm-radius);
    box-shadow: var(--tgm-shadow);
    overflow: hidden;
}

.admin-bar .tgm-sidebar-card {
    top: 112px;
}

.tgm-sidebar-status {
    padding: 12px 16px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
}

.tgm-sidebar-price {
    padding: 20px 20px 12px;
    text-align: center;
}

.tgm-sidebar-price-main {
    font-size: 32px;
    font-weight: 800;
    color: var(--tgm-text);
}

.tgm-sidebar-price-sub {
    font-size: 15px;
    color: var(--tgm-text-light);
    margin-top: 4px;
}


.tgm-sidebar-contact {
    padding: 16px 20px 16px;
    text-align: center;
    border-top: 1px solid var(--tgm-border);
}

.tgm-sidebar-agent {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.tgm-sidebar-phone,
.tgm-sidebar-email {
    display: block;
    color: var(--tgm-text-light);
    text-decoration: none;
    font-size: 16px;
    margin-bottom: 6px;
    transition: color 0.2s;
}

.tgm-sidebar-phone:hover,
.tgm-sidebar-email:hover {
    color: var(--tgm-accent);
}

.tgm-sidebar-cta {
    display: block;
    width: calc(100% - 40px);
    margin: 0 20px 16px;
    padding: 16px 20px;
    background: var(--tgm-accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--tgm-font);
}

.tgm-sidebar-cta:hover {
    background: var(--tgm-accent-hover);
}

.tgm-sidebar-meta {
    padding: 14px 20px 16px;
    border-top: 1px solid var(--tgm-border);
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 15px;
    color: var(--tgm-text-light);
}


/* ============================================================
   GALLERY GRID MODAL (Desert Star style)
   ============================================================ */

/* ============================================================
   GALLERY VIEWER (Section 7B — thumbnail navigation)
   Dark bijou styling — elegant, readability-first
   ============================================================ */

.tgm-gallery-viewer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 12, 0.94);
    z-index: 10000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.tgm-gallery-viewer-overlay.tgm-active {
    display: flex;
}

.tgm-gallery-viewer {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
    animation: tgmGvIn 0.25s ease;
}

@keyframes tgmGvIn {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: scale(1); }
}

/* Header — counter + close */
.tgm-gallery-viewer-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 4px 12px;
}

.tgm-gallery-viewer-counter {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-family: var(--tgm-font);
    letter-spacing: 1px;
}

.tgm-gallery-viewer-close {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.tgm-gallery-viewer-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Main image area */
.tgm-gallery-viewer-main {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tgm-gallery-viewer-image-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    max-height: 60vh;
    overflow: hidden;
    border-radius: 6px;
}

.tgm-gallery-viewer-img {
    max-width: 100%;
    max-height: 60vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 6px;
    object-fit: contain;
    transition: opacity 0.15s ease;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* Arrow buttons */
.tgm-gallery-viewer-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
}

.tgm-gallery-viewer-arrow:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.tgm-gallery-arrow-prev {
    left: -60px;
}

.tgm-gallery-arrow-next {
    right: -60px;
}

/* Caption */
.tgm-gallery-viewer-caption {
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    font-family: var(--tgm-font);
    text-align: center;
    padding: 12px 20px 4px;
    max-width: 600px;
    line-height: 1.4;
}

/* Thumbnail strip */
.tgm-gallery-viewer-thumbs {
    display: flex;
    gap: 8px;
    padding: 16px 0 20px;
    overflow-x: auto;
    max-width: 100%;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.tgm-gallery-viewer-thumbs::-webkit-scrollbar {
    height: 4px;
}

.tgm-gallery-viewer-thumbs::-webkit-scrollbar-track {
    background: transparent;
}

.tgm-gallery-viewer-thumbs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.tgm-gv-thumb {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background: none;
    padding: 0;
    opacity: 0.5;
    transition: all 0.2s ease;
}

.tgm-gv-thumb:hover {
    opacity: 0.8;
    border-color: rgba(255, 255, 255, 0.3);
}

.tgm-gv-thumb-active {
    opacity: 1;
    border-color: var(--tgm-accent, #c75b2a);
    box-shadow: 0 0 0 1px var(--tgm-accent, #c75b2a);
}

.tgm-gv-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}


/* ============================================================
   GENERAL MODAL (PVA buttons — Calculator, PDF, etc.)
   ============================================================ */

.tgm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);

    /* Variables for modal content (modals sit outside .tgm-single-property scope) */
    --tgm-accent: #c75b2a;
    --tgm-accent-hover: #a94a1f;
    --tgm-accent-light: #fdf0ea;
    --tgm-text: #1a1a1a;
    --tgm-text-light: #555;
    --tgm-text-lighter: #888;
    --tgm-bg: #ffffff;
    --tgm-bg-light: #f8f8f8;
    --tgm-border: #e0e0e0;
    --tgm-radius: 8px;
    --tgm-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --tgm-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --tgm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.tgm-modal-overlay.tgm-active {
    display: flex;
}

.tgm-modal {
    background: var(--tgm-bg, #ffffff);
    border-radius: 12px;
    width: 100%;
    max-width: 720px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--tgm-shadow-lg, 0 8px 32px rgba(0, 0, 0, 0.12));
    animation: tgmModalIn 0.2s ease;
}

@keyframes tgmModalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.tgm-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none !important;
    background: transparent !important;
    background-color: transparent !important;
    border-radius: 0;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--tgm-text-lighter, #888);
    transition: color 0.2s;
    z-index: 2;
    padding: 0;
    line-height: 1;
    box-shadow: none !important;
    outline: none;
}
}

.tgm-modal-close:hover {
    color: var(--tgm-text, #1a1a1a);
    background: transparent !important;
}

.tgm-modal-content {
    padding: 32px;
}

/* Map + Nearby modals — no content padding (iframe fills edge-to-edge) */
.tgm-modal-content:has(.tgm-map-modal),
.tgm-modal-content:has(.tgm-nearby-modal) {
    padding: 0;
}


/* ============================================================
   CALCULATOR MODAL
   ============================================================ */

.tgm-calc {
    padding: 8px 0;
}

.tgm-calc-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
}

.tgm-calc-subtitle {
    font-size: 15px;
    color: var(--tgm-text-light);
    margin: 0 0 24px;
}

.tgm-calc-grid {
    display: grid;
    gap: 20px;
}

.tgm-calc-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--tgm-text-light);
    margin-bottom: 6px;
}

.tgm-calc-input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--tgm-border);
    border-radius: 6px;
    overflow: hidden;
    background: var(--tgm-bg);
}

.tgm-calc-input-wrap input {
    flex: 1;
    border: none;
    padding: 10px 12px;
    font-size: 18px;
    font-weight: 600;
    font-family: var(--tgm-font);
    outline: none;
    background: transparent;
    min-width: 0;
}

.tgm-calc-prefix,
.tgm-calc-suffix {
    padding: 10px 12px;
    font-size: 16px;
    color: var(--tgm-text-lighter);
    background: var(--tgm-bg-light);
    font-weight: 600;
}

.tgm-calc-range {
    width: 100%;
    margin-top: 8px;
    accent-color: var(--tgm-accent);
}

.tgm-calc-range-label {
    text-align: right;
    font-size: 13px;
    color: var(--tgm-text-lighter);
    margin-top: 2px;
}

.tgm-calc-term-btns {
    display: flex;
    gap: 8px;
}

.tgm-calc-term-btn {
    flex: 1;
    padding: 10px 8px;
    border: 1.5px solid var(--tgm-border);
    border-radius: 6px;
    background: var(--tgm-bg);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--tgm-font);
    color: var(--tgm-text);
}

.tgm-calc-term-btn:hover {
    border-color: var(--tgm-accent);
    color: var(--tgm-accent);
}

.tgm-calc-term-btn.tgm-active {
    background: var(--tgm-accent);
    border-color: var(--tgm-accent);
    color: #fff;
}

.tgm-calc-results {
    margin-top: 24px;
    border-radius: 8px;
    overflow: hidden;
    border: 1.5px solid var(--tgm-border);
}

.tgm-calc-result-main {
    background: var(--tgm-accent);
    color: #fff;
    padding: 20px 24px;
    text-align: center;
}

.tgm-calc-result-label {
    display: block;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
    margin-bottom: 4px;
}

.tgm-calc-result-amount {
    font-size: 36px;
    font-weight: 700;
}

.tgm-calc-result-breakdown {
    padding: 16px 24px;
    background: var(--tgm-bg-light);
}

.tgm-calc-result-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 15px;
    border-bottom: 1px solid var(--tgm-border);
}

.tgm-calc-result-row:last-child {
    border-bottom: none;
}

.tgm-calc-result-row span:last-child {
    font-weight: 600;
}

.tgm-calc-total-row {
    font-weight: 700;
    font-size: 16px;
    padding-top: 12px;
}

.tgm-calc-total-row span:last-child {
    color: var(--tgm-accent);
}

.tgm-calc-disclaimer {
    margin-top: 16px;
    font-size: 12px;
    color: var(--tgm-text-lighter);
    line-height: 1.5;
}


/* ============================================================
   MAP & NEARBY MODALS
   ============================================================ */

.tgm-map-modal,
.tgm-nearby-modal {
    padding: 0;
    background: #fff;
}

.tgm-map-title,
.tgm-nearby-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    padding: 24px 24px 4px;
    background: #fff;
}

.tgm-map-address,
.tgm-nearby-subtitle {
    font-size: 15px;
    color: var(--tgm-text-light);
    margin: 0;
    padding: 0 24px 16px;
    background: #fff;
}

.tgm-nearby-community {
    font-size: 17px;
    font-weight: 600;
    color: var(--tgm-text);
    margin: 0;
    padding: 0 24px 2px;
    background: #fff;
}

/* Nearby category tabs */
.tgm-nearby-tabs {
    display: flex;
    gap: 0;
    padding: 0 16px;
    border-bottom: 2px solid var(--tgm-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: #fff;
}

.tgm-nearby-tabs::-webkit-scrollbar {
    display: none;
}

.tgm-nearby-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 14px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: var(--tgm-text-lighter);
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
    font-family: var(--tgm-font);
}

.tgm-nearby-tab:hover {
    color: var(--tgm-text);
}

.tgm-nearby-tab.tgm-active {
    color: var(--tgm-accent);
    border-bottom-color: var(--tgm-accent);
}

.tgm-nearby-tab-icon {
    font-size: 20px;
    line-height: 1;
}

.tgm-nearby-tab-label {
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tgm-nearby-map-wrap {
    position: relative;
    background: var(--tgm-bg-light);
    min-height: 450px;
}

.tgm-nearby-map-wrap iframe {
    border-radius: 0 0 8px 8px;
}


/* ============================================================
   CONTACT FORM MODAL
   ============================================================ */

.tgm-contact-modal {
    padding: 8px 0;
}

.tgm-contact-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
}

.tgm-contact-subtitle {
    font-size: 15px;
    color: var(--tgm-text-light);
    margin: 0 0 20px;
}

.tgm-contact-quick {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tgm-contact-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
    flex: 1;
    justify-content: center;
    min-width: 180px;
}

.tgm-contact-phone-btn {
    background: var(--tgm-accent);
    color: #fff;
}

.tgm-contact-phone-btn:hover {
    background: var(--tgm-accent-hover);
    color: #fff;
}

.tgm-contact-email-btn {
    background: var(--tgm-bg-light);
    color: var(--tgm-text);
    border: 1.5px solid var(--tgm-border);
}

.tgm-contact-email-btn:hover {
    border-color: var(--tgm-accent);
    color: var(--tgm-accent);
}

.tgm-contact-text-btn {
    background: #28a745;
    color: #fff;
}

.tgm-contact-text-btn:hover {
    background: #218838;
    color: #fff;
}

.tgm-contact-divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.tgm-contact-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--tgm-border);
}

.tgm-contact-divider span {
    position: relative;
    background: var(--tgm-bg);
    padding: 0 16px;
    font-size: 13px;
    color: var(--tgm-text-lighter);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tgm-contact-form {
    position: relative;
}

.tgm-form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tgm-form-field {
    margin-bottom: 14px;
}

.tgm-form-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--tgm-text);
}

.tgm-form-field input,
.tgm-form-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--tgm-border);
    border-radius: 6px;
    font-size: 16px;
    font-family: var(--tgm-font);
    transition: border-color 0.15s;
    background: var(--tgm-bg);
    color: var(--tgm-text);
    box-sizing: border-box;
}

.tgm-form-field input:focus,
.tgm-form-field textarea:focus {
    outline: none;
    border-color: var(--tgm-accent);
    box-shadow: 0 0 0 3px var(--tgm-accent-light);
}

.tgm-form-field textarea {
    resize: vertical;
    min-height: 80px;
}

.tgm-form-submit {
    width: 100%;
    padding: 14px;
    background: var(--tgm-accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: var(--tgm-font);
}

.tgm-form-submit:hover {
    background: var(--tgm-accent-hover);
}

.tgm-form-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.tgm-form-status {
    margin-top: 12px;
    padding: 0;
    border-radius: 6px;
    font-size: 15px;
    text-align: center;
    transition: all 0.2s;
}

.tgm-form-status-success {
    padding: 12px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.tgm-form-status-error {
    padding: 12px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}


/* ============================================================
   PVA REVIEWS MODAL (Section 7D)
   ============================================================ */

.tgm-reviews-modal {
    padding: 24px;
}

.tgm-reviews-modal-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 20px;
    color: var(--tgm-text);
}

.tgm-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 60vh;
    overflow-y: auto;
}

.tgm-review-card {
    padding: 16px;
    background: var(--tgm-bg-light);
    border-radius: var(--tgm-radius);
    border: 1px solid var(--tgm-border);
}

.tgm-review-stars {
    margin-bottom: 8px;
    font-size: 16px;
    letter-spacing: 1px;
}

.tgm-review-stars .tgm-star-filled {
    color: #f39c12;
}

.tgm-review-stars .tgm-star-empty {
    color: #ddd;
}

.tgm-review-text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--tgm-text);
    margin-bottom: 10px;
}

.tgm-review-attr {
    font-size: 14px;
    color: var(--tgm-text-light);
}

.tgm-review-loc {
    color: var(--tgm-text-lighter, #999);
}

.tgm-review-date {
    display: inline-block;
    margin-left: 8px;
    font-size: 13px;
    color: var(--tgm-text-lighter, #999);
}

.tgm-review-hearts {
    margin-top: 6px;
    font-size: 13px;
    color: var(--tgm-text-light);
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1080px) {
    /* Fallback grid layout (old template) */
    .tgm-property-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .tgm-sidebar-card {
        position: static;
    }

    /* WPBakery template layout — force ALL columns to full width.
       Property pages use WPBakery template pages (via Template Manager),
       so the actual columns are vc_col-sm-* with inline widths.
       Without this, the sidebar column gets crammed on tablet. */
    .tgm-template-rendered .vc_col-sm-1,
    .tgm-template-rendered .vc_col-sm-2,
    .tgm-template-rendered .vc_col-sm-3,
    .tgm-template-rendered .vc_col-sm-4,
    .tgm-template-rendered .vc_col-sm-5,
    .tgm-template-rendered .vc_col-sm-6,
    .tgm-template-rendered .vc_col-sm-7,
    .tgm-template-rendered .vc_col-sm-8,
    .tgm-template-rendered .vc_col-sm-9,
    .tgm-template-rendered .vc_col-sm-10,
    .tgm-template-rendered .vc_col-sm-11,
    .tgm-template-rendered .vc_col-sm-12,
    .tgm-template-rendered [class*="vc_col-sm-"] {
        width: 100% !important;
    }

    /* Also handle WPBakery flex rows */
    .tgm-template-rendered .vc_row .vc_column_container {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .tgm-pva-inner {
        gap: 4px;
        padding: 8px 12px;
    }

    .tgm-pva-btn {
        padding: 8px 10px;
        min-width: 56px;
        font-size: 10px;
    }

    .tgm-pva-btn-contact {
        min-width: 90px;
    }

    .tgm-price-amount {
        font-size: 32px;
    }

    .tgm-property-title {
        font-size: 22px;
    }

    .tgm-image-section {
        padding: 0 12px;
    }

    .tgm-property-content {
        padding: 20px 12px 40px;
    }

    .tgm-gallery-viewer-overlay .tgm-gallery-arrow-prev,
    .tgm-gallery-viewer-overlay .tgm-gallery-arrow-next {
        position: absolute;
    }

    .tgm-gallery-arrow-prev {
        left: 4px;
    }

    .tgm-gallery-arrow-next {
        right: 4px;
    }

    .tgm-gallery-viewer-arrow {
        width: 48px;
        height: 48px;
        background: rgba(0, 0, 0, 0.5);
    }

    .tgm-gv-thumb {
        width: 60px;
        height: 60px;
    }

    .tgm-specs-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .tgm-description-content {
        font-size: 17px;
    }

    .tgm-form-row-2col {
        grid-template-columns: 1fr;
    }

    .tgm-contact-quick {
        flex-direction: column;
    }

    .tgm-contact-quick-btn {
        min-width: auto;
    }

    .tgm-calc-result-amount {
        font-size: 28px;
    }

    .tgm-modal-content {
        padding: 24px 20px;
    }
}

@media (max-width: 480px) {
    .tgm-pva-btn svg {
        width: 18px;
        height: 18px;
    }

    .tgm-gv-thumb {
        width: 52px;
        height: 52px;
    }

    .tgm-gallery-viewer-image-wrap {
        max-height: 50vh;
    }

    .tgm-gallery-viewer-img {
        max-height: 50vh;
    }

    .tgm-specs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tgm-hero-img {
        border-radius: 6px;
    }
}


/* ============================================================
   MOBILE OVERFLOW FIX (v1.9.2)
   ============================================================
   DevTools diagnosis: .tgms-divider--has-parade (Animation Studio
   parade SVG) renders at 1386px on a 412px screen, pushing every
   parent container wider than the viewport. The .tgm-template-
   rendered override (overflow: visible) — needed for WPBakery
   stretched rows on desktop — lets it escape on mobile.
   Fix: re-apply overflow containment on small screens where
   WPBakery full-width rows are irrelevant anyway.
   Also constrains jp-menu-overlay (second offender at 1386px).
   ============================================================ */

@media (max-width: 1024px) {
    /* Re-contain overflow that .tgm-template-rendered opened */
    .tgm-single-property.tgm-template-rendered {
        overflow-x: hidden;
    }

    /* Root-level overflow containment — catches anything that escapes
       intermediate WPBakery containers or parade travelers */
    html:has(.tgm-single-property),
    html:has(.tgm-single-property) body {
        overflow-x: hidden;
    }

    /* Parade divider: constrain to viewport */
    .tgms-divider--has-parade {
        max-width: 100vw;
        overflow: hidden !important;
    }

    /* Menu overlay: constrain to viewport */
    .jp-menu-overlay {
        max-width: 100vw;
        overflow: hidden;
    }

    /* Safety net: no child should exceed viewport */
    .tgm-single-property *,
    .tgm-single-property *::before,
    .tgm-single-property *::after {
        max-width: 100vw;
    }

    /* Exempt gallery viewer and modal overlays (fixed overlays need full width) */
    .tgm-gallery-viewer-overlay,
    .tgm-gallery-viewer-overlay *,
    .tgm-modal-overlay,
    .tgm-modal-overlay *,
    .tgm-contact-modal-overlay,
    .tgm-contact-modal-overlay * {
        max-width: none;
    }
}


/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
    .tgm-pva-toolbar,
    .tgm-modal-overlay,
    .tgm-gallery-viewer-overlay,
    .tgm-sidebar-cta,
    .tgm-finance-calc-btn,
    #wpadminbar,
    header,
    footer,
    nav {
        display: none !important;
    }

    .tgm-single-property {
        font-size: 13px;
    }

    .tgm-property-content {
        display: block;
    }

    .tgm-sidebar-card {
        position: static;
        border: 1px solid #ccc;
        margin-bottom: 20px;
    }

    .tgm-hero-img {
        max-height: 400px;
        object-fit: contain;
    }

    .tgm-property-title {
        font-size: 20px;
    }

    .tgm-badge,
    .tgm-sidebar-status {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}


/* ============================================================
   CONTACT SHORTCODE STYLES
   ============================================================ */

.tgm-contact-card {
    background: var(--tgm-bg, #ffffff);
    border: 1px solid var(--tgm-border, #e0e0e0);
    border-radius: var(--tgm-radius, 8px);
    padding: 28px 32px;
    box-shadow: var(--tgm-shadow, 0 2px 8px rgba(0, 0, 0, 0.08));
}

.tgm-contact-card .tgm-section-title {
    margin-bottom: 16px;
}

.tgm-contact-row {
    padding: 10px 0;
    font-size: 17px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tgm-contact-row + .tgm-contact-row {
    border-top: 1px solid var(--tgm-border, #e0e0e0);
}

.tgm-contact-icon {
    flex-shrink: 0;
    font-size: 20px;
}

.tgm-contact-row a {
    color: var(--tgm-accent, #c75b2a);
    text-decoration: none;
    font-weight: 600;
}

.tgm-contact-row a:hover {
    text-decoration: underline;
}

/* Inline style */
.tgm-contact-inline {
    font-size: 17px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.tgm-contact-inline a {
    color: var(--tgm-accent, #c75b2a);
    text-decoration: none;
    font-weight: 600;
}

.tgm-contact-inline a:hover {
    text-decoration: underline;
}

/* Simple style */
.tgm-contact-simple .tgm-contact-row {
    padding: 6px 0;
    border: none;
    font-size: 17px;
}

.tgm-contact-simple a {
    color: var(--tgm-accent, #c75b2a);
    text-decoration: none;
}

/* Virtual tour embed */
.tgm-virtual-tour-section .tgm-tour-embed {
    box-shadow: var(--tgm-shadow, 0 2px 8px rgba(0, 0, 0, 0.08));
}


/* ============================================================
   PRICING BLOCK (shortcode — price + lot fee only)
   ============================================================ */

.tgm-pricing-block .tgm-price-amount {
    font-size: 36px;
    font-weight: 800;
    color: var(--tgm-text, #1a1a1a);
    line-height: 1.2;
}

.tgm-pricing-block .tgm-price-lotfee {
    font-size: 16px;
    color: var(--tgm-text-light, #555);
    margin-top: 4px;
}


/* ============================================================
   ADDRESS BLOCK (shortcode — title + location)
   ============================================================ */

.tgm-address-block .tgm-property-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 6px;
    padding: 0;
    color: var(--tgm-text, #1a1a1a);
    line-height: 1.3;
}

.tgm-address-block .tgm-property-location {
    font-size: 16px;
    color: var(--tgm-text-light, #555);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}

.tgm-address-block .tgm-location-community {
    color: var(--tgm-accent, #c75b2a);
    font-weight: 600;
}


/* ============================================================
   AMENITY ICON SYSTEM
   ============================================================ */

.tgm-icon {
    color: var(--tgm-icon-color, #265962);
    transition: color 0.2s ease;
    flex-shrink: 0;
    margin-right: 8px;
    vertical-align: middle;
}

.tgm-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.tgm-tag {
    display: inline-flex;
    align-items: center;
}

/* Subtitle card layout — icon left, text stack right */
.tgm-tag-has-subtitle {
    align-items: flex-start;
    padding: 8px 0;
}

.tgm-tag-has-subtitle .tgm-icon {
    margin-top: 2px;
}

.tgm-tag-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.tgm-tag-label {
    font-weight: 600;
    font-size: 15px;
    color: var(--tgm-text, #333);
}

.tgm-tag-subtitle {
    font-size: 12px;
    font-weight: 400;
    color: #888;
    margin-top: 1px;
    line-height: 1.3;
}

.tgm-tag:hover .tgm-icon {
    color: var(--tgm-icon-hover-color, #c75b2a);
}

/* Placeholder icons — visible reminder that a real icon is needed */
.tgm-icon-placeholder {
    opacity: 0.35;
}
.tgm-layout-wrap .tgm-property-title {
    font-size: inherit !important;
    color: inherit !important;
    font-weight: inherit !important;
    letter-spacing: inherit !important;
    text-transform: inherit !important;
    line-height: inherit !important;
}
.tgm-spec-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 12px 20px;
    text-align: center;
}