/* =============================================
   Mobile Fixes - Prevent Horizontal Scroll
   ============================================= */

/* Desktop - Add horizontal margins and ensure proper overflow */
@media (min-width: 992px) {

    /* No vertical scroll on desktop */
    html {
        overflow-y: auto;
        overflow-x: hidden;
    }

    body {
        overflow-x: hidden;
        overflow-y: visible;
    }

    /* Ensure submenus can show properly on desktop */
    .tp-header-height,
    .tp-header-top-3__area,
    .tp-header-3__area {
        overflow: visible !important;
    }

    .tp-header-3__main-menu {
        overflow: visible !important;
    }

    .tp-main-menu-content {
        overflow: visible !important;
    }

    /* Ensure submenu dropdowns are visible */
    .submenu,
    .tp-submenu {
        overflow: visible !important;
    }
}

@media (min-width: 1200px) {

    .tp-header-top-3__area .container,
    .tp-header-3__area .container {
        padding-left: 30px;
        padding-right: 30px;
    }
}

@media (min-width: 1400px) {

    .tp-header-top-3__area .container,
    .tp-header-3__area .container {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Header Top Right Box - Responsive Email & Phone */
.tp-header-top-3__right-box ul {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    gap: 8px;
}

.tp-header-top-3__right-box li {
    margin-right: 0;
    font-size: 14px;
}

.tp-header-top-3__right-box li a {
    word-break: break-word;
    font-size: inherit;
}

/* Header Top Left Box - Social Icons */
.tp-header-top-3__left-box ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
    gap: 8px;
}

.tp-header-top-3__left-box li {
    margin: 0;
}

.tp-header-top-3__social {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Tablet & Mobile Specific Fixes */
@media (max-width: 991px) {

    /* Prevent horizontal overflow on mobile/tablet only */
    html,
    body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    .tp-header-height {
        overflow-x: hidden;
        width: 100%;
        height: auto;
    }

    .tp-header-top-3__area {
        overflow-x: hidden;
        width: 100%;
    }

    .tp-header-top-3__area .container {
        max-width: 100% !important;
        padding-left: 5px !important;
        padding-right: 5px !important;
        overflow-x: hidden;
    }

    .tp-header-3__area {
        overflow-x: hidden;
        width: 100%;
    }

    .tp-header-3__area .container {
        max-width: 100%;
        padding-left: 15px;
        padding-right: 15px;
        overflow-x: hidden;
    }

    /* Make header top items smaller on tablets */
    .tp-header-top-3__right-box li {
        font-size: 13px;
    }

    .tp-header-top-3__left-box li span {
        font-size: 13px;
    }

    .tp-header-top-3__social a {
        font-size: 15px;
    }
}

@media (max-width: 767px) {

    /* Make contact info smaller but keep visible */
    .tp-header-top-3__right-box li {
        font-size: 11px;
    }

    .tp-header-top-3__right-box li i {
        font-size: 12px;
        margin-right: 4px;
    }

    /* Reduce gap and make more compact */
    .tp-header-top-3__right-box ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 0px;
    }

    .tp-header-top-3__right-box li {
        font-size: 10px;
        line-height: 1.2;
    }

    /* Make "Suivez-nous" text smaller */
    .tp-header-top-3__left-box li span {
        font-size: 11px;
    }

    /* Make social icons slightly smaller */
    .tp-header-top-3__social a {
        font-size: 14px;
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Adjust header top spacing */
    .tp-header-top-3__area {
        padding: 4px 0 !important;
    }

    .tp-header-top-3__social {
        padding: 4px 8px !important;
        gap: 6px !important;
    }

    /* Ensure logo doesn't overflow */
    .tp-header-3__logo {
        max-width: 100%;
        overflow: hidden;
    }

    .tp-header-3__logo img {
        max-width: 100%;
        height: auto;
    }

    /* Header right actions */
    .tp-header-3__right-action ul {
        gap: 8px;
    }

    /* Ensure all containers are constrained on mobile */
    .container,
    .container-fluid {
        overflow-x: hidden !important;
        max-width: 100vw;
    }

    /* Row fixes */
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }

    .row>[class*='col-'] {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Prevent any element from causing overflow on mobile */
    * {
        max-width: 100%;
    }

    img,
    video,
    iframe {
        max-width: 100% !important;
        height: auto;
    }
}

@media (max-width: 576px) {

    /* Extra small screens - keep everything visible but compact */
    .tp-header-top-3__right-box li {
        font-size: 10px;
    }

    .tp-header-top-3__right-box li i {
        font-size: 11px;
        margin-right: 3px;
    }

    /* Keep email and phone stacked */
    .tp-header-top-3__right-box ul {
        gap: 3px;
    }

    /* Compact social area */
    .tp-header-top-3__left-box {
        padding: 5px 0;
    }

    /* Hide "Suivez-nous:" text on very small screens but keep icons */
    .tp-header-top-3__left-box li span {
        display: none;
    }

    .tp-header-top-3__left-box ul {
        justify-content: flex-end;
        gap: 4px;
    }

    .tp-header-top-3__social a {
        font-size: 13px;
        width: 26px;
        height: 26px;
    }

    .tp-header-top-3__social {
        gap: 6px;
    }

    /* Reduce header padding */
    .tp-header-3__area .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Make logo slightly smaller on very small screens */
    .tp-header-3__logo img {
        max-height: 50px;
        width: auto;
    }
}

@media (max-width: 420px) {

    /* Ultra small screens - even more compact */
    .tp-header-top-3__right-box li {
        font-size: 9px;
    }

    .tp-header-top-3__right-box li i {
        font-size: 10px;
        margin-right: 2px;
    }

    .tp-header-top-3__social a {
        font-size: 12px;
        width: 24px;
        height: 24px;
    }

    .tp-header-top-3__social {
        gap: 4px;
    }

    .tp-header-top-3__area {
        padding: 8px 0;
    }
}

/* Ensure Bootstrap containers don't cause overflow on mobile/tablet */
@media (max-width: 991px) {
    .container {
        max-width: 100% !important;
    }
}