/*!
 * RFQ Basket — add-to-basket button, toast, and basket page styles. Token-driven, RTL-aware.
 */
.rfq-basket-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    border: 1px solid var(--rfq-border, #cbd5e1);
    color: var(--rfq-ink, #0f172a);
    background: var(--rfq-surface, #fff);
    border-radius: 8px;
    padding: 8px 14px;
    transition: border-color .15s ease, background-color .15s ease;
}
.rfq-basket-btn:hover { border-color: var(--rfq-accent, #2563eb); color: var(--rfq-accent, #2563eb); }
.rfq-basket-btn__icon { font-size: 18px; line-height: 1; }
.rfq-basket-btn--card { width: 100%; justify-content: center; padding: 7px 10px; font-size: 13px; }
.rfq-basket-btn--icon { padding: 8px; border-radius: 50%; }
.rfq-basket-btn--disabled, .rfq-basket-btn[disabled] { opacity: .5; cursor: not-allowed; }
.rfq-basket-btn.is-loading { opacity: .7; pointer-events: none; }

/* count badge (optional header element) */
[data-rfq-basket-count].is-empty { display: none; }

/* toast */
.rfq-basket-toast {
    position: fixed;
    inset-inline-end: 20px;
    bottom: 20px;
    z-index: 10060;
    background: var(--rfq-ink, #0f172a);
    color: #fff;
    padding: 12px 16px;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .3);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
    font-size: 14px;
}
.rfq-basket-toast.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.rfq-basket-toast a { color: #93c5fd; margin-inline-start: 8px; text-decoration: underline; }

/* ---- basket page ---- */
.rfq-basket-page { max-width: 1000px; margin: 0 auto; padding: 24px 16px 48px; }
.rfq-basket-page__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.rfq-basket-page__title { font-size: 22px; font-weight: 700; margin: 0; }
.rfq-basket-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.rfq-basket-group { border: 1px solid var(--rfq-border, #e2e8f0); border-radius: 12px; margin-bottom: 18px; overflow: hidden; }
.rfq-basket-group__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--rfq-muted, #f8fafc); border-bottom: 1px solid var(--rfq-border, #e2e8f0); flex-wrap: wrap; }
.rfq-basket-group__supplier { font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.rfq-basket-verified { color: #16a34a; font-weight: 700; }

.rfq-basket-row { display: grid; grid-template-columns: auto 56px 1fr auto; gap: 12px; align-items: start; padding: 14px 16px; border-bottom: 1px solid var(--rfq-border, #f1f5f9); }
.rfq-basket-row:last-child { border-bottom: 0; }
.rfq-basket-row.is-saved { background: #f0fdf4; }
.rfq-basket-row.is-unavailable { opacity: .6; }
.rfq-basket-row__img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.rfq-basket-row__name { font-weight: 600; font-size: 14px; }
.rfq-basket-row__sku { font-size: 12px; color: #64748b; }
.rfq-basket-row__fields { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.rfq-basket-row__fields input, .rfq-basket-row__fields select { border: 1px solid var(--rfq-border, #cbd5e1); border-radius: 7px; padding: 6px 8px; font: inherit; }
.rfq-basket-row__qty { width: 90px; }
.rfq-basket-row__unit { width: 90px; }
.rfq-basket-row__price { width: 110px; }
.rfq-basket-row__note { flex: 1 1 180px; min-width: 160px; }
.rfq-basket-row__flags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: #475569; }
.rfq-basket-row__flags label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--rfq-border, #cbd5e1); border-radius: 999px; background: #f8fafc; color: #475569; cursor: pointer; line-height: 1; user-select: none; transition: background .15s, border-color .15s, color .15s; }
.rfq-basket-row__flags label:hover { border-color: var(--rfq-accent, #2563eb); color: var(--rfq-accent, #2563eb); }
.rfq-basket-row__flags input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.rfq-basket-row__flags label:has(input:checked) { background: color-mix(in srgb, var(--rfq-accent, #2563eb) 12%, #fff); border-color: var(--rfq-accent, #2563eb); color: var(--rfq-accent, #2563eb); font-weight: 600; }
.rfq-basket-chip__check { font-size: 15px; width: 0; overflow: hidden; opacity: 0; margin-right: -6px; transition: width .15s, opacity .15s, margin-right .15s; }
.rfq-basket-row__flags label:has(input:checked) .rfq-basket-chip__check { width: 15px; opacity: 1; margin-right: 0; }
.rfq-basket-row__flags label:has(input:focus-visible) { outline: 2px solid var(--rfq-accent, #2563eb); outline-offset: 2px; }
.rfq-basket-row__actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.rfq-basket-row__warn { color: #b45309; font-size: 12px; margin-top: 4px; }

.rfq-basket-linkbtn { background: none; border: 0; cursor: pointer; color: #64748b; font-size: 12px; display: inline-flex; align-items: center; gap: 4px; padding: 2px; }
.rfq-basket-linkbtn:hover { color: var(--rfq-accent, #2563eb); }

.rfq-basket-btn-primary { background: var(--rfq-accent, #2563eb); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; font-weight: 600; cursor: pointer; font-size: 14px; }
.rfq-basket-btn-primary:disabled { opacity: .7; cursor: progress; }
.rfq-basket-btn-ghost { background: #fff; border: 1px solid var(--rfq-border, #cbd5e1); border-radius: 8px; padding: 9px 14px; font-weight: 600; cursor: pointer; font-size: 14px; color: var(--rfq-ink, #0f172a); }

.rfq-basket-empty { text-align: center; padding: 60px 20px; color: #64748b; }
.rfq-basket-hint { font-size: 12px; color: #64748b; margin-top: 6px; }

/* ---- unified selection checkboxes (item-select + select-all) ---- */
.rfq-basket-selectall { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px; padding: 8px 14px; border: 1px solid var(--rfq-border, #e2e8f0); border-radius: 10px; background: var(--rfq-muted, #f8fafc); cursor: pointer; font-weight: 600; font-size: 13px; color: var(--rfq-ink, #0f172a); user-select: none; transition: border-color .15s ease; }
.rfq-basket-selectall:hover { border-color: var(--rfq-accent, #2563eb); }

.rfq-check {
    -webkit-appearance: none; appearance: none;
    flex: 0 0 auto;
    width: 18px; height: 18px; margin: 0;
    border: 1.5px solid var(--rfq-border, #cbd5e1);
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    display: inline-grid; place-content: center;
    transition: background-color .15s ease, border-color .15s ease;
}
.rfq-check::before {
    content: "";
    width: 11px; height: 11px;
    transform: scale(0);
    transition: transform .12s ease-in-out;
    background: #fff;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
.rfq-check:hover { border-color: var(--rfq-accent, #2563eb); }
.rfq-check:checked { background: var(--rfq-accent, #2563eb); border-color: var(--rfq-accent, #2563eb); }
.rfq-check:checked::before { transform: scale(1); }
.rfq-check:indeterminate { background: var(--rfq-accent, #2563eb); border-color: var(--rfq-accent, #2563eb); }
.rfq-check:indeterminate::before { transform: scale(1); clip-path: none; width: 10px; height: 2px; border-radius: 1px; }
.rfq-check:focus-visible { outline: 2px solid var(--rfq-accent, #2563eb); outline-offset: 2px; }
.rfq-check:disabled { opacity: .45; cursor: not-allowed; }
.rfq-check:disabled:hover { border-color: var(--rfq-border, #cbd5e1); }

@media (max-width: 640px) {
    .rfq-basket-row { grid-template-columns: 48px 1fr; }
    .rfq-basket-row__select { grid-column: 1 / -1; }
    .rfq-basket-row__actions { flex-direction: row; }
}
