/**
 * Silenthought — Button Badge Calculator (BB-001)
 * @package Silenthought
 */

/* ── Wrapper ─────────────────────────────────────────────────────── */
.bb-calculator {
    margin: 24px 0;
    font-family: var(--font-body, 'DM Sans', sans-serif);
}

/* ── Header ──────────────────────────────────────────────────────── */
.bb-header {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    padding-bottom: 16px;
    border-bottom: 1.5px solid var(--color-gray-200, #e5e5e5);
    margin-bottom: 4px;
}

.bb-header-left {
    display: flex;
    align-items: center;
    gap: 9px;
}

/* ── Steps ───────────────────────────────────────────────────────── */
.bb-step {
    padding: 16px 0;
    border-bottom: 1px solid var(--color-gray-100, #f5f5f5);
}

.bb-step--last {
    border-bottom: none;
}

.bb-step-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: #374151;
    margin-bottom: 14px;
}

.bb-step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-black, #000);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bb-step-hint {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    font-size: 11px;
    color: #9ca3af;
}

/* ── Pill buttons ────────────────────────────────────────────────── */
.bb-pill-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bb-pill {
    padding: 10px 22px;
    border-radius: 50px;
    border: 2px solid var(--color-gray-200, #e5e5e5);
    background: #fafafa;
    font-family: var(--font-body, 'DM Sans', sans-serif);
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: border-color .17s, background .17s, color .17s, box-shadow .17s;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

.bb-pill:hover {
    border-color: var(--color-red, #eb1f3a);
    color: var(--color-red, #eb1f3a);
}

.bb-pill.is-active {
    border-color: var(--color-red, #eb1f3a);
    background: var(--color-red, #eb1f3a);
    color: #fff;
    box-shadow: 0 4px 14px rgba(235,31,58,.25);
}

.bb-lam-surcharge {
    font-size: 11px;
    font-weight: 700;
    opacity: .85;
}

/* ── Quantity spinner ────────────────────────────────────────────── */
.bb-qty-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bb-qty-spinner {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--color-gray-200, #e5e5e5);
    background: #fafafa;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color .17s, background .17s;
    flex-shrink: 0;
}

.bb-qty-spinner:hover {
    border-color: var(--color-red, #eb1f3a);
    background: #fff8f8;
    color: var(--color-red, #eb1f3a);
}

.bb-qty-input {
    width: 64px;
    height: 38px;
    text-align: center;
    border: 2px solid var(--color-gray-200, #e5e5e5);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-display, 'Poppins', sans-serif);
    color: #111827;
    background: #fff;
    -moz-appearance: textfield;
}

.bb-qty-input::-webkit-outer-spin-button,
.bb-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.bb-qty-unit {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

/* ── Tier hint ───────────────────────────────────────────────────── */
.bb-tier-hint {
    margin-top: 10px;
    font-size: 12px;
    color: #16a34a;
    font-weight: 600;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 7px 12px;
    display: none;
}

/* ── Order Summary ───────────────────────────────────────────────── */
.bb-summary {
    background: #f9fafb;
    border: 1.5px solid var(--color-gray-200, #e5e5e5);
    border-radius: 10px;
    padding: 15px 18px;
    margin: 20px 0 14px;
}

.bb-summary-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: #6b7280;
    margin-bottom: 8px;
}

.bb-summary-head svg { color: #22c55e; }

.bb-summary-text {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    line-height: 1.6;
    margin-bottom: 11px;
    word-break: break-word;
}

.bb-summary-footer {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-top: 1px solid var(--color-gray-200, #e5e5e5);
    padding-top: 10px;
    font-size: 12px;
    color: #6b7280;
}

.bb-summary-label { font-weight: 600; }

.bb-summary-total {
    font-size: 26px;
    font-weight: 800;
    color: var(--color-red, #eb1f3a);
    font-family: var(--font-display, 'Poppins', sans-serif);
    letter-spacing: -.5px;
    line-height: 1;
}

/* ── Error ───────────────────────────────────────────────────────── */
.bb-error {
    font-size: 13px;
    color: var(--color-red, #eb1f3a);
    background: #fff0f2;
    border: 1px solid #fecdd3;
    border-radius: 7px;
    padding: 10px 14px;
    margin-bottom: 12px;
}

/* ── Add to Cart ─────────────────────────────────────────────────── */
.bb-atc {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 10px;
    background: var(--color-red, #eb1f3a);
    color: #fff;
    font-family: var(--font-display, 'Poppins', sans-serif);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .3px;
    cursor: pointer;
    transition: background .2s, transform .14s, box-shadow .2s, opacity .2s;
}

.bb-atc:hover:not(:disabled) {
    background: #c91a31;
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(235,31,58,.35);
}

.bb-atc:active:not(:disabled) { transform: translateY(0); }

.bb-atc:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.bb-atc.success { background: #16a34a; }

.bb-atc-icon { flex-shrink: 0; }

/* ── Design option cards (Canva / Upload) ────────────────────────── */
.bb-design-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.bb-design-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    border: 2px solid var(--color-gray-200, #e5e5e5);
    border-radius: 10px;
    cursor: pointer;
    background: #fafafa;
    text-align: center;
    transition: border-color .17s, background .17s;
    position: relative;
}

.bb-design-option:hover {
    border-color: var(--color-red, #eb1f3a);
}

.bb-design-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.bb-design-option:has(input:checked) {
    border-color: var(--color-red, #eb1f3a);
    background: #fff5f5;
}

.bb-option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.bb-option-icon { font-size: 22px; margin-bottom: 4px; }

.bb-design-option h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    font-family: var(--font-heading, 'Poppins', sans-serif);
}

.bb-design-option p {
    margin: 0;
    font-size: 11px;
    color: #9ca3af;
}

/* ── Upload drop zone ────────────────────────────────────────────── */
.bb-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    background: #fafafa;
}

.bb-upload-area:hover { border-color: var(--color-red, #eb1f3a); background: #fff5f5; }

.bb-upload-icon { font-size: 24px; margin-bottom: 6px; }
.bb-upload-text { font-size: 13px; color: #374151; margin: 0; }
.bb-upload-hint { font-size: 11px; color: #9ca3af; margin: 4px 0 0; }

#bb-design-file {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

.bb-file-label {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 16px;
    border: 1.5px solid var(--color-red, #eb1f3a);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-red, #eb1f3a);
    cursor: pointer;
    transition: background .2s, color .2s;
}

.bb-file-label:hover { background: var(--color-red, #eb1f3a); color: #fff; }

.bb-upload-progress {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 4px;
    margin: 10px 0 4px;
    overflow: hidden;
}

.bb-upload-bar {
    height: 100%;
    width: 0%;
    background: var(--color-red, #eb1f3a);
    border-radius: 4px;
    transition: width .2s;
}

.bb-upload-filename {
    font-size: 11px;
    color: #6b7280;
    margin: 4px 0 0;
    word-break: break-all;
}

.bb-upload-area--dragover { border-color: var(--color-red, #eb1f3a); background: #fff5f5; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .bb-pill { padding: 9px 16px; font-size: 13px; }
    .bb-design-options { grid-template-columns: 1fr 1fr; gap: 8px; }
}
