/**
 * Mobile Styles
 * Loaded on all pages - rules apply only below 768px
 */

/* Hamburger button - hidden unless JS enables mobile nav */
.mobile-menu-toggle {
    display: none;
}

@media (max-width: 768px) {

    /* ---------- Page containers ---------- */
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* ---------- Sidebars removed on mobile ---------- */
    .page-sidebar,
    .home-sidebar,
    aside.sidebar {
        display: none;
    }

    .page-main,
    .home-main {
        width: 100%;
        flex: none;
        min-width: 0;
        order: unset;
    }

    .page-layout,
    .home-layout {
        display: block;
        gap: 0;
        padding: 16px 0;
    }

    /* ---------- Header / Hamburger menu ---------- */
    header .container {
        position: relative;
    }

    .header-top {
        position: relative;
        flex-direction: row;
        align-items: center;
        text-align: left;
        padding: 12px 16px;
        padding-right: 70px;
    }

    .site-branding .site-title {
        font-size: 18px;
    }

    /* Compact social row on mobile */
    .social-media {
        gap: 8px;
    }

    .follow-text {
        display: none;
    }

    /* Hamburger toggle button (injected by js/mobile.js) */
    body.has-mobile-nav .mobile-menu-toggle {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        position: absolute;
        top: 50%;
        right: 0;
        transform: translateY(-50%);
        width: 44px;
        height: 44px;
        padding: 0;
        border: none;
        border-radius: 8px;
        background: #003366;
        cursor: pointer;
        z-index: 50;
    }

    .mobile-menu-toggle .menu-bar {
        display: block;
        width: 20px;
        height: 2px;
        background: #fff;
        border-radius: 2px;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    /* Hamburger -> X animation */
    body.nav-open .mobile-menu-toggle .menu-bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    body.nav-open .mobile-menu-toggle .menu-bar:nth-child(2) {
        opacity: 0;
    }

    body.nav-open .mobile-menu-toggle .menu-bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Nav collapsed by default - toggled instantly by JS (no reload) */
    body.has-mobile-nav .main-navigation {
        max-height: 0;
        overflow: hidden;
        border-top: none;
        transition: max-height 0.3s ease;
    }

    body.has-mobile-nav.nav-open .main-navigation {
        max-height: 75vh;
        overflow-y: auto;
        border-top: 1px solid #ddd;
    }

    /* Stacked full-width menu items */
    .main-navigation ul {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
    }

    .main-navigation ul li {
        width: 100%;
        border-bottom: 1px solid #eee;
    }

    .main-navigation ul li:last-child {
        border-bottom: none;
    }

    .main-navigation ul li:not(:last-child)::after {
        display: none;
    }

    .main-navigation ul li a {
        display: block;
        width: 100%;
        padding: 14px 16px;
        font-size: 15px;
        text-align: left;
    }

    .main-navigation ul li ul.sub-menu {
        padding-left: 16px;
    }

    /* ---------- Product listing: 1 per row ---------- */
    body .woocommerce ul.products,
    body .woocommerce-page ul.products,
    body .woocommerce .products {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }

    body .woocommerce ul.products > li,
    body .woocommerce ul.products > .product,
    body .woocommerce ul.products > .product-category,
    body .woocommerce-page ul.products > li,
    body .woocommerce-page ul.products > .product-category {
        width: 100%;
        max-width: none;
        margin: 0;
    }

    .woocommerce .product .product-image {
        min-height: 160px;
    }

    .woocommerce .product img {
        max-height: 160px;
    }

    /* Related products slider: 1 per view on mobile
       (style-product.css keeps flex layout; this file loads after it) */
    .related.products ul.products {
        display: flex;
    }

    .related.products ul.products > .product {
        flex-basis: 100%;
    }

    /* ---------- Tap targets ---------- */
    .woocommerce .product .button,
    .search-widget .search-submit {
        min-height: 44px;
    }

    /* ---------- Product page tabs ---------- */
    .woocommerce div.product .woocommerce-tabs ul.tabs li a {
        padding: 10px 14px;
        font-size: 14px;
    }

    .woocommerce ul.products{
    display: list-item;
    }


    .woocommerce ul.products[class*=columns-] li.product, .woocommerce-page ul.products[class*=columns-] li.product {
        width: 100% !important;
    }


    body.tax-product_cat .page-main, body.post-type-archive-product .page-main{
        width: 100%;
    }
}

