/* القحطاني - ALQAHTANI Real Estate Styles */
/* Color Palette from Logo: Navy Blue #2c4a6e, Gold #b8985f, Beige #e8e4d9 */

:root {
    --primary-color: #2c4a6e;
    --secondary-color: #b8985f;
    --accent-color: #e8e4d9;
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --bg-light: #f5f3ed;
    --border-color: #d4cfc0;
    --shadow-color: rgba(44, 74, 110, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    line-height: 1.8;
    color: var(--text-dark);
    background: var(--accent-color);
}

[dir="ltr"] body {
    font-family: 'Roboto', sans-serif;
}

/* Center all main content text by default */
[dir="rtl"] .hero-content,
[dir="rtl"] .hero-title,
[dir="rtl"] .hero-subtitle,
[dir="rtl"] .section-header,
[dir="rtl"] .section-header h2,
[dir="rtl"] .section-header p,
[dir="rtl"] .property-content,
[dir="rtl"] .property-content h3,
[dir="rtl"] .property-location,
[dir="rtl"] .property-description,
[dir="rtl"] .no-properties,
[dir="rtl"] .page-header,
[dir="rtl"] .page-header h1,
[dir="rtl"] .page-header p,
[dir="rtl"] .footer-logo,
[dir="rtl"] .footer-desc,
[dir="rtl"] .cta-section,
[dir="rtl"] .cta-section h2,
[dir="rtl"] .cta-section p {
    text-align: center;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background: var(--primary-color);
    color: var(--text-light);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: inherit;
}

.logo-img {
    height: 60px;
    width: auto;
    object-fit: contain;
    transition: opacity 0.3s;
}

.logo a:hover .logo-img {
    opacity: 0.85;
}

.logo-text h1 {
    font-size: 24px;
    color: var(--secondary-color);
    margin: 0;
}

.logo-text p {
    font-size: 12px;
    color: var(--text-light);
    margin: 0;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
}

.main-nav a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.main-nav a:hover {
    color: var(--secondary-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lang-switch {
    padding: 8px 15px;
    background: var(--secondary-color);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s;
}

.lang-switch:hover {
    background: #d4b975;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 24px;
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e3a5f 100%);
    color: var(--text-light);
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 600px;
    display: flex;
    align-items: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/images/pattern.png') repeat;
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-logo {
    width: 180px;
    margin-bottom: 30px;
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.3));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hero-title {
    font-size: 52px;
    margin-bottom: 20px;
    color: var(--secondary-color);
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 1px;
}

.hero-subtitle {
    font-size: 20px;
    margin-bottom: 40px;
}

.hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.btn-primary {
    background: var(--secondary-color);
    color: var(--primary-color);
}

.btn-primary:hover {
    background: #a07d4a;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(184, 152, 95, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-light);
    border: 2px solid var(--secondary-color);
}

.btn-secondary:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
}

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

.btn-sm {
    padding: 8px 20px;
    font-size: 14px;
}

.btn-block {
    width: 100%;
    text-align: center;
}

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.section-header p {
    font-size: 18px;
    color: #666;
}

/* Featured Properties */
.featured-properties {
    padding: 80px 0;
    background: var(--bg-light);
}

.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.property-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px var(--shadow-color);
    transition: all 0.4s ease;
    border: 1px solid var(--border-color);
}

.property-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(44, 74, 110, 0.2);
}

.property-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.property-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--secondary-color);
    color: var(--primary-color);
    padding: 5px 15px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 12px;
}

[dir="ltr"] .property-badge {
    right: auto;
    left: 10px;
}

.property-type-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 12px;
}

[dir="ltr"] .property-type-badge {
    right: auto;
    left: 10px;
}

.property-content {
    padding: 20px;
    text-align: center;
}

.property-content h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--primary-color);
    text-align: center;
}

.property-location {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
    text-align: center;
}

.property-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    text-align: center;
}

.property-features {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    justify-content: center;
}

.property-features span {
    font-size: 14px;
    color: #666;
}

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

.property-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--secondary-color);
}

/* Services */
.services-overview {
    padding: 80px 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.service-card {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.service-card i {
    font-size: 48px;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.service-card h3 {
    font-size: 20px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.service-card p {
    color: #666;
    line-height: 1.8;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    overflow-y: auto;
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 40px;
    border-radius: 10px;
    max-width: 600px;
    position: relative;
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 30px;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
}

[dir="ltr"] .close {
    right: auto;
    left: 20px;
}

.close:hover {
    color: #333;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: inherit;
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Footer */
.main-footer {
    background: var(--primary-color);
    color: var(--text-light);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 10px;
}

.footer-section a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--secondary-color);
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: var(--secondary-color);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 18px;
}

.social-links a:hover {
    background: #d4b975;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2c5282 100%);
    color: var(--text-light);
    padding: 60px 0;
    text-align: center;
}

.page-header h1 {
    font-size: 42px;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .main-nav {
        display: none;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .properties-grid {
        grid-template-columns: 1fr;
    }
}

.text-center {
    text-align: center;
}

.no-properties {
    text-align: center;
    padding: 60px 40px;
    color: #666;
    grid-column: 1 / -1;
    width: 100%;
}


/* Enhanced Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

/* Enhanced Property Card */
.property-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.property-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1;
}

.property-card:hover .property-image::before {
    opacity: 1;
}

.property-image img {
    transition: transform 0.5s ease;
}

.property-card:hover .property-image img {
    transform: scale(1.1);
}

/* Enhanced Buttons */
.btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Service Cards Enhancement */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    transform: scaleX(0);
    transition: transform 0.3s;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card i {
    transition: all 0.4s ease;
}

.service-card:hover i {
    transform: rotateY(360deg);
    color: var(--primary-color);
}

/* Stats Section */
.stats-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e3a5f 100%);
    padding: 80px 0;
    color: white;
}

.stat-card {
    text-align: center;
    padding: 40px 20px;
}

.stat-card i {
    font-size: 48px;
    color: var(--secondary-color);
    margin-bottom: 20px;
    display: block;
}

.stat-card h3 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.stat-card p {
    font-size: 18px;
    opacity: 0.9;
}

/* About Page */
.about-content {
    text-align: center;
}

.about-content h2 {
    text-align: center;
}

.about-content p {
    text-align: center;
}

/* Vision Mission Cards */
.vm-card {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: all 0.4s;
    border-top: 4px solid var(--secondary-color);
    text-align: center;
}

.vm-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(44, 74, 110, 0.2);
}

.vm-card i {
    font-size: 56px;
    color: var(--secondary-color);
    margin-bottom: 25px;
    display: block;
    transition: transform 0.3s;
}

.vm-card h3 {
    text-align: center;
}

.vm-card p {
    text-align: center;
}

.vm-card:hover i {
    transform: scale(1.2);
}

/* About Features */
.about-features {
    margin-top: 30px;
}

.feature-item {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 10px;
    transition: all 0.3s;
    align-items: center;
}

.feature-item:hover {
    background: white;
    box-shadow: 0 5px 20px var(--shadow-color);
    transform: translateX(10px);
}

.feature-item i {
    font-size: 32px;
    color: var(--secondary-color);
    flex-shrink: 0;
}

.feature-item div {
    text-align: right;
}

[dir="ltr"] .feature-item div {
    text-align: left;
}

/* Services Detail Enhancement */
.service-detail-card {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: 0 8px 25px var(--shadow-color);
    text-align: center;
    transition: all 0.4s;
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.service-detail-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(44, 74, 110, 0.2);
    border-color: var(--secondary-color);
}

.service-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--secondary-color), #a07d4a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    transition: all 0.4s;
}

.service-detail-card:hover .service-icon {
    transform: rotateY(360deg);
    box-shadow: 0 10px 30px rgba(184, 152, 95, 0.4);
}

.service-icon i {
    font-size: 48px;
    color: white;
}

.service-detail-card h3 {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
}

.service-detail-card p {
    color: #666;
    line-height: 1.8;
    font-size: 16px;
}

/* Filters Section */
.filters-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 25px var(--shadow-color);
    margin-bottom: 40px;
}

.filters-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    align-items: end;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-color);
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    transition: all 0.3s;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(184, 152, 95, 0.1);
}

/* Enhanced Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e3a5f 100%);
    color: var(--text-light);
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.05" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,138.7C960,139,1056,117,1152,101.3C1248,85,1344,75,1392,69.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    background-position: bottom;
}

.page-header h1 {
    font-size: 48px;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.page-header p {
    font-size: 20px;
    position: relative;
    z-index: 1;
    opacity: 0.95;
}

/* Property Details Enhancement */
.property-gallery {
    margin-bottom: 40px;
}

.main-image {
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 10px 40px var(--shadow-color);
}

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

.thumbnail-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.thumbnail-images img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s;
}

.thumbnail-images img:hover,
.thumbnail-images img.active {
    border-color: var(--secondary-color);
    transform: scale(1.05);
    box-shadow: 0 5px 20px var(--shadow-color);
}

.property-price-tag {
    background: linear-gradient(135deg, var(--secondary-color), #a07d4a);
    color: white;
    padding: 20px 30px;
    border-radius: 15px;
    font-size: 32px;
    font-weight: 800;
    margin: 30px 0;
    box-shadow: 0 8px 25px rgba(184, 152, 95, 0.3);
}

.price-type {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-top: 5px;
    opacity: 0.9;
}

.property-features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.feature-item {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s;
}

.feature-item:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-5px);
}

.feature-item i {
    font-size: 28px;
    display: block;
    margin-bottom: 10px;
}

.features-list {
    list-style: none;
    padding: 0;
}

.features-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 16px;
}

.features-list li i {
    color: var(--secondary-color);
    margin-left: 10px;
    font-size: 18px;
}

.contact-buttons {
    display: flex;
    gap: 20px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.contact-buttons .btn {
    flex: 1;
    min-width: 200px;
    padding: 15px 30px;
    font-size: 18px;
}

/* Newsletter */
.newsletter {
    margin-top: 20px;
}

.newsletter h5 {
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.newsletter-form {
    display: flex;
    gap: 10px;
}

.newsletter-form input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
}

.newsletter-form button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.newsletter-form button:hover {
    background: #a07d4a;
    transform: scale(1.05);
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .hero-title {
        font-size: 36px;
    }
    
    .hero-logo {
        width: 120px;
    }
    
    .service-detail-card {
        margin-bottom: 20px;
    }
    
    .filters-form {
        grid-template-columns: 1fr;
    }
    
    .property-features-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-buttons {
        flex-direction: column;
    }
    
    .contact-buttons .btn {
        width: 100%;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection Color */
::selection {
    background: var(--secondary-color);
    color: white;
}

::-moz-selection {
    background: var(--secondary-color);
    color: white;
}

/* ===================================================
   GLOBAL RESPONSIVE SYSTEM — ALL DEVICES
   Breakpoints:
   xs  < 480px   (small phones)
   sm  < 600px   (phones)
   md  < 768px   (large phones / small tablets)
   lg  < 992px   (tablets)
   xl  < 1200px  (small desktops / laptops)
   2xl ≥ 1200px  (large desktops)
=================================================== */

/* Base helpers */
img { max-width: 100%; height: auto; display: block; }
a { touch-action: manipulation; }
button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
input, select, textarea { font-size: 16px !important; } /* prevents iOS zoom */

/* Container fluid scaling */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 40px);
}

/* ---- Tablet (≤992px) ---- */
@media (max-width: 992px) {
    /* Modal */
    .modal-content { margin: 20px; padding: 25px; max-width: 100%; }
    .form-row { grid-template-columns: 1fr !important; }

    /* Page headers */
    .page-header { padding: 60px 0 !important; }
    .page-header h1 { font-size: 32px !important; }
    .page-header p { font-size: 16px !important; }

    /* Section headers */
    .section-header h2 { font-size: 26px !important; }

    /* Properties grid */
    .properties-grid { grid-template-columns: repeat(2, 1fr) !important; }

    /* Services */
    .services-grid { grid-template-columns: repeat(2, 1fr) !important; }

    /* VM grid */
    .vm-grid { grid-template-columns: 1fr !important; }

    /* About grid */
    .about-grid { grid-template-columns: 1fr !important; }
    .about-image { display: none; }

    /* Stats */
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .about-stats-grid { grid-template-columns: repeat(2, 1fr) !important; }

    /* Team */
    .team-grid { grid-template-columns: repeat(2, 1fr) !important; }

    /* Story */
    .story-grid { grid-template-columns: 1fr !important; }
    .story-cards { grid-template-columns: repeat(2, 1fr) !important; }

    /* Services main */
    .services-main-grid { grid-template-columns: repeat(2, 1fr) !important; }

    /* Why us */
    .why-us-grid { grid-template-columns: 1fr !important; }
    .why-us-numbers { grid-template-columns: repeat(2, 1fr) !important; }

    /* VMV */
    .vmv-grid { grid-template-columns: 1fr !important; }

    /* CTA */
    .about-cta-buttons { flex-direction: column; align-items: center; }
    .services-cta-box { flex-direction: column !important; text-align: center !important; }
    .scta-buttons { justify-content: center; }

    /* Dashboard grid */
    .dashboard-grid { grid-template-columns: 1fr !important; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Large Phones / Small Tablets (≤768px) ---- */
@media (max-width: 768px) {
    body { font-size: 15px; }

    /* Properties */
    .properties-grid { grid-template-columns: 1fr !important; }
    .services-grid { grid-template-columns: 1fr !important; }
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .team-grid { grid-template-columns: repeat(2, 1fr) !important; }

    /* About hero */
    .about-hero-content h1 { font-size: 28px !important; }
    .about-hero-stats { padding: 15px 20px !important; gap: 15px !important; }
    .hero-stat-divider { display: none !important; }
    .hero-stat span { font-size: 24px !important; }

    /* Story cards */
    .story-cards { grid-template-columns: 1fr !important; }

    /* Services main */
    .services-main-grid { grid-template-columns: 1fr !important; }

    /* Home services */
    .home-services-grid { grid-template-columns: 1fr !important; }

    /* Why grid */
    .home-why-grid { grid-template-columns: repeat(2, 1fr) !important; }

    /* Action banner */
    .hab-grid { grid-template-columns: 1fr !important; }
    .hab-divider { transform: rotate(90deg); margin: -10px auto; }

    /* Process */
    .process-steps { flex-direction: column !important; align-items: center; }
    .step-connector { display: none !important; }

    /* Props filter */
    .props-filter-form, .hqs-form { grid-template-columns: 1fr 1fr !important; }
    .pf-submit { grid-column: 1/-1; }

    /* Modal */
    .modal-content { margin: 10px; padding: 20px; border-radius: 12px; }
    .close { font-size: 24px; }

    /* Dashboard */
    .client-details-grid { grid-template-columns: 1fr !important; }
    .sidebar { width: 260px; }

    /* Tasks */
    .tasks-container { grid-template-columns: 1fr !important; }
    .form-row { grid-template-columns: 1fr !important; }

    /* Footer */
    .footer-top-bar { padding: 10px 0; }
    .ftb-inner { flex-direction: column; gap: 10px; align-items: flex-start; }
    .footer-grid { grid-template-columns: 1fr !important; gap: 25px !important; }
    .footer-bottom-inner { flex-direction: column; text-align: center; gap: 8px; }
    .footer-bottom-links { justify-content: center; }

    /* Tables */
    .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }

    /* Settings */
    .setting-item { flex-direction: column !important; align-items: flex-start !important; gap: 12px !important; }
    .settings-container { max-width: 100% !important; }
    .profile-container { max-width: 100% !important; }
    .profile-info { grid-template-columns: 1fr !important; }
}

/* ---- Phones (≤600px) ---- */
@media (max-width: 600px) {
    /* Typography scale */
    h1 { font-size: clamp(24px, 7vw, 42px) !important; }
    h2 { font-size: clamp(20px, 5.5vw, 32px) !important; }
    h3 { font-size: clamp(17px, 4.5vw, 24px) !important; }

    /* Home hero */
    .home-hero-content h1 { font-size: clamp(28px, 8vw, 44px) !important; }
    .home-hero-content > p { font-size: 15px !important; }
    .home-hero-actions { flex-direction: column; align-items: center; gap: 12px !important; }
    .hhero-btn-primary, .hhero-btn-secondary, .hhero-btn-outline { width: 100%; max-width: 300px; justify-content: center; }
    .home-hero-stats { gap: 12px !important; padding: 15px !important; }
    .hhs-div { display: none !important; }
    .hhs span { font-size: 24px !important; }

    /* Quick search */
    .hqs-form { grid-template-columns: 1fr !important; }
    .hqs-tabs { flex-wrap: wrap; }

    /* Section */
    .home-section-header { flex-direction: column !important; align-items: flex-start; gap: 10px; }

    /* Properties */
    .home-props-grid, .props-grid { grid-template-columns: 1fr !important; }

    /* Filters */
    .props-filter-form { grid-template-columns: 1fr !important; }
    .hqs-form { grid-template-columns: 1fr !important; }

    /* Services CTA */
    .services-cta-box { padding: 30px 20px !important; }
    .scta-buttons { flex-direction: column; gap: 10px; width: 100%; }
    .scta-btn-primary, .scta-btn-secondary { justify-content: center; width: 100%; }

    /* About */
    .about-hero-content h1 { font-size: clamp(22px, 7vw, 36px) !important; }
    .about-cta-buttons { flex-direction: column; gap: 10px; width: 100%; }
    .btn-cta-primary, .btn-cta-secondary { justify-content: center; width: 100%; max-width: 320px; }
    .vmv-grid { grid-template-columns: 1fr !important; }
    .why-us-numbers { grid-template-columns: 1fr 1fr !important; }
    .team-grid { grid-template-columns: 1fr 1fr !important; }

    /* Stats */
    .about-stats-grid { grid-template-columns: 1fr 1fr !important; }
    .about-stat-number { font-size: 38px !important; }

    /* Footer */
    .ftb-contact-items { flex-direction: column; gap: 8px; }
    .ftb-item span { display: inline !important; }
    .footer-badges { flex-direction: column; }

    /* WHY */
    .home-why-grid { grid-template-columns: 1fr !important; }

    /* Buttons full-width on mobile */
    .btn-block { width: 100%; }

    /* HAB cards */
    .hab-card { flex-direction: column !important; text-align: center !important; }
    .hab-text h3, .hab-text p { text-align: center !important; }
}

/* ---- Small phones (≤400px) ---- */
@media (max-width: 400px) {
    .container { padding: 0 12px; }
    .home-prop-img { height: 180px !important; }
    .team-grid { grid-template-columns: 1fr !important; }
    .about-stats-grid { grid-template-columns: 1fr 1fr !important; }
    .footer-main { padding: 40px 0 25px !important; }
    .wun-card { padding: 22px 12px !important; }
    .wun-num { font-size: 36px !important; }
}

/* ---- Large screens (≥1400px) ---- */
@media (min-width: 1400px) {
    .container { max-width: 1320px; }
    .home-hero-content h1 { font-size: 70px !important; }
}

/* ===== Cross-browser fixes ===== */
/* Firefox */
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }

/* Safari smooth scroll */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

/* IE/Edge legacy */
.properties-grid, .services-grid, .stats-grid, .team-grid,
.footer-grid, .home-props-grid, .props-grid,
.home-services-grid, .vmv-grid { display: grid; }

/* Prevent horizontal scroll globally */
html, body { overflow-x: hidden; max-width: 100vw; }

/* Focus visible for accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Touch targets min size */
@media (hover: none) {
    .snav-link, .mobile-nav a, .footer-links-list a,
    .hab-btn, .hqs-btn, .pf-btn { min-height: 44px; }
}


/* ===================================================
   PROPERTY CARD (pcard) — Global styles shared by
   index.ejs (featured slider) and properties.ejs (grid)
=================================================== */

/* Properties grid for properties page */
.props-grid-new {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
@media (max-width: 992px) { .props-grid-new { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .props-grid-new { grid-template-columns: 1fr; } }
.pcard { display:flex; flex-direction:column; background:white; border-radius:16px; overflow:hidden; text-decoration:none; box-shadow:0 3px 12px rgba(44,74,110,0.08); transition:all 0.35s; border:1px solid rgba(44,74,110,0.06); }
.pcard:hover { transform:translateY(-7px); box-shadow:0 18px 40px rgba(44,74,110,0.15); }
.pcard-img { position:relative; height:210px; overflow:hidden; background:#f0f0f0; }
.pcard-img img { width:100%; height:100%; object-fit:cover; transition:transform 0.5s; }
.pcard:hover .pcard-img img { transform:scale(1.07); }
.pcard-badges { position:absolute; top:12px; right:12px; display:flex; gap:6px; flex-direction:column; z-index:2; }
[dir="rtl"] .pcard-badges { right:auto; left:12px; }
.pcard-type { padding:5px 11px; border-radius:12px; font-size:11px; font-weight:700; display:flex; align-items:center; gap:5px; }
.pcard-type-sale { background:rgba(44,74,110,0.9); color:white; }
.pcard-type-rent { background:rgba(184,152,95,0.95); color:white; }
.pcard-type-investment { background:rgba(25,135,84,0.9); color:white; }
/* Featured star — opposite side from type badge */
.pcard-featured { background:linear-gradient(135deg,#ffd700,#ffaa00); color:#333; width:24px; height:24px; border-radius:6px; display:flex; align-items:center; justify-content:center; font-size:11px; position:absolute; top:12px; left:12px; z-index:2; }
[dir="rtl"] .pcard-featured { left:auto; right:12px; }
.pcard-subcat { position:absolute; bottom:10px; right:10px; background:rgba(0,0,0,0.6); color:white; padding:3px 10px; border-radius:10px; font-size:11px; font-weight:600; z-index:2; }
[dir="rtl"] .pcard-subcat { right:auto; left:10px; }
.prop-overlay { position:absolute; inset:0; background:rgba(44,74,110,0.6); display:flex; align-items:center; justify-content:center; opacity:0; transition:opacity 0.3s; }
.pcard:hover .prop-overlay { opacity:1; }
.prop-view-btn { background:white; color:var(--primary-color); padding:10px 22px; border-radius:25px; font-weight:700; font-size:14px; display:flex; align-items:center; gap:8px; transform:translateY(15px); transition:all 0.3s; }
.pcard:hover .prop-view-btn { transform:translateY(0); }
.pcard-body { padding:16px 16px 18px; flex:1; display:flex; flex-direction:column; }
.pcard-category { font-size:11px; font-weight:600; color:var(--secondary-color); display:flex; align-items:center; gap:5px; margin-bottom:7px; }
.pcard-body h3 { font-size:15px; font-weight:700; color:var(--primary-color); margin-bottom:7px; line-height:1.4; text-align:center; }
.pcard-loc { font-size:12px; color:#999; display:flex; align-items:center; justify-content:center; gap:4px; margin-bottom:12px; }
.pcard-loc i { color:var(--secondary-color); font-size:11px; }
.pcard-specs { display:flex; gap:10px; flex-wrap:wrap; justify-content:center; padding:10px 0; border-top:1px solid #f5f5f5; border-bottom:1px solid #f5f5f5; margin-bottom:14px; }
.pcard-specs span { font-size:12px; color:#666; display:flex; align-items:center; gap:4px; }
.pcard-specs span i { color:var(--primary-color); font-size:12px; }
.pcard-footer { display:flex; justify-content:space-between; align-items:center; margin-top:auto; }
.pcard-price { display:flex; flex-direction:column; }
.price-label { font-size:11px; color:#aaa; font-weight:500; }
.price-value { font-size:19px; font-weight:900; color:var(--primary-color); line-height:1.1; }
.price-currency { font-size:12px; color:var(--secondary-color); font-weight:600; }
/* Aliases used in properties.ejs */
.pcard-price-val { font-size:19px; font-weight:900; color:var(--primary-color); }
.pcard-price-cur { font-size:12px; color:var(--secondary-color); font-weight:600; }
.pcard-details-btn { background:var(--bg-light); color:var(--primary-color); padding:9px 15px; border-radius:8px; font-size:13px; font-weight:700; display:flex; align-items:center; gap:5px; transition:all 0.2s; border:1px solid #e8e4d9; }
.pcard:hover .pcard-details-btn { background:var(--primary-color); color:white; border-color:var(--primary-color); }
