/* ===========================================
   Product Archive Shared Styles (styles.css)
   Enqueued by inc/product/functions-p-management-setup.php
   Only the custom-layout multi-column rules live here; the old orphaned
   style.css is intentionally NOT duplicated.
   =========================================== */

/* ===========================================
   Custom-layout multi-column rows (col_width)
   =========================================== */

/* Admin: compact per-widget column-width selector in the actions row.
   Styled to match WP's small secondary button and forced to show a down-chevron
   (appearance:none strips the native one). Chevron side + padding flip for RTL.
   !important is required: product-cat-edit.css styles term-screen selects with a
   very high-specificity selector (.term-php #edittag ... td select) that would
   otherwise win and make this control tall and arrow-less. */
.widget-col-width {
    box-sizing: border-box !important;
    width: auto !important;
    max-width: 120px !important;
    height: 28px !important;
    min-height: 28px !important;
    line-height: 1.3 !important;
    font-size: 12px !important;
    color: #2271b1 !important;
    background-color: #f6f7f7 !important;
    border: 1px solid #c3c4c7 !important;
    border-radius: 3px !important;
    box-shadow: none !important;
    cursor: pointer !important;
    vertical-align: middle !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2350575e' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 7px center !important;
    background-size: 10px 6px !important;
    padding: 0 21px 0 8px !important;
}

.widget-col-width:hover {
    border-color: #2271b1 !important;
    background-color: #f0f0f1 !important;
}

/* RTL admin: move the chevron to the left and swap the padding */
.rtl .widget-col-width {
    background-position: left 7px center !important;
    padding: 0 8px 0 21px !important;
}

/* Frontend: an auto-flow row of widgets. Column spans come from Tailwind
   (md:col-span-*) in tailwind-styles.css; this only tidies the grid children. */
.yj19-widget-row > .yj19-widget-col {
    min-width: 0; /* let grid children shrink instead of overflowing */
}

/* A widget placed inside a column must FILL that column: its own
   .container / .lg:container should not re-apply max-width or horizontal
   centering/padding (the grid gap already handles spacing). */
.yj19-widget-col .container,
.yj19-widget-col .lg\:container {
    max-width: none !important;
    width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ===========================================
   Subcategory "equal" cards — N per row (set in admin), rows centered
   N comes from inline --eq-cols; incomplete last row + a lone card center
   via justify-content. Mobile shows min(N,2) per row, sm+ shows exactly N.
   =========================================== */
.rn-equal-grid {
    display: grid;
    justify-content: center;
    align-items: stretch;
    --eq-gap: 0.75rem;
    --eq-card: 300px;
    gap: var(--eq-gap);
    grid-template-columns: repeat(var(--eq-cols-m, 2), minmax(0, var(--eq-card)));
}
@media (min-width: 640px) {
    .rn-equal-grid {
        --eq-gap: 1.25rem;
        grid-template-columns: repeat(var(--eq-cols, 4), minmax(0, var(--eq-card)));
    }
}
@media (min-width: 1024px) { .rn-equal-grid { --eq-gap: 1.5rem; } }
