/* ============================================
   Taif Tec - Custom Enhancements CSS
   Modern UI additions preserving original style
   ============================================ */

:root {
    --green: #1ed35f;
    --green-dark: #17b34f;
    --black: #000000;
    --white: #ffffff;
    --gray-light: #f8f9fa;
    --shadow: 0 10px 40px rgba(0,0,0,0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-main: 'Roboto', sans-serif;
    --font-ar: 'Tajawal', sans-serif;
}

/* ---- Typography ---- */
html[lang="ar"], .rtl-body {
    font-family: var(--font-ar);
}

/* ---- Standard Pages ---- */
.standard-content {
    overflow-x: hidden;
}

body.standard-page {
    overflow-y: auto !important;
    height: auto !important;
}

/* Neutralise the full-page-scroll section height overrides on standard pages.
   style.css sets page4{height:1350px!important}, page8{min-height:1340px!important} etc.
   These !important rules for the home-page scroll sections must be cleared here. */
body.standard-page .page1, body.standard-page .page2, body.standard-page .page3,
body.standard-page .page4, body.standard-page .page5, body.standard-page .page6,
body.standard-page .page7, body.standard-page .page8,
body.standard-page .page11, body.standard-page .page21, body.standard-page .page31 {
    height: auto !important;
    min-height: 0 !important;
}

/* page8 gets background-color:#fff on mobile — reset for standard pages */
body.standard-page .page8 {
    background-color: transparent !important;
}

/* ---- Footer fix for standard pages ----
   The original site used fullpage-scroll which gave every section an explicit 100vh height.
   .inner-div relied on that height (position:absolute;top:0;height:100%).
   On standard pages there is no such height, so .inner-div has no containing block and
   overlaps everything above it.  Reset it to normal document flow. */
body.standard-page #footer {
    height: auto !important;
    min-height: 0 !important;
}
body.standard-page #footer .inner-div {
    position: relative !important;
    height: auto !important;
}

.page-hero {
    position: relative;
    overflow: hidden;
}

.py-6 { padding-top: 5rem; padding-bottom: 5rem; }

.bg-dark-section {
    background-color: #111;
}

.page3-bg {
    background-image: url(../img/bg-3.png);
    background-size: cover;
    background-position: center;
}

/* ---- Language Switcher ---- */
.lang-switcher .lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    /*background: rgba(255,255,255,0.15);*/
    background: #25D366;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.3);
    transition: var(--transition);
    letter-spacing: 0.5px;
}

.lang-switcher .lang-btn:hover {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

/* ---- WhatsApp FAB ---- */
.whatsapp-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: var(--transition);
    text-decoration: none;
}

.rtl-body .whatsapp-fab {
    right: auto;
    left: 30px;
}

.whatsapp-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.6);
}

/* ---- Dark Mode Toggle ---- */
.dark-mode-toggle {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: none;
    cursor: pointer;
    z-index: 998;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    font-size: 1.2rem;
}

.rtl-body .dark-mode-toggle {
    right: auto;
    left: 30px;
}

.dark-mode-toggle .moon-icon { display: none; }
.dark-mode-toggle .sun-icon { display: block; }

body.dark-mode .dark-mode-toggle .moon-icon { display: block; }
body.dark-mode .dark-mode-toggle .sun-icon { display: none; }

/* Dark Mode */
body.dark-mode {
    --bg-dark: #0a0a0a;
    background-color: var(--bg-dark);
}
body.dark-mode .page8,
body.dark-mode .bg-white,
body.dark-mode .bg-light {
    background-color: #1a1a1a !important;
}
body.dark-mode .black-heading,
body.dark-mode .black-detail-text,
body.dark-mode .black-sub-heading {
    color: #f0f0f0 !important;
}
body.dark-mode .contact-input,
body.dark-mode .search-input {
    background: #2a2a2a;
    border-color: #444;
    color: #fff;
}
body.dark-mode .contact-info-title,
body.dark-mode .contact-label {
    color: #ccc;
}

/* ---- Animations ---- */
[data-aos] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-aos].aos-animate {
    opacity: 1;
    transform: translateY(0);
}

[data-aos="fade-right"] { transform: translateX(-30px); }
[data-aos="fade-right"].aos-animate { transform: translateX(0); }
[data-aos="fade-left"] { transform: translateX(30px); }
[data-aos="fade-left"].aos-animate { transform: translateX(0); }
[data-aos="zoom-in"] { transform: scale(0.8); }
[data-aos="zoom-in"].aos-animate { transform: scale(1); }

/* ---- Product Cards Enhanced ---- */
.product-card {
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Use contain so logos/screenshots aren't cropped */
.product-card img {
    object-fit: contain !important;
    background: #0d0d0d;
}

.product-card:hover {
    box-shadow: 0 16px 50px rgba(0,0,0,0.25);
    transform: translateY(-4px);
}

/* style.css hides .product-name with opacity:0;height:0 — restore it */
.product-card .product-name {
    opacity: 1 !important;
    height: 70px !important;
    color: #0d0d0d;
    font-size: 1rem;
    font-weight: 600;
    background: #fff;
    z-index: 2;
    position: relative;
    padding: 0 12px;
}

/* On hover the full overlay takes over — hide the static label again */
.product-card:hover .product-name {
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden;
}

/* ---- Features Cards ---- */
.feature-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 1.5rem;
    height: 100%;
    transition: var(--transition);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.feature-card:hover {
    background: rgba(30, 211, 95, 0.1);
    border-color: var(--green);
    transform: translateY(-4px);
}

.feature-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--green);
    min-width: 40px;
}

.feature-text {
    color: rgba(255,255,255,0.85);
    font-size: 1rem;
    line-height: 1.6;
    padding-top: 0.3rem;
}

/* ---- Contact Form ---- */
.contact-input {
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: var(--transition);
}

.contact-input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(30, 211, 95, 0.15);
    outline: none;
}

.contact-label {
    font-weight: 500;
    color: #555;
    margin-bottom: 0.4rem;
    display: block;
}

.contact-info-box {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 2rem;
}

.contact-info-title {
    color: var(--green);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.contact-info-text, .contact-info-link {
    color: #555;
    text-decoration: none;
    font-size: 0.95rem;
}

.contact-info-link:hover { color: var(--green); }

.social-icon-link {
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.2s;
}

.social-icon-link:hover { transform: scale(1.2); }

/* ---- Counters ---- */
.counter-box {
    padding: 1.5rem;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
}

.counter-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--green);
    line-height: 1;
}

.counter-label {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* ---- Footer Enhancements ---- */
.footer-section {
    background-color: #000;
    padding-bottom: 2rem;
}

.footer-logo {
    max-width: 150px;
    filter: brightness(10);
}

.footer-tagline {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-social-link {
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.2s;
    opacity: 0.7;
}

.footer-social-link:hover { transform: scale(1.2); opacity: 1; }

/* ---- Search Input ---- */
.search-input {
    border-radius: 8px;
    padding: 0.6rem 1rem;
}

.search-input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(30, 211, 95, 0.15);
}

/* ---- Product hero title ------------------------------------------------
   style.css renders .mobile-enter-heading as transparent fill + white stroke
   (outline text effect). On standard pages we want solid white so it is
   always readable regardless of hero background.
   -------------------------------------------------------------------- */
body.standard-page .mobile-enter-heading {
    color: #fff !important;
    -webkit-text-stroke-width: 0 !important;
    font-size: 3rem !important;
    line-height: 1.15 !important;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: .5px;
    text-shadow: 0 2px 12px rgba(0,0,0,.4);
}

@media (max-width: 767px) {
    body.standard-page .mobile-enter-heading {
        font-size: 1.5rem !important;
    }
    .page9 { padding-bottom: 60px !important; }
    .footer_contact_tag{
            font-size: 1.0rem;
        }
}

/* ---- Mobile home page --------------------------------------------------
   style.css sets body{overflow:hidden;height:100%} and
   onepage-scroll.css sets html{height:100%} + .wrapper{overflow:hidden}
   for the fullpage-scroll plugin.
   On mobile (≤600px) the plugin does NOT initialise so we restore
   html, body, and .wrapper to normal document flow.
   -------------------------------------------------------------------- */
@media (max-width: 600px) {
    /* Unlock both html AND body (onepage-scroll.css locks both) */
    html, body {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        height: auto !important;
    }

    /* .wrapper is set to overflow:hidden + height:100%!important by onepage-scroll.css */
    .wrapper, #myDIV {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        height: auto !important;
    }

    /* Sections: remove fullpage-scroll absolute positioning;
       make each section visible and naturally sized */
    .main section {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        height: auto !important;
        min-height: 100svh;
        opacity: 1 !important;      /* visible even before JS runs */
        overflow: visible !important;
    }

    /* inner-div uses position:absolute in style.css which relies on
       the section having a fixed height. On mobile restore to relative. */
    .inner-div {
        position: relative !important;
        height: auto !important;
        min-height: 50vh;
    }

    /* Ensure the nav overlay sits above everything on mobile */
    #myLinks {
        z-index: 1040 !important;
    }

    /* Hide fullpage dots on mobile (already done in style.css but reinforce) */
    #fp-nav {
        display: none !important;
    }
}

/* ---- Contact page mobile -----------------------------------------------
   Prevent side padding collapsing the form on small screens.
   -------------------------------------------------------------------- */
@media (max-width: 575px) {
    .enquiry-form .row.g-3 {
        --bs-gutter-x: 0.75rem;
    }
    .enquiry-form input,
    .enquiry-form textarea,
    .enquiry-field input,
    .enquiry-field textarea {
        font-size: 16px; /* prevents iOS zoom on focus */
    }
    .enquiry-submit-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ---- Product Detail ---- */
.product-detail-img {
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.product-full-description p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

/* ---- Prose Content ---- */
.prose-content h2, .prose-content h3 {
    color: var(--black);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose-content p {
    line-height: 1.8;
    color: #444;
    margin-bottom: 1rem;
}

/* ---- Rounded & Shadow Helpers ---- */
.rounded-lg { border-radius: 12px; }
.shadow-lg { box-shadow: var(--shadow) !important; }

/* ---- Breadcrumb ---- */
.breadcrumb-menu a {
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-menu a:hover { color: var(--green); }

/* ---- Responsive Overrides ---- */
@media (max-width: 991px) {
    .py-6 { padding-top: 3rem; padding-bottom: 3rem; }
}

@media (max-width: 767px) {
    .whatsapp-fab { bottom: 80px; right: 20px; }
    .dark-mode-toggle { bottom: 150px; right: 20px; }
    .rtl-body .whatsapp-fab { right: auto; left: 20px; }
    .rtl-body .dark-mode-toggle { right: auto; left: 20px; }
    .counter-value { font-size: 2rem; }
    .contact-info-box { padding: 1.5rem; }
    .feature-card { padding: 1rem; }
}

/* ---- Sticky CTA ---- */
.sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--green);
    color: #fff;
    text-align: center;
    padding: 12px;
    z-index: 997;
    font-weight: 600;
    font-size: 0.9rem;
    display: none;
}

@media (max-width: 767px) {
    .sticky-cta { display: block; }
}

.sticky-cta a { color: #fff; text-decoration: none; }

/* ---- Back To Top ---- */
.back-to-top {
    position: fixed;
    bottom: 90px;
    right: 80px;
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 996;
    border: none;
    font-size: 1.2rem;
    transition: var(--transition);
}

.back-to-top:hover { background: var(--green); }
.back-to-top.show { display: flex; }

/* ---- AOS Integration ---- */
.aos-init { transition-property: opacity, transform; }

/* ---- Enquiry Form ---- */
.enquiry-partner-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(30,212,96,.15);
    color: var(--green);
    border: 1px solid rgba(30,212,96,.4);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
}
.enquiry-form {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 16px;
    padding: 36px 40px;
    backdrop-filter: blur(8px);
}
.enquiry-field { display: flex; flex-direction: column; gap: 6px; }
.enquiry-field label {
    font-size: .78rem;
    font-weight: 700;
    color: rgba(255,255,255,.6);
    text-transform: uppercase;
    letter-spacing: .8px;
}
.enquiry-field .required { color: var(--green); }
.enquiry-field input,
.enquiry-field textarea {
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 8px;
    padding: 12px 16px;
    color: #fff;
    font-size: .95rem;
    transition: border-color .2s, background .2s;
    outline: none;
    resize: none;
    font-family: inherit;
}
.enquiry-field input:focus,
.enquiry-field textarea:focus {
    border-color: var(--green);
    background: rgba(30,212,96,.06);
}
.enquiry-field input::placeholder,
.enquiry-field textarea::placeholder { color: rgba(255,255,255,.3); }
.enquiry-field input.is-invalid,
.enquiry-field textarea.is-invalid { border-color: #e05252; }
.field-error { color: #f87171; font-size: .8rem; }
.enquiry-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--green);
    color: #0a1628;
    border: none;
    border-radius: 8px;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    text-transform: uppercase;
    letter-spacing: .5px;
    width: 100%;
    justify-content: center;
}
.enquiry-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(30,212,96,.35);
}
.enquiry-success-msg {
    text-align: center;
    padding: 48px 32px;
    background: rgba(30,212,96,.08);
    border: 1px solid rgba(30,212,96,.3);
    border-radius: 16px;
}
.enquiry-success-msg .success-icon {
    width: 64px; height: 64px;
    background: var(--green);
    color: #0a1628;
    border-radius: 50%;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.enquiry-success-msg h4 { color: var(--green); font-size: 1.4rem; margin-bottom: 10px; }
.enquiry-success-msg p { color: rgba(255,255,255,.7); margin: 0; }
@media (max-width: 575px) {
    .enquiry-form { padding: 24px 20px; }
}

/* ---- Hero digital presence text stroke animation ----
   The original paths used stroke-dasharray:600 (per short path segment).
   A full text element needs a much larger value to cover all character outlines. */
.svg-animationContainer .hero-digital-text {
    stroke-dasharray: 15000;
    stroke-dashoffset: 15000;
}

/* ---- Blog Cards ---- */
.blog-card { border-radius:12px; overflow:hidden; background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.08); transition:transform .2s,box-shadow .2s; }
.blog-card:hover { transform:translateY(-4px); box-shadow:0 12px 32px rgba(0,0,0,.3); }
.blog-card-img { height:200px; background-size:cover; background-position:center; }
.blog-card-body { padding:20px; }
.blog-card-cat { display:inline-block; background:rgba(30,212,96,.15); color:#1ED460; border:1px solid rgba(30,212,96,.3); border-radius:20px; padding:3px 12px; font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.8px; margin-bottom:10px; }
.blog-card-title { font-size:1.05rem; font-weight:700; color:#fff; margin-bottom:8px; line-height:1.35; }
.blog-card-excerpt { font-size:.85rem; color:#8fa3c0; line-height:1.6; margin-bottom:12px; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.blog-card-date { font-size:.75rem; color:#5a6a8a; }


/* =============================================================================
   MOBILE FIXES — All 6 issues
   Applied in order: typography → partner slider → RTL → bg images → arrows → full-screen sections
   ============================================================================= */

/* ─────────────────────────────────────────────────────────────────────────────
   ISSUE 1 — Hero section: text sizes & alignment on mobile
   .heading-text ("Transforming Your") and #example1 (outline text below)
   must look visually balanced — same visual weight, centred, vertically aligned.
   ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    /* Hero section: centre everything and give full-height flex layout */
    #sec1 .inner-div {
        display: flex !important;
        flex-direction: column;
        align-items: center !important;
        justify-content: center !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        min-height: 100svh;
    }

    /* Wrapper div for mobile text block */
    #sec1 .inner-div > div.text-center {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0;
        width: 100%;
        padding: 0 1rem;
    }

    /* "Transforming Your" — solid line */
    .heading-text {
        font-size: clamp(1.6rem, 7vw, 2.2rem) !important;
        line-height: 1 !important;
        text-align: center !important;
        letter-spacing: 0.02em;
        margin-bottom: 0 !important;
    }

    /* "Digital Presence" — outline/stroke text */
    #example1 {
        font-size: clamp(2rem, 10vw, 3.2rem) !important;
        line-height: 1 !important;
        text-align: center !important;
        margin-top: 4px !important;
        -webkit-text-stroke-width: 1.5px !important;
    }
}

@media (max-width: 380px) {
    .heading-text   { font-size: 1.5rem !important; }
    #example1       { font-size: 2rem   !important; }
}


/* ─────────────────────────────────────────────────────────────────────────────
   ISSUE 2 — Associations & Partnerships (page6) slider
   Add gap between logos, centre items, consistent spacing for both
   desktop grid and mobile carousel.
   ───────────────────────────────────────────────────────────────────────────── */

/* Desktop / tablet grid (d-md-flex) */
.page6 .row.align-items-center.justify-content-center img {
    max-height: 70px;
    width: auto !important;
    object-fit: contain;
    padding: 0 12px;
}

/* Mobile carousel */
#owl-carousel-partnerlogo .item {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    min-height: 90px;
}

#owl-carousel-partnerlogo .item img {
    max-height: 60px;
    width: auto !important;
    max-width: 140px;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}

/* Mobile 2-up carousel: give breathing room */
#owl-carousel-partnerlogo .owl-item {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dots below the carousel */
#owl-carousel-partnerlogo .owl-dots {
    margin-top: 20px !important;
}

/* Also fix the second partner carousel id if present */
#owl-carousel-partnerlogo1 .item {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    min-height: 90px;
}
#owl-carousel-partnerlogo1 .item img {
    max-height: 60px;
    width: auto !important;
    max-width: 140px;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}


/* ─────────────────────────────────────────────────────────────────────────────
   ISSUE 3 — RTL / Arabic mode: both sliders (clients + partners)
   owl carousel needs dir="rtl" on the container AND the stage must not
   get flipped twice. We reinforce the RTL carousel behaviour here.
   ───────────────────────────────────────────────────────────────────────────── */
html[dir="rtl"] .owl-carousel {
    direction: rtl;
}

/* OWL internally uses translateX — in RTL the stage translates in the
   wrong direction unless we tell it. The JS sets rtl:true but the CSS
   also needs to confirm. */
html[dir="rtl"] .owl-carousel .owl-stage {
    direction: rtl;
}

/* Partner carousel RTL: logos still look natural when mirrored */
html[dir="rtl"] #owl-carousel-partnerlogo .item,
html[dir="rtl"] #owl-carousel-partnerlogo1 .item {
    direction: rtl;
}

/* Client logos RTL */
html[dir="rtl"] #owl-carousel-clientlogo-1,
html[dir="rtl"] #owl-carousel-clientlogo-2,
html[dir="rtl"] #owl-carousel-clientlogo-resp {
    direction: rtl;
}

/* Fix: autoplay direction in RTL goes right-to-left (next = right visually) */
html[dir="rtl"] .owl-carousel.owl-rtl .owl-item {
    float: right;
}


/* ─────────────────────────────────────────────────────────────────────────────
   ISSUE 4 — Mobile background images: full cover, no crop/white edges
   style.css sets background-size:cover on .section but some sections
   get overridden or the image is too small. Reinforce all 7 mobile backgrounds.
   ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .section,
    .page1, .page2, .page3, .page4,
    .page5, .page6, .page7, .page8 {
        background-size: cover !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
        background-attachment: scroll !important; /* fixed causes issues on iOS */
    }

    /* page4 has an explicit height override in style.css — keep it
       but ensure the bg still fills */
    .page4 {
        background-size: cover !important;
        background-position: top center !important;
    }

    /* page8 (Our Presence) uses bg-white on mobile — make sure it has
       enough min-height so content doesn't overflow */
    .page8 {
        background-color: #fff !important;
        min-height: auto !important; /* let content dictate height */
    }
}


/* ─────────────────────────────────────────────────────────────────────────────
   ISSUE 5 — Decorative arrow icons: wrong position on mobile
   All absolute-positioned arrow images use values set for desktop.
   On mobile (position:relative sections) absolute positioning is relative
   to the section — reset to safe, subtle positions or hide oversized ones.
   ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {

    /* Generic: clamp all arrow images so they don't bleed outside the section */
    [class*="-arrow"] {
        max-width: 80px !important;
        opacity: 0.55;
    }

    /* Section 2 (About) arrows */
    .top-arrow {
        top: 10px !important;
        right: 10px !important;
        width: 60px !important;
    }
    .bottom-arrow {
        bottom: 10px !important;
        right: 10px !important;
        left: auto !important;
        width: 60px !important;
    }

    /* Section 3 (Future) */
    .sec3-arrow {
        width: 60px !important;
        margin-left: 0 !important;
        margin-top: 16px !important;
    }
    .sec3-top-arrow { display: none !important; }

    /* Section 4 (Products) */
    .top-arrow-sec4 {
        top: 8px !important;
        right: 8px !important;
        left: auto !important;
        width: 70px !important;
    }
    .bottom-arrow-sec4 {
        bottom: 8px !important;
        right: 8px !important;
        left: auto !important;
        top: auto !important;
        width: 60px !important;
    }

    /* Section 5 (Clients) */
    .top-arrow-sec5    { display: none !important; }
    .bottom-arrow-sec5 {
        right: 10px !important;
        bottom: 10px !important;
        left: auto !important;
        width: 60px !important;
    }

    /* Section 6 (Partners) */
    .top-arrow-sec6 {
        top: 10px !important;
        right: 10px !important;
        left: auto !important;
        width: 60px !important;
    }

    /* Section 7 (Why Us) */
    .top-arrow-sec7 {
        width: 60px !important;
        margin-left: auto !important;
        margin-top: 0 !important;
        float: right;
    }
    .bottom-arrow-sec7 {
        float: none !important;
        width: 60px !important;
        margin-right: 0 !important;
        margin-top: 16px !important;
    }

    /* Section 8 (Presence) */
    .left-arrow-sec8 {
        left: -10px !important;
        bottom: auto !important;
        top: 10px !important;
        width: 60px !important;
    }
    .top-arrow-sec8 {
        top: 10px !important;
        right: -10px !important;
        width: 60px !important;
    }
    .bottom-arrow-sec8 {
        bottom: 10px !important;
        right: 10px !important;
        width: 60px !important;
    }
}


/* ─────────────────────────────────────────────────────────────────────────────
   ISSUE 6 — Each section must cover the full mobile screen
   On mobile the onepage-scroll plugin is disabled. Sections become
   position:relative and stack naturally. Each must be at least 100vh
   tall with proper flex layout so content sits centred within.
   ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {

    /* Every section = full viewport height minimum */
    .main > section {
        min-height: 100svh !important;
        min-height: 100vh !important; /* fallback for browsers without svh */
        width: 100% !important;
        display: flex !important;
        flex-direction: column;
        position: relative !important;
    }

    /* inner-div must fill and centre content within the section */
    .main > section > .inner-div {
        flex: 1;
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        width: 100%;
        position: relative !important;
        height: auto !important;
        padding-top: 70px !important;    /* clear the fixed top-nav */
        padding-bottom: 20px !important;
        box-sizing: border-box;
    }

    /* page4 (products) and page8 (presence) have extra content —
       allow them to grow beyond 100vh rather than overflow */
    .page4,
    .page8 {
        min-height: 100svh !important;
        height: auto !important;
    }

    /* Footer section — let it be natural height */
    .page9 {
        min-height: auto !important;
    }

    /* Ensure the background fills the full section */
    .main > section {
        background-size: cover !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
    }
}

/* Tablet 601–767px: same full-screen sections */
@media (min-width: 601px) and (max-width: 767px) {
    .main > section {
        min-height: 100vh !important;
    }
    .main > section > .inner-div {
        padding-top: 80px !important;
        padding-bottom: 30px !important;
    }
}


/* =============================================================================
   MOBILE MENU FIX — English + Arabic (RTL)
   Covers phones ≤767px. Fixes:
   · Menu overlay layout (side-bar strips + nav list)
   · Counter numbers clipping off-screen
   · Arabic (RTL): side-bar float collapse, wrong padding side,
     counter position, logoOpen alignment
   ============================================================================= */

/* ── 1. Overlay container ────────────────────────────────────────────────── */
@media (max-width: 767px) {

    /* Full-screen white overlay */
    #myLinks {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        z-index: 1039 !important;
        display: flex !important;          /* always flex — d-block just sets visibility */
        flex-direction: column !important;
    }

    /* When open: force flex visible (d-block class is toggled by JS) */
    #myLinks.d-block {
        display: flex !important;
        flex-direction: column !important;
    }

    /* ── 2. Top strip: black sidebar (contact info hidden on mobile) ─────── */
    #myLinks .side-bar {
        width: 100% !important;
        height: 70px !important;           /* slim top bar */
        min-height: 70px !important;
        flex-shrink: 0;
        background-color: #000 !important;
        display: flex !important;
        align-items: center !important;
        padding: 0 20px !important;
        float: none !important;            /* fix RTL float:right collapse */
        box-sizing: border-box;
    }

    /* ── 3. Nav list area (takes all remaining height) ───────────────────── */
    #myLinks .off-canvas__page {
        position: relative !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: auto !important;
        flex: 1 !important;
        padding-top: 30px !important;
        padding-bottom: 30px !important;
        padding-left: 80px !important;
        padding-right: 20px !important;
        overflow-y: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
        box-sizing: border-box;
    }

    /* Divider line: reposition to match new left padding */
    #myLinks .off-canvas__page::before {
        left: 60px !important;
        right: auto !important;
        top: 0;
        height: 100%;
    }

    /* ── 4. Nav list: natural flow (not absolutely centred) ─────────────── */
    #myLinks .off-canvas__page ul {
        position: relative !important;
        top: auto !important;
        transform: none !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }

    /* ── 5. Counter numbers: visible & correctly placed ─────────────────── */
    #myLinks .off-canvas__page ul .counter {
        position: absolute !important;
        left: -58px !important;
        right: auto !important;
        font-size: 1.3rem !important;
        font-weight: 700;
        color: #000;
    }

    /* ── 6. Nav links: comfortable tap targets ───────────────────────────── */
    #myLinks .off-canvas__page ul li a {
        font-size: 1.5rem !important;
        padding: 14px 0 14px 30px !important;
        line-height: 1.2 !important;
    }

    /* ── 7. logoOpen: show correctly when menu opens ─────────────────────── */
    .logoOpen {
        position: fixed !important;
        left: 20px !important;
        right: auto !important;
        top: 18px !important;
        z-index: 1040 !important;
    }
}


/* =============================================================================
   RTL (Arabic) MOBILE MENU OVERRIDES
   Everything that needs to be flipped for right-to-left on phones ≤767px
   ============================================================================= */
@media (max-width: 767px) {

    /* Overlay: already full-width above, just set text direction */
    html[dir="rtl"] #myLinks {
        direction: rtl !important;
    }

    /* Side-bar: remove float, full width, RTL direction */
    html[dir="rtl"] #myLinks .side-bar {
        float: none !important;
        direction: rtl !important;
        text-align: right !important;
        padding-right: 20px !important;
        padding-left: 20px !important;
    }

    /* Nav area: flip padding — indent from RIGHT in Arabic */
    html[dir="rtl"] #myLinks .off-canvas__page {
        direction: rtl !important;
        left: 0 !important;
        right: 0 !important;
        padding-right: 80px !important;  /* indent from right for Arabic */
        padding-left: 20px !important;
    }

    /* Divider line: right side in Arabic */
    html[dir="rtl"] #myLinks .off-canvas__page::before {
        right: 60px !important;
        left: auto !important;
    }

    /* Counter: right side of the link in Arabic */
    html[dir="rtl"] #myLinks .off-canvas__page ul .counter {
        right: -58px !important;
        left: auto !important;
    }

    /* Nav link: padding flipped for RTL */
    html[dir="rtl"] #myLinks .off-canvas__page ul li a {
        padding: 14px 30px 14px 0 !important;
        text-align: right !important;
    }

    /* Active/hover indicator bar: right side */
    html[dir="rtl"] #myLinks .off-canvas__page ul li > a::after {
        left: auto !important;
        right: 0 !important;
    }

    /* logoOpen: right side in Arabic */
    html[dir="rtl"] .logoOpen {
        right: 20px !important;
        left: auto !important;
    }

    /* Hamburger icon: already on the correct side from Blade (mr-2 class),
       but ensure the bars don't flip */
    html[dir="rtl"] .icon {
        direction: ltr !important; /* bars must stay LTR so X animation works */
    }
}


/* =============================================================================
   RTL MOBILE: top-nav bar alignment
   Logo left / hamburger right on LTR.
   Logo right / hamburger left on RTL.
   ============================================================================= */
@media (max-width: 767px) {

    .top-nav > div {
        flex-direction: row !important;
    }

    /* LTR: logo on left, controls on right (default — no change needed) */

    /* RTL: logo on right (natural with dir=rtl), controls on left */
    html[dir="rtl"] .top-nav > div {
        flex-direction: row !important;
    }

    /* Language switcher: always readable */
    html[dir="rtl"] .lang-switcher {
        margin-left: 0.5rem !important;
        margin-right: 0 !important;
    }
}


/* =============================================================================
   MENU CLOSE BUTTON
   Shown inside the black .side-bar strip on mobile when the menu is open.
   Hidden on desktop (d-lg-none handles it).
   Works for both LTR (English) and RTL (Arabic).
   ============================================================================= */

.menu-close-btn {
    position: absolute;
    top: 18px;
    right: 20px;            /* LTR: top-right corner of the overlay */
    left: auto;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 1050;
    transition: border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.menu-close-btn:hover,
.menu-close-btn:focus {
    border-color: #1ed35f;
    background: rgba(30, 211, 96, 0.12);
    outline: none;
}

/* The × drawn with two pseudo-element bars */
.menu-close-x {
    position: relative;
    display: block;
    width: 18px;
    height: 18px;
}

.menu-close-x::before,
.menu-close-x::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: background 0.2s;
}

.menu-close-x::before { transform: translateY(-50%) rotate(45deg); }
.menu-close-x::after  { transform: translateY(-50%) rotate(-45deg); }

.menu-close-btn:hover .menu-close-x::before,
.menu-close-btn:hover .menu-close-x::after {
    background: #1ed35f;
}

/* RTL: flip to top-left corner */
html[dir="rtl"] .menu-close-btn {
    right: auto;
    left: 20px;
}


/* =============================================================================
   HAMBURGER → X VISIBILITY FIX
   The .icon (bar1 + bar2) has z-index:1035 but #myLinks overlay is z-index:1039.
   On mobile the overlay covers the hamburger, hiding the X animation.
   Fix: raise .icon above the overlay when menu is open (.change class is added).
   ============================================================================= */

@media (max-width: 767px) {

    /* Always keep the hamburger/X above the overlay on mobile */
    .icon {
        z-index: 1045 !important;
        position: relative;
    }

    /* When menu is open (.change added by JS), bars turn black on desktop
       but on mobile the overlay is white — keep bars black so X is visible */
    .icon.change .bar1,
    .icon.change .bar2 {
        background-color: #ffffff !important;
    }

    /* If the section has a green icon state and menu opens */
    .icon.green.change .bar1,
    .icon.green.change .bar2 {
        background-color: #000 !important;
    }
}
