/* ============================================================
   VPOINT Catalog Display — responsive tuning
   Targets: WoodMart .wd-products.wd-grid-g product grids,
   archive headings, breadcrumbs and category links.
   ============================================================ */

/* ---------- TABLET (768px – 1024px): force 3 columns ---------- */
@media (min-width: 768px) and (max-width: 1024px) {
    .wd-products.wd-grid-g,
    .products.wd-grid-g {
        --wd-col-md: 3 !important;
        grid-template-columns: repeat(3, 1fr) !important;
    }
    /* keep comfortable gutters on tablets */
    .wd-products.wd-grid-g {
        --wd-gap-md: 18px !important;
    }
}

/* ---------- MOBILE (<= 767px): readability first ---------- */
@media (max-width: 767px) {
    .wd-products.wd-grid-g,
    .products.wd-grid-g {
        --wd-col-sm: 2 !important;
        grid-template-columns: repeat(2, 1fr) !important;
        --wd-gap-sm: 12px !important;
    }

    /* Stable image box: no stretch, no layout shift */
    .wd-product .product-image-link img,
    .wd-product .wd-product-img img,
    ul.products li.product img,
    .wd-products .product-element-top img {
        aspect-ratio: 1 / 1 !important;
        object-fit: cover !important;
        width: 100% !important;
        height: auto !important;
    }

    /* Product title: clamp to 2 lines so cards stay equal height */
    .wd-product .wd-entities-title,
    .wd-product .product-title,
    ul.products li.product .woocommerce-loop-product__title {
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        min-height: 2.6em !important;
        font-size: 14px !important;
        line-height: 1.3 !important;
    }

    /* Breadcrumbs wrap instead of overflowing / shrinking */
    .wd-breadcrumbs.woocommerce-breadcrumb,
    .woocommerce-breadcrumb {
        flex-wrap: wrap !important;
        word-break: break-word !important;
        font-size: 12px !important;
        line-height: 1.6 !important;
    }

    /* Touch-friendly category / filter links */
    .wd-product-cats-lists a,
    .widget_product_categories a,
    .wd-accordion-menu a {
        min-height: 40px !important;
        display: flex !important;
        align-items: center !important;
    }

    /* Archive heading (also upgraded to h1 via JS) stays prominent */
    .entry-title.title,
    h1.entry-title {
        font-size: 22px !important;
        line-height: 1.25 !important;
    }

    /* Ensure category sidebar / filters are reachable on mobile */
    .wd-sidebar,
    .sidebar-container {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 20px !important;
    }
}

/* ---------- SMALL PHONES (<= 380px): keep 2 cols, tighten ---------- */
@media (max-width: 380px) {
    .wd-products.wd-grid-g,
    .products.wd-grid-g {
        --wd-gap-sm: 8px !important;
    }
    .wd-product .wd-entities-title,
    ul.products li.product .woocommerce-loop-product__title {
        font-size: 13px !important;
    }
}
