/**
 * JIF HOMES - Brand Stylesheet
 * Based on Brand Guidelines Ver 1.1 - Oct 2025
 */

/* ========================================
   LEAFLET MAP CRITICAL FIXES - MUST BE FIRST
   ======================================== */
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
    position: absolute;
    left: 0;
    top: 0;
}

.leaflet-container {
    overflow: hidden;
    /* leaflet.css sets its own font stack; keep the riyal-sign fallback font in map popups (prices). */
    font-family: 'Riyal Sign', 'Cairo', 'Segoe UI', Tahoma, system-ui, sans-serif;
}

.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

.leaflet-container img {
    max-width: none !important;
    max-height: none !important;
}

.leaflet-container img.leaflet-tile {
    width: 256px !important;
    height: 256px !important;
}

/* ========================================
   CSS VARIABLES
   ======================================== */
/* Saudi riyal sign (U+20C1): a one-glyph font (Noto Sans, OFL) used only for that character,
   so prices render the sign on devices whose system fonts predate it. */
@font-face {
    font-family: 'Riyal Sign';
    src: url('../fonts/riyal-sign.woff2') format('woff2');
    unicode-range: U+20C1;
    font-display: swap;
}
:root {
    /* Brand Colors */
    --desert-brown: #7A5548;
    --desert-brown-light: #8B6558;
    --desert-brown-dark: #5C4035;
    --leaf-green: #2C3E2D;
    --hills-green: #008B73;
    --light-brown: #8B8B7A;
    --pearl-white: #F4F1EC;
    --white: #FFFFFF;
    --midnight-black: #1B1F29;
    
    /* Functional */
    --text-primary: #1B1F29;
    --text-secondary: #5C5C5C;
    --text-muted: #8B8B7A;
    --border-color: #E5E2DD;
    --background: #F4F1EC;
    
    /* Status */
    --success: #008B73;
    --warning: #D4A574;
    --error: #C75050;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    
    /* Container */
    --container-max: 1200px;
}

/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Riyal Sign', 'Cairo', sans-serif;
    font-synthesis: none;   /* the riyal sign keeps its regular weight next to bold numbers */
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--pearl-white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

a {
    color: inherit;
    text-decoration: none;
}

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

/* =====================================================================
   LEAFLET TILE SAFEGUARD  (defensive — see note below)
   =====================================================================
   HISTORICAL NOTE: This block was originally added based on a wrong
   diagnosis. The real cause of the scattered-tile rendering was that
   Leaflet's CSS was being BLOCKED by the Content Security Policy —
   the CSP allow-listed unpkg.com but not cdnjs.cloudflare.com, and the
   stylesheet href pointed at cdnjs. With leaflet.css blocked, tiles
   rendered with NO positioning rules at all, which looked superficially
   like the `img { max-width: 100% }` scaling bug but had a different
   root cause. The Leaflet asset URLs have since been standardized to
   unpkg (already in the CSP allow-list).

   This safeguard is kept in place as defense in depth: if a future
   developer reintroduces a global `img { max-width: 100% }` rule, or
   loads Leaflet from a CDN that wasn't part of the original test, the
   tile sprites still won't scale and break alignment. The rule is
   harmless when leaflet.css is loading correctly. */
.leaflet-container img,
.leaflet-container img.leaflet-tile,
.leaflet-container img.leaflet-marker-icon,
.leaflet-container img.leaflet-marker-shadow,
.leaflet-container .leaflet-tile-pane img,
.leaflet-pane img {
    max-width:  none   !important;
    max-height: none   !important;
    width:      auto;
    height:     auto;
    display:    block;
}

ul, ol {
    list-style: none;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--desert-brown);
    color: white;
    padding: 0.5rem 1rem;
    z-index: 9999;
}

.skip-link:focus {
    top: 0;
}

/* ========================================
   HEADER
   ======================================== */
.site-header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1100;
}

.header-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 120px;
}

.header-logo img {
    height: 46px;   /* trimmed logo file: the mark itself is ~1.4x larger than before */
    width: auto;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-item {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-secondary);
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.2s;
}

.nav-item:hover,
.nav-item.active {
    color: var(--desert-brown);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--desert-brown);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.lang-switcher a {
    color: var(--text-muted);
    transition: color 0.2s;
}

.lang-switcher a:hover,
.lang-switcher a.active {
    color: var(--desert-brown);
    font-weight: 700;
}

.lang-switcher .divider {
    color: var(--border-color);
}

.header-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 700;
    transition: all 0.2s;
}

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

.header-btn.outline:hover {
    border-color: var(--desert-brown);
    color: var(--desert-brown);
}

.header-btn.primary {
    background: var(--desert-brown);
    color: white;
}

.header-btn.primary:hover {
    background: var(--desert-brown-dark);
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s;
}

.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Header */
@media (max-width: 900px) {
    .header-nav {
        position: fixed;
        top: 120px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1.5rem;
        gap: 0;
        box-shadow: var(--shadow-md);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }
    
    .header-nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-item {
        width: 100%;
        padding: 1rem 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-item.active::after {
        display: none;
    }
    
    .mobile-toggle {
        display: flex;
    }
    
    .header-btn {
        display: none;
    }
    
    .lang-switcher {
        margin-right: 1rem;
    }
}

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
    background: var(--leaf-green);
    color: var(--white);
    margin-top: auto;
}

.footer-main {
    padding: 4rem 0;
}

.footer-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 3rem;
}

.footer-logo {
    height: 44px;
    width: auto;
    margin-bottom: 1.5rem;
}

.footer-desc {
    font-size: 0.9rem;
    opacity: 0.85;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.footer-social a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transition: all 0.2s;
}

.footer-social a:hover {
    background: var(--desert-brown);
}

.footer-social svg {
    width: 18px;
    height: 18px;
}

.footer-links h4,
.footer-contact h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    font-size: 0.9rem;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.footer-links a:hover {
    opacity: 1;
}

.footer-contact ul {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.footer-contact svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.footer-contact a {
    opacity: 0.85;
    transition: opacity 0.2s;
}

.footer-contact a:hover {
    opacity: 1;
}

.footer-bottom {
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.875rem;
    opacity: 0.7;
}

.footer-bottom .footer-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-bottom p {
    text-align: start;
    margin: 0;
}

/* Mobile Footer */
@media (max-width: 900px) {
    .footer-container {
        grid-template-columns: 1fr 1fr;
    }
    
    .footer-brand {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .footer-container {
        grid-template-columns: 1fr;
    }
    
    .footer-brand {
        grid-column: span 1;
    }
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--desert-brown);
    color: white;
}

.btn-primary:hover {
    background: var(--desert-brown-dark);
}

.btn-secondary {
    background: var(--leaf-green);
    color: white;
}

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

.btn-outline:hover {
    border-color: var(--desert-brown);
    color: var(--desert-brown);
}

.btn-green {
    background: #25D366;
    color: white;
}

.btn-green:hover {
    background: #20BA5C;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--white);
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--desert-brown);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-container {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* ========================================
   ALERTS
   ======================================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    transition: opacity 0.3s;
}

.alert-success {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #C8E6C9;
}

.alert-error {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #FFCDD2;
}

.alert-warning {
    background: #FFF3E0;
    color: #EF6C00;
    border: 1px solid #FFE0B2;
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
    background: linear-gradient(135deg, var(--leaf-green) 0%, var(--desert-brown-dark) 100%);
    color: white;
    padding: 5rem 0;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero h1 {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero h1 span {
    display: block;
    color: var(--warning);
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.stat-item {
    text-align: start;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--warning);
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.8;
}

.hero-image {
    position: relative;
}

.hero-image-main {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.hero-image-main img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.hero-floating-card {
    position: absolute;
    background: white;
    color: var(--text-primary);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hero-floating-card.card-1 {
    top: 20px;
    right: -20px;
}

.hero-floating-card.card-2 {
    bottom: 40px;
    left: -20px;
}

@media (max-width: 900px) {
    .hero-content {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-image {
        display: none;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   SECTIONS
   ======================================== */
.section {
    padding: 5rem 0;
}

.section-header {
    text-align: start;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.section-divider {
    width: 60px;
    height: 3px;
    background: var(--desert-brown);
    margin: 1rem auto;
}

.section-header p {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   SEARCH SECTION
   ======================================== */
.search-section {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-top: -3rem;
    position: relative;
    z-index: 10;
}

.search-form {
    display: grid;
    grid-template-columns: repeat(4, 1fr) auto;
    gap: 1rem;
    align-items: end;
}

.search-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.search-group input,
.search-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
}

@media (max-width: 900px) {
    .search-form {
        grid-template-columns: 1fr 1fr;
    }
    
    .search-form .btn {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .search-form {
        grid-template-columns: 1fr;
    }
    
    .search-form .btn {
        grid-column: span 1;
    }
}

/* ========================================
   APARTMENT CARDS
   ======================================== */
.grid {
    display: grid;
    gap: 2rem;
}

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

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

@media (max-width: 600px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

.apartment-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}

.apartment-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.apartment-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.apartment-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.apartment-card:hover .apartment-image img {
    transform: scale(1.05);
}

.apartment-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--desert-brown);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
}

[dir="rtl"] .apartment-badge {
    left: auto;
    right: 1rem;
}

.apartment-favorite {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

[dir="rtl"] .apartment-favorite {
    right: auto;
    left: 1rem;
}

.apartment-favorite:hover {
    background: var(--error);
    color: white;
}

.apartment-content {
    padding: 1.25rem;
}

.apartment-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.apartment-location svg {
    width: 14px;
    height: 14px;
}

.apartment-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.apartment-title a {
    color: var(--text-primary);
    transition: color 0.2s;
}

.apartment-title a:hover {
    color: var(--desert-brown);
}

.apartment-features {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.feature-item svg {
    width: 16px;
    height: 16px;
    color: var(--desert-brown);
}

.apartment-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.apartment-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--desert-brown);
}

.apartment-price span {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* ========================================
   APARTMENT DETAIL PAGE - GALLERY
   ======================================== */
.apartment-detail {
    padding: 2rem 0 4rem;
}

.apartment-gallery {
    margin-bottom: 2rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 250px 250px;
    gap: 0.75rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.gallery-main {
    grid-row: span 2;
    position: relative;
    cursor: pointer;
}

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

.gallery-thumb {
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

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

.gallery-thumb:hover img {
    transform: scale(1.05);
}

.gallery-more {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 300px auto;
    }
    
    .gallery-main {
        grid-row: span 1;
    }
    
    .gallery-thumbs-row {
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .gallery-thumb {
        flex: 0 0 120px;
        height: 80px;
    }
}

/* Horizontal Gallery Scroll */
.gallery-horizontal {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
    margin: 0 -1.5rem;
    padding: 0 1.5rem 1rem;
}

.gallery-horizontal::-webkit-scrollbar {
    height: 6px;
}

.gallery-horizontal::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 3px;
}

.gallery-horizontal::-webkit-scrollbar-thumb {
    background: var(--desert-brown);
    border-radius: 3px;
}

.gallery-horizontal-item {
    flex: 0 0 auto;
    width: 600px;
    height: 400px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    scroll-snap-align: start;
    cursor: pointer;
}

.gallery-horizontal-item:first-child {
    width: 700px;
}

.gallery-horizontal-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-horizontal-item:hover img {
    transform: scale(1.02);
}

@media (max-width: 768px) {
    .gallery-horizontal-item {
        width: 85vw;
        height: 250px;
    }
    
    .gallery-horizontal-item:first-child {
        width: 85vw;
    }
}

/* Apartment Info Grid */
.apartment-info-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
}

@media (max-width: 900px) {
    .apartment-info-grid {
        grid-template-columns: 1fr;
    }
}

.apartment-main-info h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.apartment-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meta-item svg {
    width: 18px;
    height: 18px;
}

.apartment-description {
    margin-bottom: 2rem;
}

.apartment-description h3,
.apartment-amenities h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.apartment-description p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 1.5rem 0 2rem;
}

.detail-card {
    background: var(--white);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    text-align: start;
    border: 1px solid var(--border-color);
}

.detail-card svg {
    width: 28px;
    height: 28px;
    color: var(--desert-brown);
    margin-bottom: 0.5rem;
}

.detail-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.detail-card .label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

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

/* Amenities Grid */
.amenities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.amenity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--pearl-white);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.amenity-item svg {
    width: 20px;
    height: 20px;
    color: var(--hills-green);
}

/* Booking Sidebar (align-self keeps it as tall as its content instead of
   stretching to the grid row, and lets position: sticky work) */
.booking-sidebar {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 100px;
    align-self: start;
    height: fit-content;
}

.booking-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--desert-brown);
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.booking-price .period {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* Map Container */
.map-container {
    height: 400px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 1rem;
}

#apartment-map,
#homeMap {
    height: 100%;
    width: 100%;
}

/* ========================================
   FEATURES GRID (Why Choose Us)
   ======================================== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.feature-card {
    text-align: start;
    padding: 2rem 1.5rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    background: var(--pearl-white);
    border-radius: 50%;
    color: var(--desert-brown);
}

.feature-icon svg {
    width: 28px;
    height: 28px;
}

.feature-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

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

@media (max-width: 600px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   AUTH PAGES
   ======================================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--pearl-white);
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 900px;
    width: 100%;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.auth-image {
    background: linear-gradient(135deg, var(--leaf-green), var(--desert-brown-dark));
    color: white;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-image img {
    height: 80px;
    width: auto;
    margin-bottom: 2rem;
}

.auth-image h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.auth-image p {
    opacity: 0.85;
}

.auth-form {
    padding: 3rem;
}

.auth-form h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.auth-form .subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: start;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--desert-brown);
    font-weight: 700;
}

@media (max-width: 768px) {
    .auth-container {
        grid-template-columns: 1fr;
    }
    
    .auth-image {
        display: none;
    }
}

/* ========================================
   UTILITIES
   ======================================== */
.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: 2rem;
}

/* ========================================
   RTL SUPPORT
   ======================================== */
/* In RTL, flexbox naturally flows right-to-left */
/* Logo on right, nav items flow right-to-left, actions on left */

[dir="rtl"] .footer-container {
    direction: rtl;
}

[dir="rtl"] .search-form {
    direction: rtl;
}

[dir="rtl"] .gallery-horizontal {
    direction: rtl;
}

/* ========================================
   ADMIN STYLES
   ======================================== */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.admin-stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.admin-stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.admin-stat-icon.brown {
    background: rgba(122, 85, 72, 0.1);
    color: var(--desert-brown);
}

.admin-stat-icon.green {
    background: rgba(0, 139, 115, 0.1);
    color: var(--hills-green);
}

.admin-stat-icon.dark {
    background: rgba(44, 62, 45, 0.1);
    color: var(--leaf-green);
}

.admin-stat-icon.muted {
    background: rgba(139, 139, 122, 0.1);
    color: var(--light-brown);
}

.admin-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.admin-stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.admin-stat-change {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.admin-stat-change.positive {
    color: var(--success);
}

.admin-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-card-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.admin-card-body {
    padding: 1.5rem;
}

.admin-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
}

.admin-badge-success {
    background: #E8F5E9;
    color: #2E7D32;
}

.admin-badge-warning {
    background: #FFF3E0;
    color: #EF6C00;
}

/* ============================================================================
   RENTAL-TYPE BADGES (global)
   Used on apartment cards, the apartment detail page header, and Leaflet
   map popups. The base positioning is set per-page (absolute on cards,
   inline-block on detail / popups via inline style="position:static;").
   ========================================================================= */
.rental-badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.4;
    white-space: nowrap;
}
.rental-badge.rental-daily   { background: rgba(27, 40, 56, 0.92);  color: #fff; }
.rental-badge.rental-monthly { background: rgba(0, 139, 115, 0.92); color: #fff; }
.rental-badge.rental-both    { background: rgba(122, 85, 72, 0.95); color: #1B1F29; }

/* ============================================================================
   ARABIC TYPOGRAPHY & RTL POLISH
   Arabic-script text in Cairo renders ~10-12% smaller perceptually than the
   same point size in Latin. We bump the base size and line-height when
   [dir="rtl"] is active so apartment titles, descriptions, and metadata
   read cleanly without ligature breakage.

   NEVER use letter-spacing on Arabic — it breaks the curvilinear joins
   between letters and is the #1 reason Arabic web text looks "wrong."
   ========================================================================= */

[dir="rtl"], [lang="ar"] {
    font-family: 'Riyal Sign', 'Cairo', 'Segoe UI', Tahoma, system-ui, sans-serif;
    /* Arabic Cairo glyphs sit lower; the slight line-height bump centers
       them visually against Latin in mixed contexts. */
    line-height: 1.8;
    /* Critical: no letter-spacing on Arabic. */
    letter-spacing: 0;
    /* word-spacing helps Arabic word boundaries (which lack the same
       inter-word whitespace pull as Latin). A small positive value reads
       cleaner without distorting individual words. */
    word-spacing: 0.02em;
}

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4,
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3, [lang="ar"] h4 {
    /* Headers in Arabic Cairo need a smaller line-height than body copy
       — 1.45 is the sweet spot. The body's 1.8 is too airy for headings. */
    line-height: 1.45;
    /* Headings carry the bold Cairo cut; allow ligatures to render. */
    font-feature-settings: "liga" on, "calt" on;
}

/* Apartment-card titles — works for both AR and EN. Two-line clamp with
   a stable min-height so cards in a grid don't snap to different heights
   when titles are long vs short. */
.apt-title {
    line-height: 1.45;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 2.9em;
    word-break: break-word;
}
.apt-title[lang="ar"] {
    line-height: 1.55;
    min-height: 3.1em;     /* Arabic two-line height is slightly taller */
}

/* Apartment detail page heading — make sure long Arabic titles wrap
   gracefully instead of overflowing the column. */
.apartment-main-info h1 {
    word-break: break-word;
    overflow-wrap: anywhere;
}
.apartment-main-info h1[lang="ar"] {
    line-height: 1.5;
    font-size: clamp(1.4rem, 3vw, 2rem);
}

/* Description paragraph + meta rows in RTL: ensure text-align follows
   the language direction. Some legacy v1 rules force text-align: left. */
[dir="rtl"] .apartment-description p,
[dir="rtl"] .apartment-meta,
[dir="rtl"] .apt-city,
[dir="rtl"] .apt-meta {
    text-align: right;
}

/* Number rendering in RTL: prices, phones, dates — keep LTR-correct
   even inside an RTL container, so "450 SAR" doesn't become "SAR 450"
   with the digits reversed. Use `dir="ltr"` on the element OR the
   `bdi` element where you control the markup; this rule is a fallback
   for cases where we forgot. */
[dir="rtl"] .apt-price,
[dir="rtl"] .booking-price,
[dir="rtl"] .mp-price {
    unicode-bidi: plaintext;
}

/* Apartment-detail meta row in RTL: the icon + text were rendering
   with the icon stuck to the wrong side because flex defaults to LTR. */
[dir="rtl"] .meta-item {
    flex-direction: row-reverse;
    text-align: right;
}

/* Logical-property cleanup: legacy rules use `left:` / `right:` for badge
   positioning, which we now override per-page using the ?lang ternary.
   Cards rendered through pages that pass `lang="ar"` on the title
   element get the correct flow without further CSS tricks. */


/* ---- Added in the 2026-09 hardening pass ---------------------------------- */
[hidden] { display: none !important; }
/* Honeypot: visually hidden without an off-screen offset (an offset makes RTL pages scroll sideways). */
.hp-field { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Booking request page (pages/book.php) */
.booking-page { padding: 24px 0 64px; }
.booking-container { max-width: 760px; }
.booking-header h1 { margin: 0 0 8px; font-size: 1.6rem; }
.booking-intro { color: var(--text-muted, #4b5563); margin: 0 0 20px; line-height: 1.6; }
.booking-header .apartment-summary { margin-bottom: 24px; padding: 16px; border-radius: 8px; background: #f7f7f8; border: 1px solid #e5e7eb; }
.booking-header .apt-title { margin: 0 0 4px; font-size: 1.1rem; }
.booking-header .apt-meta { margin: 0; color: #555; font-size: 0.95rem; }
.booking-form { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 20px; }
.booking-form .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.booking-form .form-row { display: flex; flex-direction: column; gap: 6px; }
.booking-form .form-row.span-2 { grid-column: 1 / -1; }
.booking-form label { font-size: 0.9rem; font-weight: 400; }
.booking-form .req { color: #c0392b; }
.booking-form input, .booking-form select, .booking-form textarea { padding: 10px 12px; font: inherit; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; }
.booking-form input:focus, .booking-form select:focus, .booking-form textarea:focus { outline: none; border-color: #7A5548; box-shadow: 0 0 0 3px rgba(122,85,72,.18); }
.booking-form .hint { font-size: .8rem; color: #6b7280; }
.booking-form .form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.booking-form .btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border: 1px solid transparent; border-radius: 6px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.booking-form .btn-primary { background: #1B1F29; color: #fff; }
.booking-form .btn-primary:hover:not(:disabled) { background: #2d2f3a; }
.booking-form .btn-secondary { background: #fff; color: #1B1F29; border-color: #d1d5db; }
.booking-form .btn:disabled { opacity: .6; cursor: not-allowed; }
.booking-form .alert { padding: 12px 14px; border-radius: 6px; margin-top: 12px; font-size: .95rem; }
.booking-form .alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.booking-note { margin: 14px 0 0; font-size: .85rem; color: #6b7280; }
.price-estimate { background: #f9fafb; padding: 14px 16px; border-radius: 8px; margin-top: 18px; }
.price-estimate .price-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: .95rem; }
.price-estimate .price-row.total { font-weight: 700; border-top: 1px solid #e5e7eb; margin-top: 6px; padding-top: 10px; }
@media (max-width: 600px) { .booking-form .form-grid { grid-template-columns: 1fr; } }

/* Booking status page (pages/booking-status.php) */
/* ---- Booking status page (request received / confirmed / declined …) ---- */
.booking-status-page { padding: 44px 16px 80px; background: var(--pearl-white, #F4F1EC); }
.status-wrap { max-width: 900px; margin: 0 auto; }
.status-head { display: flex; align-items: center; gap: 20px; margin-bottom: 14px; }
.status-mark {
    width: 66px; height: 66px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
    background: var(--leaf-green, #2C3E2D); color: #fff; box-shadow: 0 10px 26px rgba(44, 62, 45, .28);
    animation: status-pop .5s cubic-bezier(.2, .9, .3, 1.3) both;
}
.status-mark svg { width: 32px; height: 32px; }
.state-declined .status-mark, .state-expired .status-mark, .state-cancelled .status-mark, .state-not_found .status-mark { background: var(--desert-brown, #7A5548); box-shadow: 0 10px 26px rgba(122, 85, 72, .28); }
@keyframes status-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.status-eyebrow { margin: 0 0 4px; font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; color: var(--hills-green, #008B73); }
.status-title { margin: 0; font-size: clamp(1.9rem, 4.4vw, 2.8rem); line-height: 1.12; font-weight: 700; color: var(--midnight-black, #1B1F29); letter-spacing: -.01em; }
.status-lead { margin: 0 0 24px; font-size: 1.08rem; line-height: 1.7; color: var(--text-secondary, #5C5C5C); max-width: 780px; }
.status-note-inline { color: var(--midnight-black, #1B1F29); font-weight: 700; }
.stay-card { background: #fff; border-radius: 18px; border: 1px solid var(--border-color, #E5E2DD); box-shadow: 0 12px 34px rgba(27, 31, 41, .07); overflow: hidden; margin-bottom: 30px; }
.stay-top { display: flex; align-items: center; gap: 18px; padding: 22px 24px; }
.stay-photo { width: 128px; height: 94px; object-fit: cover; border-radius: 12px; flex: 0 0 auto; background: #ece9e3; }
.stay-photo-empty { background: linear-gradient(135deg, #2C3E2D, #5C4035); opacity: .35; }
.stay-info { flex: 1; min-width: 0; }
.stay-info h2 { margin: 0 0 4px; font-size: 1.3rem; line-height: 1.3; }
.stay-info h2 a { color: inherit; text-decoration: none; }
.stay-info h2 a:hover { text-decoration: underline; }
.stay-loc { margin: 0; color: var(--text-secondary, #5C5C5C); font-size: .95rem; }
.stay-guest { margin: 4px 0 0; color: var(--text-secondary, #5C5C5C); font-size: .9rem; }
.stay-guest strong { color: var(--midnight-black, #1B1F29); font-weight: 700; }
.stay-status { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: .92rem; white-space: nowrap; background: #eaf1ec; color: var(--leaf-green, #2C3E2D); }
.stay-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stay-status.confirmed { background: #e3f3ec; color: #0f6b52; }
.stay-status.declined, .stay-status.cancelled, .stay-status.expired { background: #f6e8e4; color: #8a3b2b; }
.stay-facts { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; border-top: 1px solid var(--border-color, #E5E2DD); border-bottom: 1px solid var(--border-color, #E5E2DD); }
.stay-facts > div { padding: 18px 24px; border-inline-end: 1px solid var(--border-color, #E5E2DD); }
.stay-facts > div:last-child { border-inline-end: 0; }
.stay-facts dt { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-secondary, #5C5C5C); font-weight: 700; margin-bottom: 8px; }
.stay-facts dd { margin: 0; font-weight: 700; font-size: 1.08rem; color: var(--midnight-black, #1B1F29); }
.mono { font-family: inherit; letter-spacing: .04em; }
.stay-total { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 24px; background: #faf8f4; font-weight: 700; }
.stay-total small { display: block; font-weight: 400; color: var(--text-secondary, #5C5C5C); font-size: .8rem; margin-top: 2px; }
.stay-total strong { font-size: 1.45rem; color: var(--midnight-black, #1B1F29); white-space: nowrap; }
.next-steps h3 { margin: 0 0 16px; font-size: 1.35rem; }
.next-steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.next-steps li { display: grid; grid-template-columns: 42px 1fr; gap: 16px; align-items: start; }
.step-num { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--leaf-green, #2C3E2D); color: var(--leaf-green, #2C3E2D); display: grid; place-items: center; font-weight: 700; background: #fff; }
.step-num.done { background: var(--leaf-green, #2C3E2D); color: #fff; }
.next-steps strong { display: block; font-size: 1.08rem; margin-bottom: 3px; color: var(--midnight-black, #1B1F29); }
.next-steps p { margin: 0; color: var(--text-secondary, #5C5C5C); line-height: 1.6; }
.status-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }
.status-actions .btn-wa, .status-actions .btn-ghost { display: inline-flex; align-items: center; gap: 10px; padding: 14px 30px; border-radius: 999px; font-weight: 700; text-decoration: none; font-size: 1rem; transition: transform .15s, background .15s, box-shadow .15s; }
.status-actions .btn-wa { background: var(--leaf-green, #2C3E2D); color: #fff; box-shadow: 0 10px 24px rgba(44, 62, 45, .24); }
.status-actions .btn-wa:hover { background: #22302A; transform: translateY(-1px); }
.status-actions .btn-wa svg { width: 20px; height: 20px; }
.status-actions .btn-ghost { border: 1.5px solid var(--leaf-green, #2C3E2D); color: var(--leaf-green, #2C3E2D); background: transparent; }
.status-actions .btn-ghost:hover { background: rgba(44, 62, 45, .06); }
.status-note { margin: 16px 0 0; font-size: .9rem; color: var(--text-secondary, #5C5C5C); }
.status-note a { color: var(--leaf-green, #2C3E2D); }
@media (max-width: 720px) {
    .status-head { gap: 14px; }
    .stay-top { flex-wrap: wrap; }
    .stay-facts { grid-template-columns: 1fr 1fr; }
    .stay-facts > div:nth-child(2n) { border-inline-end: 0; }
    .stay-facts > div:nth-child(-n+2) { border-bottom: 1px solid var(--border-color, #E5E2DD); }
    .status-actions .btn-wa, .status-actions .btn-ghost { width: 100%; justify-content: center; }
}
.status-card .total-amount { font-size: 1.3rem; font-weight: 700; }
.status-card .actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.status-card .btn { display: inline-block; padding: 12px 24px; border-radius: 6px; text-decoration: none; font-weight: 700; }
.status-card .btn-primary { background: #1B1F29; color: #fff; }
.status-card .btn-secondary { background: #fff; color: #1B1F29; border: 1px solid #d1d5db; }
@media (max-width: 540px) { .status-card .booking-details { grid-template-columns: 1fr; } }

/* ===== Ratings and guest reviews (imported from Guesty) ===== */
.apt-rating { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 10px; font-weight: 700; color: var(--midnight-black, #1B1F29); text-decoration: none; }
.apt-rating:hover .apt-rating-count { text-decoration: underline; }
.apt-rating-star, .review-stars { color: #C9962B; }
.apt-rating-count { font-weight: 400; color: var(--text-secondary, #5C5C5C); }
.apt-rating-line { margin: 2px 0 6px; font-size: 0.88rem; font-weight: 700; color: var(--midnight-black, #1B1F29); }
.apt-rating-line span[aria-hidden] { color: #C9962B; }
.apt-rating-line .apt-rating-count { font-weight: 400; }
.min-nights-note { margin: 4px 0 12px; font-size: 0.85rem; color: var(--text-secondary, #5C5C5C); }
.apartment-reviews { margin-top: 2rem; }
.apartment-reviews h3 { margin-bottom: 0.4rem; }
.reviews-summary, .reviews-overall { margin: 0 0 1rem; font-weight: 700; color: var(--midnight-black, #1B1F29); }
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.review-card { background: #fff; border: 1px solid var(--border-color, #E5E2DD); border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; text-align: start; }
.review-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.review-stars { letter-spacing: 1px; font-size: 0.95rem; white-space: nowrap; }
.review-channel { font-size: 0.75rem; font-weight: 700; color: var(--text-secondary, #5C5C5C); border: 1px solid var(--border-color, #E5E2DD); border-radius: 999px; padding: 2px 8px; }
.review-title { margin: 0; font-size: 1rem; }
.review-body { margin: 0; line-height: 1.65; color: var(--text-primary, #2b2b2b); }
.review-reply { margin: 0; padding-inline-start: 10px; border-inline-start: 3px solid var(--border-color, #E5E2DD); font-size: 0.88rem; color: var(--text-secondary, #5C5C5C); }
.review-meta { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; margin-top: auto; }
.review-avatar { width: 30px; height: 30px; border-radius: 50%; background: rgba(44, 62, 45, 0.12); color: var(--leaf-green, #2C3E2D); display: inline-grid; place-items: center; font-weight: 700; flex: 0 0 auto; }
.review-name { font-weight: 700; }
.review-date { margin-inline-start: auto; color: var(--text-secondary, #5C5C5C); }
.review-unit { font-size: 0.82rem; color: var(--leaf-green, #2C3E2D); text-decoration: underline; text-underline-offset: 2px; }
.home-reviews { padding: 3rem 0; }
.home-reviews .section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 1.2rem; }
@media (max-width: 600px) { .reviews-grid { grid-template-columns: 1fr; } }
/* Apartment page: column layout so short reviews do not leave holes under long ones */
.apartment-reviews .reviews-grid { display: block; columns: 2 260px; column-gap: 16px; }
.apartment-reviews .reviews-grid .review-card { break-inside: avoid; width: 100%; margin-bottom: 16px; }
/* Homepage: horizontal carousel, 4 cards per view, arrows + swipe, equal-height cards */
.reviews-carousel { position: relative; }
.reviews-track {
    display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
    padding: 4px 2px 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; outline: none;
}
.reviews-track::-webkit-scrollbar { display: none; }
.reviews-track .review-card { flex: 0 0 calc((100% - 48px) / 4); scroll-snap-align: start; }
.reviews-track .review-body { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.reviews-nav {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
    width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border-color, #E5E2DD);
    background: #fff; color: var(--leaf-green, #2C3E2D); cursor: pointer; display: grid; place-items: center;
    box-shadow: 0 6px 18px rgba(27, 31, 41, .12); transition: background .15s, transform .15s;
}
.reviews-nav svg { width: 20px; height: 20px; }
.reviews-nav:hover:not([disabled]) { background: var(--leaf-green, #2C3E2D); color: #fff; }
.reviews-nav.prev { inset-inline-start: -21px; }
.reviews-nav.next { inset-inline-end: -21px; }
[dir="rtl"] .reviews-nav svg { transform: scaleX(-1); }
.reviews-nav[disabled] { opacity: .3; cursor: default; }
.reviews-carousel.no-scroll .reviews-nav { display: none; }
@media (max-width: 1100px) { .reviews-track .review-card { flex-basis: calc((100% - 32px) / 3); } }
@media (max-width: 800px)  { .reviews-track .review-card { flex-basis: calc((100% - 16px) / 2); } }
@media (max-width: 520px)  { .reviews-track .review-card { flex-basis: 86%; } .reviews-nav { display: none; } }
/* Host rating cards (Airbnb / Gathern) under the carousel: two up, one column on phones */
.review-badges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; max-width: 960px; margin: 28px auto 0; }
.review-badge svg { display: block; width: 100%; height: auto; }
@media (max-width: 720px) { .review-badges { grid-template-columns: 1fr; max-width: 480px; gap: 14px; } }

/* =====================================================================
   Contact & Feedback pages: one intro, a form card and an aside card in
   the booking-status visual language (18px cards, leaf-green pill buttons).
   ===================================================================== */
.cf-page { padding: 56px 0 72px; }
.cf-intro { max-width: 720px; margin-bottom: 34px; }
.cf-eyebrow { margin: 0 0 6px; font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; color: var(--hills-green, #008B73); }
.cf-title { margin: 0 0 10px; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; font-weight: 700; color: var(--midnight-black, #1B1F29); letter-spacing: -.01em; }
.cf-lead { margin: 0; font-size: 1.06rem; line-height: 1.7; color: var(--text-secondary, #5C5C5C); max-width: 62ch; }
[dir="rtl"] .cf-eyebrow, [dir="rtl"] .cf-title { letter-spacing: 0; }   /* Arabic is never tracked */
.cf-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.cf-card { background: #fff; border-radius: 18px; border: 1px solid var(--border-color, #E5E2DD); box-shadow: 0 12px 34px rgba(27, 31, 41, .07); }
.cf-form { padding: 28px 30px 30px; }
.cf-form h2 { margin: 0 0 4px; font-size: 1.3rem; }
.cf-sub { margin: 0 0 22px; color: var(--text-secondary, #5C5C5C); font-size: .95rem; }
.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cf-field { margin-bottom: 16px; }
.cf-field > label, .cf-field .cf-label { display: block; font-size: .88rem; font-weight: 700; margin-bottom: 7px; color: var(--midnight-black, #1B1F29); }
.cf-field .opt { font-weight: 400; color: var(--text-secondary, #5C5C5C); }
.cf-field input, .cf-field select, .cf-field textarea {
    width: 100%; padding: 13px 15px; border: 1.5px solid var(--border-color, #E5E2DD); border-radius: 12px;
    font: inherit; font-size: .98rem; background: #fff; color: var(--midnight-black, #1B1F29); transition: border-color .15s, box-shadow .15s;
}
.cf-field input:focus, .cf-field select:focus, .cf-field textarea:focus { outline: none; border-color: var(--leaf-green, #2C3E2D); box-shadow: 0 0 0 4px rgba(44, 62, 45, .10); }
.cf-field textarea { min-height: 150px; resize: vertical; }
.cf-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.cf-choices label { position: relative; cursor: pointer; margin: 0; }
.cf-choices input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cf-choices span { display: inline-block; padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--border-color, #E5E2DD); font-size: .92rem; font-weight: 700; color: var(--text-secondary, #5C5C5C); background: #fff; transition: background .15s, color .15s, border-color .15s; }
.cf-choices label:hover span { border-color: var(--leaf-green, #2C3E2D); color: var(--leaf-green, #2C3E2D); }
.cf-choices input:checked + span { background: var(--leaf-green, #2C3E2D); border-color: var(--leaf-green, #2C3E2D); color: #fff; }
.cf-choices input:focus-visible + span { box-shadow: 0 0 0 4px rgba(44, 62, 45, .18); }
.cf-stars { display: inline-flex; align-items: center; gap: 4px; }
.cf-stars label { position: relative; width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; margin: 0; border-radius: 50%; }
.cf-stars input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cf-stars svg { width: 28px; height: 28px; fill: #e2ddd5; stroke: #cfc9bf; stroke-width: 1; transition: fill .12s, transform .12s; }
.cf-stars label:hover svg { transform: scale(1.12); }
.cf-stars[data-v="1"] label:nth-child(-n+1) svg, .cf-stars[data-v="2"] label:nth-child(-n+2) svg, .cf-stars[data-v="3"] label:nth-child(-n+3) svg,
.cf-stars[data-v="4"] label:nth-child(-n+4) svg, .cf-stars[data-v="5"] label:nth-child(-n+5) svg { fill: #C9962B; stroke: #b7861f; }
.cf-stars input:focus-visible + svg { outline: 2px solid var(--leaf-green, #2C3E2D); outline-offset: 3px; border-radius: 50%; }
.cf-stars-value { margin: 0 10px; font-weight: 700; color: var(--midnight-black, #1B1F29); }   /* dir=ltr on the span keeps "1 / 5" readable in Arabic */
.cf-btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 30px; border-radius: 999px; font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; text-decoration: none; border: 1.5px solid transparent; transition: transform .15s, background .15s, box-shadow .15s; }
.cf-btn svg { width: 20px; height: 20px; }
.cf-btn.primary { background: var(--leaf-green, #2C3E2D); color: #fff; box-shadow: 0 10px 24px rgba(44, 62, 45, .24); }
.cf-btn.primary:hover { background: #22302A; transform: translateY(-1px); }
.cf-btn.ghost { border-color: var(--leaf-green, #2C3E2D); color: var(--leaf-green, #2C3E2D); background: transparent; }
.cf-btn.ghost:hover { background: rgba(44, 62, 45, .06); }
.cf-btn:focus-visible { outline: 3px solid rgba(44, 62, 45, .35); outline-offset: 2px; }
.cf-actions { display: flex; gap: 14px 18px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.cf-actions .hint { color: var(--text-secondary, #5C5C5C); font-size: .88rem; }
.cf-alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-size: .95rem; line-height: 1.55; }
.cf-alert.error { background: #f6e8e4; color: #8a3b2b; border: 1px solid #ecd2cb; }
.cf-alert ul { margin: 0; padding-inline-start: 18px; }
.cf-aside { padding: 24px 26px; }
.cf-aside h3 { margin: 0 0 16px; font-size: 1.05rem; }
.cf-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.cf-list li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; }
.cf-ico { width: 40px; height: 40px; border-radius: 50%; background: #eaf1ec; color: var(--leaf-green, #2C3E2D); display: grid; place-items: center; }
.cf-ico svg { width: 20px; height: 20px; }
.cf-ico.num { background: #fff; border: 2px solid var(--leaf-green, #2C3E2D); font-weight: 700; }
.cf-list strong { display: block; font-size: 1rem; margin-bottom: 2px; color: var(--midnight-black, #1B1F29); }
.cf-list p { margin: 0; color: var(--text-secondary, #5C5C5C); font-size: .92rem; line-height: 1.55; }
.cf-list a { color: var(--leaf-green, #2C3E2D); text-decoration: underline; text-underline-offset: 3px; }
.cf-aside .cf-btn { margin-top: 18px; width: 100%; justify-content: center; }
.cf-list-tight { gap: 12px; }
.cf-list-tight p { font-size: .88rem; }
.cf-socials { display: flex; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border-color, #E5E2DD); align-items: center; }
.cf-socials span { font-size: .9rem; color: var(--text-secondary, #5C5C5C); margin-inline-end: auto; }
.cf-socials a { width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--border-color, #E5E2DD); display: grid; place-items: center; color: var(--midnight-black, #1B1F29); transition: border-color .15s, color .15s; }
.cf-socials a:hover { border-color: var(--leaf-green, #2C3E2D); color: var(--leaf-green, #2C3E2D); }
.cf-socials a svg { width: 18px; height: 18px; }
.cf-done { padding: 34px 30px; display: grid; grid-template-columns: 66px 1fr; gap: 20px; align-items: start; }
.cf-done .mark { width: 66px; height: 66px; border-radius: 50%; background: var(--leaf-green, #2C3E2D); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 26px rgba(44, 62, 45, .28); }
.cf-done .mark svg { width: 32px; height: 32px; }
.cf-done h2 { margin: 4px 0 6px; font-size: 1.5rem; }
.cf-done p { margin: 0 0 18px; color: var(--text-secondary, #5C5C5C); line-height: 1.65; max-width: 56ch; }
@media (max-width: 900px) { .cf-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
    .cf-page { padding: 36px 0 52px; }
    .cf-row { grid-template-columns: 1fr; }
    .cf-form { padding: 22px 18px; }
    .cf-actions .cf-btn { width: 100%; justify-content: center; }
    .cf-done { grid-template-columns: 1fr; padding: 26px 20px; }
}
