/* Trang /tiktok-shop-showcase — "Phần trưng bày" (làm lại 14/09, mobile trước).
 * Mobile (<992px): 2 tab Đang trưng bày / Thêm sản phẩm, danh sách cuộn theo trang (không
 * lồng khung cuộn 420px), thanh "Thêm đã chọn" dính đáy màn. Desktop: 2 cột như cũ. */

.sc-page { --sc-orange: #ea580c; --sc-soft: #fff7ed; --sc-line: #fed7aa; }  /* rộng bằng khung trang như /tiktok-shop-link-generator (bỏ max-width 1100 — 18/09) */

/* Header 18/09: số sản phẩm + nút sang trang tạo link (Showcase / sản phẩm) + 3 bước. */
.sc-head { background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%); border: 1px solid var(--sc-line); border-radius: 16px; padding: 16px; margin-bottom: 12px; }
.sc-head__main { display: flex; align-items: center; gap: 12px; }
.sc-head__icon { flex: 0 0 46px; height: 46px; border-radius: 14px; background: var(--sc-orange); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; box-shadow: 0 4px 12px rgba(234,88,12,.3); }
.sc-head__text { flex: 1; min-width: 0; }
.sc-head h1 { font-size: 1.2rem; font-weight: 800; margin: 0; color: #111827; }
.sc-head p { font-size: .8rem; color: #6b7280; margin: 2px 0 0; line-height: 1.35; }
.sc-head__stat { flex: 0 0 auto; text-align: center; background: #fff; border: 1px solid var(--sc-line); border-radius: 12px; padding: 6px 12px; line-height: 1.1; }
.sc-head__stat b { display: block; font-size: 1.25rem; font-weight: 800; color: var(--sc-orange); }
.sc-head__stat span { font-size: .68rem; color: #6b7280; }
.sc-head__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sc-head__actions .sc-btn { text-decoration: none; }
.sc-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 12px 0 0; font-size: .74rem; color: #9a3412; }
.sc-steps li { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; background: rgba(255,255,255,.6); border-radius: 10px; padding: 6px 8px; line-height: 1.25; }
.sc-steps span { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; background: var(--sc-orange); color: #fff; font-size: .66rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }

.sc-connect { background: #fff; border: 1.5px dashed var(--sc-line); border-radius: 14px; padding: 28px 16px; text-align: center; }

.sc-channel { margin-bottom: 12px; }
.sc-channel .form-select { border-radius: 10px; }

.sc-tabs { display: flex; gap: 4px; padding: 4px; background: #fff; border-radius: 12px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.sc-tab { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 9px 6px; font-size: .86rem; font-weight: 600; color: #6b7280; display: flex; align-items: center; justify-content: center; gap: 6px; }
.sc-tab.is-active { background: var(--sc-soft); color: var(--sc-orange); font-weight: 700; }
.sc-tab__count { min-width: 20px; padding: 1px 6px; border-radius: 10px; background: #f3f4f6; font-size: .72rem; }
.sc-tab.is-active .sc-tab__count { background: var(--sc-orange); color: #fff; }

.sc-grid { display: grid; gap: 12px; }
.sc-card { background: #fff; border: 1px solid #f1f1f1; border-radius: 14px; padding: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.05); min-width: 0; }
.sc-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.sc-card__title { font-size: .95rem; font-weight: 700; margin: 0; color: #111827; display: flex; align-items: center; gap: 6px; }
.sc-card__title i { color: var(--sc-orange); }
.sc-card__sub { font-size: .76rem; color: #6b7280; }
.sc-pane { display: none; }
.sc-pane.is-active { display: block; }

.sc-icon-btn { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid #e5e7eb; background: #fff; color: #374151; display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; padding: 0; }
.sc-icon-btn:active { background: #f3f4f6; }
.sc-icon-btn.is-danger { color: #dc2626; border-color: #fecaca; }

/* Dòng sản phẩm đang trưng bày */
.sc-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #f3f4f6; }
.sc-item:first-child { border-top: 0; }
.sc-item img, .sc-pick img { flex: 0 0 56px; width: 56px; height: 56px; object-fit: cover; border-radius: 10px; background: #f3f4f6; }
.sc-item__body, .sc-pick__body { flex: 1; min-width: 0; }
.sc-name { font-size: .84rem; font-weight: 600; color: #111827; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sc-price { font-size: .84rem; font-weight: 700; color: #e11d48; margin-top: 2px; }
.sc-meta { font-size: .7rem; color: #9ca3af; margin-top: 1px; }
.sc-meta b { color: var(--sc-orange); font-weight: 700; }
/* Hoa hồng: % + tiền dự kiến/đơn (+ thưởng nếu có) — chung cho 2 danh sách. */
.sc-comm { font-size: .74rem; color: #374151; margin-top: 2px; }
.sc-comm b { color: #15803d; font-weight: 800; }
.sc-comm__amt { color: #15803d; font-weight: 700; }
.sc-comm__reward { display: inline-block; margin-left: 2px; padding: 0 6px; border-radius: 10px; background: #fef3c7; color: #92400e; font-size: .68rem; font-weight: 700; }
.sc-item__actions { display: flex; gap: 6px; }

/* Ô tìm + dòng chọn sản phẩm */
.sc-search { position: relative; margin: 4px 0 6px; }
.sc-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9ca3af; }
.sc-search input { width: 100%; height: 40px; border: 1px solid #e5e7eb; border-radius: 20px; padding: 0 14px 0 36px; font-size: .86rem; background: #f9fafb; outline: none; }
.sc-search input:focus { border-color: var(--sc-orange); background: #fff; }

.sc-pick { display: flex; align-items: center; gap: 10px; padding: 10px 6px; margin: 0 -6px; border-radius: 10px; cursor: pointer; }
.sc-pick + .sc-pick { border-top: 1px solid #f3f4f6; }
.sc-pick input { position: absolute; opacity: 0; pointer-events: none; }
.sc-check { flex: 0 0 22px; height: 22px; border-radius: 50%; border: 2px solid #d1d5db; display: flex; align-items: center; justify-content: center; color: #fff; font-size: .8rem; }
.sc-pick.is-picked { background: var(--sc-soft); }
.sc-pick.is-picked .sc-check { background: var(--sc-orange); border-color: var(--sc-orange); }

.sc-manual { margin-top: 10px; border-top: 1px solid #f3f4f6; padding-top: 10px; }
.sc-manual summary { font-size: .82rem; font-weight: 600; color: #374151; cursor: pointer; list-style: none; }
.sc-manual summary::-webkit-details-marker { display: none; }
.sc-manual summary i { transition: transform .15s; }
.sc-manual[open] summary i { transform: rotate(90deg); }
.sc-manual__row { display: flex; gap: 8px; margin-top: 8px; }
.sc-manual__row input { flex: 1; min-width: 0; height: 40px; border: 1px solid #e5e7eb; border-radius: 10px; padding: 0 12px; font-size: .84rem; }
.sc-manual__hint { font-size: .72rem; color: #9ca3af; margin-top: 4px; }

.sc-btn { border: 0; border-radius: 22px; background: var(--sc-orange); color: #fff; font-weight: 700; font-size: .86rem; padding: 0 16px; height: 40px; white-space: nowrap; }
.sc-btn:disabled { opacity: .5; }
.sc-btn--ghost { background: #fff; color: var(--sc-orange); border: 1px solid var(--sc-line); }

.sc-empty { text-align: center; color: #6b7280; font-size: .84rem; padding: 28px 8px; }
.sc-empty i { display: block; font-size: 1.8rem; color: #d1d5db; margin-bottom: 6px; }

/* Thanh "Thêm đã chọn" */
.sc-pickbar { display: none; align-items: center; gap: 10px; background: #fff; border-top: 1px solid #f3f4f6; padding: 10px 12px; }
.sc-pickbar.is-visible { display: flex; }
.sc-pickbar__text { flex: 1; font-size: .84rem; color: #374151; }
.sc-pickbar__text b { color: var(--sc-orange); }

.sc-toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 1080; max-width: calc(100% - 32px); background: #111827; color: #fff; font-size: .84rem; padding: 10px 16px; border-radius: 22px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.sc-toast.is-error { background: #b91c1c; }


@media (max-width: 991.98px) {
    /* Chừa chỗ cho thanh dính đáy khỏi che dòng cuối. */
    .sc-page.has-pickbar { padding-bottom: 72px; }
    .sc-pickbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1070; padding-bottom: calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(0,0,0,.06); }
}

@media (max-width: 575.98px) {
    .sc-head { padding: 14px 12px; }
    .sc-head p { display: none; }
    .sc-head__actions .sc-btn { flex: 1; justify-content: center; padding: 0 10px; font-size: .8rem; }
    .sc-steps { font-size: .68rem; }
    .sc-steps li { flex-direction: column; text-align: center; padding: 6px 4px; }
}

@media (min-width: 992px) {
    .sc-tabs { display: none; }
    .sc-item { padding: 10px 8px; margin: 0 -8px; border-radius: 10px; transition: background .15s; }
    .sc-item:hover { background: #fafafa; }
    .sc-pick:hover { background: #fafafa; }
    .sc-pick.is-picked:hover { background: var(--sc-soft); }
    /* 2 thẻ CAO BẰNG NHAU (18/09): cùng chiều cao cố định, danh sách co giãn + cuộn bên trong
       ⇒ cột ngắn không lửng lơ cạnh cột dài. Phần dưới (Tải thêm / Product ID / thanh chọn) ở đáy. */
    .sc-grid { grid-template-columns: 1fr 1fr; align-items: stretch; gap: 16px; }
    .sc-card { padding: 18px; height: max(600px, calc(100vh - 220px)); }
    .sc-pane, .sc-pane.is-active { display: flex; flex-direction: column; }
    #showcaseList, #pickList { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
    .sc-pickbar { margin: 10px -18px -18px; border-radius: 0 0 14px 14px; }
    .sc-toast { bottom: 24px; }
}
