/**
 * PropertySoft Property Details Layout
 *
 * All rules scoped under .ps-property-layout to prevent interference.
 * Base font-size set explicitly to 16px to prevent theme overrides.
 * All font-sizes use em (relative to our 16px base), NOT rem (theme root).
 */

/* === Custom Properties === */
.ps-property-layout {
    --ps-max-width: 1200px;
    --ps-border-color: #e0e0e0;
    --ps-bg-light: #f8f9fa;
    --ps-text-primary: inherit;
    --ps-text-secondary: #6c757d;
    --ps-accent-color: #2c3e50;
    --ps-success-color: #28a745;
    --ps-warning-color: #f0ad4e;
    --ps-danger-color: #dc3545;
    --ps-link-color: #0073aa;
    --ps-radius: 8px;
    --ps-spacing: 1.5em;

    max-width: var(--ps-max-width);
    margin: 0 auto;
    padding: 0 var(--ps-spacing);
    font-family: inherit;
    font-size: 16px;
    color: var(--ps-text-primary);
    line-height: 1.6;
}

/* === Error States === */
.ps-property-layout.ps-error {
    padding: 2em;
    text-align: center;
    background: var(--ps-bg-light);
    border-radius: var(--ps-radius);
}

/* === Section 1: Top Bar === */
.ps-property-layout .ps-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1em 0;
    margin-bottom: var(--ps-spacing);
    border-bottom: 1px solid var(--ps-border-color);
}

.ps-property-layout .ps-back-link {
    color: var(--ps-link-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1em;
    transition: opacity 0.2s;
}

.ps-property-layout .ps-back-link:hover {
    opacity: 0.7;
}

.ps-property-layout .ps-share-buttons {
    display: flex;
    gap: 0.75em;
}

.ps-property-layout .ps-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: transform 0.2s, opacity 0.2s;
}

.ps-property-layout .ps-share-btn:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

.ps-property-layout .ps-share-facebook {
    background: #1877f2;
}

.ps-property-layout .ps-share-whatsapp {
    background: #25d366;
}

/* === Section 2: Header === */
.ps-property-layout .ps-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2em;
    margin-bottom: var(--ps-spacing);
}

.ps-property-layout .ps-header-left {
    flex: 3;
}

.ps-property-layout .ps-header-right {
    flex: 1;
    text-align: right;
}

.ps-property-layout .ps-title {
    font-size: 1.75em;
    font-weight: 700;
    margin: 0 0 0.5em;
    line-height: 1.3;
}

.ps-property-layout .ps-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em 1.5em;
    color: var(--ps-text-secondary);
    margin-bottom: 0.5em;
    font-size: 1.2em;
}

.ps-property-layout .ps-ref {
    font-family: monospace;
    font-size: 1em;
}

.ps-property-layout .ps-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    font-weight: 600;
    font-size: 1em;
}

.ps-property-layout .ps-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #999;
}

.ps-property-layout .ps-status--for-sale .ps-status-dot {
    background: var(--ps-success-color);
    animation: ps-pulse 2s infinite;
}

.ps-property-layout .ps-status--under-offer .ps-status-dot {
    background: var(--ps-warning-color);
    animation: ps-pulse 2s infinite;
}

.ps-property-layout .ps-status--sold .ps-status-dot {
    background: var(--ps-danger-color);
}

.ps-property-layout .ps-status--default .ps-status-dot {
    background: #999;
}

@keyframes ps-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@media (prefers-reduced-motion: reduce) {
    .ps-property-layout .ps-status-dot {
        animation: none !important;
    }
}

.ps-property-layout .ps-price {
    font-size: 1.75em;
    font-weight: 700;
    color: var(--ps-accent-color);
    white-space: nowrap;
}

/* === Section 3: Gallery === */
.ps-property-layout .ps-gallery {
    margin-bottom: var(--ps-spacing);
    border-radius: var(--ps-radius);
    overflow: hidden;
}

.ps-property-layout .ps-no-images {
    background: var(--ps-bg-light);
    text-align: center;
    padding: 4em 2em;
    border-radius: var(--ps-radius);
}

.ps-property-layout .ps-no-images img {
    max-width: 200px;
    opacity: 0.5;
}

/* === Section 4: Specs Grid === */
.ps-property-layout .ps-specs-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1em;
    margin-bottom: var(--ps-spacing);
}

.ps-property-layout .ps-spec-item {
    display: flex;
    align-items: center;
    gap: 0.75em;
    padding: 1em;
    border: 1px solid var(--ps-border-color);
    border-radius: var(--ps-radius);
    background: var(--ps-bg-light);
}

.ps-property-layout .ps-spec-icon img {
    display: block;
}

.ps-property-layout .ps-spec-info {
    display: flex;
    flex-direction: column;
}

.ps-property-layout .ps-spec-value {
    font-weight: 700;
    font-size: 1.25em;
    line-height: 1.2;
}

.ps-property-layout .ps-spec-label {
    font-size: 0.875em;
    color: var(--ps-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === Section 5–8: Generic Sections === */
.ps-property-layout .ps-section {
    margin-bottom: var(--ps-spacing);
    padding-bottom: var(--ps-spacing);
    border-bottom: 1px solid var(--ps-border-color);
}

.ps-property-layout .ps-section:last-child {
    border-bottom: none;
}

.ps-property-layout .ps-section h4 {
    font-size: 1.25em;
    font-weight: 700;
    margin: 0 0 1em;
}

.ps-property-layout .ps-section h5 {
    font-size: 1.15em;
    font-weight: 700;
    margin: 0 0 1em;
}

/* === Section 5: Description === */
.ps-property-layout .ps-description-text {
    text-align: justify;
    font-size: 1em;
    line-height: 1.8;
}

/* === Section 6: Features === */
.ps-property-layout .ps-features-list {
    list-style: disc;
    padding-left: 1.5em;
    margin: 0;
    font-size: 1em;
}

.ps-property-layout .ps-features-list li {
    line-height: 3em;
}

/* === Section 7: Fees === */
.ps-property-layout .ps-fees-list {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.ps-property-layout .ps-fee-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75em 1em;
    background: var(--ps-bg-light);
    border-radius: var(--ps-radius);
    font-size: 1em;
}

.ps-property-layout .ps-fee-label {
    font-weight: 500;
}

.ps-property-layout .ps-fee-value {
    font-weight: 700;
}

/* === Section 8: Location === */
.ps-property-layout .ps-gps-coords {
    color: var(--ps-text-secondary);
    font-family: monospace;
    font-size: 0.875em;
    margin-bottom: 1em;
}

.ps-property-layout .ps-map-container {
    border-radius: var(--ps-radius);
    overflow: hidden;
    border: 1px solid var(--ps-border-color);
}

.ps-property-layout .ps-map-container iframe {
    display: block;
}

/* === Section 9: Enquiry Form === */
.ps-property-layout .ps-contact-phone {
    margin-bottom: 1em;
}

.ps-property-layout .ps-contact-phone a {
    color: var(--ps-link-color);
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 600;
}

.ps-property-layout .ps-whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.75em 1.5em;
    background: #25d366;
    color: #fff;
    text-decoration: none;
    border-radius: var(--ps-radius);
    font-weight: 600;
    font-size: 1em;
    margin-bottom: 1.5em;
    transition: background 0.2s;
}

.ps-property-layout .ps-whatsapp-btn:hover {
    background: #1ebe57;
    color: #fff;
}

.ps-property-layout .ps-enquiry-form {
    display: flex;
    flex-direction: column;
    gap: 1em;
    max-width: 600px;
}

.ps-property-layout .ps-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25em;
}

.ps-property-layout .ps-form-group label {
    font-weight: 600;
    font-size: 0.9em;
}

.ps-property-layout .ps-form-group input[type="text"],
.ps-property-layout .ps-form-group input[type="email"],
.ps-property-layout .ps-form-group textarea {
    padding: 0.75em;
    border: 1px solid var(--ps-border-color);
    border-radius: calc(var(--ps-radius) / 2);
    font-family: inherit;
    font-size: 1em;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.ps-property-layout .ps-form-group input:focus,
.ps-property-layout .ps-form-group textarea:focus {
    border-color: var(--ps-link-color);
    outline: 2px solid var(--ps-link-color);
    outline-offset: -2px;
}

.ps-property-layout .ps-form-group input.ps-field-invalid,
.ps-property-layout .ps-form-group textarea.ps-field-invalid {
    border-color: var(--ps-danger-color);
}

.ps-property-layout .ps-field-error {
    color: var(--ps-danger-color);
    font-size: 0.875em;
    min-height: 1.2em;
}

/* Honeypot */
.ps-property-layout .ps-hp-field {
    position: absolute;
    left: -9999px;
    height: 0;
    overflow: hidden;
    opacity: 0;
}

.ps-property-layout .ps-submit-btn {
    padding: 0.875em 2em;
    background: var(--ps-accent-color);
    color: #fff;
    border: none;
    border-radius: var(--ps-radius);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    align-self: flex-start;
}

.ps-property-layout .ps-submit-btn:hover {
    opacity: 0.9;
}

.ps-property-layout .ps-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ps-property-layout .ps-form-message {
    padding: 1em;
    border-radius: var(--ps-radius);
    font-weight: 500;
    display: none;
}

.ps-property-layout .ps-form-message.ps-message-success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ps-property-layout .ps-form-message.ps-message-error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Noscript */
.ps-property-layout .ps-noscript {
    padding: 1em;
    background: var(--ps-bg-light);
    border-radius: var(--ps-radius);
    border: 1px solid var(--ps-border-color);
}

/* === Responsive: Tablet Landscape (768-1024px) === */
@media (max-width: 1024px) {
    .ps-property-layout .ps-specs-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* === Responsive: Mobile (<768px) === */
@media (max-width: 767px) {
    .ps-property-layout .ps-header {
        flex-direction: column;
        gap: 0.5em;
    }

    .ps-property-layout .ps-header-right {
        text-align: left;
    }

    .ps-property-layout .ps-title {
        font-size: 1.35em;
    }

    .ps-property-layout .ps-price {
        font-size: 1.5em;
    }

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

    .ps-property-layout .ps-description-text {
        text-align: left;
    }

    .ps-property-layout .ps-features-list {
        list-style: none;
        padding-left: 0;
    }

    .ps-property-layout .ps-topbar {
        flex-direction: column;
        gap: 0.75em;
        align-items: flex-start;
    }

    .ps-property-layout .ps-fee-item {
        flex-direction: column;
        gap: 0.25em;
    }
}

/* === Focus Visible for Keyboard Navigation === */
.ps-property-layout a:focus-visible,
.ps-property-layout button:focus-visible,
.ps-property-layout input:focus-visible,
.ps-property-layout textarea:focus-visible {
    outline: 2px solid var(--ps-link-color);
    outline-offset: 2px;
}
