/**
 * Propstack Single Listing Styles — Redesigned
 *
 * Premium dark real estate template inspired by München Makler style.
 *
 * @package Propstack_Sync
 * @since 2.0.0
 */

/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
    --ps-bg:              #1e1e1e;
    --ps-bg-card:         #2a2a2a;
    --ps-bg-card-alt:     #333333;
    --ps-bg-input:        #3a3a3a;
    --ps-accent:          #00d2d3;
    --ps-accent-hover:    #00b8b9;
    --ps-accent-glow:     rgba(0, 210, 211, .15);
    --ps-white:           #ffffff;
    --ps-text:            #e0e0e0;
    --ps-text-muted:      #999999;
    --ps-text-dim:        #777777;
    --ps-border:          #3c3c3c;
    --ps-success:         #4caf50;
    --ps-radius:          10px;
    --ps-radius-sm:       6px;
    --ps-shadow:          0 4px 24px rgba(0,0,0,.35);
    --ps-transition:      .3s cubic-bezier(.4,0,.2,1);
    --ps-container:       1280px;
}

/* ============================================================
   Reset & Base
   ============================================================ */
.propstack-single-listing *,
.propstack-single-listing *::before,
.propstack-single-listing *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.propstack-single-listing {
    background-color: var(--ps-bg);
    color: var(--ps-text);
    line-height: 1.65;
    max-width: var(--ps-container);
    margin: 0 auto;
    padding: 0 24px 60px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.propstack-single-listing a {
    color: var(--ps-accent);
    text-decoration: none;
    transition: color var(--ps-transition);
}

.propstack-single-listing a:hover {
    color: var(--ps-accent-hover);
}

/* ============================================================
   Gallery Section
   ============================================================ */
.propstack-gallery-section {
    margin-bottom: 40px;
    position: relative;
}

/* --- Main Image --- */
.propstack-gallery-main {
    position: relative;
    overflow: hidden;
    border-radius: var(--ps-radius);
    background: var(--ps-bg-card);
    box-shadow: var(--ps-shadow);
}

.propstack-gallery-slider {
    position: relative;
    width: 100%;
    height: clamp(280px, 58vh, 640px);
}

.propstack-gallery-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .55s ease;
    pointer-events: none;
}

.propstack-gallery-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.propstack-gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- Image Counter Badge --- */
.propstack-gallery-counter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: var(--ps-white);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: .8rem;
    letter-spacing: .5px;
    z-index: 5;
    pointer-events: none;
}

/* --- Nav Arrows --- */
.propstack-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,.50);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--ps-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--ps-transition), transform var(--ps-transition);
    z-index: 10;
}

.propstack-gallery-nav:hover {
    background: var(--ps-accent);
    transform: translateY(-50%) scale(1.08);
}

.propstack-gallery-prev { left: 16px; }
.propstack-gallery-next { right: 16px; }

.propstack-gallery-nav .material-symbols-rounded {
    font-size: 26px;
}

/* --- Thumbnails --- */
.propstack-gallery-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    padding: 6px 0;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--ps-accent) var(--ps-bg-card);
    scroll-behavior: smooth;
}

.propstack-gallery-thumbnails::-webkit-scrollbar { height: 5px; }
.propstack-gallery-thumbnails::-webkit-scrollbar-track { background: var(--ps-bg-card); border-radius: 3px; }
.propstack-gallery-thumbnails::-webkit-scrollbar-thumb { background: var(--ps-accent); border-radius: 3px; }

.propstack-gallery-thumb {
    flex-shrink: 0;
    width: 108px;
    height: 72px;
    border-radius: var(--ps-radius-sm);
    overflow: hidden;
    cursor: pointer;
    opacity: .55;
    transition: opacity var(--ps-transition), border-color var(--ps-transition), transform var(--ps-transition);
    border: 2px solid transparent;
}

.propstack-gallery-thumb:hover {
    opacity: .85;
    transform: translateY(-2px);
}

.propstack-gallery-thumb.active {
    opacity: 1;
    border-color: var(--ps-accent);
}

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

/* ============================================================
   Header / Key Metrics
   ============================================================ */
.propstack-listing-header {
    padding: 36px 0 32px;
    border-bottom: 1px solid var(--ps-border);
    margin-bottom: 36px;
}

.propstack-listing-title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 700;
    color: var(--ps-white);
    line-height: 1.25;
    margin-bottom: 8px;
}

.propstack-listing-subtitle {
    font-size: .95rem;
    color: var(--ps-text-muted);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.propstack-listing-subtitle .material-symbols-rounded {
    font-size: 18px;
    color: var(--ps-accent);
}

/* --- Quick Info / Metric Boxes --- */
.propstack-quick-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.propstack-quick-item {
    background: var(--ps-bg-card);
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius);
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color var(--ps-transition), box-shadow var(--ps-transition);
}

.propstack-quick-item:hover {
    border-color: var(--ps-accent);
    box-shadow: 0 0 0 1px var(--ps-accent), 0 0 20px var(--ps-accent-glow);
}

.propstack-quick-label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ps-text-muted);
}

.propstack-quick-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ps-white);
}

/* ============================================================
   Content Wrapper — Two-Column
   ============================================================ */
.propstack-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 44px;
    align-items: start;
}

.propstack-main-content {
    min-width: 0;
}

/* ============================================================
   Section Cards
   ============================================================ */
.propstack-section {
    background: var(--ps-bg-card);
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius);
    padding: 28px 32px;
    margin-bottom: 28px;
    box-shadow: var(--ps-shadow);
}

.propstack-section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--ps-white);
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--ps-border);
    position: relative;
}

/* accent underline */
.propstack-section-title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 48px;
    height: 2px;
    background: var(--ps-accent);
    border-radius: 2px;
}

/* ============================================================
   Description & Text Content
   ============================================================ */
.propstack-description-content {
    color: var(--ps-text);
    line-height: 1.85;
    position: relative;
    font-size: .95rem;
}

.propstack-description-content p,
.propstack-location-content p,
.propstack-other-content p {
    margin-bottom: 1em;
    line-height: 1.85;
}

.propstack-description-content p:last-child,
.propstack-location-content p:last-child,
.propstack-other-content p:last-child {
    margin-bottom: 0;
}

.propstack-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--ps-accent);
    color: var(--ps-accent);
    padding: 10px 22px;
    border-radius: 24px;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 600;
    margin-top: 18px;
    transition: background var(--ps-transition), color var(--ps-transition);
}

.propstack-read-more:hover {
    background: var(--ps-accent);
    color: var(--ps-bg);
}

/* ============================================================
   Features / Ausstattung — Simple List
   ============================================================ */
.propstack-features-list {
    list-style: none;
    margin: 0;
    padding: 0;
    columns: 2;
    column-gap: 1.5rem;
}

.propstack-feature-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    break-inside: avoid;
    font-size: .9rem;
    color: var(--ps-text);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.propstack-feature-list-item:last-child {
    border-bottom: none;
}

.propstack-feature-list-item .material-symbols-rounded {
    font-size: 18px;
    color: var(--ps-accent);
    flex-shrink: 0;
}

/* ============================================================
   Object Data
   ============================================================ */
.propstack-data-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.propstack-data-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--ps-bg);
    border-radius: var(--ps-radius-sm);
    border: 1px solid var(--ps-border);
    transition: border-color var(--ps-transition);
}

.propstack-data-item:hover {
    border-color: var(--ps-accent);
}

.propstack-data-label {
    font-size: .85rem;
    color: var(--ps-text-muted);
}

.propstack-data-value {
    font-size: .95rem;
    font-weight: 700;
    color: var(--ps-white);
    text-align: right;
}

/* ============================================================
   Energy Certificate / Energieausweis
   ============================================================ */
.propstack-energy-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.propstack-energy-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 18px;
    background: var(--ps-bg);
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius-sm);
}

.propstack-energy-label {
    font-size: .8rem;
    color: var(--ps-text-muted);
    text-transform: uppercase;
    letter-spacing: .4px;
}

.propstack-energy-value {
    font-size: .95rem;
    font-weight: 700;
    color: var(--ps-white);
}

.propstack-energy-class {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ps-success);
    color: var(--ps-white);
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 700;
    width: fit-content;
}

/* --- Energy Efficiency Scale --- */
.propstack-energy-scale {
    display: flex;
    gap: 2px;
    margin-top: 1.25rem;
    border-radius: 6px;
    overflow: hidden;
}

.propstack-energy-scale-item {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.25rem;
    font-size: .75rem;
    font-weight: 700;
    color: #fff;
    opacity: 0.4;
    transition: opacity var(--ps-transition), transform var(--ps-transition);
}

.propstack-energy-scale-item.active {
    opacity: 1;
    transform: scaleY(1.2);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.35);
    border-radius: 4px;
    position: relative;
}

.propstack-energy-scale-item.active::after {
    content: '▼';
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: var(--ps-white);
}

/* ============================================================
   Location & Other text sections
   ============================================================ */
.propstack-location-content,
.propstack-other-content {
    color: var(--ps-text);
    line-height: 1.85;
    font-size: .95rem;
}

/* ============================================================
   Sidebar
   ============================================================ */
.propstack-sidebar {
    position: sticky;
    top: 30px;
    height: fit-content;
}

/* --- Agent / Contact Card --- */
.propstack-contact-card {
    background: var(--ps-bg-card);
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius);
    padding: 32px 28px;
    box-shadow: var(--ps-shadow);
    text-align: center;
}

.propstack-contact-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--ps-accent);
    margin-bottom: 16px;
}

.propstack-contact-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ps-white);
    margin-bottom: 4px;
}

.propstack-contact-role {
    font-size: .8rem;
    color: var(--ps-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.propstack-contact-divider {
    width: 100%;
    height: 1px;
    background: var(--ps-border);
    margin-bottom: 20px;
}

.propstack-contact-text {
    font-size: .88rem;
    color: var(--ps-text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
    text-align: left;
}

/* --- Contact Info Rows --- */
.propstack-contact-info {
    text-align: left;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.propstack-contact-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .88rem;
    color: var(--ps-text);
}

.propstack-contact-info-row .material-symbols-rounded {
    font-size: 20px;
    color: var(--ps-accent);
    flex-shrink: 0;
}

.propstack-contact-info-row a {
    color: var(--ps-text);
}

.propstack-contact-info-row a:hover {
    color: var(--ps-accent);
}

/* --- CTA Buttons --- */
.propstack-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    border-radius: 30px;
    font-size: .92rem;
    font-weight: 700;
    text-decoration: none;
    transition: background var(--ps-transition), color var(--ps-transition), transform var(--ps-transition), box-shadow var(--ps-transition);
    margin-bottom: 12px;
    cursor: pointer;
    border: none;
    letter-spacing: .3px;
}

.propstack-contact-btn-primary {
    background: var(--ps-accent);
    color: var(--ps-bg);
}

.propstack-contact-btn-primary:hover {
    background: var(--ps-accent-hover);
    color: var(--ps-bg);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--ps-accent-glow);
}

.propstack-contact-btn-secondary {
    background: transparent;
    border: 1px solid var(--ps-accent);
    color: var(--ps-accent);
}

.propstack-contact-btn-secondary:hover {
    background: var(--ps-accent);
    color: var(--ps-bg);
}

.propstack-contact-btn .material-symbols-rounded {
    font-size: 20px;
}

/* ============================================================
   Floating Social Bar (right edge)
   ============================================================ */
.propstack-social-bar {
    position: fixed;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

.propstack-social-bar a {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--ps-accent);
    color: var(--ps-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--ps-transition), transform var(--ps-transition), box-shadow var(--ps-transition);
    box-shadow: 0 2px 10px rgba(0,0,0,.3);
}

.propstack-social-bar a:hover {
    background: var(--ps-accent-hover);
    transform: scale(1.12);
    box-shadow: 0 4px 18px var(--ps-accent-glow);
}

.propstack-social-bar .material-symbols-rounded {
    font-size: 22px;
}

/* ============================================================
   Responsive — 1200
   ============================================================ */
@media (max-width: 1200px) {
    .propstack-content-wrapper {
        grid-template-columns: 1fr 320px;
        gap: 30px;
    }
    .propstack-social-bar { display: none; }
}

/* ============================================================
   Responsive — 992
   ============================================================ */
@media (max-width: 992px) {
    .propstack-content-wrapper {
        grid-template-columns: 1fr;
    }

    .propstack-sidebar {
        position: static;
    }

    .propstack-gallery-slider {
        height: clamp(240px, 45vh, 420px);
    }
}

/* ============================================================
   Responsive — 768
   ============================================================ */
@media (max-width: 768px) {
    .propstack-single-listing {
        padding: 0 16px 48px;
    }

    .propstack-listing-title {
        font-size: 1.5rem;
    }

    .propstack-gallery-slider {
        height: 280px;
    }

    .propstack-quick-info {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .propstack-quick-item {
        padding: 16px;
    }

    .propstack-section {
        padding: 22px 20px;
    }

    .propstack-data-grid,
    .propstack-energy-grid {
        grid-template-columns: 1fr;
    }

    .propstack-features-list {
        columns: 1;
    }

    .propstack-gallery-nav {
        width: 40px;
        height: 40px;
    }

    .propstack-gallery-nav .material-symbols-rounded {
        font-size: 22px;
    }

    .propstack-gallery-prev { left: 10px; }
    .propstack-gallery-next { right: 10px; }
}

/* ============================================================
   Responsive — 480
   ============================================================ */
@media (max-width: 480px) {
    .propstack-listing-title {
        font-size: 1.3rem;
    }

    .propstack-gallery-slider {
        height: 220px;
    }

    .propstack-quick-info {
        grid-template-columns: 1fr;
    }

    .propstack-gallery-thumb {
        width: 80px;
        height: 54px;
    }

    .propstack-section-title {
        font-size: 1.1rem;
    }

    .propstack-contact-card {
        padding: 24px 20px;
    }

    .propstack-contact-btn {
        padding: 13px 20px;
        font-size: .88rem;
    }

    .propstack-energy-scale-item {
        padding: 0.4rem 0.15rem;
        font-size: .65rem;
    }
}

/* ============================================================
   Print
   ============================================================ */
@media print {
    .propstack-single-listing {
        background: #fff;
        color: #222;
    }
    .propstack-gallery-nav,
    .propstack-social-bar,
    .propstack-read-more,
    .propstack-contact-btn { display: none; }
    .propstack-section,
    .propstack-quick-item,
    .propstack-data-item,
    .propstack-feature-list-item,
    .propstack-energy-item,
    .propstack-contact-card {
        background: #f9f9f9;
        border-color: #ddd;
        color: #222;
    }
    .propstack-section-title,
    .propstack-listing-title,
    .propstack-quick-value,
    .propstack-data-value,
    .propstack-energy-value,
    .propstack-contact-title { color: #111; }
    .propstack-energy-scale-item { opacity: 1; }
}