/* =============================================================================
   Popup Buy Now Checkout — v1.1.0
   ============================================================================= */

:root {
    --pbnc-blue:        #2563eb;
    --pbnc-blue-dark:   #1d4ed8;
    --pbnc-blue-light:  #eff6ff;
    --pbnc-green:       #16a34a;
    --pbnc-green-bg:    #f0fdf4;
    --pbnc-red:         #dc2626;
    --pbnc-red-bg:      #fef2f2;
    --pbnc-text:        #111827;
    --pbnc-muted:       #6b7280;
    --pbnc-border:      #e5e7eb;
    --pbnc-bg:          #ffffff;
    --pbnc-surface:     #f9fafb;
    --pbnc-overlay:     rgba(0,0,0,0.60);
    --pbnc-r:           10px;
    --pbnc-r-sm:        7px;
    --pbnc-shadow:      0 24px 64px rgba(0,0,0,0.18), 0 4px 16px rgba(0,0,0,0.09);
    --pbnc-t:           0.22s cubic-bezier(.4,0,.2,1);
    --pbnc-font:        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --pbnc-w:           500px;
}

/* Body lock */
body.pbnc-body-locked { overflow: hidden; }

/* =============================================================================
   Overlay
   ============================================================================= */
.pbnc-overlay {
    position:        fixed;
    inset:           0;
    z-index:         999999;
    display:         flex;
    align-items:     center;
    justify-content: center;
    padding:         16px;
    background:      var(--pbnc-overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity:         0;
    visibility:      hidden;
    transition:      opacity var(--pbnc-t), visibility var(--pbnc-t);
    font-family:     var(--pbnc-font);
}
.pbnc-overlay.pbnc-is-open { opacity: 1; visibility: visible; }

/* =============================================================================
   Modal
   ============================================================================= */
.pbnc-modal {
    position:        relative;
    width:           100%;
    max-width:       var(--pbnc-w);
    max-height:      92vh;
    overflow-y:      auto;
    background:      var(--pbnc-bg);
    border-radius:   var(--pbnc-r);
    box-shadow:      var(--pbnc-shadow);
    transform:       translateY(20px) scale(.97);
    transition:      transform var(--pbnc-t);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--pbnc-border) transparent;
}
.pbnc-modal::-webkit-scrollbar       { width: 5px; }
.pbnc-modal::-webkit-scrollbar-thumb { background: var(--pbnc-border); border-radius: 3px; }
.pbnc-overlay.pbnc-is-open .pbnc-modal { transform: translateY(0) scale(1); }

/* =============================================================================
   Close button
   ============================================================================= */
.pbnc-close {
    position:   absolute;
    top:        12px;
    right:      12px;
    width:      30px;
    height:     30px;
    display:    flex;
    align-items: center;
    justify-content: center;
    padding:    0;
    background: transparent;
    border:     1px solid var(--pbnc-border);
    border-radius: 50%;
    color:      var(--pbnc-muted);
    cursor:     pointer;
    transition: background var(--pbnc-t), color var(--pbnc-t);
    z-index:    10;
}
.pbnc-close:hover, .pbnc-close:focus-visible {
    background: var(--pbnc-surface);
    color:      var(--pbnc-text);
    outline:    none;
}
.pbnc-close svg { width: 13px; height: 13px; display: block; }

/* =============================================================================
   Header
   ============================================================================= */
.pbnc-header {
    display:     flex;
    align-items: flex-start;
    gap:         12px;
    padding:     24px 24px 0;
}
.pbnc-header-icon {
    flex-shrink:     0;
    width:           40px;
    height:          40px;
    display:         flex;
    align-items:     center;
    justify-content: center;
    background:      var(--pbnc-blue-light);
    border-radius:   9px;
    color:           var(--pbnc-blue);
}
.pbnc-header-icon svg { width: 20px; height: 20px; }
.pbnc-title   { margin: 0 0 3px !important; font-size: 1.1rem !important; font-weight: 700 !important; color: var(--pbnc-text) !important; line-height: 1.3 !important; }
.pbnc-subtitle { margin: 0 !important; font-size: 0.79rem !important; color: var(--pbnc-muted) !important; }

/* =============================================================================
   Product strip
   ============================================================================= */
.pbnc-product-summary {
    display:      flex;
    align-items:  center;
    gap:          10px;
    margin:       14px 24px 0;
    padding:      10px 12px;
    background:   var(--pbnc-surface);
    border:       1px solid var(--pbnc-border);
    border-radius: var(--pbnc-r-sm);
}
.pbnc-product-thumb img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; display: block; }
.pbnc-product-info  { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pbnc-product-name  { font-size: .83rem; font-weight: 600; color: var(--pbnc-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbnc-product-price { font-size: .80rem; color: var(--pbnc-muted); }
.pbnc-product-price .woocommerce-Price-amount { color: var(--pbnc-blue); font-weight: 600; }

/* =============================================================================
   Form wrap
   ============================================================================= */
.pbnc-form-wrap { padding: 18px 24px 24px; }

/* Message */
.pbnc-message { padding: 9px 13px; margin-bottom: 16px; border-radius: var(--pbnc-r-sm); font-size: .83rem; font-weight: 500; line-height: 1.5; }
.pbnc-msg-error   { background: var(--pbnc-red-bg);   border: 1px solid #fecaca; color: var(--pbnc-red);   }
.pbnc-msg-success { background: var(--pbnc-green-bg); border: 1px solid #bbf7d0; color: var(--pbnc-green); }

/* Row / grid */
.pbnc-row      { margin-bottom: 14px; }
.pbnc-row:last-child { margin-bottom: 0; }
.pbnc-grid-3   { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* Field */
.pbnc-field { display: flex; flex-direction: column; gap: 5px; }
.pbnc-field label {
    font-size:   .76rem !important;
    font-weight: 600 !important;
    color:       var(--pbnc-text) !important;
    margin:      0 !important;
    letter-spacing: .01em;
}
.pbnc-req { color: var(--pbnc-red); margin-left: 2px; }

/* Input wrapper */
.pbnc-inp-wrap { position: relative; display: flex; align-items: center; }

.pbnc-inp-ico {
    position:       absolute;
    left:           9px;
    width:          14px;
    height:         14px;
    color:          #9ca3af;
    pointer-events: none;
    flex-shrink:    0;
    display:        block;
}

/* Inputs */
.pbnc-form-wrap input[type="text"],
.pbnc-form-wrap input[type="tel"],
.pbnc-form-wrap input[type="email"],
.pbnc-form-wrap textarea {
    width:          100% !important;
    box-sizing:     border-box !important;
    padding:        8px 10px 8px 32px !important;
    font-size:      .85rem !important;
    font-family:    var(--pbnc-font) !important;
    color:          var(--pbnc-text) !important;
    background:     #fff !important;
    border:         1px solid var(--pbnc-border) !important;
    border-radius:  var(--pbnc-r-sm) !important;
    outline:        none !important;
    box-shadow:     none !important;
    transition:     border-color var(--pbnc-t), box-shadow var(--pbnc-t) !important;
    line-height:    1.5 !important;
    -webkit-appearance: none;
    appearance:     none;
    margin:         0 !important;
}
.pbnc-form-wrap textarea {
    padding-left:   10px !important;
    resize:         vertical;
    min-height:     70px;
}
.pbnc-form-wrap input:focus,
.pbnc-form-wrap textarea:focus {
    border-color: var(--pbnc-blue) !important;
    box-shadow:   0 0 0 3px rgba(37,99,235,.12) !important;
}
.pbnc-form-wrap input::placeholder,
.pbnc-form-wrap textarea::placeholder { color: #c4cdd6 !important; }

/* Pincode spinner inside field */
.pbnc-pin-wrap { position: relative; }
.pbnc-pin-spinner {
    position:     absolute;
    right:        9px;
    width:        13px;
    height:       13px;
    border:       2px solid var(--pbnc-border);
    border-top-color: var(--pbnc-blue);
    border-radius: 50%;
    animation:    pbnc-spin .7s linear infinite;
    display:      none;
}

/* Pincode city/state badge */
.pbnc-pin-location {
    display:     none;
    align-items: center;
    gap:         3px;
    font-size:   .72rem;
    font-weight: 500;
    color:       var(--pbnc-green);
    margin-top:  3px;
}
.pbnc-pin-location svg { flex-shrink: 0; }

/* =============================================================================
   Order Summary Card
   ============================================================================= */
.pbnc-order-card {
    border:        1px solid var(--pbnc-border);
    border-radius: var(--pbnc-r-sm);
    overflow:      hidden;
    margin-bottom: 14px;
}

.pbnc-order-card-title {
    display:     flex;
    align-items: center;
    gap:         7px;
    padding:     10px 14px;
    background:  var(--pbnc-surface);
    border-bottom: 1px solid var(--pbnc-border);
    font-size:   .78rem;
    font-weight: 700;
    color:       var(--pbnc-text);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.pbnc-order-card-title svg { width: 14px; height: 14px; color: var(--pbnc-muted); flex-shrink: 0; }

/* Rows inside card */
.pbnc-order-row {
    display:     flex;
    align-items: center;
    justify-content: space-between;
    gap:         10px;
    padding:     10px 14px;
    border-bottom: 1px solid var(--pbnc-border);
    font-size:   .83rem;
}
.pbnc-order-row:last-child { border-bottom: none; }

.pbnc-order-row-lbl { color: var(--pbnc-muted); flex-shrink: 0; }
.pbnc-order-row-val { text-align: right; color: var(--pbnc-text); flex: 1; }

/* Loading state */
.pbnc-ship-loading-txt {
    display:     inline-flex;
    align-items: center;
    gap:         6px;
    font-size:   .80rem;
    color:       var(--pbnc-muted);
    font-style:  italic;
}
.pbnc-ship-spin {
    display:       inline-block;
    width:         12px;
    height:        12px;
    border:        2px solid var(--pbnc-border);
    border-top-color: var(--pbnc-blue);
    border-radius: 50%;
    animation:     pbnc-spin .7s linear infinite;
    flex-shrink:   0;
}

/* Idle */
.pbnc-ship-idle-txt { font-size: .79rem; color: var(--pbnc-muted); font-style: italic; }

/* Free shipping badge */
.pbnc-ship-free {
    display:     inline-flex;
    align-items: center;
    gap:         4px;
    font-weight: 600;
    color:       var(--pbnc-green);
    font-size:   .83rem;
}
.pbnc-ship-free svg { flex-shrink: 0; }

/* Single rate result */
.pbnc-ship-single { font-size: .83rem; color: var(--pbnc-text); }
.pbnc-ship-single b { color: var(--pbnc-blue); }

/* Choose label */
.pbnc-ship-choose-lbl { font-size: .76rem; color: var(--pbnc-muted); font-weight: 500; }

/* Grand total row */
.pbnc-order-total-row {
    background:    var(--pbnc-surface);
    border-top:    2px solid var(--pbnc-border) !important;
}
.pbnc-total-lbl { font-weight: 700 !important; color: var(--pbnc-text) !important; }
.pbnc-total-val { font-weight: 700 !important; font-size: .95rem !important; color: var(--pbnc-blue) !important; }

/* =============================================================================
   Shipping method radio options
   ============================================================================= */
.pbnc-ship-methods {
    padding:        2px 14px 12px;
    display:        flex;
    flex-direction: column;
    gap:            6px;
}

.pbnc-ship-opt {
    display:        flex;
    align-items:    center;
    gap:            8px;
    padding:        8px 11px;
    border:         1.5px solid var(--pbnc-border);
    border-radius:  var(--pbnc-r-sm);
    cursor:         pointer;
    transition:     border-color var(--pbnc-t), background var(--pbnc-t);
    font-size:      .83rem;
}
.pbnc-ship-opt:hover,
.pbnc-ship-opt.is-active {
    border-color: var(--pbnc-blue);
    background:   var(--pbnc-blue-light);
}

.pbnc-ship-opt input[type="radio"] {
    width:         14px !important;
    height:        14px !important;
    padding:       0 !important;
    margin:        0 !important;
    flex-shrink:   0;
    accent-color:  var(--pbnc-blue);
    border:        none !important;
    box-shadow:    none !important;
}

.pbnc-ship-opt-lbl  { flex: 1; font-weight: 500; color: var(--pbnc-text); }
.pbnc-ship-opt-cost { font-weight: 700; white-space: nowrap; color: var(--pbnc-blue); }
.pbnc-ship-opt-cost em { font-style: normal; color: var(--pbnc-green); }
.pbnc-ship-free-tag { color: var(--pbnc-green); font-weight: 600; font-style: normal; }

/* =============================================================================
   Submit button
   ============================================================================= */
.pbnc-submit-btn {
    display:         flex !important;
    align-items:     center !important;
    justify-content: center !important;
    gap:             8px !important;
    width:           100% !important;
    padding:         13px 24px !important;
    font-size:       .95rem !important;
    font-weight:     600 !important;
    font-family:     var(--pbnc-font) !important;
    color:           #fff !important;
    border:          none !important;
    border-radius:   var(--pbnc-r-sm) !important;
    cursor:          pointer !important;
    box-shadow:      0 2px 8px rgba(37,99,235,.22) !important;
    transition:      filter var(--pbnc-t), box-shadow var(--pbnc-t) !important;
    min-height:      48px !important;
    -webkit-appearance: none !important;
    appearance:      none !important;
    margin-bottom:   0 !important;
}
.pbnc-submit-btn:hover:not(:disabled) {
    filter:     brightness(1.09) !important;
    box-shadow: 0 4px 16px rgba(37,99,235,.32) !important;
}
.pbnc-submit-btn:active:not(:disabled) { transform: scale(.99); }
.pbnc-submit-btn:disabled, .pbnc-submit-btn.pbnc-loading { opacity: .72; cursor: not-allowed !important; }
.pbnc-submit-text { display: flex; align-items: center; gap: 8px; }
.pbnc-submit-text svg { width: 17px; height: 17px; }

.pbnc-spinner {
    width:         20px;
    height:        20px;
    border:        2.5px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation:     pbnc-spin .7s linear infinite;
}

/* Secure note */
.pbnc-secure-note {
    display:         flex !important;
    align-items:     center !important;
    justify-content: center !important;
    gap:             5px !important;
    margin:          11px 0 0 !important;
    font-size:       .73rem !important;
    color:           var(--pbnc-muted) !important;
    font-weight:     400 !important;
}
.pbnc-secure-note svg { width: 12px; height: 12px; flex-shrink: 0; }

/* =============================================================================
   Elementor compatibility
   ============================================================================= */

/* Hide the original native ATC button when our injected one is present */
.pbnc-injected ~ button[type="submit"].single_add_to_cart_button:not(.pbnc-buy-now-btn),
form.cart .elementor-button-wrapper button.single_add_to_cart_button:not(.pbnc-buy-now-btn),
form.cart .elementor-button.single_add_to_cart_button:not(.pbnc-buy-now-btn) {
    display: none !important;
}

/* Elementor stretches its button container — match that width */
.elementor-add-to-cart .pbnc-buy-now-btn,
.elementor-widget-woocommerce-product-add-to-cart .pbnc-buy-now-btn,
.e-wc-product-add-to-cart .pbnc-buy-now-btn {
    width: 100% !important;
    margin-top: 6px !important;
}

/* Inside Elementor button-wrapper divs */
.elementor-button-wrapper .pbnc-buy-now-btn {
    width:        100% !important;
    border-radius: var(--pbnc-r-sm) !important;
}

/* =============================================================================
   Buy Now button (product pages)
   ============================================================================= */
.pbnc-buy-now-btn {
    display:         inline-flex !important;
    align-items:     center !important;
    justify-content: center !important;
    width:           100% !important;
    padding:         12px 28px !important;
    font-size:       1rem !important;
    font-weight:     600 !important;
    color:           #fff !important;
    border:          none !important;
    border-radius:   var(--pbnc-r-sm) !important;
    cursor:          pointer !important;
    box-shadow:      0 2px 8px rgba(37,99,235,.22) !important;
    transition:      filter .2s, box-shadow .2s !important;
    -webkit-appearance: none !important;
    appearance:      none !important;
    text-transform:  none !important;
}
.pbnc-buy-now-btn:hover, .pbnc-buy-now-btn:focus-visible {
    filter:         brightness(1.1) !important;
    box-shadow:     0 4px 16px rgba(37,99,235,.3) !important;
    outline:        none !important;
}
.pbnc-buy-now-btn:active { transform: scale(.98) !important; }

/* =============================================================================
   Animations
   ============================================================================= */
@keyframes pbnc-spin { to { transform: rotate(360deg); } }

/* =============================================================================
   Responsive
   ============================================================================= */
@media (max-width: 600px) {
    .pbnc-overlay   { align-items: flex-end; padding: 0; }
    .pbnc-modal     {
        max-height:    95vh;
        border-radius: 16px 16px 0 0;
        transform:     translateY(100%);
    }
    .pbnc-overlay.pbnc-is-open .pbnc-modal { transform: translateY(0); }

    .pbnc-grid-3    { grid-template-columns: 1fr; }
    .pbnc-header    { padding: 20px 18px 0; }
    .pbnc-form-wrap { padding: 16px 18px 22px; }
    .pbnc-product-summary { margin: 12px 18px 0; }
}

@media (max-width: 380px) {
    .pbnc-header, .pbnc-form-wrap, .pbnc-product-summary { padding-left: 14px; padding-right: 14px; }
    .pbnc-product-summary { margin-left: 14px; margin-right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .pbnc-overlay, .pbnc-modal { transition: none !important; }
    .pbnc-spinner, .pbnc-pin-spinner, .pbnc-ship-spin { animation: none !important; opacity: .6; }
}

/* =============================================================================
   v2 — Stock badge, Upsell/Order Bump, Coupon field
   ============================================================================= */

/* ── Stock countdown badge ─────────────────────────────────────────── */
.pbnc-stock-badge {
    display:         flex;
    align-items:     center;
    gap:             6px;
    background:      #fff7ed;
    border:          1px solid #fed7aa;
    color:           #c2410c;
    font-size:       .8rem;
    font-weight:     500;
    padding:         7px 12px;
    border-radius:   var(--pbnc-r-sm);
    margin:          0 var(--pbnc-modal-pad) 4px;
    animation:       pbnc-pulse 2s infinite;
}
.pbnc-stock-badge strong { font-weight: 700; }

@keyframes pbnc-pulse {
    0%,100% { opacity:1; }
    50%      { opacity:.75; }
}

/* ── Qty stepper (in product strip) ───────────────────────────────── */
.pbnc-product-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px var(--pbnc-modal-pad);
    background: var(--pbnc-surface);
    border-bottom: 1px solid var(--pbnc-border);
}
.pbnc-qty-wrap {
    display:     flex;
    align-items: center;
    gap:         4px;
    margin-left: auto;
    flex-shrink: 0;
}
.pbnc-qty-btn {
    width:            28px;
    height:           28px;
    border:           1px solid var(--pbnc-border);
    border-radius:    6px;
    background:       #fff;
    color:            var(--pbnc-text);
    font-size:        1.1rem;
    line-height:      1;
    cursor:           pointer;
    display:          flex;
    align-items:      center;
    justify-content:  center;
    transition:       background .15s, border-color .15s;
}
.pbnc-qty-btn:hover { background: var(--pbnc-surface); border-color: var(--pbnc-muted); }

#pbnc-quantity {
    width:      40px;
    text-align: center;
    border:     1px solid var(--pbnc-border);
    border-radius: 6px;
    padding:    2px 4px;
    font-size:  .9rem;
    font-weight:600;
    color:      var(--pbnc-text);
    background: #fff;
    -moz-appearance: textfield;
}
#pbnc-quantity::-webkit-inner-spin-button,
#pbnc-quantity::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ── Upsell / Order bump ───────────────────────────────────────────── */
.pbnc-upsell-wrap {
    margin: 0 0 12px;
    border-radius: var(--pbnc-r-sm);
    overflow: hidden;
}
.pbnc-upsell-card {
    display:       block;
    cursor:        pointer;
    border:        2px dashed var(--pbnc-border);
    border-radius: var(--pbnc-r-sm);
    background:    #f0fdf4;
    transition:    border-color .2s, background .2s;
    user-select:   none;
}
.pbnc-upsell-card:has(.pbnc-upsell-check:checked) {
    border-color: #16a34a;
    background:   #dcfce7;
}
.pbnc-upsell-inner {
    display:     flex;
    align-items: center;
    gap:         10px;
    padding:     10px 12px;
}
.pbnc-upsell-check { position: absolute; opacity: 0; width: 0; height: 0; }

.pbnc-upsell-thumb {
    width:         52px;
    height:        52px;
    object-fit:    cover;
    border-radius: 6px;
    flex-shrink:   0;
    border:        1px solid var(--pbnc-border);
}
.pbnc-upsell-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pbnc-upsell-tag  { font-size: .7rem; font-weight: 700; color: #16a34a; text-transform: uppercase; letter-spacing: .04em; }
.pbnc-upsell-label { font-size: .8rem; color: var(--pbnc-muted); }
.pbnc-upsell-name  { font-size: .9rem; font-weight: 600; color: var(--pbnc-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbnc-upsell-price-row { display: flex; align-items: center; gap: 6px; }
.pbnc-upsell-price      { font-size: .95rem; font-weight: 700; color: #16a34a; }
.pbnc-upsell-orig-price { font-size: .78rem; color: var(--pbnc-muted); text-decoration: line-through; }

.pbnc-upsell-checkbox-wrap {
    flex-shrink:      0;
    width:            22px;
    height:           22px;
    border:           2px solid var(--pbnc-border);
    border-radius:    5px;
    background:       #fff;
    display:          flex;
    align-items:      center;
    justify-content:  center;
    transition:       background .2s, border-color .2s;
}
.pbnc-upsell-card:has(.pbnc-upsell-check:checked) .pbnc-upsell-checkbox-wrap {
    background:   #16a34a;
    border-color: #16a34a;
}
.pbnc-upsell-checkbox-icon {
    display: block;
    width:   10px;
    height:  6px;
    border-left:   2px solid #fff;
    border-bottom: 2px solid #fff;
    transform:     rotate(-45deg) translateY(-1px);
    opacity: 0;
    transition: opacity .15s;
}
.pbnc-upsell-card:has(.pbnc-upsell-check:checked) .pbnc-upsell-checkbox-icon { opacity: 1; }

/* ── Shipping Combo Upsell card ───────────────────────────────────── */
.pbnc-combo-wrap {
    margin: 0 0 12px;
    border-radius: var(--pbnc-r-sm);
    overflow: hidden;
}
.pbnc-combo-card-ui {
    display:       block;
    cursor:        pointer;
    border:        2px dashed #bfdbfe;
    border-radius: var(--pbnc-r-sm);
    background:    #eff6ff;
    transition:    border-color .2s, background .2s;
    user-select:   none;
}
.pbnc-combo-card-ui:has(.pbnc-combo-check:checked) {
    border-color: #2563eb;
    background:   #dbeafe;
}
.pbnc-combo-inner {
    display:     flex;
    align-items: center;
    gap:         10px;
    padding:     10px 12px;
}
.pbnc-combo-check { position: absolute; opacity: 0; width: 0; height: 0; }
.pbnc-combo-thumb {
    width:         52px;
    height:        52px;
    object-fit:    cover;
    border-radius: 6px;
    flex-shrink:   0;
    border:        1px solid #bfdbfe;
}
.pbnc-combo-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pbnc-combo-tag     { font-size: .7rem; font-weight: 700; color: #1d4ed8; text-transform: uppercase; letter-spacing: .04em; }
.pbnc-combo-saving  { font-size: .82rem; font-weight: 700; color: #15803d; background: #dcfce7; display: inline-block; padding: 1px 7px; border-radius: 10px; width: fit-content; }
.pbnc-combo-name    { font-size: .9rem; font-weight: 600; color: var(--pbnc-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbnc-combo-desc    { font-size: .78rem; color: var(--pbnc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbnc-combo-price-row { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.pbnc-combo-price   { font-size: .95rem; font-weight: 700; color: #1d4ed8; }
.pbnc-combo-add-hint { font-size: .75rem; color: var(--pbnc-muted); }
.pbnc-combo-card-ui:has(.pbnc-combo-check:checked) .pbnc-upsell-checkbox-wrap {
    background:   #2563eb;
    border-color: #2563eb;
}
.pbnc-combo-card-ui:has(.pbnc-combo-check:checked) .pbnc-upsell-checkbox-icon { opacity: 1; }

/* Combo reward badge on shipping row */
.pbnc-combo-reward-badge {
    display: inline-block;
    background: #6366f1;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    margin-left: 4px;
    vertical-align: middle;
    letter-spacing: .03em;
    text-transform: uppercase;
}

/* ── Coupon code row ───────────────────────────────────────────────── */
.pbnc-coupon-row { margin-bottom: 12px; }

.pbnc-coupon-input-wrap {
    display:       flex;
    align-items:   center;
    gap:           0;
    border:        1px solid var(--pbnc-border);
    border-radius: var(--pbnc-r-sm);
    overflow:      hidden;
    background:    #fff;
    transition:    border-color .2s;
}
.pbnc-coupon-input-wrap:focus-within { border-color: var(--pbnc-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

.pbnc-coupon-ico {
    width:      36px;
    flex-shrink:0;
    padding:    0 10px;
    color:      var(--pbnc-muted);
}
.pbnc-coupon-input-wrap input {
    flex:       1;
    border:     none !important;
    outline:    none !important;
    box-shadow: none !important;
    padding:    9px 4px;
    font-size:  .88rem;
    color:      var(--pbnc-text);
    background: transparent;
    min-width:  0;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.pbnc-coupon-apply-btn {
    flex-shrink: 0;
    padding:     0 14px;
    height:      38px;
    background:  var(--pbnc-surface);
    border:      none;
    border-left: 1px solid var(--pbnc-border);
    color:       var(--pbnc-primary);
    font-weight: 600;
    font-size:   .82rem;
    cursor:      pointer;
    transition:  background .15s;
}
.pbnc-coupon-apply-btn:hover     { background: #e0e7ff; }
.pbnc-coupon-apply-btn:disabled  { opacity: .6; cursor: not-allowed; }

.pbnc-coupon-msg { font-size: .8rem; margin-top: 6px; padding: 6px 10px; border-radius: 6px; display: none; }
.pbnc-coupon-ok  { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.pbnc-coupon-err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* Flash highlight when code is auto-filled from pill */
@keyframes pbnc-coupon-flash {
    0%   { border-color: #d1d5db; box-shadow: none; }
    30%  { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.25); }
    100% { border-color: #d1d5db; box-shadow: none; }
}
.pbnc-coupon-highlight {
    animation: pbnc-coupon-flash 1.2s ease forwards;
}

/* ── Coupon discount row in summary ─────────────────────────────────── */
.pbnc-coupon-discount-row { color: #16a34a; }
.pbnc-discount-lbl { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: #16a34a; }
.pbnc-discount-val { font-weight: 700; color: #16a34a; }

.pbnc-remove-coupon {
    background:  none;
    border:      none;
    color:       var(--pbnc-muted);
    cursor:      pointer;
    font-size:   1rem;
    line-height: 1;
    padding:     0 2px;
    transition:  color .15s;
}
.pbnc-remove-coupon:hover { color: #dc2626; }

/* =============================================================================
   v3 — Available Coupons strip, Free Shipping progress bar
   ============================================================================= */

/* ── Available coupons strip ───────────────────────────────────────── */
.pbnc-coupons-strip {
    background:    #fafafa;
    border-bottom: 1px solid #ebebeb;
    padding:       10px var(--pbnc-modal-pad) 0;
}
.pbnc-coupons-strip-label {
    display:        flex;
    align-items:    center;
    gap:            5px;
    font-size:      .7rem;
    font-weight:    700;
    color:          #888;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom:  8px;
}
.pbnc-coupon-chips {
    display:   flex;
    flex-wrap: wrap;
    gap:       7px;
    padding-bottom: 10px;
}

/* ── Code-only pill ────────────────────────────────────────────────── */
.pbnc-coupon-pill {
    display:        inline-flex;
    align-items:    center;
    gap:            5px;
    background:     #fff;
    border:         1.5px dashed #d1d5db;
    border-radius:  6px;
    padding:        5px 11px;
    font-family:    'Courier New', Courier, monospace;
    font-size:      .82rem;
    font-weight:    700;
    color:          #374151;
    letter-spacing: .06em;
    cursor:         pointer;
    transition:     border-color .15s, color .15s, background .15s, transform .12s;
    position:       relative;
}
.pbnc-coupon-pill::after {
    content:     '›';
    font-size:   .9rem;
    font-family: sans-serif;
    color:       #9ca3af;
    transition:  transform .15s, color .15s;
    font-weight: 400;
    letter-spacing: 0;
}
.pbnc-coupon-pill:hover {
    border-color: #6366f1;
    border-style: solid;
    color:        #4338ca;
    background:   #eef2ff;
    transform:    translateY(-1px);
}
.pbnc-coupon-pill:hover::after { color: #6366f1; transform: translateX(2px); }

.pbnc-coupon-pill.is-open {
    border-color: #6366f1;
    border-style: solid;
    color:        #4338ca;
    background:   #eef2ff;
}
.pbnc-coupon-pill.is-open::after { content: '›'; transform: rotate(90deg); color: #6366f1; }

.pbnc-coupon-pill.is-applied {
    border-color: #16a34a;
    border-style: solid;
    color:        #15803d;
    background:   #f0fdf4;
}
.pbnc-coupon-pill.is-applied::after { content: '✓'; color: #16a34a; font-size: .75rem; transform: none; }

/* ── Expandable detail drawer ──────────────────────────────────────── */
.pbnc-coupon-detail {
    background:    #fff;
    border:        1.5px solid #6366f1;
    border-radius: 10px;
    margin:        0 0 10px;
    overflow:      hidden;
}

.pbnc-detail-top {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    padding:         12px 14px 0;
}
.pbnc-detail-code-block {
    display:     flex;
    align-items: baseline;
    gap:         8px;
}
.pbnc-detail-code-label {
    font-size:      .68rem;
    font-weight:    700;
    color:          #9ca3af;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.pbnc-detail-code {
    font-family:    'Courier New', Courier, monospace;
    font-size:      1rem;
    font-weight:    800;
    color:          #4338ca;
    letter-spacing: .08em;
}

.pbnc-detail-copy {
    display:      flex;
    align-items:  center;
    gap:          4px;
    background:   #f5f3ff;
    border:       1px solid #c4b5fd;
    border-radius:6px;
    padding:      4px 10px;
    font-size:    .72rem;
    font-weight:  600;
    color:        #6d28d9;
    cursor:       pointer;
    font-family:  inherit;
    transition:   background .15s;
}
.pbnc-detail-copy:hover  { background: #ede9fe; }
.pbnc-detail-copy.copied { background: #dcfce7; border-color: #86efac; color: #15803d; }

.pbnc-detail-body {
    padding: 8px 14px 12px;
}
.pbnc-detail-disc {
    font-size:   .9rem;
    color:       #111827;
    margin:      0 0 8px;
    line-height: 1.4;
}
.pbnc-detail-disc strong { color: #4338ca; }

.pbnc-detail-desc {
    font-size:   .8rem;
    color:       #4b5563;
    margin:      -4px 0 8px;
    line-height: 1.5;
    padding:     6px 10px;
    background:  #f5f3ff;
    border-radius: 6px;
    border-left: 3px solid #a5b4fc;
}

.pbnc-detail-meta {
    display:   flex;
    gap:       12px;
    flex-wrap: wrap;
}
.pbnc-detail-meta span {
    font-size: .73rem;
    color:     #6b7280;
}

.pbnc-detail-apply-btn {
    display:      block;
    width:        100%;
    border:       none;
    border-top:   1px solid #e5e7eb;
    background:   #6366f1;
    color:        #fff;
    font-size:    .85rem;
    font-weight:  700;
    padding:      11px;
    cursor:       pointer;
    font-family:  inherit;
    transition:   background .15s;
    letter-spacing:.02em;
}
.pbnc-detail-apply-btn:hover    { background: #4f46e5; }
.pbnc-detail-apply-btn:disabled { opacity: .6; cursor: not-allowed; }
.pbnc-detail-apply-btn.is-applied {
    background: #16a34a;
    cursor:     pointer;
}
.pbnc-detail-apply-btn.is-applied:hover { background: #15803d; }

/* ── Free shipping progress bar ────────────────────────────────────── */
.pbnc-freeship-bar {
    padding:       8px var(--pbnc-modal-pad) 6px;
    background:    #f0fdf4;
    border-bottom: 1px solid #bbf7d0;
}
.pbnc-freeship-bar.pbnc-freeship-earned {
    background:    #dcfce7;
    border-color:  #86efac;
}
.pbnc-freeship-msg {
    font-size:   .8rem;
    font-weight: 600;
    color:       #166534;
    margin-bottom:5px;
}
.pbnc-freeship-track {
    height:        6px;
    background:    #d1fae5;
    border-radius: 99px;
    overflow:      hidden;
}
.pbnc-freeship-fill {
    height:      100%;
    background:  linear-gradient(90deg,#34d399,#10b981);
    border-radius:99px;
    transition:  width .5s ease;
}
.pbnc-freeship-fill.pbnc-freeship-full {
    background: linear-gradient(90deg,#10b981,#059669);
}

/* =============================================================================
   v4 — Shipping Engine Admin UI
   (Only shown in WP admin, scoped under .wrap)
   ============================================================================= */

/* ── Mode toggle ────────────────────────────────────────────────────── */
.pbnc-engine-mode-box {
    display:        flex;
    gap:            14px;
    margin:         18px 0 24px;
    flex-wrap:      wrap;
}
.pbnc-mode-opt {
    flex:           1;
    min-width:      240px;
    display:        flex;
    align-items:    flex-start;
    gap:            12px;
    background:     #fff;
    border:         2px solid #e5e7eb;
    border-radius:  10px;
    padding:        14px 16px;
    cursor:         pointer;
    transition:     border-color .18s, box-shadow .18s;
}
.pbnc-mode-opt input[type=radio] { margin-top: 3px; flex-shrink: 0; }
.pbnc-mode-opt.active {
    border-color: #6366f1;
    box-shadow:   0 0 0 3px rgba(99,102,241,.12);
    background:   #fafafe;
}
.pbnc-mode-opt:hover { border-color: #a5b4fc; }
.pbnc-mode-icon { font-size: 1.5rem; line-height: 1; flex-shrink: 0; }
.pbnc-mode-opt strong { display: block; font-size: .92rem; color: #111827; }
.pbnc-mode-opt small  { color: #6b7280; font-size: .78rem; line-height: 1.4; }

/* ── Engine builder header ──────────────────────────────────────────── */
.pbnc-engine-header {
    display:     flex;
    align-items: center;
    gap:         14px;
    flex-wrap:   wrap;
    margin-bottom: 16px;
}
.pbnc-engine-header h3 { margin: 0; font-size: 1.1rem; }
.pbnc-engine-header .description { flex: 1; min-width: 200px; margin: 0; }
.pbnc-zones-empty {
    text-align:  center;
    color:       #9ca3af;
    padding:     40px;
    background:  #fafafa;
    border:      1.5px dashed #e5e7eb;
    border-radius: 10px;
    font-size:   .9rem;
}

/* ── Zone card ──────────────────────────────────────────────────────── */
.pbnc-zone-card {
    display:       flex;
    background:    #fff;
    border:        1.5px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 14px;
    overflow:      hidden;
    transition:    box-shadow .15s;
}
.pbnc-zone-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.07); }
.pbnc-zone-card.pbnc-dragging {
    opacity:    .5;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
}

.pbnc-zone-drag-handle {
    display:      flex;
    align-items:  center;
    justify-content: center;
    width:        32px;
    background:   #f9fafb;
    border-right: 1px solid #e5e7eb;
    color:        #d1d5db;
    font-size:    1.2rem;
    cursor:       grab;
    flex-shrink:  0;
    user-select:  none;
    letter-spacing: -2px;
}
.pbnc-zone-drag-handle:active { cursor: grabbing; }

.pbnc-zone-body { flex: 1; padding: 16px 18px; }

/* ── Zone rows ──────────────────────────────────────────────────────── */
.pbnc-zone-row { margin-bottom: 12px; }
.pbnc-zone-top {
    display:     flex;
    align-items: flex-end;
    gap:         12px;
    flex-wrap:   wrap;
}
.pbnc-zone-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 140px; }
.pbnc-zone-field label {
    font-size:   .75rem;
    font-weight: 600;
    color:       #6b7280;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.pbnc-zone-field input[type=text],
.pbnc-zone-field input[type=number] {
    padding:     7px 10px;
    border:      1.5px solid #d1d5db;
    border-radius: 6px;
    font-size:   .88rem;
    width:       100%;
    box-sizing:  border-box;
}
.pbnc-zone-field input:focus {
    border-color: #6366f1;
    outline:      none;
    box-shadow:   0 0 0 3px rgba(99,102,241,.1);
}
.pbnc-zone-field-sm  { max-width: 130px; }
.pbnc-zone-field-full { flex: 1 1 100%; }

.pbnc-pin-hint {
    font-size:   .7rem;
    font-weight: 400;
    color:       #9ca3af;
    text-transform: none;
    letter-spacing: 0;
}
.pbnc-zone-field textarea {
    padding:     8px 10px;
    border:      1.5px solid #d1d5db;
    border-radius: 6px;
    font-size:   .82rem;
    font-family: 'Courier New', monospace;
    width:       100%;
    box-sizing:  border-box;
    resize:      vertical;
    line-height: 1.5;
}
.pbnc-zone-field textarea:focus {
    border-color: #6366f1;
    outline:      none;
    box-shadow:   0 0 0 3px rgba(99,102,241,.1);
}

.pbnc-zone-delete {
    align-self:   flex-end;
    padding:      7px 11px !important;
    color:        #ef4444 !important;
    border-color: #fca5a5 !important;
    background:   #fff5f5 !important;
    flex-shrink:  0;
}
.pbnc-zone-delete:hover { background: #fee2e2 !important; }

/* ── Weight slabs ───────────────────────────────────────────────────── */
.pbnc-zone-slabs {
    background:   #f9fafb;
    border:       1px solid #f3f4f6;
    border-radius: 8px;
    padding:      12px 14px;
    margin-top:   4px;
}
.pbnc-slabs-header {
    display:     grid;
    grid-template-columns: 1fr 1fr 36px;
    gap:         8px;
    font-size:   .72rem;
    font-weight: 700;
    color:       #9ca3af;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 8px;
    padding:     0 4px;
}
.pbnc-slab-row {
    display:     grid;
    grid-template-columns: 1fr 1fr 36px;
    gap:         8px;
    align-items: center;
    margin-bottom: 6px;
}
.pbnc-slab-weight,
.pbnc-slab-price {
    display:     flex;
    align-items: center;
    gap:         6px;
    background:  #fff;
    border:      1.5px solid #e5e7eb;
    border-radius: 6px;
    padding:     5px 8px;
}
.pbnc-slab-weight input,
.pbnc-slab-price input {
    flex:        1;
    border:      none !important;
    outline:     none !important;
    box-shadow:  none !important;
    padding:     0 !important;
    font-size:   .85rem;
    width:       100%;
    min-width:   0;
}
.pbnc-slab-unit, .pbnc-slab-price span {
    font-size:   .78rem;
    color:       #9ca3af;
    white-space: nowrap;
    flex-shrink: 0;
}
.pbnc-del-slab {
    background:  none;
    border:      none;
    color:       #f87171;
    cursor:      pointer;
    font-size:   .9rem;
    padding:     4px;
    line-height: 1;
    border-radius: 4px;
    transition:  background .15s;
}
.pbnc-del-slab:hover { background: #fee2e2; }

.pbnc-slabs-footer {
    display:     flex;
    align-items: center;
    gap:         20px;
    margin-top:  10px;
    flex-wrap:   wrap;
}
.pbnc-add-slab {
    font-size:   .8rem !important;
    padding:     5px 12px !important;
}
.pbnc-extra-kg { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 200px; }
.pbnc-extra-kg label {
    font-size:   .72rem;
    font-weight: 600;
    color:       #6b7280;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.pbnc-extra-kg-inp {
    display:     flex;
    align-items: center;
    gap:         6px;
    background:  #fff;
    border:      1.5px solid #e5e7eb;
    border-radius: 6px;
    padding:     5px 10px;
    max-width:   200px;
}
.pbnc-extra-kg-inp span { font-size: .8rem; color: #9ca3af; white-space: nowrap; }
.pbnc-extra-kg-inp input {
    flex:        1;
    border:      none !important;
    outline:     none !important;
    padding:     0 !important;
    box-shadow:  none !important;
    font-size:   .88rem;
    min-width:   0;
}

/* ── Save bar ───────────────────────────────────────────────────────── */
.pbnc-engine-actions {
    display:     flex;
    align-items: center;
    padding:     16px 0 8px;
    gap:         12px;
}

/* =============================================================================
   v5 — Sticky Buy Now Bar (mobile only)
   ============================================================================= */

#pbnc-sticky-bar {
    display:        none;  /* JS shows it */
    position:       fixed;
    bottom:         0;
    left:           0;
    right:          0;
    z-index:        99998;
    background:     #fff;
    border-top:     1px solid #e5e7eb;
    box-shadow:     0 -4px 20px rgba(0,0,0,.10);
    transform:      translateY(100%);
    transition:     transform .28s cubic-bezier(.4,0,.2,1);
    will-change:    transform;
}

/* Only show on mobile */
@media ( max-width: 768px ) {
    #pbnc-sticky-bar { display: block; }
}

#pbnc-sticky-bar.pbnc-sticky-visible {
    transform: translateY(0);
}
#pbnc-sticky-bar.pbnc-sticky-hidden {
    transform: translateY(100%);
}

.pbnc-sticky-inner {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    gap:             12px;
    padding:         10px 16px;
    padding-bottom:  calc(10px + env(safe-area-inset-bottom, 0px));
    max-width:       640px;
    margin:          0 auto;
}

.pbnc-sticky-product {
    display:     flex;
    align-items: center;
    gap:         10px;
    flex:        1;
    min-width:   0;
    overflow:    hidden;
}

.pbnc-sticky-thumb {
    width:        44px;
    height:       44px;
    object-fit:   cover;
    border-radius: 8px;
    flex-shrink:  0;
    border:       1px solid #f3f4f6;
}

.pbnc-sticky-info {
    display:    flex;
    flex-direction: column;
    min-width:  0;
}
.pbnc-sticky-name {
    font-size:    .82rem;
    font-weight:  600;
    color:        #111827;
    white-space:  nowrap;
    overflow:     hidden;
    text-overflow:ellipsis;
    line-height:  1.2;
}
.pbnc-sticky-price {
    font-size:   .78rem;
    color:       #6b7280;
    margin-top:  2px;
}
.pbnc-sticky-price .woocommerce-Price-amount { color: #16a34a; font-weight: 700; }

.pbnc-sticky-btn {
    flex-shrink:   0;
    padding:       11px 20px !important;
    font-size:     .9rem !important;
    font-weight:   700 !important;
    border-radius: 8px !important;
    border:        none !important;
    color:         #fff !important;
    cursor:        pointer;
    white-space:   nowrap;
    font-family:   inherit;
    transition:    opacity .15s, transform .1s;
}
.pbnc-sticky-btn:active { transform: scale(.97); opacity: .9; }

/* =============================================================================
   v5 — Dashboard Admin Styles
   ============================================================================= */

.pbnc-dash-wrap { max-width: 1200px; }

.pbnc-dash-titlebar {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    flex-wrap:       wrap;
    gap:             12px;
    margin-bottom:   20px;
}
.pbnc-dash-titlebar h1 { margin: 0; }

.pbnc-range-tabs { display: flex; gap: 4px; }
.pbnc-range-tab {
    padding:       5px 14px;
    border:        1.5px solid #e5e7eb;
    border-radius: 6px;
    font-size:     .8rem;
    font-weight:   600;
    color:         #6b7280;
    text-decoration: none;
    transition:    all .15s;
    background:    #fff;
}
.pbnc-range-tab:hover  { border-color: #6366f1; color: #6366f1; }
.pbnc-range-tab.active { background: #6366f1; border-color: #6366f1; color: #fff; }

/* ── Summary cards ── */
.pbnc-dash-cards {
    display:   grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap:       14px;
    margin-bottom: 28px;
}
.pbnc-dash-card {
    background:   #fff;
    border:       1px solid #e5e7eb;
    border-radius: 12px;
    padding:      16px;
    display:      flex;
    align-items:  flex-start;
    gap:          12px;
    box-shadow:   0 1px 4px rgba(0,0,0,.04);
}
.pbnc-dash-card-icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.pbnc-dash-card-val  { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.pbnc-dash-card-lbl  { font-size: .75rem; color: #6b7280; margin-top: 4px; }
.pbnc-dash-card-sub  { font-size: .7rem;  color: #9ca3af; margin-top: 2px; }

/* ── Section wrapper ── */
.pbnc-dash-section { margin-bottom: 32px; }
.pbnc-dash-section-title {
    font-size:    1rem;
    font-weight:  700;
    color:        #111827;
    margin:       0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
}
.pbnc-dash-section-title span { font-weight: 400; color: #9ca3af; font-size: .85rem; }

/* ── Trend chart ── */
.pbnc-chart-wrap {
    background:   #fff;
    border:       1px solid #e5e7eb;
    border-radius: 12px;
    padding:      20px 20px 12px;
}
.pbnc-chart-legend {
    display:       flex;
    gap:           16px;
    margin-bottom: 12px;
    font-size:     .75rem;
    font-weight:   600;
    color:         #6b7280;
}
.pbnc-legend-opens  { color: #6366f1; }
.pbnc-legend-orders { color: #10b981; }

.pbnc-chart {
    display:     flex;
    align-items: flex-end;
    gap:         4px;
    height:      120px;
    overflow-x:  auto;
    padding-bottom: 4px;
}
.pbnc-chart-col {
    display:        flex;
    flex-direction: column;
    align-items:    center;
    gap:            3px;
    flex:           1;
    min-width:      28px;
}
.pbnc-chart-bars {
    display:     flex;
    align-items: flex-end;
    gap:         2px;
    height:      100px;
    width:       100%;
    justify-content: center;
}
.pbnc-bar {
    flex:         1;
    border-radius: 3px 3px 0 0;
    min-height:   2px;
    max-width:    14px;
    transition:   height .4s ease;
    cursor:       default;
}
.pbnc-bar:hover { opacity: .8; }
.pbnc-bar-open  { background: #6366f1; }
.pbnc-bar-order { background: #10b981; }
.pbnc-chart-label {
    font-size:  .62rem;
    color:      #9ca3af;
    white-space: nowrap;
    text-align: center;
    transform:  rotate(-40deg);
    transform-origin: right center;
    margin-top: 4px;
}

/* ── Per-product table ── */
.pbnc-dash-table th { font-size: .78rem; }
.pbnc-dash-table td { font-size: .85rem; vertical-align: middle; }

/* ── Insights ── */
.pbnc-insights-grid {
    display:   grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap:       12px;
}
.pbnc-insight-card {
    display:      flex;
    align-items:  flex-start;
    gap:          12px;
    padding:      14px 16px;
    border-radius: 10px;
    font-size:    .84rem;
    line-height:  1.5;
    border:       1px solid transparent;
}
.pbnc-insight-icon { font-size: 1.4rem; flex-shrink: 0; line-height: 1; }
.pbnc-insight-card strong { display: block; margin-bottom: 2px; }
.pbnc-insight-green { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.pbnc-insight-amber { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.pbnc-insight-red   { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.pbnc-insight-blue  { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.pbnc-insight-card a { color: inherit; font-weight: 600; }

/* =============================================================================
   Mini-Cart & Floating Icon
   ============================================================================= */

.pbnc-buttons-wrap {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.pbnc-buttons-wrap > .button {
    flex: 1;
    margin: 0 !important;
}

.pbnc-loop-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}
.pbnc-loop-buttons > .button {
    margin: 0 !important;
    width: 100% !important;
}

.pbnc-add-to-cart-btn {
    background: #fff !important;
    color: var(--pbnc-text) !important;
    border: 1px solid var(--pbnc-border) !important;
}
.pbnc-add-to-cart-btn:hover {
    background: var(--pbnc-surface) !important;
}

/* Floating Cart Target */
.pbnc-floating-cart {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #111827;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 999990;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8) translateY(20px);
}
.pbnc-floating-cart.is-visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}
.pbnc-floating-cart:hover {
    transform: scale(1.08) translateY(-3px);
}
.pbnc-floating-cart svg {
    width: 26px;
    height: 26px;
}
.pbnc-floating-qty {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}
.pbnc-floating-cart.pbnc-bounce {
    animation: pbnc-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes pbnc-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* Mini Cart Side Panel */
.pbnc-minicart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999995;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    backdrop-filter: blur(3px);
}
.pbnc-minicart-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.pbnc-minicart-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 400px;
    background: #fff;
    z-index: 999996;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    font-family: var(--pbnc-font);
}
.pbnc-minicart-overlay.is-open .pbnc-minicart-panel {
    transform: translateX(0);
}

.pbnc-minicart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--pbnc-border);
}
.pbnc-minicart-title {
    font-size: 1.25rem !important;
    line-height: 1.3 !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    font-weight: 700 !important;
    font-family: var(--pbnc-font) !important;
    color: var(--pbnc-text) !important;
    margin: 0 !important;
}
.pbnc-minicart-close {
    background: none;
    border: none;
    color: var(--pbnc-muted);
    cursor: pointer;
    padding: 5px;
    display: flex;
}
.pbnc-minicart-close:hover { color: var(--pbnc-text); }
.pbnc-minicart-close svg { width: 22px; height: 22px; }

.pbnc-minicart-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}
.pbnc-minicart-empty {
    text-align: center;
    color: var(--pbnc-muted);
    padding: 40px 20px;
}
.pbnc-minicart-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.pbnc-cart-item {
    display: flex;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--pbnc-surface);
}
.pbnc-cart-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.pbnc-cart-item-thumb {
    width: 65px;
    height: 65px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--pbnc-border);
}
.pbnc-cart-item-details { flex: 1; min-width: 0; }
.pbnc-cart-item-name {
    font-size: 0.83rem !important;
    line-height: 1.3 !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    font-weight: 600 !important;
    font-family: var(--pbnc-font) !important;
    color: var(--pbnc-text) !important;
    margin: 0 0 4px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.pbnc-cart-item-price {
    font-size: 0.95rem;
    color: var(--pbnc-blue);
    font-family: var(--pbnc-font);
    font-weight: 600;
    margin: 0 0 10px;
}
.pbnc-cart-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pbnc-cart-item-remove {
    background: none;
    border: none;
    color: var(--pbnc-muted);
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}
.pbnc-cart-item-remove:hover { color: var(--pbnc-red); }

.pbnc-minicart-footer {
    padding: 24px;
    border-top: 1px solid var(--pbnc-border);
    background: var(--pbnc-surface);
}
.pbnc-minicart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--pbnc-text);
}
.pbnc-minicart-checkout-btn {
    width: 100%;
    padding: 16px;
    background: var(--pbnc-blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s, filter 0.2s;
}
.pbnc-minicart-checkout-btn:hover {
    filter: brightness(1.1);
}
.pbnc-minicart-checkout-btn:active {
    transform: scale(0.98);
}

/* Multi-item list inside checkout popup */
.pbnc-checkout-items {
    max-height: 140px;
    overflow-y: auto;
    margin: 14px 24px 0;
    border: 1px solid var(--pbnc-border);
    border-radius: var(--pbnc-r-sm);
    background: var(--pbnc-surface);
}
.pbnc-checkout-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--pbnc-border);
}
.pbnc-checkout-item:last-child {
    border-bottom: none;
}
.pbnc-checkout-item-thumb {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 4px;
}
.pbnc-checkout-item-info {
    flex: 1;
    min-width: 0;
}
.pbnc-checkout-item-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--pbnc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.pbnc-checkout-item-meta {
    font-size: 0.75rem;
    color: var(--pbnc-muted);
}
.pbnc-checkout-item-price {
    font-weight: 600;
    color: var(--pbnc-text);
    font-size: 0.85rem;
}

/* =============================================================================
   Tax / GST row
   ============================================================================= */
#pbnc-tax-row .pbnc-order-row-lbl {
    color: var(--pbnc-muted);
    font-style: italic;
    font-size: .80rem;
}
#pbnc-tax-row .pbnc-tax-val {
    font-weight: 600;
    color: #7c3aed;
    font-size: .83rem;
}

/* =============================================================================
   Restaurant Radius Delivery Check
   ============================================================================= */
.pbnc-reastro-wrap {
    margin: 0 0 14px;
    border: 1.5px solid #bfdbfe;
    border-radius: var(--pbnc-r-sm);
    background: #eff6ff;
    overflow: hidden;
}

.pbnc-reastro-inner {
    display:     flex;
    align-items: center;
    gap:         10px;
    padding:     11px 13px;
    flex-wrap:   wrap;
}

.pbnc-reastro-icon {
    flex-shrink:      0;
    width:            36px;
    height:           36px;
    display:          flex;
    align-items:      center;
    justify-content:  center;
    background:       #dbeafe;
    border-radius:    50%;
    color:            #1d4ed8;
}

.pbnc-reastro-text {
    flex:            1;
    min-width:       0;
    display:         flex;
    flex-direction:  column;
    gap:             2px;
}
.pbnc-reastro-text strong {
    font-size:   .85rem;
    font-weight: 700;
    color:       #1e40af;
}
.pbnc-reastro-sub {
    font-size: .76rem;
    color:     var(--pbnc-muted);
}

.pbnc-reastro-btn {
    flex-shrink:     0;
    display:         inline-flex;
    align-items:     center;
    gap:             6px;
    padding:         7px 13px;
    font-size:       .78rem;
    font-weight:     600;
    font-family:     var(--pbnc-font);
    color:           #1d4ed8;
    background:      #fff;
    border:          1.5px solid #93c5fd;
    border-radius:   6px;
    cursor:          pointer;
    transition:      background .15s, border-color .15s, box-shadow .15s;
    white-space:     nowrap;
}
.pbnc-reastro-btn:hover:not(:disabled) {
    background:    #dbeafe;
    border-color:  #3b82f6;
    box-shadow:    0 2px 8px rgba(37,99,235,.15);
}
.pbnc-reastro-btn:disabled {
    opacity: .65;
    cursor:  not-allowed;
}

/* Result message strip */
.pbnc-reastro-msg {
    display:     flex;
    align-items: flex-start;
    gap:         8px;
    padding:     9px 13px;
    font-size:   .80rem;
    line-height: 1.55;
    border-top:  1px solid;
}
.pbnc-reastro-msg svg { flex-shrink: 0; margin-top: 1px; }

.pbnc-reastro-success {
    background:   #f0fdf4;
    color:        #15803d;
    border-color: #86efac;
}
.pbnc-reastro-warning {
    background:   #fffbeb;
    color:        #92400e;
    border-color: #fde68a;
}
.pbnc-reastro-error {
    background:   #fef2f2;
    color:        #b91c1c;
    border-color: #fca5a5;
}

@media (max-width: 420px) {
    .pbnc-reastro-inner { flex-direction: column; align-items: flex-start; }
    .pbnc-reastro-btn   { width: 100%; justify-content: center; }
}
  
 