/* ================================================================
   Cash Buyer Bidding — Front-End Styles
   Version: 1.1.0
   ================================================================
   BRAND VARIABLES (header only) — edit to retheme:
     --cbb-brand-bg      header background
     --cbb-brand-text    text / borders on brand-bg
     --cbb-brand-border  bottom border under header

   STRUCTURE VARIABLES — controls action colours:
     --cbb-instr-bg      instructions band
     --cbb-price-bg      price stage panel
     --cbb-bid-btn-bg    bid button
   ================================================================ */

.cbb-widget {
    /* ── Brand (header) ── */
    --cbb-brand-bg:      #92D1E6;
    --cbb-brand-text:    #576059;
    --cbb-brand-border:  #576059;
    --cbb-brand-desc:    #3d4440;
    --cbb-brand-chip-bg: rgba(87,96,89,.15);

    /* ── Instructions band ── */
    --cbb-instr-bg:      #dc2626;
    --cbb-instr-text:    #ffffff;

    /* ── Price panel ── */
    --cbb-price-bg:      #111827;
    --cbb-price-text:    #f9fafb;
    --cbb-price-disc:    #f87171;
    --cbb-price-lbl:     #6b7280;
    --cbb-ticker-val:    #fbbf24;
    --cbb-ticker-track:  #374151;

    /* ── Bid button ── */
    --cbb-bid-btn-bg:    #dc2626;
    --cbb-bid-btn-text:  #ffffff;
    --cbb-bid-btn-hover: #b91c1c;
    --cbb-bid-pulse:     rgba(220,38,38,.45);

    /* ── Phase progress bar ── */
    --cbb-phase-fill:    #dc2626;
    --cbb-phase-track:   #f3f4f6;

    /* ── Drop warning ── */
    --cbb-drop-warn-bg:  #fef2f2;
    --cbb-drop-warn-bd:  #fca5a5;
    --cbb-drop-warn-tx:  #991b1b;

    /* ── Floor badge ── */
    --cbb-floor-bg:      #f0fdf4;
    --cbb-floor-bd:      #86efac;
    --cbb-floor-tx:      #166534;
    --cbb-floor-nf-bg:   #eff6ff;
    --cbb-floor-nf-bd:   #93c5fd;
    --cbb-floor-nf-tx:   #1e40af;

    /* ── Feedback ── */
    --cbb-fb-late-bg:    #fff7ed;
    --cbb-fb-late-bd:    #fed7aa;
    --cbb-fb-late-tx:    #9a3412;
    --cbb-fb-err-bg:     #fef2f2;
    --cbb-fb-err-bd:     #fca5a5;
    --cbb-fb-err-tx:     #991b1b;
    --cbb-fb-busy-bg:    #fefce8;
    --cbb-fb-busy-bd:    #fde047;
    --cbb-fb-busy-tx:    #854d0e;

    /* ── Layout ── */
    font-family: inherit;
    max-width: 640px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    border: 1.5px solid #b8dce8;
    background: #ffffff;
}

/* ── HEADER ─────────────────────────────────────────── */
.cbb-header {
    background: var(--cbb-brand-bg);
    padding: 1.25rem 1.5rem;
    border-bottom: 3px solid var(--cbb-brand-border);
}
.cbb-header__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.cbb-header__title {
    font-size: 18px;
    font-weight: 500;
    color: var(--cbb-brand-text);
    line-height: 1.4;
    margin: 0;
}
.cbb-live-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--cbb-brand-chip-bg);
    border: 1px solid var(--cbb-brand-text);
    border-radius: 4px;
    padding: 4px 8px;
    flex-shrink: 0;
}
.cbb-live-chip__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cbb-brand-text);
    animation: cbb-blink 1s infinite;
}
@keyframes cbb-blink { 0%,100%{opacity:1} 50%{opacity:.25} }
.cbb-live-chip__txt {
    font-size: 11px;
    font-weight: 600;
    color: var(--cbb-brand-text);
    letter-spacing: .06em;
}
.cbb-header__desc {
    font-size: 13px;
    color: var(--cbb-brand-desc);
    line-height: 1.5;
    margin: 0 0 10px;
}
.cbb-header__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.cbb-header__mv-label  { font-size: 12px; color: var(--cbb-brand-desc); }
.cbb-header__mv-value  { font-size: 14px; font-weight: 600; color: var(--cbb-brand-text); }
.cbb-header__mv-sep    { width: 1px; height: 14px; background: var(--cbb-brand-text); opacity: .3; }
.cbb-header__mv-note   { font-size: 12px; color: var(--cbb-brand-desc); }

/* ── INSTRUCTIONS BAND ───────────────────────────────── */
.cbb-instructions {
    background: var(--cbb-instr-bg);
    color: var(--cbb-instr-text);
    font-size: 13px;
    font-weight: 500;
    padding: .65rem 1.5rem;
    line-height: 1.5;
}

/* ── PANELS ──────────────────────────────────────────── */
.cbb-panel { display: none; padding: 1.5rem; }
.cbb-panel--active { display: block; }

/* Gate */
.cbb-panel--gate { text-align: center; padding: 2rem 1.5rem; }
.cbb-panel--gate p { margin: 0 0 1rem; color: #374151; }

/* Countdown */
.cbb-panel--countdown { text-align: center; }
.cbb-countdown__label  { font-size: 14px; color: #6b7280; margin: 0 0 .5rem; }
.cbb-countdown__clock  { font-size: 42px; font-weight: 700; color: #111827; letter-spacing: .05em; font-variant-numeric: tabular-nums; }

/* ── LIVE PANEL ───────────────────────────────────────── */
.cbb-live-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.cbb-live-chip--panel { background: rgba(220,38,38,.1); border-color: #dc2626; }
.cbb-live-chip--panel .cbb-live-chip__dot { background: #dc2626; }
.cbb-live-chip--panel .cbb-live-chip__txt { color: #dc2626; }

/* Phase progress bar */
.cbb-phase-track { flex: 1; height: 6px; background: var(--cbb-phase-track); border-radius: 3px; margin-left: 1rem; overflow: hidden; }
.cbb-phase-fill  { height: 100%; background: var(--cbb-phase-fill); border-radius: 3px; width: 0; transition: width .5s ease; }

/* Floor badge */
.cbb-floor-badge {
    display: inline-block;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--cbb-floor-bd);
    background: var(--cbb-floor-bg);
    color: var(--cbb-floor-tx);
    margin-bottom: 1rem;
}
.cbb-floor-badge--no-floor {
    border-color: var(--cbb-floor-nf-bd);
    background: var(--cbb-floor-nf-bg);
    color: var(--cbb-floor-nf-tx);
}

/* Drop warning */
.cbb-drop-warn {
    display: none;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--cbb-drop-warn-bd);
    background: var(--cbb-drop-warn-bg);
    color: var(--cbb-drop-warn-tx);
    margin-bottom: 1rem;
}
.cbb-drop-warn--visible { display: block; }

/* Price stage */
.cbb-price-stage {
    background: var(--cbb-price-bg);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}
.cbb-price-stage__label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--cbb-price-lbl);
    margin: 0 0 .5rem;
}
.cbb-price-stage__price {
    font-size: 52px;
    font-weight: 800;
    color: var(--cbb-price-text);
    line-height: 1;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    transition: color .3s;
}
.cbb-price-stage__price--flash { color: var(--cbb-price-disc); }
.cbb-price-stage__disc {
    font-size: 15px;
    color: var(--cbb-price-disc);
    margin-top: .4rem;
}
.cbb-price-stage__ticker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
}
.cbb-ticker__label { font-size: 12px; color: var(--cbb-price-lbl); }
.cbb-ticker__val   { font-size: 14px; font-weight: 600; color: var(--cbb-ticker-val); font-variant-numeric: tabular-nums; min-width: 30px; }
.cbb-ticker__bar   { width: 80px; height: 4px; background: var(--cbb-ticker-track); border-radius: 2px; overflow: hidden; }
.cbb-ticker__prog  { height: 100%; background: var(--cbb-ticker-val); border-radius: 2px; width: 100%; transition: width 1s linear; }

/* Bid area */
.cbb-bid-area { text-align: center; }
.cbb-bid-note { font-size: 12px; color: #6b7280; margin: .5rem 0 0; }

/* ── BUTTONS ──────────────────────────────────────────── */
.cbb-btn {
    display: inline-block;
    font-size: 16px;
    font-weight: 700;
    padding: 14px 32px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: background .2s, transform .1s, box-shadow .2s;
    text-decoration: none;
}
.cbb-btn--bid {
    background: var(--cbb-bid-btn-bg);
    color: var(--cbb-bid-btn-text);
    width: 100%;
    font-size: 18px;
    padding: 18px;
    border-radius: 10px;
    box-shadow: 0 0 0 0 var(--cbb-bid-pulse);
    animation: cbb-pulse 2s infinite;
}
@keyframes cbb-pulse {
    0%   { box-shadow: 0 0 0 0 var(--cbb-bid-pulse); }
    70%  { box-shadow: 0 0 0 12px rgba(220,38,38,0); }
    100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); }
}
.cbb-btn--bid:hover:not(:disabled) { background: var(--cbb-bid-btn-hover); transform: translateY(-1px); }
.cbb-btn--bid:active:not(:disabled) { transform: translateY(0); }
.cbb-btn--bid:disabled { opacity: .6; cursor: not-allowed; animation: none; }
.cbb-btn--secondary {
    background: transparent;
    color: var(--cbb-brand-text);
    border: 2px solid var(--cbb-brand-text);
    padding: 10px 24px;
    font-size: 14px;
}

/* ── FEEDBACK ────────────────────────────────────────── */
.cbb-feedback {
    margin-top: 1rem;
    font-size: 14px;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    min-height: 0;
    transition: padding .2s;
}
.cbb-feedback:not(:empty) { padding: 12px 16px; }
.cbb-feedback--late  { background: var(--cbb-fb-late-bg); border: 1px solid var(--cbb-fb-late-bd); color: var(--cbb-fb-late-tx); }
.cbb-feedback--error { background: var(--cbb-fb-err-bg);  border: 1px solid var(--cbb-fb-err-bd);  color: var(--cbb-fb-err-tx); }
.cbb-feedback--busy  { background: var(--cbb-fb-busy-bg); border: 1px solid var(--cbb-fb-busy-bd); color: var(--cbb-fb-busy-tx); }

/* ── RESULT PANELS ───────────────────────────────────── */
.cbb-panel--sold,
.cbb-panel--expired { text-align: center; padding: 3rem 1.5rem; }
.cbb-result__icon  { font-size: 48px; display: block; margin-bottom: .75rem; }
.cbb-result__title { font-size: 20px; font-weight: 600; color: #111827; margin: 0; }

/* ── RESULT OVERLAY (won / late) ─────────────────────── */
.cbb-result-overlay {
    text-align: center;
    padding: 2.5rem 1.5rem;
    border-top: 1px solid #e5e7eb;
}
.cbb-result-overlay.cbb-result--winner { background: #f0fdf4; }
.cbb-result-overlay.cbb-result--late   { background: #fff7ed; }
.cbb-result-icon  { font-size: 48px; display: block; margin-bottom: .75rem; }
.cbb-result-msg   { font-size: 18px; font-weight: 600; color: #111827; margin: 0 0 .5rem; }
.cbb-result-price { font-size: 14px; color: #374151; }
.cbb-redirect-countdown { font-size: 13px; color: #6b7280; margin-top: .75rem; }

/* ── NOTICE ──────────────────────────────────────────── */
.cbb-notice { font-size: 14px; color: #6b7280; padding: 1rem; }
