/* ==========================================================================
   زفلتة - تصميم الموبايل
   بيتحمّل بعد كل ملفات الصفحات عشان يغلب عليها.
   ========================================================================== */

/* ---------- عام لكل الأجهزة اللمس ---------- */
/* الزرارين العايمين للموبايل بس */
.mobile-bar { display: none; }

@media (hover: none) {
    a,
    button,
    label { -webkit-tap-highlight-color: transparent; }

    /* إحساس بالضغط على الأزرار */
    .btn:active,
    .btn-skew:active,
    .zf-submit:active,
    .svc-more:active,
    .mobile-fab:active { transform: scale(.92); }

    /* كروت "ما الذي يميزنا" بتتقلب لما توصل نص الشاشة */
    .flip-card.in-focus .flip-inner { transform: rotateY(180deg); }
}

/* ==========================================================================
   التابلت والموبايل (أقل من 992)
   ========================================================================== */
@media (max-width: 991.98px) {

    :root { --header-h: 68px; }


    /* ---------- الهيدر ---------- */
    /* مهم: backdrop-filter بيخلي القائمة (position: fixed جوه الهيدر) تتحسب على طول الهيدر بس
       فالقائمة بتتقص. في الموبايل بنستخدم خلفية صلبة بداله. */
    .site-header,
    .site-header.scrolled {
        background: rgba(250, 249, 247, .98);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
    .site-header .navbar { min-height: var(--header-h); padding: 6px 0; }
    .brand-logo,
    .site-header.scrolled .brand-logo { height: 52px; }

    .header-mobile-actions { display: flex; align-items: center; gap: 10px; }
    .header-call {
        position: relative;
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        border-radius: 14px;
        background: var(--gold);
        color: var(--navy);
        font-size: 1.1rem;
    }
    .header-call::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
        border: 2px solid var(--gold);
        animation: m-ring 2.2s ease-out infinite;
    }
    .header-call i { animation: m-shake 2.2s ease-in-out infinite; }
    .navbar-toggler {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 14px;
        background: var(--navy);
    }
    .toggler-bar { width: 20px; height: 2.5px; background: var(--white); }
    .toggler-bar:nth-child(2) { width: 14px; background: var(--gold); margin-left: 6px; }

    /* ---------- قائمة الموبايل (شاشة كاملة) ---------- */
    .offcanvas.offcanvas-start {
        --bs-offcanvas-width: 100%;
        background:
            radial-gradient(circle at 100% 0, rgba(220, 154, 3, .22), transparent 40%),
            repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 40px),
            var(--navy);
        color: var(--white);
        border: 0;
    }
    .offcanvas-header { padding: 14px 20px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
    .offcanvas .brand-logo { height: 52px; padding: 4px; border-radius: 14px; background: var(--cream); }
    .menu-close {
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        border: 0;
        border-radius: 14px;
        background: rgba(255, 255, 255, .08);
        color: var(--white);
        font-size: 1.2rem;
        transition: transform .4s var(--ease), background .3s var(--ease);
    }
    .menu-close:active { transform: rotate(90deg); background: var(--gold); color: var(--navy); }

    .offcanvas-body { display: flex; flex-direction: column; gap: 18px; padding: 18px 20px 30px; }
    .offcanvas .navbar-nav { gap: 6px; margin: 0 !important; }
    .site-header .offcanvas .nav-link {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 12px 14px !important;
        border: 1px solid rgba(255, 255, 255, .06);
        border-radius: 16px;
        background: rgba(255, 255, 255, .04);
        color: var(--white);
        font-size: 1.12rem;
    }
    .site-header .offcanvas .nav-link::after { display: none; }
    .nav-icon {
        display: grid;
        place-items: center;
        width: 40px;
        height: 40px;
        border-radius: 12px;
        background: rgba(220, 154, 3, .14);
        color: var(--gold);
        font-size: 1.1rem;
    }
    .nav-arrow { margin-right: auto; color: rgba(255, 255, 255, .35); font-size: .9rem; }
    .site-header .offcanvas .nav-link.active { border-color: rgba(220, 154, 3, .5); background: rgba(220, 154, 3, .14); color: var(--gold); }
    .site-header .offcanvas .nav-link.active .nav-icon { background: var(--gold); color: var(--navy); }
    .site-header .offcanvas .nav-link.active .nav-arrow { color: var(--gold); }

    /* الروابط بتدخل واحد ورا التاني */
    .offcanvas .nav-item,
    .offcanvas .btn-whatsapp,
    .offcanvas .menu-extra { opacity: 0; transform: translateX(-30px); }
    .offcanvas.show .nav-item,
    .offcanvas.show .btn-whatsapp,
    .offcanvas.show .menu-extra { animation: m-menu-in .5s var(--ease) forwards; }
    .offcanvas.show .nav-item { animation-delay: calc(.08s + var(--i) * .05s); }
    .offcanvas.show .btn-whatsapp { animation-delay: .45s; }
    .offcanvas.show .menu-extra { animation-delay: .52s; }

    .offcanvas .btn-whatsapp { width: 100%; padding: 14px; font-size: 1.08rem; }

    .menu-extra { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
    .menu-contact { display: flex; align-items: center; gap: 10px; color: var(--white); }
    .menu-contact i {
        display: grid;
        place-items: center;
        width: 42px;
        height: 42px;
        border-radius: 50%;
        background: var(--gold);
        color: var(--navy);
    }
    .menu-contact small { display: block; color: rgba(255, 255, 255, .55); }
    .menu-social { display: flex; gap: 8px; }
    .menu-social a {
        display: grid;
        place-items: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(255, 255, 255, .08);
        color: var(--white);
    }

    /* ---------- زرارين عايمين: واتساب يمين واتصال شمال ---------- */
    .mobile-bar {
        position: fixed;
        right: 16px;
        left: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom));
        z-index: 1035;
        display: flex;
        justify-content: space-between;
        pointer-events: none;
        animation: m-bar-in .7s var(--ease) .6s backwards;
        transition: transform .4s var(--ease);
    }
    .mobile-bar.is-hidden { transform: translateY(160%); }
    .mobile-fab {
        display: grid;
        place-items: center;
        width: 58px;
        height: 58px;
        border-radius: 50%;
        color: var(--white);
        font-size: 1.6rem;
        pointer-events: auto;
        transition: transform .2s var(--ease);
    }
    .mobile-fab:hover { color: var(--white); }
    .mobile-fab:active { transform: scale(.92); }
    .mobile-fab.is-wa {
        background: var(--whatsapp);
        font-size: 1.85rem;
        box-shadow: 0 10px 24px rgba(37, 211, 102, .45);
        animation: pulse 2.2s infinite;
    }
    .mobile-fab.is-call {
        background: #0a7cff;
        box-shadow: 0 10px 24px rgba(10, 124, 255, .4);
    }
    .mobile-fab.is-call i { animation: m-shake 2.6s ease-in-out infinite; }

    .whatsapp-float { display: none; }
    .back-to-top { bottom: calc(86px + env(safe-area-inset-bottom)); left: 24px; width: 42px; height: 42px; }

    /* ---------- الهيرو: صورة جنب + شكل كحلي + كلام جوه (نفس فكرة الكمبيوتر) ---------- */
    .hero-main,
    .hero-main.is-compact {
        display: flex;
        align-items: center;
        min-height: 0;
        padding: 34px 0 96px;
        text-align: center;
    }
    .hero-main.is-compact { min-height: 0; }
    .hero-main::before { display: none; }

    /* الصورة */
    .hero-main .hero-media {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        width: 66%;
    }
    .hero-main .hero-media picture { display: block; height: 100%; }
    .hero-main .hero-img {
        object-position: var(--hero-pos-m, 0% 50%);
        filter: saturate(1.12) contrast(1.05) brightness(1.04);
    }
    .hero-main .hero-media::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, transparent 60%, rgba(8, 29, 48, .4));
    }

    /* الشكل */
    .hero-main .hero-shape { display: none; }
    .hero-main .hero-shape-m { display: block; }
    .hero-shape-m .shape-layer-2 { fill: rgba(8, 29, 48, .45); }
    .hero-shape-m .shape-layer-3 { fill: var(--navy); }
    .hero-shape-m .shape-line { stroke-width: 4; }
    .hero-shape-m .shape-line-thin { stroke-width: 1.5; opacity: .55; filter: none; }

    /* علامة عايمة على الصورة */
    .hero-tag {
        position: absolute;
        top: 12px;
        left: 10px;
        z-index: 3;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 7px 12px;
        border: 1px solid rgba(255, 255, 255, .18);
        border-radius: 30px;
        background: rgba(8, 29, 48, .72);
        -webkit-backdrop-filter: blur(6px);
        backdrop-filter: blur(6px);
        color: var(--white);
        font-size: .76rem;
        font-weight: 700;
        box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
    }
    .hero-tag i { color: var(--gold); font-size: .9rem; }

    /* الكلام في المساحة الكحلي */
    .hero-container { padding-right: 12px; padding-left: 10px; }
    .hero-main .hero-content {
        width: 45%;
        margin-right: 0;
        padding: 0;
    }
    .hero-badge,
    .hero-desc,
    .hero-trust { display: none; }
    .hero-breadcrumb { justify-content: center; margin-bottom: 10px; font-size: .76rem; }

    .hero-heading {
        margin-bottom: 10px;
        font-size: 2.1rem;
        line-height: 1.15;
    }
    .hero-main.is-compact .hero-heading { font-size: 1.6rem; }
    .hero-pre {
        display: block;
        margin-bottom: 2px;
        color: rgba(255, 255, 255, .85);
        font-size: .4em;
        font-weight: 700;
        letter-spacing: .5px;
    }
    .hero-heading .hero-heading-line {
        margin-top: 6px;
        font-size: .44em;
        line-height: 1.4;
    }
    .hero-heading small {
        margin-top: 8px;
        color: rgba(255, 255, 255, .75);
        font-size: .32em;
        font-weight: 500;
        line-height: 1.6;
    }
    .hero-main.is-compact .hero-heading small { font-size: .4em; }
    .hero-line { width: 54px; height: 5px; margin: 0 auto 14px; }

    /* الأزرار: مستديرة عشان تناسب العمود الضيق */
    .hero-buttons {
        display: grid;
        grid-template-columns: 1fr;
        gap: 7px;
        margin-bottom: 0;
    }
    .hero-buttons .btn-skew {
        justify-content: center;
        gap: 8px;
        padding: 9px 4px;
        border-radius: 12px;
        font-size: .82rem;
        white-space: nowrap;
        clip-path: none;
    }
    .hero-buttons .btn-skew-gold { box-shadow: 0 10px 24px rgba(220, 154, 3, .35); }
    .hero-buttons .btn-skew-light {
        border: 1px solid rgba(37, 211, 102, .55);
        background: rgba(37, 211, 102, .12);
    }
    .hero-buttons .btn-skew-light i { color: var(--whatsapp); }
    .hero-buttons .btn-skew-light:hover i { color: var(--white); }

    /* أرقام صغيرة */
    .hero-mini {
        display: none;
        justify-content: center;
        margin-top: 18px;
    }
    .hero-mini > div { flex: 1; padding: 0 6px; }
    .hero-mini > div + div { border-right: 1px solid rgba(255, 255, 255, .15); }
    .hero-mini strong {
        display: block;
        color: var(--gold);
        font-size: 1.35rem;
        font-weight: 900;
        line-height: 1.2;
        direction: ltr;
    }
    .hero-mini small { color: rgba(255, 255, 255, .7); font-size: .72rem; }

    /* ---------- خطوات التنفيذ: الكارت ما يطلعش برا الشاشة ---------- */
    .process-card,
    .process-step.is-even .process-card { transform: translateY(24px); }
}

/* ==========================================================================
   الموبايل (أقل من 768)
   ========================================================================== */
@media (max-width: 767.98px) {

    body { font-size: 15.5px; }

    .section { padding: 64px 0; }
    .section-heading { margin-bottom: 32px; }
    .section-title { font-size: 1.65rem; }
    .section-text { font-size: .98rem; }
    .section-badge { font-size: .85rem; padding: 5px 14px; margin-bottom: 12px; }

    /* ---------- السلايدر الأفقي ---------- */
    .m-swipe,
    .types-grid,
    .factors-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 16px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .m-swipe::-webkit-scrollbar,
    .types-grid::-webkit-scrollbar,
    .factors-grid::-webkit-scrollbar { display: none; }

    .m-swipe { padding-bottom: 16px; padding-top: 6px; }
    .m-swipe > * {
        flex: 0 0 84%;
        max-width: 84%;
        scroll-snap-align: center;
    }

    .m-dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
    .m-dots button {
        width: 8px;
        height: 8px;
        padding: 0;
        border: 0;
        border-radius: 8px;
        background: var(--border);
        transition: width .35s var(--ease), background .35s var(--ease);
    }
    .m-dots button.active { width: 26px; background: var(--gold); }
    .why-home .m-dots button,
    .is-dark-dots button { background: rgba(255, 255, 255, .2); }
    .why-home .m-dots button.active { background: var(--gold); }

    /* ---------- الرئيسية ---------- */
    .service-card.has-media { padding: 12px 12px 26px; }
    .service-media { height: 190px; }
    .stats-row { margin-top: 50px; padding: 26px 12px; }
    .about-list li { font-size: .97rem; }

    .project-item { width: 250px; height: 190px; }

    .feature-card { flex-direction: column; gap: 14px; }

    .contact-box { border-radius: 24px; }

    /* ---------- من نحن ---------- */
    .types-grid { gap: 14px; padding: 4px 0 16px; grid-auto-rows: auto; }
    .types-grid .type-card {
        flex: 0 0 80%;
        height: 320px;
        scroll-snap-align: center;
    }
    .types-grid .type-text { max-height: 80px; margin-top: 8px; opacity: 1; }

    .trust-item { padding: 18px; }
    .flip-card { height: 260px; }
    .flip-hint { font-size: .85rem; }

    /* ---------- الخدمات ---------- */
    .svc-media { height: 180px; }
    .details-content { padding: 24px 20px; }
    .details-title { font-size: 1.45rem; }
    .details-buttons,
    .story-buttons,
    .intro-actions,
    .success-actions { display: grid; grid-template-columns: 1fr; }
    .details-buttons .btn,
    .story-buttons .btn,
    .intro-actions .btn,
    .success-actions .btn { width: 100%; }
    .why-svc-media::before { inset: 0 30px 40px 0; }
    .radar-map { border-radius: 20px; }

    /* ---------- البانر الأخير ---------- */
    .cta-section { padding: 20px 0 70px; }
    .cta-title { font-size: 1.85rem; }
    .cta-buttons { display: grid; grid-template-columns: 1fr; gap: 10px; }
    .cta-buttons .btn-skew { justify-content: center; padding: 15px 10px; clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%); }
    .cta-phone {
        justify-content: center;
        margin: 8px 0 0;
        padding: 12px;
        border: 1px dashed rgba(255, 255, 255, .2);
        border-radius: 16px;
    }

    /* ---------- اتصل بنا: الكروت 2×2 ---------- */
    .contact-cards-section { margin-top: -40px; }
    .contact-cards-section .row { --bs-gutter-x: 12px; --bs-gutter-y: 12px; }
    .contact-cards-section .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
    .contact-card { align-items: center; padding: 18px 12px 18px; border-radius: 20px; text-align: center; }
    .contact-card-icon { width: 50px; height: 50px; margin-bottom: 10px; font-size: 1.25rem; border-radius: 15px; }
    .contact-card-label { font-size: .85rem; }
    .contact-card-value { margin: 0 0 8px; font-size: .88rem; }
    .contact-card-action { font-size: .82rem; }
    .form-card { border-radius: 24px; }
    .info-card { border-radius: 24px; padding: 28px 22px; }

    /* ---------- المدونة ---------- */
    .blog-toolbar { padding: 10px; border-radius: 18px; }
    .blog-cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; padding-bottom: 2px; }
    .blog-cats::-webkit-scrollbar { display: none; }
    .blog-cat { flex-shrink: 0; }
    .featured-media { min-height: 220px; }
    .featured-title { font-size: 1.4rem; }
    .post-hero { padding: 50px 0 150px; }
    .post-title { font-size: 1.7rem; }
    .post-cover { margin-top: -110px; border-radius: 20px; }
    .post-lead { font-size: 1.04rem; padding: 18px 20px; }
    .post-content h2 { font-size: 1.4rem; }
    .post-share { justify-content: center; }
    .post-share > span { width: 100%; text-align: center; margin: 0; }

    /* ---------- الأسئلة ---------- */
    .faq-search-section { margin-top: -50px; }
    .faq-search-label { font-size: 1.05rem; }
    .faq-quick { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; }
    .faq-quick::-webkit-scrollbar { display: none; }
    .faq-chip { flex-shrink: 0; }
    .faq-count { width: 100%; text-align: center; }
    .faq-accordion .accordion-button { padding: 16px 18px; font-size: 1rem; }
    .faq-accordion .accordion-body { padding: 16px 18px 20px; }

    /* ---------- مقاول أسفلت ---------- */
    .hl-card { padding: 20px 16px; }
    .hl-card h3 { font-size: 1rem; }
    .calc-types { grid-template-columns: 1fr 1fr; }
    .calc-type span {
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        padding: 14px 8px;
        font-size: .9rem;
        text-align: center;
    }
    .calc-area-input input { font-size: 1.5rem; }
    .calc-actions { display: grid; grid-template-columns: 1fr; }

    /* جدول المقارنة: اللوجو بس في عمود زفلتة */
    .compare-head .is-us { font-size: 0; }
    .compare-head .is-us img { width: 40px; height: 40px; }
    .compare-head > span:first-child { font-size: .95rem; }

    .factors-grid { gap: 14px; border: 0; border-radius: 0; padding: 4px 0 16px; overflow-y: hidden; }
    .factors-grid .factor-card {
        flex: 0 0 80%;
        border: 1px solid var(--border) !important;
        border-radius: 22px;
        scroll-snap-align: center;
    }

    /* ---------- الفوتر ---------- */
    .site-footer { padding-top: 56px; text-align: center; }
    .footer-logo { height: 96px; }
    .footer-about { margin: 0 auto; }
    .footer-title::after { right: 50%; transform: translateX(50%); }
    .footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
    .site-footer .col-6 { flex: 0 0 100%; max-width: 100%; }
    .footer-contact li { display: flex; justify-content: center; align-items: center; gap: 6px; }
    .footer-contact i { margin: 0; }
    .footer-social { justify-content: center; }
    .footer-bottom { margin-top: 36px; }
}

/* ==========================================================================
   Keyframes
   ========================================================================== */
@keyframes m-ring {
    0% { opacity: .7; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.5); }
}
@keyframes m-shake {
    0%, 70%, 100% { transform: rotate(0); }
    75%, 85%, 95% { transform: rotate(-15deg); }
    80%, 90% { transform: rotate(15deg); }
}
@keyframes m-menu-in {
    to { opacity: 1; transform: none; }
}
@keyframes m-bar-in {
    from { opacity: 0; transform: translateY(120%); }
    to { opacity: 1; transform: none; }
}
