/* =====================================================
   QATAR DIRECTORY - MOBILE RESPONSIVE CSS
   Add inside <style> tag in MasterPage <head> section
   ===================================================== */

/* -------------------------------------------------------
   1. HEADER - Two-row centered layout on mobile
      Row 1: Logo  |  Language  About Us  Services
      Row 2: ICV logo + Social icons (centered, padded)
------------------------------------------------------- */

@media (max-width: 991px) {

    .header2024 {
        height: auto !important;
        padding-bottom: 8px !important;
    }

    /* Wrapper = flex row, wraps so social-icons falls to row 2 */
    .header2024 .wrapper {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 8px 10px 4px !important;
        gap: 4px;
    }

    /* Logo left side of row 1 */
    .logo {
        flex: 0 0 auto;
        z-index: 2;
    }

    /* Buttons group — right side of row 1, same line as logo */
    .header_element2 {
        position: static !important;
        margin-left: auto !important;
        margin-top: 0 !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 4px !important;
        flex: 0 0 auto;
        max-width: calc(100% - 140px);
    }

    .header_element2 .btn,
    .header_element2 a.btn {
        font-size: 11px !important;
        padding: 4px 8px !important;
        white-space: nowrap;
    }

    #languagePicker {
        font-size: 11px !important;
        padding: 4px 6px !important;
        max-width: 100px;
    }

    /* Row 2: ICV + social icons — full width, centered, padded */
    .social-icons {
        width: 100% !important;
        order: 99;
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        padding: 6px 0 4px !important;
        border-top: 1px solid rgba(255,255,255,0.2);
        margin-top: 2px;
    }

    .icv_header_logo {
        float: none !important;
        height: 26px !important;
        margin-right: 4px !important;
        vertical-align: middle;
    }

    .social-icons span {
        display: inline-flex;
        align-items: center;
    }

    .social-icons span img {
        height: 24px !important;
        width: 24px !important;
    }
}

/* Extra small phones */
@media (max-width: 479px) {

    .header2024 {
        padding-bottom: 6px !important;
    }

    .header2024 .wrapper {
        padding: 6px 8px 2px !important;
        gap: 4px;
    }
    .logo {
        width:auto;
        top:-6px;
    }

    .logo img {
        height: 40px !important;
        width: auto !important;
    }

    .header_element2 {
        gap: 3px !important;
        max-width: calc(100% - 110px);
    }

    .header_element2 .btn,
    .header_element2 a.btn {
        font-size: 10px !important;
        padding: 3px 5px !important;
    }

    #languagePicker {
        font-size: 10px !important;
        padding: 3px 4px !important;
        max-width: 80px;
    }

    .social-icons {
        gap: 5px !important;
        padding: 6px 0 3px !important;
    }

    .social-icons span img {
        height: 22px !important;
        width: 22px !important;
    }

    .icv_header_logo {
        height: 22px !important;
    }
}

/* -------------------------------------------------------
   2. SEARCH BAR - Fix input and button sizing on mobile
------------------------------------------------------- */

@media (max-width: 767px) {
    .search-main-bar {
        border-radius: 30px;
        padding: 2px 4px;
    }

    .search-box {
        height: 40px !important;
        font-size: 14px !important;
        padding: 0 12px !important;
    }

    .search-btn {
        height: 32px !important;
        width: auto !important;
        flex-shrink: 0;
    }

    .ai-search-btn {
        height: 32px !important;
        width: auto !important;
        flex-shrink: 0;
    }

    .search-buttons {
        gap: 6px;
        margin-left: 6px;
    }
}

@media (max-width: 479px) {
    .search-box {
        height: 36px !important;
        font-size: 13px !important;
        padding: 0 10px !important;
    }

    .search-btn {
        height: 28px !important;
    }

    .ai-search-btn {
        height: 28px !important;
    }

    .search_box {
        margin: 5px 8px !important;
        padding: 4px 0 !important;
    }
}

/* -------------------------------------------------------
   3. TOP BANNER SLIDER - Fix overflow on mobile
------------------------------------------------------- */

@media (max-width: 767px) {
    .topbannerDIV2024 {
        height: auto !important;
        min-height: 60px;
        overflow: hidden;
    }

    .sliderTopbannernew img,
    .topbannerDIV2024 img {
        width: 100% !important;
        height: auto !important;
        max-height: 100px;
        object-fit: cover;
    }
}

@media (max-width: 479px) {
    .sliderTopbannernew img,
    .topbannerDIV2024 img {
        max-height: 70px;
    }
}

/* -------------------------------------------------------
   4. HOME BANNER ADS - 2 per row on all mobile sizes
------------------------------------------------------- */

@media (max-width: 991px) {

    #bannersDIV,
    .home_banner_ads {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        justify-content: center !important;
        align-items: flex-start !important;
        padding: 6px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    #bannersDIV .abanner,
    .home_banner_ads .abanner {
        flex: 0 0 calc(50% - 4px) !important;
       
        display: block !important;
        box-sizing: border-box !important;
        float: none !important;
    }

    #bannersDIV .abanner img,
    .home_banner_ads .abanner img {
        width: 100% !important;
        height: auto !important;
        display: block !important;
        border-radius: 4px;
    }
}  */

/* -------------------------------------------------------
   5. STATS / VISITORS CARDS - Fix margins and layout
------------------------------------------------------- */

@media (max-width: 767px) {
    .states-div .row.g-3 {
        margin-right: 5px !important;
        margin-left: 5px !important;
    }

    .visitors-card {
        min-width: unset !important;
        width: 100%;
        padding: 8px 4px !important;
    }

    .visitors-card .visitor-count {
        font-size: 16px !important;
    }

    .visitors-card .visitor-label {
        font-size: 11px !important;
    }

    .visitors-card .badge-icon img {
        width: 36px !important;
        height: 36px !important;
    }

    .visitors-card::before {
        margin-left: 0 !important;
    }
}

@media (max-width: 479px) {
    .states-div .row.g-3 {
        margin-right: 4px !important;
        margin-left: 4px !important;
    }

    .visitors-card {
        padding: 6px 4px !important;
    }
}

/* -------------------------------------------------------
   6. HOME DATA WIDGETS - Stack rows on mobile
------------------------------------------------------- */

@media (max-width: 767px) {
    .home_data_widget_v2 {
        margin-bottom: 8px;
    }

    .home_data_widget_v2 img {
        width: 100% !important;
        height: auto !important;
    }
}

@media (max-width: 479px) {
    .states-div .row:not(.g-3) {
        margin-top: 8px !important;
    }
}

/* -------------------------------------------------------
   7. TRENDING BLOG PANEL - Fix fixed height overflow
------------------------------------------------------- */

@media (max-width: 767px) {
    .trending-inner {
        height: auto !important;
        min-height: 120px;
        flex-wrap: wrap;
        gap: 8px !important;
    }

    .blog-thumb {
        width: 100px !important;
        flex-shrink: 0;
    }

    .blog-thumb img {
        height: 70px !important;
    }

    .blog-content {
        font-size: 11px !important;
    }
}

@media (max-width: 479px) {
    .trending-inner {
        flex-direction: column !important;
    }

    .blog-thumb {
        width: 100% !important;
    }

    .blog-thumb img {
        height: 100px !important;
        width: 100% !important;
        object-fit: cover;
    }
}

/* -------------------------------------------------------
   8. TAGLINE BAR - Responsive font sizes
------------------------------------------------------- */

@media (max-width: 767px) {
    .tagline-bar h6 {
        font-size: 16px !important;
    }

    .tagline-sub {
        font-size: 10px !important;
    }

    .tagline-bar {
        padding: 8px !important;
        background-size: cover !important;
    }
}

@media (max-width: 479px) {
    .tagline-bar h6 {
        font-size: 14px !important;
    }
}

/* -------------------------------------------------------
   9. LATEST / MOST SEARCH SECTIONS
------------------------------------------------------- */

@media (max-width: 767px) {
    .latest_most_search h4 {
        font-size: 11px !important;
    }

    .latest_most_search,
    .latest_most_search a {
        font-size: 10px !important;
    }
}



/* -------------------------------------------------------
   10. JOIN US BUTTON - Fix off-screen position
------------------------------------------------------- */

@media (max-width: 767px) {
    .join_us_div {
        right: -20px !important;
        bottom: 80px;
        z-index: 999;
    }

    .join_us_div img {
        height: 40px !important;
    }
}

/* -------------------------------------------------------
   11. FOOTER - Improve mobile layout
------------------------------------------------------- */

@media (max-width: 767px) {
    .qd-footer .col-lg-2,
    .qd-footer .col-lg-6,
    .qd-footer .col-lg-4 {
        text-align: center !important;
        padding: 8px !important;
    }

    .qd-footer .more_buttons .col-lg-6,
    .qd-footer .more_buttons .col-xs-6 {
        width: 50% !important;
    }

    .qd-footer .btn {
        font-size: 10px !important;
        padding: 4px 6px !important;
        margin-bottom: 4px;
    }

    .qd-footer h2 {
        font-size: 11px !important;
    }

    .qd-footer p {
        font-size: 10px !important;
    }

    .qd-footer img {
        max-width: 80px !important;
    }
}

/* -------------------------------------------------------
   12. GENERAL UTILITY - Prevent horizontal scroll
------------------------------------------------------- */

@media (max-width: 767px) {
    body {
        overflow-x: hidden;
    }

    .wrapper {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
}

/* -------------------------------------------------------
   13. CLIENT LOGO SLIDER - Contain within screen
------------------------------------------------------- */

@media (max-width: 767px) {
    #jssor_1 {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden;
    }
}

/* -------------------------------------------------------
   14. MODAL - Fix width on small screens
------------------------------------------------------- */

@media (max-width: 767px) {
    .modal-md {
        width: 95% !important;
        margin: 5px auto !important;
    }

    .modal-contentmy {
        padding: 20px !important;
        padding-top: 30px !important;
    }
}
