/* =========================================================
   Mobile Responsive Fixes for aldqh.com
   ضع هذا الملف بعد css/style.css
   ========================================================= */

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

img,
svg,
video,
canvas {
    max-width: 100%;
    height: auto;
}

/* يمنع العناصر الطويلة من الخروج خارج شاشة الجوال */
p,
h1,
h2,
h3,
h4,
h5,
h6,
a,
span,
div {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* =======================
   الحاويات العامة
   ======================= */
.container,
.container-fluid {
    width: 100%;
    max-width: 100%;
}

@media (max-width: 767.98px) {
    .container,
    .container-fluid {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    .row {
        margin-left: -8px !important;
        margin-right: -8px !important;
    }

    [class*="col-"] {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
}

/* =======================
   السلايدر الرئيسي
   ======================= */
#header-carousel,
.header-carousel-container,
#headerCarousel,
.carousel-inner,
.carousel-item {
    width: 100%;
    max-width: 100%;
}

.carousel-background {
    width: 100%;
    overflow: hidden;
}

.carousel-background img {
    width: 100% !important;
    height: clamp(340px, 65vh, 650px) !important;
    object-fit: cover !important;
    object-position: center !important;
}

.carousel-container {
    width: 100% !important;
    padding: 0 18px !important;
}

.carousel-content {
    width: min(92%, 900px) !important;
    max-width: 92% !important;
    margin: 0 auto !important;
    padding: 16px !important;
    text-align: center !important;
}

.carousel-content h1,
.carousel-content h2 {
    line-height: 1.45 !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

@media (max-width: 767.98px) {
    .carousel-background img {
        height: 430px !important;
    }

    .carousel-content {
        max-width: 96% !important;
        padding: 14px 10px !important;
    }

    .carousel-content h1 {
        font-size: 25px !important;
        line-height: 1.55 !important;
        margin-bottom: 12px !important;
    }

    .carousel-content h2 {
        font-size: 20px !important;
        line-height: 1.55 !important;
        margin-bottom: 10px !important;
    }

    .carousel-content p {
        font-size: 14px !important;
        line-height: 1.8 !important;
        margin-bottom: 12px !important;
    }

    .btn-get-started {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 10px 18px !important;
        font-size: 14px !important;
        border-radius: 8px !important;
    }

    .carousel-control-prev,
    .carousel-control-next {
        width: 11% !important;
    }

    .carousel-indicators {
        bottom: 7px !important;
    }
}

/* =======================
   الأقسام والعناوين
   ======================= */
#about,
#services,
#portfolio,
#contact {
    width: 100%;
    overflow: hidden;
}

.section-header {
    max-width: 900px;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 10px;
    padding-right: 10px;
}

.section-header h2,
.section-header h3 {
    line-height: 1.45 !important;
}

.section-header p {
    line-height: 1.9 !important;
}

.welcome {
    max-width: 1000px !important;
}

.welcome h1 {
    font-size: clamp(20px, 3vw, 34px) !important;
    line-height: 1.9 !important;
}

@media (max-width: 767.98px) {
    #about,
    #services,
    #portfolio,
    #contact {
        padding-top: 45px !important;
        padding-bottom: 45px !important;
    }

    .section-header {
        margin-bottom: 24px !important;
    }

    .section-header h2,
    .section-header h3 {
        font-size: 26px !important;
    }

    .section-header p {
        font-size: 14px !important;
        line-height: 1.9 !important;
    }

    .welcome {
        padding: 0 !important;
    }

    .welcome h1 {
        font-size: 18px !important;
        line-height: 2 !important;
        text-align: right !important;
    }

    .welcome .btn {
        width: auto !important;
        min-width: 120px;
    }
}

/* =======================
   الرؤية - الرسالة - الاستراتيجية
   ======================= */
.about-col {
    display: flex;
    margin-bottom: 18px;
}

.about-content {
    width: 100%;
    height: 100%;
}

@media (max-width: 767.98px) {
    .about-col {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .about-content {
        padding: 24px 18px !important;
        border-radius: 14px !important;
    }

    .about-content h2 {
        font-size: 22px !important;
    }

    .about-content p {
        font-size: 14px !important;
        line-height: 1.95 !important;
        text-align: right !important;
    }
}

/* =======================
   الخدمات
   ======================= */
.service-col {
    height: 100%;
    margin-bottom: 20px;
}

.service-detail {
    line-height: 1.9 !important;
}

@media (max-width: 767.98px) {
    #services .col-md-6,
    #services .col-lg-4 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .service-col {
        min-height: auto !important;
        padding: 24px 18px !important;
        border-radius: 15px !important;
        margin-bottom: 16px !important;
    }

    .service-icon {
        margin-bottom: 12px !important;
    }

    .service-col h3 {
        font-size: 20px !important;
    }

    .service-detail,
    .service-detail a {
        font-size: 14px !important;
        line-height: 1.95 !important;
    }
}

/* =======================
   معرض الأعمال
   ======================= */
.portfolio-container,
.portfolio-wrap,
.portfolio-wrap figure {
    max-width: 100%;
}

.portfolio-wrap img {
    width: 100% !important;
    height: auto !important;
    object-fit: cover;
}

.portfolio-title {
    line-height: 1.7 !important;
}

@media (max-width: 767.98px) {
    .portfolio-flters {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        padding: 0 !important;
    }

    .portfolio-flters li {
        margin: 0 !important;
        padding: 8px 11px !important;
        font-size: 12px !important;
        white-space: normal !important;
        text-align: center !important;
    }

    .portfolio-item {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 18px !important;
    }

    .portfolio-title {
        font-size: 14px !important;
        padding: 12px !important;
        line-height: 1.8 !important;
    }
}

/* =======================
   نموذج التواصل
   ======================= */
#contact .form-control {
    width: 100% !important;
    min-height: 46px;
    font-size: 16px !important; /* يمنع تكبير iPhone تلقائياً */
}

#contact textarea.form-control {
    min-height: 130px;
}

#contact button[type="submit"] {
    min-height: 46px;
    padding: 10px 22px;
}

.contact-info {
    width: 100%;
    max-width: 100%;
}

.contact-info iframe {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: 320px !important;
    border: 0 !important;
    border-radius: 12px;
}

.contact-info p {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.social {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.social a {
    flex: 0 0 auto;
}

@media (max-width: 767.98px) {
    #contact .col-md-7,
    #contact .col-md-5 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    #contact .form {
        margin-bottom: 28px !important;
    }

    #contact .form-row {
        display: block !important;
        margin: 0 !important;
    }

    #contact .form-row > .form-group {
        max-width: 100% !important;
        flex: 0 0 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    #contact .form-group {
        margin-bottom: 12px !important;
    }

    #contact button[type="submit"] {
        width: 100% !important;
    }

    .contact-info {
        text-align: right !important;
    }

    .contact-info iframe {
        height: 270px !important;
        margin-bottom: 20px;
    }

    .contact-info p {
        font-size: 13px !important;
        line-height: 1.8 !important;
    }

    .social {
        justify-content: center;
        margin-top: 18px;
    }
}

/* =======================
   الفوتر
   ======================= */
#footer {
    overflow: hidden;
}

#footer p {
    margin-bottom: 0;
}

@media (max-width: 767.98px) {
    #footer {
        padding: 22px 0 !important;
    }

    #footer .row {
        text-align: center !important;
    }

    #footer .col-md-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    #footer p {
        font-size: 12px !important;
        line-height: 1.8 !important;
    }

    .back-to-top {
        width: 42px !important;
        height: 42px !important;
        right: auto !important;
        left: 14px !important;
        bottom: 14px !important;
    }
}

/* =======================
   مواصفات عامة للجوال
   ======================= */
@media (max-width: 575.98px) {
    body {
        font-size: 14px !important;
    }

    h1 {
        font-size: 24px !important;
    }

    h2 {
        font-size: 22px !important;
    }

    h3 {
        font-size: 19px !important;
    }

    .btn,
    button,
    input,
    select,
    textarea {
        max-width: 100% !important;
    }
}

/* أجهزة صغيرة جداً */
@media (max-width: 360px) {
    .container,
    .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .carousel-content h1 {
        font-size: 22px !important;
    }

    .carousel-content h2 {
        font-size: 18px !important;
    }

    .section-header h2,
    .section-header h3 {
        font-size: 22px !important;
    }
}


/* =========================================================
   إصلاح ارتفاع السلايدر على الجوال
   يمنع المساحة الزرقاء الفارغة أسفل الصورة
   ========================================================= */
@media (max-width: 767.98px) {

    #header-carousel,
    #header-carousel .header-carousel-container,
    #headerCarousel,
    #headerCarousel .carousel-inner,
    #headerCarousel .carousel-item {
        height: 430px !important;
        min-height: 430px !important;
        max-height: 430px !important;
    }

    #headerCarousel .carousel-item {
        position: relative !important;
        overflow: hidden !important;
        background: #17345d !important;
    }

    #headerCarousel .carousel-background {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 430px !important;
        min-height: 430px !important;
        max-height: 430px !important;
        overflow: hidden !important;
    }

    #headerCarousel .carousel-background img {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 430px !important;
        min-height: 430px !important;
        max-height: 430px !important;
        object-fit: cover !important;
        object-position: center !important;
    }

    #headerCarousel .carousel-container {
        position: absolute !important;
        inset: 0 !important;
        height: 430px !important;
        min-height: 430px !important;
        max-height: 430px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 25px 50px 45px !important;
        z-index: 2 !important;
    }

    #headerCarousel .carousel-content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 0 !important;
        text-align: center !important;
        transform: none !important;
    }

    #headerCarousel .carousel-content h1 {
        font-size: 26px !important;
        line-height: 1.45 !important;
        margin: 12px 0 !important;
    }

    #headerCarousel .carousel-content h2 {
        font-size: 20px !important;
        line-height: 1.5 !important;
        margin: 0 0 10px !important;
    }

    #headerCarousel .btn-get-started {
        margin-top: 8px !important;
    }

    #headerCarousel .carousel-indicators {
        bottom: 12px !important;
        margin-bottom: 0 !important;
        z-index: 5 !important;
    }

    #headerCarousel .carousel-control-prev,
    #headerCarousel .carousel-control-next {
        top: 0 !important;
        bottom: 0 !important;
        height: 430px !important;
        width: 12% !important;
        z-index: 5 !important;
    }
}

/* شاشة جوال صغيرة */
@media (max-width: 480px) {
    #header-carousel,
    #header-carousel .header-carousel-container,
    #headerCarousel,
    #headerCarousel .carousel-inner,
    #headerCarousel .carousel-item,
    #headerCarousel .carousel-background,
    #headerCarousel .carousel-background img,
    #headerCarousel .carousel-container {
        height: 390px !important;
        min-height: 390px !important;
        max-height: 390px !important;
    }

    #headerCarousel .carousel-control-prev,
    #headerCarousel .carousel-control-next {
        height: 390px !important;
    }

    #headerCarousel .carousel-container {
        padding: 20px 45px 42px !important;
    }

    #headerCarousel .carousel-content h1 {
        font-size: 23px !important;
    }

    #headerCarousel .carousel-content h2 {
        font-size: 18px !important;
    }
}


/* =========================================================
   إصلاح السلايدر على الكمبيوتر والتابلت
   ========================================================= */
@media (min-width: 768px) {

    #header-carousel,
    #header-carousel .header-carousel-container,
    #headerCarousel,
    #headerCarousel .carousel-inner,
    #headerCarousel .carousel-item {
        height: clamp(480px, 36vw, 590px) !important;
        min-height: 0 !important;
        max-height: 590px !important;
        overflow: hidden !important;
    }

    #headerCarousel .carousel-item {
        position: relative !important;
        background: #17345d !important;
    }

    #headerCarousel .carousel-background {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: hidden !important;
    }

    #headerCarousel .carousel-background img {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        max-height: none !important;
        object-fit: cover !important;
        object-position: center !important;
    }

    #headerCarousel .carousel-container {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        max-height: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 40px 90px 60px !important;
        z-index: 2 !important;
    }

    #headerCarousel .carousel-content {
        width: min(1000px, 85%) !important;
        max-width: 85% !important;
        margin: 0 auto !important;
        padding: 0 !important;
        text-align: center !important;
        transform: none !important;
    }

    #headerCarousel .carousel-content h1 {
        font-size: clamp(30px, 3vw, 46px) !important;
        line-height: 1.45 !important;
        margin: 14px 0 !important;
    }

    #headerCarousel .carousel-content h2 {
        font-size: clamp(34px, 4vw, 58px) !important;
        line-height: 1.4 !important;
        margin: 0 0 14px !important;
    }

    #headerCarousel .carousel-indicators {
        bottom: 18px !important;
        margin-bottom: 0 !important;
        z-index: 5 !important;
    }

    #headerCarousel .carousel-control-prev,
    #headerCarousel .carousel-control-next {
        top: 0 !important;
        bottom: 0 !important;
        height: 100% !important;
        width: 7% !important;
        z-index: 5 !important;
    }
}