/* ==========================================================================
   MOBILE-FIXES.CSS — Comprehensive mobile-first responsive overrides
   -----
   Goals:
   • No horizontal overflow on any viewport (375px and up)
   • Fluid typography with clamp() for smooth scaling
   • Compact sticky header with hamburger + bottom-nav on mobile
   • Single-column layouts on mobile; multi-column on tablet/desktop
   • Touch-friendly tap targets (>=44px), readable fonts (>=13px body)
   • Safe-area-inset support for notched phones
   • Override stray global rules from woocommerce.css (bottom-nav leak etc.)
   • Proper RTL mobile layout
   ========================================================================== */

/* ===== 1. ROOT GUARDS — prevent horizontal scroll ===== */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -webkit-overflow-scrolling: touch;
    text-size-adjust: 100%;
}

* { box-sizing: border-box; }

img, picture, video, svg, iframe, embed, canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

table { max-width: 100%; }

/* Force breaking of long strings (URLs, long Persian words, code) */
p, li, h1, h2, h3, h4, h5, h6, span, a, td, th, div, blockquote {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
}

/* Containers — fluid by default */
.container,
.topbar-inner,
.nav-inner,
.trust-inner,
.footer-inner,
.footer-bottom,
.sec-inner,
.hero-inner,
.pargas-admin-body {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
}

/* ===== 2. ROOT FLUID TYPOGRAPHY ===== */
html {
    /* 14px @ 360px → 16px @ 768px → 17px @ 1280px */
    font-size: clamp(14px, 0.6rem + 1vw, 17px);
}

body {
    font-size: 14px;
    line-height: 1.7;
}

h1 { font-size: clamp(1.4rem, 5vw + 0.4rem, 2.4rem); line-height: 1.35; }
h2 { font-size: clamp(1.2rem, 3.5vw + 0.4rem, 2rem); line-height: 1.4; }
h3 { font-size: clamp(1.05rem, 2.5vw + 0.4rem, 1.5rem); line-height: 1.45; }
h4 { font-size: clamp(0.95rem, 1.5vw + 0.5rem, 1.15rem); line-height: 1.5; }

/* ===== 3. TOPBAR — hide on very small screens, simplify ===== */
@media (max-width: 899px) {
    .topbar { padding: .3rem 0; font-size: 11px; }
    .topbar-inner {
        padding: 0 14px;
        gap: 8px;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow: hidden;
        white-space: nowrap;
    }
    .topbar a { margin-right: 10px; font-size: 11px; }
    /* Hide long content like address in topbar on mobile to save space */
    .topbar .topbar-address,
    .topbar .topbar-hours { display: none !important; }
    /* Topbar right side: keep only essential items */
    .topbar-right { gap: 10px !important; }
}

@media (max-width: 479px) {
    .topbar { font-size: 10.5px; }
    .topbar a { margin-right: 8px; }
    /* On very small phones, hide topbar entirely (we have nav + bottom-nav) */
    .topbar { display: none; }
}

/* ===== 4. NAV / HEADER — compact sticky mobile header ===== */
@media (max-width: 899px) {
    .nav { position: sticky; top: 0; z-index: 200; }
    .nav-inner {
        height: 58px;
        padding: 0 14px;
        gap: 10px;
        flex-wrap: nowrap;
    }
    .logo { gap: 8px; }
    .logo-mark { width: 34px; height: 34px; border-radius: 9px; }
    .logo-text span:first-child { font-size: 13px; }
    .logo-text span:last-child { font-size: 9.5px; }
    .logo img { max-height: 38px !important; max-width: 150px !important; }

    /* Hide desktop nav-links, search, CTAs */
    .nav-mid,
    .nav-links,
    .nav-search,
    .nav-ctas { display: none !important; }

    /* Mobile icons */
    .nav-icons {
        display: flex !important;
        gap: 4px;
        flex-shrink: 0;
        margin-right: auto; /* push hamburger to the far edge in RTL */
    }
    .icon-btn { width: 38px; height: 38px; border-radius: 10px; }
    .icon-btn svg { width: 18px; height: 18px; }

    /* Hamburger always visible on mobile */
    .hamburger {
        display: flex !important;
        flex-direction: column;
        gap: 4px;
        cursor: pointer;
        padding: 6px;
        margin-left: 2px;
    }
    .hamburger span {
        width: 22px;
        height: 2px;
        background: var(--mid, #475569);
        border-radius: 2px;
        transition: all .3s;
    }
    .hamburger.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .hamburger.active span:nth-child(2) { opacity: 0; }
    .hamburger.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

    /* Mobile search — compact pill */
    .mobile-search {
        display: block !important;
        padding: 0 14px 10px;
        background: #fff;
        border-bottom: 1px solid #E2E8F0;
    }
    .mobile-search .searchbar {
        padding: 8px 14px;
        gap: 6px;
        border-radius: 99px;
    }
    .mobile-search .searchbar input { font-size: 13px; }

    /* Mobile nav drawer */
    .mobile-nav {
        display: none;
        flex-direction: column;
        background: #fff;
        border-bottom: 1px solid #E2E8F0;
        padding: 8px 14px 14px;
        max-height: 70vh;
        overflow-y: auto;
        box-shadow: 0 16px 32px rgba(14,42,92,.08);
    }
    .mobile-nav.open { display: flex; }
    .mobile-nav a {
        padding: 12px 6px;
        font-size: 14px;
        font-weight: 600;
        color: #334155;
        border-bottom: 1px solid #F1F5F9;
        text-decoration: none;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }
    .mobile-nav a:last-child { border-bottom: none; }
    .mobile-nav a.active { color: #2563EB; background: #EFF6FF; border-radius: 8px; padding-inline: 10px; }

    /* Show CTAs inside mobile-nav drawer instead of nav bar */
    .mobile-nav .nav-cta-row {
        display: flex !important;
        gap: 8px;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #F1F5F9;
    }
    .mobile-nav .nav-cta-row .btn { flex: 1; justify-content: center; font-size: 12.5px; padding: 10px 12px; }
}

/* ===== 5. TRUST BAR — horizontal scroll on mobile ===== */
@media (max-width: 899px) {
    .trust { padding: 8px 0; }
    .trust-inner {
        padding: 0 14px;
        gap: 1.2rem;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .trust-inner::-webkit-scrollbar { display: none; }
    .trust-inner .trust-item { font-size: 11px; padding: 0; flex-shrink: 0; }
    .trust-item { padding: 0 1.2rem; font-size: 11.5px; }
}

/* ===== 6. HERO ===== */
@media (max-width: 899px) {
    .hero { padding: 32px 0; min-height: auto !important; }
    .hero-inner {
        grid-template-columns: 1fr !important;
        gap: 24px;
        padding: 0 14px !important;
    }
    .hero h1 { font-size: clamp(1.6rem, 6vw + 0.4rem, 2.2rem); line-height: 1.3; }
    .hero p { font-size: 14px; line-height: 1.8; }
    .hero-btns {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    .hero-btns .btn {
        width: 100%;
        justify-content: center;
        font-size: 13.5px;
        padding: 12px 16px;
    }
    .hero-stats {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    .hstat-num { font-size: 1.4rem; }
    .hstat-lbl { font-size: 11px; }
}

/* ===== 7. STATS GRID ===== */
@media (max-width: 899px) {
    .stats-inner {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
        padding: 0 14px;
    }
    .stat-item { padding: 18px 14px; }
    .stat-num { font-size: 1.8rem; }
    .stat-lbl { font-size: 12px; }
}

/* ===== 8. SECTION HEADERS ===== */
@media (max-width: 899px) {
    .sec { padding: 36px 0 !important; }
    .sec-inner { padding: 0 14px !important; }
    .sec-header { margin-bottom: 24px; }
    .sec-header h2 { font-size: clamp(1.3rem, 4vw + 0.4rem, 1.8rem); }
    .sec-header p { font-size: 13px; }
}

/* ===== 9. PRODUCT GRID (homepage) ===== */
@media (max-width: 599px) {
    .pgrid,
    ul.products,
    .pgrid-shop,
    .ngrid,
    .fgrid,
    .cgrid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
}
@media (min-width: 600px) and (max-width: 899px) {
    .pgrid,
    ul.products,
    .pgrid-shop,
    .ngrid,
    .fgrid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
    }
    .cgrid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Product cards — fluid */
.pcard,
li.product {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    overflow: hidden;
    transition: all .25s;
}
.pcard-body { padding: 14px; }
.pcard-body h3 { font-size: 14px; font-weight: 700; line-height: 1.5; margin-bottom: 8px; }
.pcard-img { aspect-ratio: 4/3; overflow: hidden; }
.pcard-img img { width: 100%; height: 100%; object-fit: cover; }

/* ===== 10. SINGLE PRODUCT PAGE ===== */
@media (max-width: 899px) {
    .pp-layout,
    .single-product .product,
    .single-product div.product {
        display: flex !important;
        flex-direction: column !important;
        gap: 18px !important;
        padding: 0 14px !important;
    }
    /* Gallery */
    .gallery,
    .pp-gallery,
    .woocommerce-product-gallery {
        width: 100% !important;
        max-width: 100% !important;
    }
    .gallery-main,
    .woocommerce-product-gallery__image {
        aspect-ratio: 1/1 !important;
        border-radius: 14px !important;
        overflow: hidden;
    }
    .gallery-main img,
    .woocommerce-product-gallery__image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 14px;
    }
    .gallery-badge {
        top: 10px !important;
        right: 10px !important;
        font-size: 10.5px !important;
        padding: 4px 10px !important;
    }
    /* Thumbnails — horizontal scroll on mobile */
    .thumb-strip {
        display: flex !important;
        overflow-x: auto;
        gap: 8px !important;
        padding-bottom: 4px;
        scrollbar-width: none;
    }
    .thumb-strip::-webkit-scrollbar { display: none; }
    .thumb {
        flex: 0 0 64px !important;
        width: 64px !important;
        height: 64px !important;
        border-radius: 10px !important;
    }
    .thumb img { width: 100%; height: 100%; object-fit: cover; }

    /* Buy box / info */
    .buybox,
    .pp-info,
    .single-product .summary,
    .single-product .product .summary {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }
    .product-head h1,
    .pp-info h1,
    .single-product .product_title {
        font-size: clamp(1.25rem, 4vw + 0.4rem, 1.7rem) !important;
        line-height: 1.4 !important;
        margin-bottom: 8px !important;
    }
    .sku-row { font-size: 11px !important; margin-bottom: 6px !important; }
    .rating-row { flex-wrap: wrap; gap: 6px !important; font-size: 12px !important; }
    .cert-strip { gap: 5px !important; }
    .cert-pill { font-size: 10.5px !important; padding: 4px 9px !important; }
    .cert-pill svg { width: 11px !important; height: 11px !important; }

    /* Price box */
    .price-box { padding: 14px !important; border-radius: 12px !important; }
    .price-now,
    .pp-price,
    .single-product .price {
        font-size: 1.4rem !important;
        margin-bottom: 8px !important;
        display: block;
    }
    .price-row {
        flex-wrap: wrap;
        gap: 6px !important;
    }
    .price-unit { font-size: 11px !important; }
    .price-save { font-size: 10px !important; padding: 2px 7px !important; }
    .price-note { font-size: 11.5px !important; line-height: 1.7 !important; }
    .bulk-note { font-size: 11.5px !important; padding: 8px 11px !important; line-height: 1.6 !important; }

    /* Size chips */
    .size-select-row {
        flex-wrap: wrap;
        gap: 6px !important;
        margin-bottom: 10px !important;
    }
    .size-select-row .size-chip {
        font-size: 11.5px !important;
        padding: 6px 11px !important;
    }

    /* Quantity + CTA */
    .qty-row {
        flex-wrap: wrap;
        gap: 8px !important;
        margin-bottom: 10px !important;
    }
    .qty-label { font-size: 12px !important; }
    .qty-stepper { border-radius: 9px !important; }
    .qty-stepper button,
    .qty-stepper input {
        padding: 8px 12px !important;
        font-size: 13px !important;
    }
    .cta-row,
    .pp-actions,
    .single-product .cart,
    .single-product .product .cart {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }
    .cta-row .btn,
    .cta-row button,
    .pp-actions .btn,
    .pp-actions button,
    .btn-buy,
    .single-product .cart button,
    .single-product .cart .button,
    .single-product .product .cart button,
    .single-product .product .cart .button {
        width: 100% !important;
        justify-content: center;
        padding: 12px 14px !important;
        font-size: 13.5px !important;
        border-radius: 10px !important;
    }

    /* Spec grid */
    .spec-grid,
    .pp-specs {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
    }
    .spec-item,
    .spec-grid > div { padding: 9px 11px !important; font-size: 12px !important; }

    /* FAQ / uses / ingredients / certs sections */
    .pp-section,
    .pp-faq,
    .pp-uses,
    .pp-certs,
    .pp-ingredients,
    .faq-item,
    .uses-card,
    .ingredients-card,
    .certs-card { padding: 14px !important; border-radius: 12px !important; }
    .pp-section h3,
    .pp-faq h3,
    .faq-item h4,
    .uses-card h3,
    .ingredients-card h3,
    .certs-card h3 { font-size: 13.5px !important; margin-bottom: 10px !important; }
    .pp-section ul li,
    .pp-uses ul li,
    .pp-ingredients ul li { font-size: 12.5px !important; line-height: 1.9 !important; }

    /* Related products */
    .related.products,
    .upsells.products,
    .related,
    .upsells {
        padding: 0 14px !important;
        margin-top: 26px !important;
    }
    .related > h2,
    .upsells > h2 { font-size: 1.1rem !important; margin-bottom: 12px !important; }
    .related ul.products,
    .upsells ul.products {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    /* Tabs */
    .woocommerce-tabs ul.tabs {
        display: flex !important;
        flex-wrap: wrap;
        gap: 4px;
        padding: 0 !important;
        margin: 0 0 16px !important;
        border-bottom: 1px solid #E2E8F0;
    }
    .woocommerce-tabs ul.tabs li {
        flex: 1 1 auto;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
    }
    .woocommerce-tabs ul.tabs li a {
        display: block;
        padding: 10px 8px !important;
        font-size: 12.5px !important;
        text-align: center;
        border-bottom: 2px solid transparent;
    }
    .woocommerce-tabs ul.tabs li.active a {
        border-bottom-color: #2563EB;
        color: #2563EB !important;
    }
    .woocommerce-tabs .panel {
        padding: 14px !important;
        font-size: 13.5px !important;
        line-height: 1.9 !important;
    }
    /* Breadcrumb */
    .crumb {
        padding: 10px 14px !important;
        font-size: 11.5px !important;
        flex-wrap: wrap;
        gap: 4px;
    }
}

/* ===== 11. SHOP / ARCHIVE PAGE ===== */
@media (max-width: 899px) {
    .cat-layout,
    .archive .site-main > .cat-layout,
    .woocommerce.archive .cat-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 14px !important;
        padding: 0 14px !important;
    }

    /* Category intro / hero */
    .cat-intro {
        padding: 14px 0 !important;
    }
    .cat-intro h1 {
        font-size: 1.3rem !important;
        margin-bottom: 6px !important;
        line-height: 1.4 !important;
    }
    .cat-intro p {
        font-size: 12.5px !important;
        line-height: 1.7 !important;
    }

    /* Filter bar — sticky horizontal chips at top */
    .filter-bar {
        display: flex !important;
        position: sticky;
        top: 58px;
        z-index: 95;
        background: #fff;
        border-bottom: 1px solid #E2E8F0;
        padding: 10px 14px !important;
        gap: 8px;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
        margin: 0 -14px 14px;
    }
    .filter-bar::-webkit-scrollbar { display: none; }
    .filter-chip {
        flex-shrink: 0;
        background: #F1F5F9;
        border: 1px solid #E2E8F0;
        color: #334155;
        font-size: 12px;
        font-weight: 600;
        padding: 7px 14px;
        border-radius: 99px;
        cursor: pointer;
        font-family: inherit;
        white-space: nowrap;
    }
    .filter-chip.active {
        background: linear-gradient(135deg, #0E2A5C, #2563EB);
        color: #fff;
        border-color: transparent;
    }

    /* Filter sidebar — hidden by default on mobile, slides in as drawer */
    .filter-sidebar {
        display: none !important;
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        right: 0 !important;
        width: 88vw !important;
        max-width: 360px !important;
        z-index: 600 !important;
        background: #fff !important;
        padding: 18px 16px 30px !important;
        overflow-y: auto !important;
        box-shadow: -8px 0 32px rgba(0,0,0,.18) !important;
        border-radius: 0 !important;
        border: none !important;
        animation: slideInRight .25s ease;
    }
    .filter-sidebar.filter-open,
    .filter-sidebar.open {
        display: block !important;
    }
    @keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }

    /* Backdrop when filter sidebar is open */
    .filter-sidebar.filter-open::before,
    .filter-sidebar.open::before {
        content: '';
        position: fixed;
        top: 0; bottom: 0;
        right: 88vw;
        left: 0;
        background: rgba(0,0,0,.4);
        z-index: -1;
    }

    .filter-sidebar h4 {
        font-size: 14px !important;
        margin-bottom: 14px !important;
    }
    .fs-apply {
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        margin-top: 14px;
        padding: 12px !important;
        font-size: 13.5px !important;
    }

    /* Main column */
    .main-col { width: 100% !important; }

    /* Toolbar — result count + ordering */
    .toolbar,
    .woocommerce-result-count-wrap {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        padding: 8px 0 12px !important;
        align-items: stretch !important;
    }
    .toolbar > span,
    .woocommerce-result-count,
    .woocommerce-ordering {
        width: 100% !important;
        float: none !important;
        margin: 0 !important;
        font-size: 12px !important;
    }
    .woocommerce-ordering select,
    .orderby {
        width: 100% !important;
        padding: 9px 12px !important;
        font-size: 13px !important;
        border: 1px solid #E2E8F0 !important;
        border-radius: 9px !important;
        background: #fff !important;
    }

    /* Product card grid (within shop) */
    .main-col ul.products,
    .main-col .pgrid-shop {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    /* Two-column on slightly larger mobile */
    @media (min-width: 480px) {
        .main-col ul.products,
        .main-col .pgrid-shop {
            grid-template-columns: repeat(2, 1fr) !important;
        }
    }

    /* Product card — compact, touch-friendly */
    .pcard,
    li.product {
        border-radius: 12px !important;
        overflow: hidden;
    }
    .pcard-thumb,
    li.product .woocommerce-loop-product__featured-image-wrapper,
    li.product img {
        aspect-ratio: 1/1;
        border-radius: 0;
    }
    .pcard-img,
    li.product img.attachment-shop_catalog,
    li.product img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    .pcard-body,
    li.product .product-details,
    li.product .star-rating + a,
    li.product > a + * {
        padding: 10px 12px !important;
    }
    .pcard-body h3,
    .pcard-title,
    li.product .woocommerce-loop-product__title {
        font-size: 13px !important;
        line-height: 1.5 !important;
        margin-bottom: 6px !important;
        min-height: auto !important;
    }
    .pcard-price,
    li.product .price {
        font-size: 13.5px !important;
        font-weight: 700 !important;
        color: #0E2A5C !important;
    }
    .pcard-badge {
        font-size: 10px !important;
        padding: 3px 8px !important;
        top: 8px !important;
        right: 8px !important;
    }
    .pcard-cert {
        font-size: 9.5px !important;
        padding: 2px 6px !important;
    }
    .pcard-cart-btn,
    li.product .button,
    li.product .added_to_cart {
        width: 100% !important;
        text-align: center !important;
        padding: 9px 10px !important;
        font-size: 12px !important;
        border-radius: 9px !important;
        margin-top: 6px !important;
    }

    /* SEO block + related cats + FAQ — readable mobile widths */
    .seo-block {
        padding: 18px 0 !important;
    }
    .seo-block h2 { font-size: 1rem !important; margin-bottom: 8px !important; }
    .seo-block h3 { font-size: 0.95rem !important; margin: 12px 0 6px !important; }
    .seo-block p { font-size: 12.5px !important; line-height: 1.9 !important; }

    .related-cats { gap: 6px !important; padding: 10px 0 18px !important; }
    .related-cats .rel-chip,
    .related-cats a {
        font-size: 11.5px !important;
        padding: 6px 12px !important;
    }

    .faq-item,
    .faq-q,
    .faq-a {
        font-size: 12.5px !important;
    }
    .faq-q {
        padding: 12px !important;
    }
    .faq-a {
        padding: 0 12px 12px !important;
        line-height: 1.8 !important;
    }
}

/* ===== 12. CART / CHECKOUT ===== */
@media (max-width: 899px) {
    .cart-layout,
    .woocommerce-cart .cart-layout,
    .woocommerce-checkout .checkout {
        display: flex !important;
        flex-direction: column !important;
        gap: 18px !important;
        padding: 0 14px !important;
    }
    .cart-item {
        flex-wrap: wrap !important;
        gap: 10px !important;
        padding: 12px !important;
    }
    .cart-thumb { width: 56px !important; height: 56px !important; }
    .cart-info { flex: 1 1 calc(100% - 70px) !important; min-width: 0; }
    .cart-info h4,
    .cart-info .product-name a { font-size: 13px !important; }
    .cart-price-col {
        flex: 1 1 100% !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding-top: 8px;
        border-top: 1px dashed #E2E8F0;
    }
    .cart-price { font-size: 14px !important; }
    .qty-mini input { width: 36px !important; padding: 6px !important; font-size: 13px !important; }

    .summary-card,
    .cart_totals,
    .woocommerce-checkout-review-order {
        position: static !important;
        width: 100% !important;
        padding: 16px !important;
    }

    /* Checkout form */
    .woocommerce-billing-fields,
    .woocommerce-shipping-fields {
        padding: 0 !important;
    }
    .form-row,
    .woocommerce form .form-row {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 0 12px !important;
    }
    .form-row-first,
    .form-row-last {
        width: 100% !important;
        float: none !important;
    }
    .woocommerce form .form-row input.input-text,
    .woocommerce form .form-row textarea,
    .woocommerce form .form-row select {
        width: 100% !important;
        font-size: 14px !important;
        padding: 10px 12px !important;
    }
    #place_order,
    .checkout-button,
    .woocommerce button.button {
        width: 100% !important;
        padding: 14px !important;
        font-size: 14px !important;
    }

    /* Cart totals table — make it stack */
    .cart_totals table,
    .woocommerce-checkout-review-order-table {
        width: 100% !important;
    }
    .cart_totals th,
    .cart_totals td,
    .woocommerce-checkout-review-order-table th,
    .woocommerce-checkout-review-order-table td {
        padding: 8px 6px !important;
        font-size: 12.5px !important;
    }
}

/* ===== 13. MY ACCOUNT — fix double title + responsive ===== */
@media (max-width: 899px) {
    .panel-layout,
    .woocommerce-account .panel-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 14px !important;
        padding: 0 14px;
    }
    .panel-sidebar,
    .woocommerce-account .panel-sidebar {
        position: static !important;
        width: 100% !important;
    }
    .profile-card {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px !important;
    }
    .profile-avatar { width: 44px !important; height: 44px !important; font-size: 14px !important; }
    .profile-info h2,
    .profile-info .name { font-size: 14px !important; }
    .profile-info span { font-size: 11.5px !important; }

    /* Side menu — horizontal scroll on mobile OR accordion */
    .side-menu {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }
    .side-menu .grp-title {
        grid-column: 1 / -1;
        padding: 10px 4px 4px !important;
        font-size: 10px !important;
    }
    .side-menu a {
        padding: 10px 8px !important;
        font-size: 12px !important;
        background: #F8FAFC;
        border-radius: 9px;
        border: 1px solid #E2E8F0;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 4px !important;
    }
    .side-menu a svg { width: 18px !important; height: 18px !important; }
    .side-menu a .chev { display: none; }
    .side-menu a .count { font-size: 10px !important; padding: 1px 6px; border-radius: 99px; background: #DBEAFE; color: #2563EB; }

    .quick-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
    .quick-item {
        padding: 12px 4px !important;
        font-size: 10.5px !important;
    }
    .quick-item .ic {
        width: 36px !important;
        height: 36px !important;
        margin-bottom: 4px;
    }
    .quick-item .ic svg { width: 18px !important; height: 18px !important; }

    .credit-strip {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px !important;
    }
    .credit-strip .amt { font-size: 12px !important; }
    .credit-strip a { font-size: 10.5px !important; padding: 4px 9px !important; }

    .panel-section-head {
        flex-wrap: wrap;
        gap: 6px;
        margin: 18px 0 10px !important;
    }
    .panel-section-head h3 { font-size: 15px !important; }
    .panel-section-head a { font-size: 11.5px !important; }

    .track-card,
    .quote-card,
    .info-card,
    .addr-card {
        padding: 12px !important;
        margin-bottom: 10px !important;
    }
    .track-head {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    .track-head h4 { font-size: 12.5px !important; line-height: 1.6 !important; }
    .track-status { font-size: 10px !important; padding: 3px 8px !important; }
    .steps { gap: 2px !important; margin: 8px 0 !important; }
    .step-dot { width: 22px !important; height: 22px !important; }
    .step-line-track { height: 2px !important; }
    .step-labels { font-size: 9.5px !important; gap: 2px !important; }
    .step-labels span { font-size: 9.5px !important; }
    .track-foot {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
    }

    .info-row {
        flex-direction: column !important;
        gap: 2px !important;
        padding: 8px 0 !important;
        border-bottom: 1px solid #F1F5F9;
    }
    .info-row span:first-child { font-size: 11.5px !important; color: #64748B !important; }
    .info-row span:last-child { font-size: 13px !important; color: #0A1628 !important; font-weight: 600; }
}

/* ===== 14. WOOCOMMERCE LOGIN / REGISTER ===== */
@media (max-width: 899px) {
    .auth-wrap { padding: 20px 14px 40px !important; }
    .auth-box {
        padding: 22px 18px !important;
        border-radius: 16px !important;
    }
    .auth-tabs { padding: 3px !important; }
    .auth-tab { padding: 9px !important; font-size: 12.5px !important; }
    .field input,
    .otp-row input {
        font-size: 14px !important;
        padding: 11px 12px !important;
    }
    .otp-row { gap: 6px !important; }
    .otp-row input { width: 38px !important; height: 44px !important; text-align: center !important; }
    .b2b-note { font-size: 11px !important; padding: 10px !important; line-height: 1.7; }
}

/* ===== 15. BLOG / ARCHIVE / SEARCH ===== */
@media (max-width: 899px) {
    .blog-layout,
    .article-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 18px !important;
        padding: 0 14px !important;
    }
    .blog-sidebar,
    .article-sidebar {
        position: static !important;
        width: 100% !important;
        order: 2;
    }
    .post-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
    .featured-card {
        aspect-ratio: 4/3 !important;
        padding: 16px !important;
    }
    .featured-card h2 { font-size: 1.1rem !important; }
    .post-card,
    .article-card {
        padding: 0 !important;
        border-radius: 14px;
        overflow: hidden;
    }
    .post-card-img,
    .article-cover {
        aspect-ratio: 16/9;
    }
    .post-card-body,
    .article-card-body { padding: 14px !important; }
    .post-card-body h3,
    .article-card-body h3 { font-size: 14.5px !important; line-height: 1.55; }
    .post-card-meta,
    .article-meta { font-size: 11.5px !important; }
    .post-card-excerpt,
    .article-excerpt { font-size: 12.5px !important; line-height: 1.8; }

    .post-head h1,
    .article-title { font-size: 1.3rem !important; line-height: 1.5; margin: 10px 0 12px; }
    .cover { aspect-ratio: 16/9 !important; border-radius: 12px; }
    .article-body { font-size: 14px !important; line-height: 2 !important; }
    .article-body h2 { font-size: 1.15rem !important; margin: 18px 0 10px; }
    .article-body h3 { font-size: 1rem !important; margin: 14px 0 8px; }
    .article-body p { margin: 0 0 14px; }
    .article-body img { border-radius: 10px; margin: 14px 0; }
    .article-body blockquote {
        padding: 12px 14px !important;
        font-size: 13.5px !important;
        margin: 14px 0 !important;
        border-right: 3px solid #2563EB;
        background: #F8FAFC;
        border-radius: 0 8px 8px 0;
    }

    /* Related posts scroller */
    .rp-scroller {
        display: flex !important;
        overflow-x: auto;
        gap: 12px;
        padding-bottom: 8px;
        scrollbar-width: none;
    }
    .rp-scroller::-webkit-scrollbar { display: none; }
    .rp-scroller .rp-card {
        flex: 0 0 240px;
        max-width: 240px;
    }

    /* Pagination */
    .pagination,
    .woocommerce-pagination {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        justify-content: center;
        padding: 14px 0 !important;
    }
    .pagination a,
    .pagination span,
    .woocommerce-pagination a,
    .woocommerce-pagination span {
        min-width: 36px;
        height: 36px;
        padding: 0 10px !important;
        font-size: 13px !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* ===== 16. FOOTER — proper mobile layout ===== */
@media (max-width: 899px) {
    .footer { padding: 30px 0 0 !important; }
    .footer-inner {
        grid-template-columns: 1fr !important;
        gap: 22px !important;
        padding: 0 14px !important;
    }
    .footer .flogo { gap: 8px; margin-bottom: 8px; }
    .footer .flogo-mark { width: 38px; height: 38px; }
    .footer .flogo-name { font-size: 15px; }
    .footer .fdesc {
        font-size: 12.5px !important;
        line-height: 1.8 !important;
        max-width: 100% !important;
    }
    .footer .social-links {
        display: flex !important;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 14px;
    }
    .footer .social-btn {
        width: 38px !important;
        height: 38px !important;
        border-radius: 10px;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .footer .social-btn svg {
        width: 18px !important;
        height: 18px !important;
        stroke: rgba(255,255,255,.85) !important;
    }
    .footer .trust-badges {
        display: flex !important;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 14px;
    }
    .footer .trust-badge {
        font-size: 10.5px !important;
        padding: 4px 9px !important;
    }
    .footer .flinks h4 {
        font-size: 13px !important;
        margin-bottom: 10px !important;
        padding-bottom: 6px;
        border-bottom: 1px solid rgba(255,255,255,.08);
    }
    .footer .flinks ul { gap: 6px !important; }
    .footer .flinks ul li a { font-size: 12.5px !important; }

    .footer-bottom {
        flex-direction: column !important;
        text-align: center !important;
        gap: 6px !important;
        padding: 14px !important;
        font-size: 11.5px !important;
    }
    .footer-bottom span { font-size: 11.5px !important; }
}

/* ===== 17. BOTTOM-NAV — forced visible on mobile ===== */
/* This OVERRIDES the buggy global .bottom-nav{display:none} leak in woocommerce.css */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 250;
    background: #fff;
    border-top: 1px solid #E2E8F0;
    box-shadow: 0 -4px 16px rgba(14,42,92,.08);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}

/* Mobile: bottom-nav is FLEX (visible) */
@media (max-width: 899px) {
    .bottom-nav {
        display: flex !important;
        justify-content: space-around;
        align-items: stretch;
    }
    .bottom-nav .nav-item {
        flex: 1;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 6px 4px;
        font-size: 10.5px;
        font-weight: 600;
        color: #64748B;
        text-decoration: none;
        transition: color .2s;
        min-height: 50px;
    }
    .bottom-nav .nav-item svg {
        width: 22px;
        height: 22px;
        stroke: currentColor;
    }
    .bottom-nav .nav-item.active { color: #2563EB; }
    .bottom-nav .nav-item:hover { color: #2563EB; }

    /* Body padding so bottom-nav doesn't cover content */
    body { padding-bottom: calc(70px + env(safe-area-inset-bottom)) !important; }
}

/* Desktop: bottom-nav hidden */
@media (min-width: 900px) {
    .bottom-nav { display: none !important; }
    body { padding-bottom: 0 !important; }
}

/* ===== 18. CHATBOT — above bottom-nav on mobile ===== */
@media (max-width: 899px) {
    .chat-fab {
        position: fixed;
        bottom: calc(80px + env(safe-area-inset-bottom)) !important;
        left: 14px !important;
        z-index: 240;
    }
    .chat-toggle {
        width: 52px !important;
        height: 52px !important;
    }
    .chat-win {
        position: fixed;
        bottom: calc(140px + env(safe-area-inset-bottom)) !important;
        left: 14px !important;
        right: 14px !important;
        width: auto !important;
        max-width: calc(100vw - 28px) !important;
        max-height: 60vh !important;
    }
}

/* ===== 19. MODALS — full screen on mobile ===== */
@media (max-width: 899px) {
    .overlay {
        padding: 0 !important;
        align-items: stretch !important;
    }
    .mbox {
        max-width: 100% !important;
        width: 100% !important;
        max-height: 100vh !important;
        height: 100vh !important;
        border-radius: 0 !important;
        overflow-y: auto;
    }
    .m-header { padding: 18px 16px 12px !important; }
    .m-header h3 { font-size: 17px !important; }
    .m-header p { font-size: 13px !important; }
    .m-body { padding: 14px 16px 18px !important; }
    .mrow label { font-size: 12.5px !important; }
    .mrow input,
    .mrow select,
    .mrow textarea {
        font-size: 14px !important;
        padding: 11px 13px !important;
    }
    .mgrid-2 {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
    .m-footer {
        flex-direction: column-reverse !important;
        gap: 8px !important;
    }
    .m-footer button {
        width: 100% !important;
        padding: 13px !important;
        font-size: 14px !important;
    }
}

/* ===== 20. FORMS — touch-friendly ===== */
@media (max-width: 899px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="search"],
    input[type="url"],
    input[type="number"],
    textarea,
    select {
        width: 100%;
        font-size: 16px !important; /* >=16px prevents iOS zoom */
        padding: 11px 13px;
        border: 1.5px solid #E2E8F0;
        border-radius: 11px;
        background: #FAFBFF;
        color: #0A1628;
        outline: none;
        transition: border-color .2s;
    }
    input:focus,
    textarea:focus,
    select:focus {
        border-color: #2563EB;
        background: #fff;
        box-shadow: 0 0 0 4px rgba(37,99,235,.08);
    }
    label { font-size: 13px !important; font-weight: 600; color: #334155; }
    button,
    .btn,
    input[type="submit"] {
        min-height: 44px;
        font-size: 14px !important;
    }
    .btn { padding: 11px 18px; border-radius: 10px; }
}

/* ===== 21. ADMIN PANEL — responsive ===== */
@media (max-width: 899px) {
    .pargas-admin-body {
        flex-direction: column !important;
    }
    .pargas-tabs {
        width: 100% !important;
        flex-direction: row !important;
        overflow-x: auto;
        border: none !important;
        border-bottom: 1px solid #E2E8F0 !important;
        padding: 0 !important;
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 10;
    }
    .pargas-tab {
        white-space: nowrap;
        padding: 12px 14px !important;
        border: none !important;
        border-bottom: 3px solid transparent !important;
        font-size: 12.5px !important;
    }
    .pargas-tab.active { border-bottom-color: #2563EB !important; }
    .pargas-content { padding: 14px !important; }
    .pargas-field-row { grid-template-columns: 1fr !important; }
}

/* ===== 22. PAGE TITLE — prevent duplicates on WC pages ===== */
/* WooCommerce pages: hide the WP-inserted H1 (we have our own breadcrumb/title in templates) */
.woocommerce-account .entry-title,
.woocommerce-cart .entry-title,
.woocommerce-checkout .entry-title,
.woocommerce-page .entry-title,
.woocommerce .entry-title,
body.woocommerce-account .entry-title,
body.woocommerce-cart .entry-title,
body.woocommerce-checkout .entry-title {
    display: none !important;
}

/* Also hide any duplicate page header WooCommerce might add */
.woocommerce-account .woocommerce-page-title,
.woocommerce-cart .woocommerce-page-title,
.woocommerce-checkout .woocommerce-page-title {
    display: none !important;
}

/* Generic page title styling for non-WC pages */
@media (max-width: 899px) {
    main.container > h1,
    .page-title {
        font-size: 1.4rem !important;
        margin: 14px 0 18px !important;
        padding: 0 14px !important;
    }
}

/* ===== 23. CRUMB — proper mobile styling ===== */
.crumb {
    padding: 12px 0;
    font-size: 12px;
    color: #64748B;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
@media (max-width: 899px) {
    .crumb {
        padding: 10px 14px;
        font-size: 11.5px;
    }
    .crumb a { font-size: 11.5px; }
}

/* ===== 24. 404 / EMPTY STATES ===== */
@media (max-width: 899px) {
    .empty-cart,
    .no-results,
    .error-404 {
        padding: 28px 18px !important;
        font-size: 14px !important;
        text-align: center;
    }
    .empty-cart h2,
    .no-results h2,
    .error-404 h1 {
        font-size: 1.3rem !important;
        margin-bottom: 10px;
    }
}

/* ===== 25. MISC FIXES ===== */

/* Make sure any inline-styled width:1200px etc. don't break mobile */
@media (max-width: 899px) {
    [style*="width:1200px"],
    [style*="width: 1200px"],
    [style*="width:1100px"],
    [style*="width: 1100px"],
    [style*="width:1000px"],
    [style*="width: 1000px"],
    [style*="width:960px"],
    [style*="width: 960px"],
    [style*="max-width:1200px"],
    [style*="max-width: 1200px"] {
        width: 100% !important;
        max-width: 100% !important;
    }
    [style*="padding:2rem"],
    [style*="padding: 2rem"] {
        padding: 1rem 14px !important;
    }
}

/* Reset body padding-bottom when there's no bottom-nav */
body:not(.has-bottom-nav) { padding-bottom: 0 !important; }

/* Make sure tables don't overflow */
table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}
table tbody, table thead { width: 100%; }

/* Iframe / embeds responsive */
iframe, embed, object, .wp-block-embed {
    max-width: 100%;
    width: 100%;
    aspect-ratio: 16/9;
}

/* Pretty scrollbar (desktop only) */
@media (min-width: 900px) {
    ::-webkit-scrollbar { width: 9px; height: 9px; }
    ::-webkit-scrollbar-track { background: #F1F5F9; }
    ::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 4px; }
    ::-webkit-scrollbar-thumb:hover { background: #94A3B8; }
}

/* Hide scrollbar on mobile for horizontal scrollers */
@media (max-width: 899px) {
    .filter-bar,
    .trust-inner,
    .rp-scroller,
    .pargas-tabs {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .filter-bar::-webkit-scrollbar,
    .trust-inner::-webkit-scrollbar,
    .rp-scroller::-webkit-scrollbar,
    .pargas-tabs::-webkit-scrollbar { display: none; }
}

/* ===== 26. SPECIFIC PAGE TWEAKS ===== */

/* Single product gallery thumbnails — horizontal scroll on mobile */
@media (max-width: 899px) {
    .flex-control-thumbs {
        display: flex !important;
        overflow-x: auto;
        gap: 8px;
        margin-top: 10px;
        padding-bottom: 4px;
        scrollbar-width: none;
    }
    .flex-control-thumbs::-webkit-scrollbar { display: none; }
    .flex-control-thumbs li {
        flex: 0 0 60px !important;
        width: 60px !important;
    }
    .flex-control-thumbs img {
        width: 60px !important;
        height: 60px !important;
        border-radius: 8px;
        object-fit: cover;
        cursor: pointer;
        border: 2px solid transparent;
    }
    .flex-control-thumbs img.flex-active {
        border-color: #2563EB;
    }
}

/* WC notices — full width on mobile */
@media (max-width: 899px) {
    .woocommerce-message,
    .woocommerce-info,
    .woocommerce-error {
        margin: 0 0 14px !important;
        padding: 12px 14px !important;
        font-size: 12.5px !important;
        border-radius: 10px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .woocommerce-message a,
    .woocommerce-info a,
    .woocommerce-error a {
        font-size: 12px !important;
        padding: 4px 10px !important;
        border-radius: 6px;
    }
}

/* Star ratings — readable size */
@media (max-width: 899px) {
    .star-rating,
    .wc-block-grid__product-rating .star-rating {
        font-size: 13px !important;
    }
}

/* Product price — readable */
@media (max-width: 899px) {
    .woocommerce-Price-amount,
    .price,
    .pcard-price {
        font-size: 14px !important;
    }
    li.product .price,
    li.product .woocommerce-Price-amount {
        font-size: 14px !important;
    }
}

/* Add-to-cart button on product card */
@media (max-width: 899px) {
    li.product .button,
    li.product .added_to_cart,
    .pcard-cart-btn {
        width: 100% !important;
        text-align: center !important;
        padding: 9px 12px !important;
        font-size: 12.5px !important;
        border-radius: 9px;
        margin-top: 8px !important;
    }
}

/* CTA section */
@media (max-width: 899px) {
    .cta-section { padding: 30px 0 !important; }
    .cta-inner {
        padding: 0 14px !important;
        text-align: center;
    }
    .cta-inner h2 { font-size: 1.3rem !important; margin-bottom: 10px; }
    .cta-inner p { font-size: 13px !important; margin-bottom: 18px; }
    .cta-btns {
        flex-direction: column;
        gap: 8px;
    }
    .cta-btns .btn {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* Feature cards */
@media (max-width: 899px) {
    .fcard {
        padding: 16px !important;
        gap: 10px;
        border-radius: 14px;
    }
    .ficon {
        width: 44px !important;
        height: 44px !important;
    }
    .fcard h3 { font-size: 14px !important; }
    .fcard p { font-size: 12.5px !important; line-height: 1.8; }
}

/* Cert cards */
@media (max-width: 899px) {
    .cert-card {
        padding: 12px !important;
        min-width: 0 !important;
        flex: 1 1 calc(50% - 4px) !important;
        flex-basis: calc(50% - 4px) !important;
    }
}

/* === END === */
