/* ─────────────────────────────────────────────────────────────────────
   KSEC Backorder Manager — Product page notice + checkout tag (v0.9.9)
   Ports the legacy customizer styling into the plugin, status-aware via
   CSS variables defined in restock-status.css.
   ───────────────────────────────────────────────────────────────────── */

/* ────────── Product page notice box (replaces snippet 25 cmpt 2) ────────── */

.ksec-backorder-notice.ksec-bo-product-notice {
    background: var(--ksec-bo-bg);
    border: 1px solid var(--ksec-bo-border);
    border-radius: 10px;
    padding: 16px 18px;
    margin: 0 0 16px;
    clear: both;
    position: relative;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ksec-bo-text);
}

/* Decorative blob in the top-right corner — preserves the customizer's
   hero treatment. Status-aware via the variable. */
.ksec-backorder-notice.ksec-bo-product-notice::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--ksec-bo-decorative);
    pointer-events: none;
}

/* Header — dot wrapper + eyebrow + title */
.ksec-bo-product-notice .ksec-bon-header,
.ksec-bo-product-notice__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    position: relative; /* sits above the ::before blob */
}

.ksec-bo-product-notice__icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    background: var(--ksec-bo-icon-bg);
    border: 1px solid var(--ksec-bo-icon-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ksec-bo-product-notice .ksec-bon-eyebrow,
.ksec-bo-product-notice__eyebrow {
    font-family: 'Syne', 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ksec-bo-eyebrow);
    margin: 0 0 2px;
}

.ksec-bo-product-notice .ksec-bon-title,
.ksec-bo-product-notice__title {
    font-family: 'Syne', 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #111111;
    line-height: 1.2;
    margin: 0;
}

.ksec-bo-product-notice .ksec-bon-divider,
.ksec-bo-product-notice__divider {
    height: .5px;
    background: var(--ksec-bo-border);
    margin: 0 0 12px;
}

.ksec-bo-product-notice .ksec-bon-body,
.ksec-bo-product-notice__body {
    font-size: 14px;
    color: var(--ksec-bo-text);
    line-height: 1.6;
    margin-bottom: 10px;
}

/* Business no-cancel line: its own line, tucked under the body paragraph */
.ksec-bo-product-notice .ksec-bo-product-notice__business {
    margin-top: -4px;
}

.ksec-bo-product-notice .ksec-bon-note,
.ksec-bo-product-notice__note {
    font-size: 14px;
    color: var(--ksec-bo-eyebrow);
    line-height: 1.5;
    margin: 0 0 10px;
    font-style: italic;
}

/* Link chips — small white-on-coloured pills, status-tinted border */
.ksec-bo-product-notice .ksec-bon-links,
.ksec-bo-product-notice__links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.ksec-bo-product-notice .ksec-bon-link,
.ksec-bo-product-notice__link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ksec-bo-link);
    background: #FFFFFF;
    border: 1px solid var(--ksec-bo-link-decoration);
    border-radius: 6px;
    padding: 5px 10px;
    text-decoration: none;
    transition: background .15s;
}
.ksec-bo-product-notice .ksec-bon-link:hover,
.ksec-bo-product-notice__link:hover {
    background: var(--ksec-bo-link-bg-hover);
}

.ksec-bo-product-notice .ksec-bon-disclaimer,
.ksec-bo-product-notice__disclaimer {
    font-size: 12.5px;
    color: #666666;
    line-height: 1.5;
    padding-top: 10px;
    border-top: .5px solid var(--ksec-bo-border);
    margin: 0;
}

/* ────────── WOOBT — WPC Frequently Bought Together (v0.11.1) ──────────
   WOOBT wraps the stock notice in `<div class="woobt-availability">`.
   Compact the inline notice for the narrower FBT column.

   v0.11.1 fixes:
     - Shoptimizer / WOOBT override `.stock.available-on-backorder` text
       colour with amber. !important on bg + colour forces our palette.
     - Icon circle dropped in WOOBT context — green-on-green-on-green was
       washing out the dot. Just the bare dot reads more clearly here.
     - flex-wrap: wrap removed — the icon was breaking onto its own line.
       Use nowrap with align-items: flex-start so the dot sits next to
       the first line and the text wraps naturally beside it. */

.woobt-availability p.stock.available-on-backorder.ksec-bo-stock-line {
    font-size: 12.5px;
    padding: 6px 10px;
    margin: 4px 0;
    border-radius: 6px;
    line-height: 1.4;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
    /* Force the palette through theme + WOOBT overrides. */
    background: var(--ksec-bo-bg, #F2FFF7) !important;
    border: 1px solid var(--ksec-bo-border, #C8EEDA) !important;
    color: var(--ksec-bo-text, #444444) !important;
}
.woobt-availability p.stock.available-on-backorder.ksec-bo-stock-line > span {
    color: var(--ksec-bo-text, #444444) !important;
}
.woobt-availability p.stock.available-on-backorder.ksec-bo-stock-line a {
    color: var(--ksec-bo-link, #007A30) !important;
    text-decoration: underline;
    text-decoration-color: var(--ksec-bo-link-decoration, #BBEDCC);
}

/* Drop the icon circle in WOOBT — the bare dot reads better in the
   compact context (and the circle's tinted bg clashed with the row's
   already-tinted bg). */
.woobt-availability p.stock.available-on-backorder.ksec-bo-stock-line .ksec-bo-stock-line__icon {
    width: auto;
    height: auto;
    background: transparent !important;
    border: none !important;
    margin-top: 5px;
    flex-shrink: 0;
}
.woobt-availability p.stock.available-on-backorder.ksec-bo-stock-line .ksec-bo-stock-line__icon .ksec-bo-dot {
    width: 10px;
    height: 10px;
}

/* Fallback selectors for alternative WOOBT layouts — same compact rules. */
.woobt-products p.stock.available-on-backorder.ksec-bo-stock-line,
.woobt-product p.stock.available-on-backorder.ksec-bo-stock-line,
.woobt-table p.stock.available-on-backorder.ksec-bo-stock-line {
    font-size: 12.5px;
    padding: 6px 10px;
    margin: 4px 0;
    border-radius: 6px;
    line-height: 1.4;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
    background: var(--ksec-bo-bg, #F2FFF7) !important;
    border: 1px solid var(--ksec-bo-border, #C8EEDA) !important;
    color: var(--ksec-bo-text, #444444) !important;
}
.woobt-products p.stock.available-on-backorder.ksec-bo-stock-line .ksec-bo-stock-line__icon,
.woobt-product p.stock.available-on-backorder.ksec-bo-stock-line .ksec-bo-stock-line__icon,
.woobt-table p.stock.available-on-backorder.ksec-bo-stock-line .ksec-bo-stock-line__icon {
    width: auto;
    height: auto;
    background: transparent !important;
    border: none !important;
    margin-top: 5px;
}
.woobt-products p.stock.available-on-backorder.ksec-bo-stock-line .ksec-bo-stock-line__icon .ksec-bo-dot,
.woobt-product p.stock.available-on-backorder.ksec-bo-stock-line .ksec-bo-stock-line__icon .ksec-bo-dot,
.woobt-table p.stock.available-on-backorder.ksec-bo-stock-line .ksec-bo-stock-line__icon .ksec-bo-dot {
    width: 10px;
    height: 10px;
}

/* ────────── WC Bundles context support (v0.11.0) ──────────
   Bundle availability widget + bundled-item cart line details both
   render the same `<p class="stock available-on-backorder">` markup,
   but the surrounding layout is narrower / inline. Override the main
   flex layout to a block layout for these contexts; status colours
   still flow through via CSS variables. */

.bundled_item_cart_details p.stock.available-on-backorder,
.bundle_availability p.stock.available-on-backorder {
    display: block;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--ksec-bo-text, #444444);
    background: var(--ksec-bo-bg, #F2FFF7);
    border: 1px solid var(--ksec-bo-border, #C8EEDA);
    border-radius: 8px;
    padding: 9px 12px;
    margin: 0 0 12px;
}

.bundle_availability p.stock.available-on-backorder a {
    color: var(--ksec-bo-link, #007A30);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: var(--ksec-bo-link-decoration, #BBEDCC);
}
.bundle_availability p.stock.available-on-backorder a:hover {
    text-decoration-color: var(--ksec-bo-link, #007A30);
}

/* WC Bundles validation / info notices — keep the typography in line
   with the rest of the plugin so the bundle config UI reads cleanly. */
.bundle_error .woocommerce-info {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    border-radius: 8px;
    padding: 9px 12px;
}
.bundle_error .woocommerce-info ul.msg {
    margin: 0;
    padding: 0;
    list-style: none;
}
.bundle_error .woocommerce-info ul.msg li {
    margin: 0;
    padding: 0;
}

/* ────────── Checkout cart line tag (replaces snippet 25 cmpt 3) ────────── */

.ksec-checkout-line-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #CC0009;
    background: #FFF5F5;
    border: 1px solid #FFDDDD;
    border-radius: 5px;
    padding: 3px 8px;
    margin-top: 4px;
    white-space: nowrap;
}
.ksec-checkout-line-status::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #E8000D;
    flex-shrink: 0;
}
