/* Two-category layout (regional-products collage + home's "Explora
   Nuestras Categorías") reuses the product-category-grid-two block, but
   with 560x368 rectangular cards instead of the 368x368 squares that
   block's own CSS was tuned for on "Our Products" (3 categories) — scoped
   to this extra class (set via the block's html_attributes.class field)
   so the Our Products page is untouched. Guarded to desktop only: mobile
   already stacks 2 cards per row via its own 47% rule. */
@media (min-width: 769px) {
    /* The base rule hardcodes ".categories" to 1136px (560*2 + 16 gap),
       sized for the ~1296px content width Bootstrap's ".container" gives
       at its xxl breakpoint (>=1400px window). Between 1170-1399px
       (Bootstrap's xl breakpoint) the container only has ~1116px of
       content width, 20px short of 1136px — since margin:auto can't go
       negative, the row pinned to the left edge and overflowed off the
       right instead of centering. Capping at 1136px but otherwise
       letting it shrink to 100% of the container keeps it centered at
       every breakpoint. */
    .product-category-grid-two.cat-grid-two-wide .categories {
        width: 100% !important;
        max-width: 1136px;
    }
    /* Cards split the row's actual width in half (minus half the 16px
       gap) instead of a fixed 560px, so they still fill it exactly when
       the row itself has shrunk below 1136px. */
    .product-category-grid-two.cat-grid-two-wide .categories .card-wrapper {
        width: calc(50% - 8px);
    }
    .product-category-grid-two.cat-grid-two-wide .card-small-desing-two {
        width: 100% !important;
    }
}

/* Pre-existing bug (also present on Home/Regional Products, not introduced
   by cat-grid-two-wide): the base stylesheet's ".categories" rule hardcodes
   `width: 1136px !important` with no responsive override, so below 768px
   the row stays 1136px wide instead of stacking to the viewport — the
   second card silently clips off-screen (no visible scrollbar, since
   `#theme` has overflow:hidden) instead of wrapping below the first.
   Matches the specificity + !important of the base rule so it wins. */
@media (max-width: 768px) {
    .product-category-grid-two.cat-grid-two-wide .categories {
        width: 100% !important;
    }

    /* Same call as cat-grid-align-left's mobile fix (product-category-grid-
       two-align.css): these are 560x368 rectangles, not the square cards
       the base stylesheet's 47%/47% split was built for — squeezed into
       half-width at mobile they read as cramped, and their title text
       (sized for a much wider card) crowds/overlaps the neighboring card.
       Stacked full-width, one per row, like the other variant already
       does. */
    .product-category-grid-two.cat-grid-two-wide .categories .card-wrapper {
        width: 100% !important;
    }
    .product-category-grid-two.cat-grid-two-wide .card-small-desing-two {
        width: 100% !important;
    }

    /* The base stylesheet zeroes this card's left margin on mobile
       (".card-content{margin:auto 0 0 0!important}") for its other callers'
       button-row layout, where the button pins itself to the card's left
       edge. This variant's titles have no button, so the zeroed left margin
       reads as the title text jammed straight into the card's left edge/
       rounded corner — only the left side needed restoring; bottom/right
       stay at the base rule's 0 so the text doesn't gain extra space there
       too. */
    .product-category-grid-two.cat-grid-two-wide .card-small-desing-two .card-content {
        margin: auto 0px 0px 24px !important;
    }
}
