/* Signedge Designer UI — printing options on the PRODUCT PAGE, same card
   look as inside the designer. Generated from override.css ("PRINTING
   OPTIONS — ACCORDION CARDS") with the designer scope replaced by .nbo-sg,
   which product-options.js adds to core's NBO controller element. */
.nbo-sg, .sg-opt-progress {
    --sg-primary: #2563eb;
    --sg-bg: #ffffff;
    --sg-border: #e5e7eb;
    --sg-text: #1f2937;
    --sg-text-soft: #6b7280;
    --sg-text-muted: #9ca3af;
}
/* core / theme defaults that fight the cards */
.nbo-sg .nbd-option-field.sg-card > .nbd-field-header { min-height: 0 !important; }
.nbo-sg .nbd-xlabel-wrap input[type="radio"] {
    position: absolute !important; opacity: 0 !important; width: 1px !important; height: 1px !important; pointer-events: none !important;
}
.nbo-sg .nbd-xlabel-wrap > label { word-break: normal !important; overflow-wrap: anywhere !important; }
.nbo-sg .nbo-clear-option-wrap { margin-top: 6px !important; }
@media (min-width: 768px) {
    /* more room than the designer panel → 3 tiles per row */
    .nbo-sg .sg-card .nbd-xlabel-wrap { width: calc(33.333% - 6px) !important; }
}

/* ============================================================
   PRINTING OPTIONS — ACCORDION CARDS (client: "look like the demo")
   JS (override.js enhanceOptionCards) adds .sg-card on each field, a
   .sg-field-status circle + .sg-field-value subtitle in its header,
   .sg-selected on the chosen swatch, and #sg-opt-progress above the list.
   ============================================================ */

/* Progress header: "PRINTING OPTIONS        2 / 3 done" + bar */
.sg-opt-progress {
    padding: 4px 2px 12px !important;
}
.sg-opt-progress-top {
    display: flex !important;
    align-items: baseline !important;
    justify-content: space-between !important;
    margin-bottom: 8px !important;
}
.sg-opt-progress-title {
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: .06em !important;
    text-transform: uppercase !important;
    color: var(--sg-text-soft) !important;
}
.sg-opt-progress-count {
    font-size: 11px !important;
    color: var(--sg-text-muted) !important;
}
.sg-opt-progress-bar {
    height: 6px !important;
    border-radius: 99px !important;
    background: #e5e7eb !important;
    overflow: hidden !important;
}
.sg-opt-progress-bar i {
    display: block !important;
    height: 100% !important;
    width: 0;
    border-radius: 99px !important;
    background: var(--sg-primary) !important;
    transition: width .25s ease !important;
}
.sg-opt-progress.is-complete .sg-opt-progress-bar i {
    background: #22c55e !important;
}

/* The card */
.nbo-sg .nbd-option-field.sg-card {
    background: var(--sg-bg) !important;
    border: 1.5px solid var(--sg-border) !important;
    border-radius: 12px !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04) !important;
    transition: border-color .15s, box-shadow .15s !important;
}
/* Open card (core adds .nbo-collapse when closed) */
.nbo-sg .nbd-option-field.sg-card:not(.nbo-collapse) {
    border-color: var(--sg-primary) !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, .10) !important;
}

/* Card header: [status] title / subtitle [tip] [chevron] */
.nbo-sg .nbd-option-field.sg-card > .nbd-field-header {
    display: grid !important;
    grid-template-columns: 26px minmax(0, 1fr) auto auto !important;
    grid-template-areas: "st lbl tip tg" "st sub sub tg" !important;
    align-items: center !important;
    column-gap: 10px !important;
    row-gap: 1px !important;
    margin: 0 !important;
    padding: 12px 14px !important;
    background: transparent !important;
    border: 0 !important;
    cursor: pointer !important;
    user-select: none !important;
}
.nbo-sg .nbd-option-field.sg-card > .nbd-field-header::after {
    display: none !important; /* core clearfix would become a grid item */
}
.nbo-sg .nbd-option-field.sg-card > .nbd-field-header > label {
    grid-area: lbl !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--sg-text) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    margin: 0 !important;
    line-height: 1.3 !important;
    cursor: pointer !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}
.nbo-sg .nbd-option-field.sg-card > .nbd-field-header > .sg-field-value {
    grid-area: sub !important;
    font-size: 11px !important;
    color: var(--sg-text-soft) !important;
    line-height: 1.35 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}
.nbo-sg .nbd-option-field.sg-card > .nbd-field-header > .nbd-help-tip {
    grid-area: tip !important;
    margin: 0 !important;
    align-self: center !important;
}
.nbo-sg .nbd-option-field.sg-card > .nbd-field-header > .nbo-toggle {
    grid-area: tg !important;
    margin: 0 !important;
    width: 22px !important;
    height: 22px !important;
    position: relative !important;
    float: none !important;
}
/* −/+ icons → chevron (up when open, down when closed) */
.nbo-sg .nbd-option-field.sg-card > .nbd-field-header > .nbo-toggle svg {
    display: none !important;
}
.nbo-sg .nbd-option-field.sg-card > .nbd-field-header > .nbo-toggle::before {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 7px !important;
    height: 7px !important;
    border-right: 2px solid var(--sg-text-soft) !important;
    border-bottom: 2px solid var(--sg-text-soft) !important;
    transform: translate(-50%, -75%) rotate(45deg) !important;   /* ∨ */
}
.nbo-sg .nbd-option-field.sg-card > .nbd-field-header > .nbo-minus::before {
    transform: translate(-50%, -25%) rotate(-135deg) !important; /* ∧ */
}

/* Status circle: number when pending, green ✓ when chosen */
.nbo-sg .sg-field-status {
    grid-area: st !important;
    width: 26px !important;
    height: 26px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: var(--sg-text-soft) !important;
    background: #f3f4f6 !important;
    border: 1.5px solid #e5e7eb !important;
    box-sizing: border-box !important;
    position: relative !important;
}
.nbo-sg .sg-field-status.is-done {
    background: #22c55e !important;
    border-color: #22c55e !important;
}
.nbo-sg .sg-field-status.is-done::before {
    content: '' !important;
    width: 6px !important;
    height: 11px !important;
    border-right: 2.5px solid #fff !important;
    border-bottom: 2.5px solid #fff !important;
    transform: translateY(-1px) rotate(45deg) !important;
}

/* Card body. Core collapses it with height:0 + padding:0 + a 0.4s opacity
   fade; our padding overrode that, leaving a faint strip of the tiles
   visible on a closed card. Closed → not rendered at all; open → short
   slide/fade in. */
.nbo-sg .nbd-option-field.sg-card > .nbd-field-content {
    padding: 2px 12px 12px !important;
    height: auto !important;
    opacity: 1 !important;
    transition: none !important;
    animation: sgCardOpen .18s ease-out !important;
}
.nbo-sg .nbd-option-field.sg-card.nbo-collapse > .nbd-field-content {
    display: none !important;
}
@keyframes sgCardOpen {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}

/* No "i" help icon in the card header (cleaner look, client request) */
.nbo-sg .nbd-option-field.sg-card > .nbd-field-header > .nbd-help-tip {
    display: none !important;
}

/* Image / colour swatches: compact 2-column tiles */
.nbo-sg .sg-card .nbd-xlabel-wrapper {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}
.nbo-sg .sg-card .nbd-xlabel-wrap {
    width: calc(50% - 4px) !important;
    margin: 0 !important;
    padding: 6px 6px 8px !important;
    border: 1.5px solid var(--sg-border) !important;
    border-radius: 10px !important;
    background: var(--sg-bg) !important;
    box-sizing: border-box !important;
    transition: border-color .15s, background .15s !important;
}
.nbo-sg .sg-card .nbd-xlabel-wrap:hover {
    border-color: rgba(37, 99, 235, .45) !important;
}
.nbo-sg .sg-card .nbd-xlabel-wrap.sg-selected {
    border-color: var(--sg-primary) !important;
    background: rgba(37, 99, 235, .12) !important; /* matches the demo's tint (was .06 — too pale) */
    box-shadow: 0 0 0 1px var(--sg-primary) inset !important;
}
/* Open card: tinted header band, like the demo */
.nbo-sg .nbd-option-field.sg-card:not(.nbo-collapse) > .nbd-field-header {
    background: rgba(37, 99, 235, .09) !important;
}
.nbo-sg .nbd-option-field.sg-card:not(.nbo-collapse) > .nbd-field-content {
    padding-top: 12px !important; /* breathing room below the tinted header */
}
.nbo-sg .sg-card .nbd-xlabel-value {
    padding-top: 72% !important; /* a bit shorter than core's square */
}
.nbo-sg .sg-card .nbd-xlabel {
    border: 0 !important;
    border-radius: 7px !important;
    box-shadow: none !important;
}
/* Selection is shown by the tile border — drop core's big ✓ overlay */
.nbo-sg .sg-card .nbd-xlabel-wrap input:checked + label::after {
    display: none !important;
}
.nbo-sg .sg-card .nbd-xlabel .nbd-help-tip {
    width: 18px !important;
    height: 18px !important;
    font-size: 11px !important;
    top: 4px !important;
    left: 4px !important;
}
.nbo-sg .sg-card .nbd-xlabel .nbd-help-tip::after {
    margin-top: 1px !important;
}
.nbo-sg .sg-card .nbd-xlabel .nbo-recomand svg {
    width: 14px !important;
    height: 22px !important;
}
.nbo-sg .sg-card .nbd-xlabel-wrap > label {
    display: block !important;
    margin-top: 6px !important;
    font-size: 11.5px !important;
    line-height: 1.3 !important;
    text-align: center !important;
    color: var(--sg-text) !important;
}
.nbo-sg .sg-card .nbd-xlabel-wrap > label b {
    font-weight: 600 !important;
}
.nbo-sg .sg-card .nbd-xlabel-wrap.sg-selected > label {
    color: var(--sg-primary) !important;
}


/* Mobile: the product summary column (description + options) didn't use the
   full width — a wide empty band on the right. Make it span the row. */
@media (max-width: 767px) {
    .single-product div.product .summary,
    .single-product div.product .entry-summary,
    .single-product div.product .summary-inner,
    .single-product .product-summary-wrap,
    .single-product .single-product-page .summary {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        float: none !important;
    }
    .nbo-sg, .nbo-sg .nbd-option-wrapper, .sg-opt-progress {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Mobile, WPBakery product layout (confirmed via devtools):
   1. the summary column's inner wrapper carries big left/right padding from
      its "Design options" (vc_custom_…) — meant for desktop;
   2. columns inside a flex inner row (vc_row-flex > vc_col-sm-12) only get
      width:100% from 768px up, so below that they shrank to their content. */
@media (max-width: 767px) {
    .single-product .wpb-content-wrapper .vc_row > .wpb_column > .vc_column-inner {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    .single-product .wpb-content-wrapper .vc_row .vc_row > .wpb_column > .vc_column-inner {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .single-product .wpb-content-wrapper .vc_row-flex > .wpb_column,
    .single-product .wpb-content-wrapper .vc_row-flex > .vc_column_container {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* Mobile: the column is "wd-enabled-flex", so its .wpb_wrapper is a flex
   container and the add-to-cart / printing-options block inside shrank to
   its content (empty band on the right, seen in devtools). Let it fill. */
@media (max-width: 767px) {
    .single-product .wd-enabled-flex > .vc_column-inner > .wpb_wrapper > * {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .single-product form.cart:has(.nbo-sg),
    .single-product .nbo-sg {
        width: 100% !important;
    }
}

/* Desktop: tiles were 2 per row (huge). The earlier 3-col rule sat BEFORE
   the generated 50% rule with equal specificity, so it lost — this one is
   last and more specific. Wide column (≥ 560px) → 4 per row. */
@media (min-width: 768px) {
    .nbo-sg .nbd-option-field.sg-card .nbd-xlabel-wrapper > .nbd-xlabel-wrap {
        width: calc(33.333% - 6px) !important;
    }
    .nbo-sg .nbd-option-field.sg-card .nbd-xlabel-value {
        padding-top: 62% !important;
    }
}
@container (min-width: 560px) {
    .nbo-sg .nbd-option-field.sg-card .nbd-xlabel-wrapper > .nbd-xlabel-wrap {
        width: calc(25% - 6px) !important;
    }
}
.nbo-sg .nbd-option-field.sg-card > .nbd-field-content {
    container-type: inline-size;
}

/* Square option images (client: all their images are square) —
   overrides the 72% / 62% heights above, every screen size. */
.nbo-sg .nbd-option-field.sg-card .nbd-xlabel-wrapper .nbd-xlabel-value {
    padding-top: 100% !important;
}
