/*
=================================================================
  ✅ 1. MOBILE HEADER & HORIZONTAL SCROLLING (For screens < 992px)
=================================================================
*/
@media (max-width: 991.98px) {
    /* --- Base Layout & Logo Centering --- */
    .header-mobile .container {
        position: relative;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .header-mobile .logo {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }

    /* --- Icon Visibility & Arrangement --- */
    .header-mobile .header-tool-icon {
        display: none !important;
    }

    .header-tools-mobile {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.75rem;
        order: 3; /* Ensure it's on the right side */
        height: 100%; /* Match parent height */
    }

    /* Unified height and alignment for all header tools items */
    .header-mobile .header-tools__item {
        display: flex !important;
        align-items: center;
        justify-content: center;
        margin: 0;
        padding: 0;
        height: 40px; /* Fixed height for all items */
        min-height: 40px;
        line-height: 1;
        vertical-align: middle;
    }

    .header-tools-mobile .header-tools__item:first-child {
        order: 1; /* Language switcher first */
        height: 40px; /* Same height as other items */
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Ensure all header tools items are aligned with same height */
    .header-tools-mobile .header-tools__item {
        display: flex;
        align-items: center;
        justify-content: center;
        vertical-align: middle;
        height: 40px;
        min-height: 40px;
        line-height: 1;
    }

    /* Language switcher link alignment */
    .header-tools-mobile .header-tools__item a {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        line-height: 1;
        vertical-align: middle;
    }

    /* --- Styling for User Actions inside the Slide-out Panel --- */
    .mobile-nav-panel .panel-footer {
        border-top: 1px solid #e0e0e0;
        padding: 1rem 1.5rem;
        margin-top: auto;
    }

    .panel-user-actions .btn {
        text-transform: uppercase;
        font-weight: 600;
        width: 100%;
    }

    .panel-footer .social-links {
        justify-content: center;
        gap: 1.5rem;
    }


    /* --- Horizontal Scrolling for Sections --- */
    .swiper.markets-swiper,
    .swiper.products-swiper {
        margin-left: -15px;
        margin-right: -15px;
        padding: 0 15px 10px 15px;
        cursor: grab;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-height: 350px; /* Ensure minimum height */
    }

    .markets-swiper .swiper-slide {
        width: 75%;
        max-width: 320px;
        min-width: 280px;
        height: auto;
    }

    .products-swiper .swiper-slide {
        width: 75%;
        max-width: 320px;
        min-width: 280px;
        height: auto;
    }

    /* Fallback for when Swiper is not loaded */
    .markets-swiper:not(.swiper-initialized),
    .products-swiper:not(.swiper-initialized) {
        display: flex !important;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scrollbar-width: thin;
    }

    .markets-swiper:not(.swiper-initialized) .swiper-wrapper,
    .products-swiper:not(.swiper-initialized) .swiper-wrapper {
        display: flex;
        flex-direction: row;
    }

    .markets-swiper:not(.swiper-initialized) .swiper-slide,
    .products-swiper:not(.swiper-initialized) .swiper-slide {
        flex: 0 0 75%;
        scroll-snap-align: start;
    }

    @media (min-width: 576px) {
        .markets-swiper .swiper-slide {
            width: 50%;
        }

        .products-swiper .swiper-slide {
            width: 50%;
        }
    }

    @media (min-width: 768px) {
        .markets-swiper .swiper-slide {
            width: 40%;
        }

        .products-swiper .swiper-slide {
            width: 40%;
        }
    }

    .swiper-scrollbar {
        background: rgba(0, 0, 0, 0.1);
        position: relative;
        bottom: -10px;
        left: 15px;
        width: calc(100% - 30px);
        height: 4px;
        margin-top: 20px;
    }

    .swiper-scrollbar-drag {
        background: var(--wm-red, #a52a2a);
        border-radius: 2px;
    }
}

/*
=================================================================
  ✅ 2. MOBILE FOOTER CENTERING FIX (النسخة النهائية والمؤكدة)
  NOTE: Footer styles moved to footer.css for comprehensive styling
=================================================================
*/
