/* ============================================
   مؤسسة خلف الجميلي للمقاولات
   ملف التنسيقات الرئيسي
   ============================================ */

/* --- المتغيرات والألوان الرئيسية --- */
:root {
    --primary: #c9a227;          /* ذهبي هادئ */
    --primary-dark: #a8861f;
    --secondary: #2c3e50;        /* أزرق داكن للنصوص */
    --whatsapp: #25d366;
    --whatsapp-dark: #1ebe5a;
    --bg-light: #f9f8f5;
    --bg-white: #ffffff;
    --bg-soft: #f1efe9;
    --text-dark: #2c3e50;
    --text-mid: #5a6c7d;
    --text-light: #8a9aa8;
    --border: #e8e5dd;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.10);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

/* --- إعادة الضبط الأساسية --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Segoe UI', Tahoma, 'Arial', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.7;
    overflow-x: hidden;
}

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

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

ul {
    list-style: none;
}

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

/* --- الأزرار --- */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-whatsapp {
    background-color: var(--whatsapp);
    color: #fff;
    border-color: var(--whatsapp);
}

.btn-whatsapp:hover {
    background-color: var(--whatsapp-dark);
    border-color: var(--whatsapp-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-dark);
    border-color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

/* --- العناوين العامة --- */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 12px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--primary);
    margin: 12px auto 0;
    border-radius: 2px;
}

.section-sub {
    text-align: center;
    color: var(--text-mid);
    max-width: 700px;
    margin: 0 auto 48px;
    font-size: 1.05rem;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    background-color: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
}

.logo:hover {
    color: var(--primary-dark);
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-mid);
    transition: var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-dark);
}

.nav-links a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--text-dark);
    cursor: pointer;
}

/* ============================================
   HERO
   ============================================ */
.hero {
    padding: 140px 0 80px;
    background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg-light) 100%);
}

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

.hero-text h1 {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.hero-sub {
    font-size: 1.2rem;
    color: var(--primary-dark);
    font-weight: 600;
    margin-bottom: 16px;
}

.hero-desc {
    color: var(--text-mid);
    font-size: 1.05rem;
    margin-bottom: 32px;
    max-width: 540px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-image img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.hero-image img:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

/* ============================================
   SERVICES
   ============================================ */
.services {
    padding: 80px 0;
    background-color: var(--bg-white);
}

.service-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    background-color: var(--bg-light);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 48px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.service-card.reverse {
    direction: ltr;
}

.service-card.reverse > * {
    direction: rtl;
}

.service-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 320px;
}

.service-info {
    padding: 32px 36px;
}

.service-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.service-info ul {
    margin-bottom: 24px;
}

.service-info ul li {
    color: var(--text-mid);
    padding: 6px 0;
    padding-right: 22px;
    position: relative;
}

.service-info ul li::before {
    content: '✓';
    position: absolute;
    right: 0;
    color: var(--primary);
    font-weight: 700;
}

/* ============================================
   FEATURES
   ============================================ */
.features {
    padding: 80px 0;
    background-color: var(--bg-light);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 48px;
}

.feature-card {
    background-color: var(--bg-white);
    padding: 36px 24px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.feature-icon {
    font-size: 2.4rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--text-mid);
    font-size: 0.95rem;
}

/* ============================================
   ABOUT
   ============================================ */
.about {
    padding: 80px 0;
    background-color: var(--bg-white);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.about-text .section-title {
    text-align: right;
    margin-bottom: 24px;
}

.about-text .section-title::after {
    margin: 12px 0 0;
}

.about-text p {
    color: var(--text-mid);
    margin-bottom: 16px;
    font-size: 1.05rem;
}

.about-list {
    margin-top: 16px;
}

.about-list li {
    color: var(--text-mid);
    padding: 8px 0;
    padding-right: 24px;
    position: relative;
}

.about-list li::before {
    content: '◆';
    position: absolute;
    right: 0;
    color: var(--primary);
    font-size: 0.75rem;
}

.about-image img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

/* ============================================
   GALLERY
   ============================================ */
.gallery {
    padding: 80px 0;
    background-color: var(--bg-light);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.gallery-item {
    width: 100%;
    height: 260px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
    opacity: 0.9;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 85vh;
    border-radius: var(--radius-sm);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    left: 32px;
    font-size: 2.5rem;
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.lightbox-close:hover {
    color: var(--primary);
}

/* ============================================
   CTA
   ============================================ */
.cta {
    padding: 80px 0;
    background: linear-gradient(135deg, #fdfbf5 0%, #f5f0e3 100%);
    text-align: center;
}

.cta-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.cta-content p {
    color: var(--text-mid);
    font-size: 1.1rem;
    margin-bottom: 32px;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   CONTACT
   ============================================ */
.contact {
    padding: 80px 0;
    background-color: var(--bg-white);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 48px;
    margin-top: 16px;
}

.contact-info h3,
.contact-form h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.contact-info p {
    color: var(--text-mid);
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.contact-info a {
    color: var(--primary-dark);
    font-weight: 600;
}

.contact-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background-color: var(--bg-light);
    padding: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-dark);
    background-color: var(--bg-white);
    transition: var(--transition);
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

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

.contact-form .btn {
    margin-top: 8px;
    width: 100%;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background-color: var(--secondary);
    color: #dfe6ec;
    padding: 56px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-brand h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.footer-brand p {
    color: #b0bfcc;
    font-size: 0.95rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: #b0bfcc;
    transition: var(--transition);
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--primary);
    padding-right: 6px;
}

.footer-contact p {
    color: #b0bfcc;
    font-size: 0.95rem;
}

.footer-contact a {
    color: var(--primary);
    font-weight: 600;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    text-align: center;
    font-size: 0.9rem;
    color: #8a9aa8;
}

.footer-bottom a {
    color: var(--primary);
    font-weight: 600;
    transition: var(--transition);
}

.footer-bottom a:hover {
    color: #fff;
}

/* ============================================
   FLOATING BUTTONS
   ============================================ */
.float-btn {
    position: fixed;
    bottom: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    transition: var(--transition);
    cursor: pointer;
}

.float-call {
    right: 20px;
    background-color: var(--primary);
    color: #fff;
}

.float-call:hover {
    background-color: var(--primary-dark);
    transform: scale(1.1);
}

.float-whatsapp {
    left: 20px;
    background-color: var(--whatsapp);
    color: #fff;
}

.float-whatsapp:hover {
    background-color: var(--whatsapp-dark);
    transform: scale(1.1);
}

/* ============================================
   ANIMATIONS
   ============================================ */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */
@media (max-width: 992px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .hero-desc {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-image {
        order: -1;
    }

    .service-card,
    .service-card.reverse {
        grid-template-columns: 1fr;
        direction: rtl;
    }

    .service-img img {
        min-height: 240px;
    }

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

    .about-content {
        grid-template-columns: 1fr;
    }

    .about-text .section-title {
        text-align: center;
    }

    .about-text .section-title::after {
        margin: 12px auto 0;
    }

    .about-image {
        order: -1;
    }

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

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 72px;
        right: 0;
        left: 0;
        background-color: var(--bg-white);
        flex-direction: column;
        gap: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease, padding 0.35s ease;
        box-shadow: var(--shadow-md);
    }

    .nav-links.active {
        max-height: 400px;
        padding: 16px 0;
    }

    .nav-links a {
        padding: 14px 24px;
        border-bottom: 1px solid var(--border);
        font-size: 1.05rem;
    }

    .nav-links a:last-child {
        border-bottom: none;
    }

    .nav-links a::after {
        display: none;
    }

    .hero {
        padding: 110px 0 60px;
    }

    .hero-text h1 {
        font-size: 1.6rem;
    }

    .hero-sub {
        font-size: 1.05rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-item {
        height: 220px;
    }

    .service-info {
        padding: 24px 20px;
    }

    .cta-content h2 {
        font-size: 1.4rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-links {
        align-items: center;
    }

    .contact-form {
        padding: 24px 18px;
    }

    .float-btn {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
        bottom: 16px;
    }

    .float-call {
        right: 14px;
    }

    .float-whatsapp {
        left: 14px;
    }
}

@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 1.4rem;
    }

    .btn {
        padding: 11px 20px;
        font-size: 0.95rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .contact-buttons {
        flex-direction: column;
    }

    .contact-buttons .btn {
        width: 100%;
    }
}


/* ============================================
   إضافات خاصة بالصفحات الداخلية (gypsum.html)
   ============================================ */

/* --- شارة القسم في الهيرو --- */
.hero-tag {
    display: inline-block;
    background-color: rgba(201, 162, 39, 0.12);
    color: var(--primary-dark);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 50px;
    margin-bottom: 16px;
    border: 1px solid rgba(201, 162, 39, 0.3);
}

/* --- قسم المقدمة --- */
.intro-section {
    padding: 70px 0;
    background-color: var(--bg-white);
}

.intro-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.intro-text {
    color: var(--text-mid);
    font-size: 1.08rem;
    line-height: 1.9;
    margin-bottom: 20px;
    text-align: right;
}

.intro-text strong {
    color: var(--primary-dark);
    font-weight: 700;
}

/* --- قسم تفاصيل الخدمات --- */
.services-detail {
    padding: 80px 0;
    background-color: var(--bg-light);
}

.services-detail .service-info p {
    color: var(--text-mid);
    margin-bottom: 16px;
    font-size: 1rem;
    line-height: 1.8;
}

.services-detail .service-info strong {
    color: var(--primary-dark);
    font-weight: 700;
}

/* --- قسم الأسئلة الشائعة --- */
.faq-section {
    padding: 80px 0;
    background-color: var(--bg-white);
}

.faq-list {
    max-width: 800px;
    margin: 48px auto 0;
}

.faq-item {
    background-color: var(--bg-light);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--primary);
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 20px 24px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dark);
    text-align: right;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: inherit;
    transition: var(--transition);
}

.faq-question:hover {
    color: var(--primary-dark);
}

.faq-icon {
    font-size: 1.4rem;
    color: var(--primary);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-right: 12px;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 24px;
}

.faq-item.active .faq-answer {
    max-height: 300px;
    padding: 0 24px 20px;
}

.faq-answer p {
    color: var(--text-mid);
    line-height: 1.8;
    font-size: 1rem;
}

/* --- تحسين استجابة الصفحات الداخلية --- */
@media (max-width: 768px) {
    .intro-text {
        text-align: center;
        font-size: 1rem;
    }

    .faq-question {
        font-size: 0.98rem;
        padding: 16px 18px;
    }

    .faq-answer {
        padding: 0 18px;
    }

    .faq-item.active .faq-answer {
        padding: 0 18px 16px;
    }
}