/**
 * "Design Online" modal — lives outside the editor (#banner-designer-app
 * scopes its own --bd-accent to WP blue for the toolbar), so this gets
 * its own brand-colour scope instead of inheriting that.
 */
.bd-donl-overlay {
    --bd-donl-navy: #1a2f5c;
    --bd-donl-orange: #e8622c;
    --bd-donl-orange-dark: #c9511f;
    --bd-donl-border: #e5e7ec;

    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(10, 18, 38, 0.55);
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.bd-donl-overlay.open {
    display: flex;
}

body.bd-donl-lock-scroll {
    overflow: hidden;
}

.bd-donl-modal {
    background: #fff;
    width: 100%;
    max-width: 760px;
    max-height: 85vh;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 70px rgba(10, 18, 38, 0.35);
    overflow: hidden;
}

/* Three-slot header: back (fixed width, hidden via visibility so its
   slot stays reserved and the title doesn't jump when it toggles) |
   title (centred, flexes to fill) | close (fixed width, symmetric with
   back). */
.bd-donl-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--bd-donl-border);
}

.bd-donl-header h2 {
    flex: 1;
    min-width: 0;
    margin: 0;
    text-align: center;
    font-size: 19px;
    font-weight: 800;
    color: var(--bd-donl-navy);
}

.bd-donl-back,
.bd-donl-close {
    flex: none;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #8a93a6;
    cursor: pointer;
    border-radius: 8px;
}

.bd-donl-back {
    font-size: 20px;
    visibility: hidden;
}

.bd-donl-back.visible {
    visibility: visible;
}

.bd-donl-close {
    font-size: 24px;
    line-height: 1;
}

.bd-donl-back:hover,
.bd-donl-close:hover {
    background: #f0f2f6;
    color: var(--bd-donl-navy);
}

.bd-donl-body {
    padding: 20px 22px 24px;
    overflow-y: auto;
}

.bd-donl-loading,
.bd-donl-error,
.bd-donl-empty {
    text-align: center;
    padding: 40px 10px;
    color: #6b7280;
    font-size: 14px;
}

.bd-donl-empty-admin {
    text-align: left;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 18px 20px;
}

.bd-donl-empty-admin p {
    margin: 0 0 12px;
    color: var(--bd-donl-navy);
}

.bd-donl-empty-cta {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--bd-donl-orange);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
}

.bd-donl-empty-cta:hover {
    background: var(--bd-donl-orange-dark);
    color: #fff;
}

/* ---------- Category sections ---------- */

.bd-donl-category {
    margin-bottom: 26px;
}

/* A showcase section title, not a utility accordion row — centred,
   larger, with a divider underneath to read as its own "shelf" of
   products rather than a small side label. */
.bd-donl-category-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: none;
    border: none;
    border-bottom: 2px solid var(--bd-donl-border);
    padding: 8px 0 16px;
    margin-bottom: 16px;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: var(--bd-donl-navy);
    cursor: pointer;
    text-align: center;
}

.bd-donl-caret {
    display: inline-block;
    color: var(--bd-donl-orange);
    transition: transform 0.15s ease;
}

.bd-donl-category.is-open .bd-donl-caret {
    transform: rotate(90deg);
}

.bd-donl-card-grid {
    display: none;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 12px;
}

.bd-donl-category.is-open .bd-donl-card-grid {
    display: flex;
}

/* ---------- Product card (collapsed face + accordion detail) ---------- */

.bd-donl-card {
    width: 152px;
    border: 1px solid var(--bd-donl-border);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.bd-donl-card:hover {
    border-color: #c7cee0;
    box-shadow: 0 6px 18px rgba(10, 18, 38, 0.1);
}

.bd-donl-card.is-open {
    width: 100%;
    box-shadow: 0 10px 28px rgba(10, 18, 38, 0.14);
}

.bd-donl-card-face {
    display: block;
    width: 100%;
    background: #fff;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
}

.bd-donl-card.is-open .bd-donl-card-face {
    display: none;
}

.bd-donl-card-face img {
    display: block;
    width: 100%;
    height: 110px;
    object-fit: cover;
    background: #f4f5f7;
}

.bd-donl-card-name {
    display: block;
    padding: 8px 10px 10px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--bd-donl-navy);
    line-height: 1.3;
}

/* ---------- Expanded detail (size pills + Start Design) ---------- */

.bd-donl-card-detail {
    display: none;
    padding: 14px 16px 16px;
    /* Smooth-in on open — a plain CSS transition is enough for this,
       matches the "плавные transitions" ask without extra JS machinery. */
    animation: bd-donl-detail-in 0.18s ease;
}

.bd-donl-card.is-open .bd-donl-card-detail {
    display: block;
}

@keyframes bd-donl-detail-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.bd-donl-detail-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.bd-donl-detail-head img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    background: #f4f5f7;
    flex: none;
}

.bd-donl-detail-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--bd-donl-navy);
}

.bd-donl-size-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8a93a6;
    margin-bottom: 8px;
}

.bd-donl-size-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

/* Step 2/3 lightweight loading indicator — shown briefly inside a
   product card (sizes/prices) or the template gallery area (matching
   templates) while that step's own AJAX call is in flight. Deliberately
   plain text + a subtle pulse rather than a spinner graphic — this is a
   sub-second wait in the common case, not worth a heavier treatment. */
.bd-donl-step-status {
    font-size: 13px;
    color: #8a93a6;
    padding: 10px 0;
    animation: bd-donl-pulse 1.2s ease-in-out infinite;
}

.bd-donl-step-status-error {
    color: var(--bd-donl-orange);
    cursor: pointer;
    text-decoration: underline;
    animation: none;
}

@keyframes bd-donl-pulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

.bd-donl-no-sizes {
    font-size: 13px;
    color: #8a93a6;
    padding: 6px 0 16px;
}

@media (prefers-reduced-motion: reduce) {
    .bd-donl-step-status {
        animation: none;
    }
}

.bd-donl-size-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--bd-donl-border);
    background: #fff;
    color: var(--bd-donl-navy);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.bd-donl-size-pill:hover {
    border-color: var(--bd-donl-orange);
}

.bd-donl-size-pill.active {
    background: var(--bd-donl-orange);
    border-color: var(--bd-donl-orange);
    color: #fff;
}

.bd-donl-size-price {
    opacity: 0.75;
    font-weight: 600;
}

.bd-donl-size-pill.active .bd-donl-size-price {
    opacity: 0.9;
}

/* ---------- Template gallery (shown once a size with matching
   templates is picked) — "Start from Blank" stays the button itself,
   these are the alternative starting points. ---------- */

.bd-donl-template-gallery {
    margin-bottom: 16px;
}

/* ---------- Choose Template — dedicated full-screen step ----------
   Same visual language as the rest of the modal (Step 1's card grid) —
   deliberately no new colours here, only the --bd-donl-navy/orange/
   border tokens already defined on .bd-donl-overlay above. Sits inside
   .bd-donl-body as a sibling of .bd-donl-categories; openTemplateScreen()
   in bd-design-online.js toggles which of the two is visible, the same
   full-replace pattern the Shape Templates admin wizard already uses
   for its own steps. */
.bd-donl-template-screen-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.bd-donl-template-screen-back {
    flex: none;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px 7px 8px;
    border-radius: 999px;
    border: 1.5px solid var(--bd-donl-border);
    background: #fff;
    color: var(--bd-donl-navy);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.bd-donl-template-screen-back:hover {
    border-color: var(--bd-donl-orange);
    background: #fff7f3;
}

.bd-donl-template-screen-title {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--bd-donl-navy);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.bd-donl-template-screen-gallery {
    margin-bottom: 16px;
}

.bd-donl-template-gallery-heading {
    font-size: 13px;
    font-weight: 700;
    color: var(--bd-donl-navy);
    margin-bottom: 10px;
}

.bd-donl-template-section + .bd-donl-template-section {
    margin-top: 12px;
}

.bd-donl-template-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8a93a6;
    margin-bottom: 8px;
}

.bd-donl-template-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bd-donl-template-thumb {
    width: 92px;
    border: 1.5px solid var(--bd-donl-border);
    border-radius: 8px;
    background: #fff;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bd-donl-template-thumb:hover {
    border-color: var(--bd-donl-orange);
    box-shadow: 0 4px 12px rgba(10, 18, 38, 0.12);
}

.bd-donl-template-thumb img {
    display: block;
    width: 100%;
    height: 68px;
    object-fit: cover;
    background: #f4f5f7;
}

.bd-donl-template-noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 68px;
    background: #f4f5f7;
    color: #9aa1ad;
    font-size: 10.5px;
}

.bd-donl-template-name {
    display: block;
    padding: 6px 6px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--bd-donl-navy);
    line-height: 1.3;
}

/* ---------- Click-to-preview-large template overlay — a proper modal
   on top of the modal (see buildLargePreview()/openLargePreview() in
   bd-design-online.js), one shared element reused for every thumbnail.
   Declared with its own --bd-donl-* fallback values (matching
   .bd-donl-overlay's) since it's appended directly to <body>, a
   sibling of the modal, not a descendant of it. A dark backdrop (not
   pointer-events:none, unlike the hover version this replaces) — this
   is a real, deliberate step the visitor opens, not a passive glance,
   so it should behave like the modal it sits on top of: click-outside
   or ✕ or Escape to dismiss, "Choose This Template" to proceed.
   ---------- */
.bd-donl-large-preview-overlay {
    --bd-donl-navy: #1a2f5c;
    --bd-donl-orange: #e8622c;
    --bd-donl-orange-dark: #c9511f;
    --bd-donl-border: #e5e7ec;

    display: none;
    position: fixed;
    inset: 0;
    z-index: 100010;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(10, 18, 38, 0.65);
}

.bd-donl-large-preview-overlay.open {
    display: flex;
}

.bd-donl-large-preview-modal {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 24px 70px rgba(10, 18, 38, 0.35);
}

.bd-donl-large-preview-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: none;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(10, 18, 38, 0.18);
    font-size: 20px;
    line-height: 1;
    color: var(--bd-donl-navy);
    cursor: pointer;
}

.bd-donl-large-preview-image-wrap {
    border-radius: 8px;
    overflow: hidden;
    background:
        linear-gradient(45deg, #f0f1f4 25%, transparent 25%),
        linear-gradient(-45deg, #f0f1f4 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f1f4 75%),
        linear-gradient(-45deg, transparent 75%, #f0f1f4 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.bd-donl-large-preview-image-wrap img {
    display: block;
    width: 100%;
    max-height: 65vh;
    object-fit: contain;
}

.bd-donl-large-preview-image-wrap .bd-donl-template-noimg {
    height: 240px;
    font-size: 14px;
}

.bd-donl-large-preview-name {
    margin-top: 14px;
    font-size: 16px;
    font-weight: 700;
    color: var(--bd-donl-navy);
    text-align: center;
}

/* ---------- Products-list step — "All Templates" gallery shortcode
   context only (see openLargePreview()'s galleryCtx.products param /
   window.bdOpenTemplateCatalogPreview()). Reuses .bd-donl-size-label
   verbatim; the cards below are a deliberately simple name+thumb+price
   grid, not full product cards — good enough for "pick which product",
   the real detail is the size step that follows. ---------- */
.bd-donl-large-preview-products {
    margin-top: 16px;
    text-align: left;
}

.bd-donl-large-preview-products .bd-donl-size-label {
    text-align: center;
}

.bd-donl-preview-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
    padding: 2px;
}

.bd-donl-preview-product-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1.5px solid var(--bd-donl-border);
    border-radius: 8px;
    background: #fff;
    padding: 8px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bd-donl-preview-product-card:hover {
    border-color: var(--bd-donl-orange);
    box-shadow: 0 4px 12px rgba(10, 18, 38, 0.12);
}

.bd-donl-preview-product-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
    background: #f4f5f7;
    margin-bottom: 6px;
}

.bd-donl-preview-product-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--bd-donl-navy);
    line-height: 1.3;
}

.bd-donl-preview-product-price {
    font-size: 11.5px;
    color: #6a7182;
    margin-top: 3px;
}

.bd-donl-preview-products-empty {
    text-align: center;
    color: #6a7182;
    font-size: 13px;
    margin: 0;
    padding: 20px 0;
}

/* ---------- Inline size step — "Our Free Templates" gallery context
   only (see openLargePreview()'s galleryCtx param); hidden entirely for
   the plain Design Online modal gallery, which already has a size
   selected before the preview ever opens. Reuses .bd-donl-size-label/
   -pills/-pill verbatim (same look as the modal's own size step). ---------- */
.bd-donl-large-preview-sizes {
    margin-top: 16px;
    text-align: left;
}

.bd-donl-large-preview-sizes .bd-donl-size-label {
    text-align: center;
}

.bd-donl-large-preview-sizes .bd-donl-size-pills {
    justify-content: center;
    margin-bottom: 0;
}

.bd-donl-large-preview-choose-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 12px 20px;
    border-radius: 999px;
    border: none;
    background: var(--bd-donl-orange);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(232, 98, 44, 0.3);
    transition: background 0.15s ease;
}

.bd-donl-large-preview-choose-btn:hover {
    background: var(--bd-donl-orange-dark);
}

.bd-donl-large-preview-choose-btn:disabled {
    background: #c9ccd4;
    box-shadow: none;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .bd-donl-large-preview-overlay {
        padding: 12px;
    }

    .bd-donl-large-preview-modal {
        padding: 16px;
    }
}

/* ---------- Start Design — same pill-CTA language as the rest of the
   site's "Design Online" buttons (see .blc-btn-orange-pulse) ---------- */

.bd-donl-start-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    border-radius: 999px;
    border: none;
    background: #c9ccd4;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: not-allowed;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.bd-donl-start-btn:not(:disabled) {
    background: var(--bd-donl-orange);
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(232, 98, 44, 0.3);
}

.bd-donl-start-btn:not(:disabled):hover {
    background: var(--bd-donl-orange-dark);
}

@media (max-width: 560px) {
    .bd-donl-card {
        width: calc(50% - 7px);
    }
}

/* ---------------------------------------------------------------
   Per-product "Design Online" button — single product page (full
   variant) and archive/shop-loop cards (compact variant). An
   ADDITIONAL, direct entry point alongside the picker above (this
   whole file otherwise), not part of it — see BD_Products_Admin::
   render_design_online_button() (which sets background/border-color
   inline from the Settings screen's own colour picker, and the label
   text) and class-bd-design-online-button.php for the woocommerce_*
   hooks that place it. This block only owns shape/spacing/hover, kept
   deliberately independent of the --bd-donl-* tokens above since the
   button's colour is a site-owner setting, not this fixed brand palette.
   --------------------------------------------------------------- */
.bd-design-online-btn {
    display: inline-block;
    border: 2px solid transparent;
    border-radius: 999px;
    color: #fff;
    font-weight: 700;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    appearance: none;
    /* Guards against Kadence's loop "View Details" button being floated in
       some layout modes — a floated sibling this doesn't clear can end up
       visually overlapping it instead of sitting cleanly below. See the
       .product-action-wrap:has(...) rule below for the main fix. */
    clear: both;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.bd-design-online-btn:hover,
.bd-design-online-btn:focus {
    filter: brightness(0.92);
    color: #fff;
}

.bd-design-online-btn:active {
    transform: scale(0.98);
}

.bd-design-online-btn-full {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 10px 0;
    padding: 12px 20px;
    font-size: 14px;
}

.bd-design-online-btn-compact {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
}

/* ---------------------------------------------------------------
   Single product page: Design Online + "Have a Design? Order Fast"
   side by side instead of each stacking full-width (see open_cta_row()/
   close_cta_row() in class-bd-design-online-button.php — the shared
   wrapper always exists even if only one button, or neither, actually
   renders inside it). flex-wrap + min-width (not a fixed viewport
   media query) is the primary responsive mechanism: whichever button
   runs out of room first wraps to its own full-width line — this
   responds to the PRODUCT COLUMN's actual width (which varies with
   theme sidebar/layout settings), not just the viewport, so it stacks
   correctly even on a wide screen with a narrow product column.
   --------------------------------------------------------------- */
.bd-product-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 10px 0;
}

.bd-product-cta-row .bd-design-online-btn-full,
.bd-product-cta-row .bd-order-fast-btn {
    flex: 1 1 180px;
    width: auto;
    max-width: none;
    margin: 0;
}

@media (max-width: 480px) {
    .bd-product-cta-row .bd-design-online-btn-full,
    .bd-product-cta-row .bd-order-fast-btn {
        flex-basis: 100%;
    }
}

/* ---------------------------------------------------------------
   Archive card: Kadence's own "View Details" button (the loop add-
   to-cart button, relabelled — see the woocommerce_product_add_to_
   cart_text filter in the child theme's functions.php) sits in the
   same .product-action-wrap as ours, and on hover-reveal card layouts
   (.woo-archive-action-on-hover) that whole wrap is a single
   position:absolute box — without an explicit stacking rule, a
   floated or auto-width "View Details" button and our own full-width
   one can end up rendered on top of each other instead of one below
   the other. :has() scopes this to ONLY wraps that actually contain
   our button, so archive cards without "Design Online" enabled (or
   other plugins' own buttons in this same wrap elsewhere) are
   untouched.
   --------------------------------------------------------------- */
.product-action-wrap:has(.bd-design-online-btn) {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Same bordered-pill treatment as "Design Online" for visual
   consistency, but outlined rather than solid — "View Details" is the
   primary commerce action (sits above Design Online in this stack,
   per DOM order) and reads as visually secondary/neutral next to the
   button using the site owner's own chosen accent colour. !important
   mirrors this codebase's existing convention for overriding Kadence's
   theme-customizer-controlled button defaults (see .blc-btn-orange-
   pulse in the child theme's own CSS). */
.product-action-wrap:has(.bd-design-online-btn) .add_to_cart_button {
    display: block !important;
    width: 100%;
    box-sizing: border-box;
    border-radius: 999px !important;
    border: 2px solid var(--bd-donl-navy, #1a2f5c) !important;
    background: transparent !important;
    color: var(--bd-donl-navy, #1a2f5c) !important;
    font-weight: 700;
    font-size: 12px;
    text-align: center;
    padding: 7px 14px !important;
    line-height: 1.4;
}

.product-action-wrap:has(.bd-design-online-btn) .add_to_cart_button:hover {
    background: var(--bd-donl-navy, #1a2f5c) !important;
    color: #fff !important;
}

/* .product-action-wrap is a CHILD of .entry-content-wrap, absolutely
   positioned from the wrap's own padding-box bottom edge (bottom:-0.8rem
   on hover) and extending UPWARD by its own content height — it was
   sized for a single button. With Design Online added, that box is
   taller, so it now extends further up than the wrap's own reserved
   padding-bottom accounts for, and overlaps the in-flow title/price
   above it. Reserving more padding-bottom here pushes the action-wrap's
   anchor point down, giving the taller box room without touching
   title/price at all (measured/confirmed via screenshot + bounding
   boxes, not just read off the CSS — see PR notes).
   Separately, the card itself (li.product) is overflow:hidden, and
   Kadence's own translateY(-2rem) on hover only shifts the wrap up
   enough to keep a single-button-tall action area from being clipped —
   also insufficient now, tuned larger below for the same reason. */
.woocommerce ul.products li.product .entry-content-wrap:has(.bd-design-online-btn) {
    padding-bottom: 5.5rem;
}

.woocommerce ul.products.woo-archive-action-on-hover li.product:has(.bd-design-online-btn):hover .entry-content-wrap,
.woocommerce ul.products.woo-archive-action-on-hover li.product:has(.bd-design-online-btn):focus-within .entry-content-wrap {
    transform: translateY(-4.75rem);
}

/* ---------------------------------------------------------------
   "Our Free Templates" gallery — single product page (see class-bd-
   templates-gallery.php). Reuses the modal's own .bd-donl-template-*
   thumbnail/section markup and CSS verbatim (see the "Template
   gallery" rules above) rather than a second copy — this wrapper's
   only job is re-establishing the same --bd-donl-* custom-property
   scope .bd-donl-overlay normally provides, since this section lives
   directly on the product page, outside the modal, and those reused
   rules would otherwise resolve against nothing.
   --------------------------------------------------------------- */
.bd-templates-gallery {
    --bd-donl-navy: #1a2f5c;
    --bd-donl-orange: #e8622c;
    --bd-donl-orange-dark: #c9511f;
    --bd-donl-border: #e5e7ec;

    margin-top: 32px;
}

.bd-templates-gallery-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--bd-donl-navy);
    margin-bottom: 14px;
}

/* Card sizing here only — NOT the shared .bd-donl-template-thumb rules
   above, which stay compact for their other home inside the Design
   Online modal's own (much narrower) card. These overrides match this
   theme's real WooCommerce product-card proportions (measured live off
   ul.products li.product on /shop/: ~280px wide, 3:4 portrait image,
   4px corner radius, 17px/500 title) so this section reads as more of
   the same product grid rather than a smaller, unrelated widget. */
.bd-templates-gallery .bd-donl-template-row {
    gap: 28px;
}

.bd-templates-gallery .bd-donl-template-thumb {
    width: 220px;
    border-radius: 4px;
}

.bd-templates-gallery .bd-donl-template-thumb img,
.bd-templates-gallery .bd-donl-template-thumb .bd-donl-template-noimg {
    height: auto;
    aspect-ratio: 3 / 4;
}

.bd-templates-gallery .bd-donl-template-name {
    padding: 8px 10px 12px;
    font-size: 15px;
    font-weight: 500;
}
