/* ═══════════════════════════════════════════════
   Custom Bundle Box Builder — bundle-box.css
   ═══════════════════════════════════════════════ */

.cbb-wizard {
    --gold:    #c9a96e;
    --gold-l:  #eedfc0;
    --gold-d:  #9a7440;
    --bg:      #faf8f4;
    --surface: #ffffff;
    --border:  #e8dfd0;
    --text:    #1e1810;
    --muted:   #8c7b68;
    --accent:  #fdf4e3;

    font-family: inherit;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin: 1.5rem 0 2rem;
}

/* RTL support */
.cbb-wizard[dir="rtl"] { direction: rtl; text-align: right; }
.cbb-wizard[dir="rtl"] .cbb-footer     { flex-direction: row-reverse; }
.cbb-wizard[dir="rtl"] .cbb-footer-two { flex-direction: row-reverse; }
.cbb-wizard[dir="rtl"] .cbb-tray-bar   { flex-direction: row-reverse; }
.cbb-wizard[dir="rtl"] .cbb-search-row { flex-direction: row-reverse; }
.cbb-wizard[dir="rtl"] .cbb-ritem      { flex-direction: row-reverse; }

/* ── Steps ───────────────────────────────────── */
.cbb-steps {
    display: flex; align-items: center; justify-content: center;
    padding: 1rem 2rem; background: #1a1410;
}
.cbb-step       { display: flex; align-items: center; gap: 8px; opacity: .4; transition: opacity .3s; }
.cbb-step.cbb-active { opacity: 1; }
.cbb-step.cbb-done   { opacity: .7; }
.cbb-step-num {
    width: 28px; height: 28px; border-radius: 50%;
    border: 1.5px solid var(--gold);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: var(--gold); font-weight: 700;
    flex-shrink: 0;
}
.cbb-step.cbb-active .cbb-step-num { background: var(--gold); color: #1a1410; }
.cbb-step.cbb-done   .cbb-step-num { background: var(--gold-d); color: #fff; border-color: var(--gold-d); }
.cbb-step-lbl { font-size: 12px; color: #c8bfb4; letter-spacing: .06em; text-transform: uppercase; }
.cbb-conn     { width: 48px; height: 1px; background: #3d3328; margin: 0 8px; flex-shrink: 0; }

/* ── Panel ───────────────────────────────────── */
.cbb-panel           { padding: 1.5rem 2rem; }
.cbb-panel.cbb-hidden{ display: none !important; }
.cbb-title { font-size: 1.2rem !important; font-weight: 700 !important; color: var(--text) !important; margin: 0 0 4px !important; padding: 0 !important; }
.cbb-sub   { font-size: .875rem !important; color: var(--muted) !important; margin: 0 0 1.25rem !important; }

/* ── Tray ────────────────────────────────────── */
.cbb-tray-bar {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; padding: .65rem 1rem; margin-bottom: 1rem;
}
.cbb-tray-lbl    { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; font-weight: 600; }
.cbb-tray-slots  { display: flex; gap: 5px; flex: 1; flex-wrap: wrap; }
.cbb-slot {
    width: 32px; height: 32px; border-radius: 50%;
    border: 1.5px dashed var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; color: var(--muted); transition: all .2s; flex-shrink: 0;
}
.cbb-slot.cbb-filled       { border-style: solid; border-color: var(--gold); background: var(--gold-l); cursor: pointer; }
.cbb-slot.cbb-filled:hover { background: #fce8c5; }
.cbb-counter { font-size: 13px; font-weight: 700; color: var(--gold-d); white-space: nowrap; }

/* ── Search row ──────────────────────────────── */
.cbb-search-row { display: flex; gap: 10px; margin-bottom: 1rem; }
.cbb-search {
    flex: 1 !important; padding: .6rem 1rem !important;
    border: 1px solid var(--border) !important; border-radius: 8px !important;
    font-size: 14px !important; background: var(--surface) !important;
    color: var(--text) !important; box-shadow: none !important;
    height: auto !important;
}
.cbb-search:focus { border-color: var(--gold) !important; outline: none !important; box-shadow: none !important; }
.cbb-filter {
    padding: .6rem .85rem !important;
    border: 1px solid var(--border) !important; border-radius: 8px !important;
    font-size: 13px !important; background: var(--surface) !important;
    color: var(--text) !important; height: auto !important;
    cursor: pointer;
}

/* ── Product Grid ────────────────────────────── */
.cbb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 10px; max-height: 430px; overflow-y: auto; padding-right: 4px;
    margin-bottom: 4px;
}
.cbb-grid::-webkit-scrollbar       { width: 4px; }
.cbb-grid::-webkit-scrollbar-track { background: transparent; }
.cbb-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.cbb-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; overflow: hidden; cursor: pointer;
    transition: transform .18s, border-color .18s;
    position: relative; user-select: none;
}
.cbb-card:hover            { border-color: var(--gold); transform: translateY(-2px); }
.cbb-card.cbb-selected     { border: 2px solid var(--gold); background: var(--accent); }
.cbb-card.cbb-disabled     { opacity: .4; cursor: not-allowed; pointer-events: none; }
.cbb-card-check {
    display: none; position: absolute; top: 6px; right: 6px;
    width: 22px; height: 22px; background: var(--gold);
    border-radius: 50%; align-items: center; justify-content: center;
    font-size: 11px; color: #1a1410; font-weight: 700;
}
.cbb-card.cbb-selected .cbb-card-check { display: flex; }

.cbb-card-img {
    height: 95px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #faf6f0, #f0e8d8); overflow: hidden;
}
.cbb-card-img img  { width: 100%; height: 100%; object-fit: cover; }
.cbb-card-img span { font-size: 38px; }
.cbb-card-body     { padding: 8px 10px 10px; }
.cbb-card-name     { font-size: 13px !important; font-weight: 600 !important; color: var(--text) !important; line-height: 1.3 !important; margin: 0 0 2px !important; }
.cbb-card-brand    { font-size: 11px !important; color: var(--muted) !important; text-transform: uppercase; letter-spacing: .05em; margin: 0 !important; }
.cbb-card-tag      { display: inline-block; margin-top: 5px; padding: 2px 7px; border-radius: 3px; font-size: 10px; background: var(--accent); color: var(--gold-d); border: 1px solid var(--gold-l); }

.cbb-empty,
.cbb-loading { grid-column: 1/-1; text-align: center; color: var(--muted); padding: 2.5rem 0; font-size: 14px; }

/* ── Footer / Buttons ────────────────────────── */
.cbb-footer     { margin-top: 1.25rem; display: flex; justify-content: flex-end; }
.cbb-footer-two { justify-content: space-between; }

.cbb-btn {
    display: inline-block; padding: .65rem 1.75rem; border-radius: 8px;
    font-size: 14px; font-weight: 700; cursor: pointer;
    transition: background .18s, color .18s; border: none;
    letter-spacing: .03em; text-decoration: none !important;
}
.cbb-btn-primary           { background: var(--gold) !important; color: #1a1410 !important; }
.cbb-btn-primary:hover     { background: var(--gold-d) !important; color: #fff !important; }
.cbb-btn-primary:disabled  { background: var(--border) !important; color: var(--muted) !important; cursor: not-allowed !important; }
.cbb-btn-ghost             { background: transparent !important; color: var(--muted) !important; border: 1px solid var(--border) !important; }
.cbb-btn-ghost:hover       { border-color: var(--gold) !important; color: var(--gold-d) !important; }

/* ── Review list ─────────────────────────────── */
.cbb-rlist  { display: flex; flex-direction: column; gap: 8px; }
.cbb-ritem  { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
.cbb-rnum   { width: 28px; height: 28px; border-radius: 50%; background: var(--gold-l); color: var(--gold-d); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cbb-rinfo  { flex: 1; min-width: 0; }
.cbb-rname  { font-size: 14px !important; font-weight: 600 !important; color: var(--text) !important; margin: 0 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cbb-rmeta  { font-size: 12px !important; color: var(--muted) !important; margin: 2px 0 0 !important; }
.cbb-rdel   { background: none !important; border: none !important; color: var(--muted) !important; cursor: pointer; font-size: 18px; padding: 4px; border-radius: 4px; margin-left: auto; transition: color .15s; flex-shrink: 0; }
.cbb-rdel:hover { color: #c0392b !important; }

/* ── Confirm summary ─────────────────────────── */
.cbb-csummary { background: var(--surface); border: 1px solid var(--gold-l); border-radius: 12px; padding: 1.25rem; }
.cbb-ctitle   { font-size: 13px !important; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-d) !important; font-weight: 700 !important; margin: 0 0 12px !important; }
.cbb-chips    { display: flex; flex-wrap: wrap; gap: 8px; }
.cbb-chip     { display: flex; align-items: center; gap: 6px; background: var(--accent); border: 1px solid var(--gold-l); border-radius: 20px; padding: 5px 12px; font-size: 13px; color: var(--text); }
.cbb-chip-num { width: 20px; height: 20px; background: var(--gold); color: #1a1410; border-radius: 50%; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cbb-cnote    { font-size: 12px !important; color: var(--muted) !important; margin: 1rem 0 0 !important; padding-top: .75rem !important; border-top: 1px solid var(--border) !important; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 640px) {
    .cbb-panel      { padding: 1rem; }
    .cbb-search-row { flex-direction: column; }
    .cbb-conn       { width: 20px; }
    .cbb-step-lbl   { display: none; }
    .cbb-grid       { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); max-height: 360px; }
}
