/* ============================================================
   Biscotte Sock Studio — visual refresh (storefront-matched)
   Drop-in replacement for static/biscotte-theme.css

   Matches the Biscotte Yarns storefront: Lora serif headings and
   letterspaced small-caps labels, white surfaces with warm
   off-white bands, hairline rules, 6px controls, green primary
   buttons. Restyles the EXISTING template classes, so the only
   template edits needed are the two listed in HANDOFF.md.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..600&family=Instrument+Sans:wght@400..700&display=swap');

:root {
    /* Brand green */
    --bq-green:        #47803D;   /* hero band, primary buttons, step markers */
    --bq-green-hover:  #3A6B31;   /* primary button hover */
    --bq-green-ink:    #3D7033;   /* green TEXT on white (AA) */
    --bq-green-tint:   #F1F7EF;   /* selected option background */
    --bq-green-deep:   #2F5527;   /* text on the tint */

    /* Neutrals */
    --bq-ink:          #1B1B1B;   /* headings */
    --bq-body:         #3B3B37;   /* paragraphs */
    --bq-secondary:    #6E6E68;   /* secondary text on white */
    --bq-muted:        #63635E;   /* small caps labels, table headers */
    --bq-label:        #6E6E68;   /* field labels */
    --bq-paper:        #FFFFFF;   /* page background */
    --bq-warm:         #F7F6F2;   /* warm band / needle note / table head */
    --bq-warm-hover:   #F5F3EE;   /* secondary button hover */
    --bq-border:       #E4E2DC;   /* card borders */
    --bq-line:         #EEECE6;   /* inner dividers */
    --bq-field:        #D6D3CB;   /* control borders */
    --bq-field-hover:  #A8A49A;
    --bq-danger:       #9E3B36;
    --bq-danger-bg:    #FBF4F3;
    --bq-danger-line:  #E2CFCF;

    /* Shape + rhythm */
    --bq-r-card: 10px;
    --bq-r-ctrl: 6px;
    --bq-control: 48px;           /* every input and select */

    --bq-serif: 'Lora', Georgia, serif;
    --bq-sans:  'Instrument Sans', system-ui, sans-serif;
}

/* ---------- Base ---------------------------------------------------- */

body {
    --bs-body-bg: var(--bq-paper);
    --bs-body-color: var(--bq-body);
    --bs-primary: var(--bq-green);
    --bs-success: var(--bq-green);
    --bs-danger: var(--bq-danger);
    background-color: var(--bq-paper);
    color: var(--bq-body);
    font-family: var(--bq-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--bq-serif); color: var(--bq-ink); font-weight: 600; }
h1, .display-5 { font-size: 36px; letter-spacing: -0.01em; line-height: 1.12; }
h2 { font-size: 24px; letter-spacing: -0.005em; }
h3 { font-size: 20px; }
h4, h5 { font-size: 18px; }
p { text-wrap: pretty; }
strong, b { font-weight: 600; }
small, .small { font-size: 14px; }
.text-muted { color: var(--bq-secondary) !important; }
.lead { font-size: 17px; font-weight: 400; color: var(--bq-secondary); }

a { color: var(--bq-ink); text-decoration: none; }
a:hover { color: var(--bq-green-ink); }
/* inline links inside body copy (e.g. the needle note) */
.card-body a, .step-content a, p a { color: var(--bq-green-ink); text-decoration: underline; }

/* letterspaced serif caps — the storefront's section-label style */
.bq-eyebrow {
    font-family: var(--bq-serif);
    font-size: 14px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bq-muted);
}

/* Font Awesome: quiet and small, or drop the CDN entirely */
.fa, .fas, .far, .fal, .fad, .fab { color: var(--bq-green-ink); font-size: 0.9em; }

/* ---------- Header / footer ----------------------------------------- */

.hero-navbar {
    background: var(--bq-paper) !important;
    border-bottom: 1px solid var(--bq-border);
    box-shadow: none;
    min-height: 68px;
    padding: 10px 0;
    margin-bottom: 32px !important;
}
.navbar-brand-with-title { padding: 0; gap: 12px; }
.navbar-brand-with-title:hover { transform: none; }
.navbar-brand-with-title img { max-width: 34px !important; filter: none; }
.navbar-brand-with-title:hover img { filter: none; }
.navbar-title { font-family: var(--bq-serif); font-size: 19px !important; font-weight: 600; }
.navbar-nav { gap: 6px; }
.navbar-nav .nav-link {
    color: var(--bq-secondary) !important;
    font-size: 16px;
    padding: 8px 12px;
    border-radius: var(--bq-r-ctrl);
    transition: background-color .15s ease, color .15s ease;
}
.navbar-nav .nav-link:hover { color: var(--bq-ink) !important; background: var(--bq-warm); transform: none; }

.branding-footer {
    background: var(--bq-paper);
    border-top: 1px solid var(--bq-border);
    color: var(--bq-muted);
    font-family: var(--bq-serif);
    font-size: 14px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 24px;
    margin-top: 56px;
}

/* ---------- Hero band ----------------------------------------------- */

.bq-hero {
    background: var(--bq-green);
    border-radius: var(--bq-r-card);
    padding: 26px 32px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}
.bq-hero .bq-hero-kicker {
    font-family: var(--bq-sans);
    font-size: 13px; font-weight: 600;
    letter-spacing: 0.16em; text-transform: uppercase;
    color: #FFFFFF;
    margin-bottom: 14px;
}
.bq-hero h1 { color: #fff; font-size: 32px; line-height: 1.1; margin: 0 0 8px; }
.bq-hero p  { color: #fff; font-size: 16px; margin: 0; }
/* white knockout cat mark, sized so nothing is cropped */
.bq-hero-mark { flex: 0 0 auto; width: 72px; height: 72px; object-fit: contain; align-self: center; }

/* ---------- Step cards ---------------------------------------------- */

.step-container {
    background: var(--bq-paper);
    border: 1px solid var(--bq-border);
    border-radius: var(--bq-r-card);
    box-shadow: none;
    margin-bottom: 20px !important;
    overflow: hidden;
}
.step-container:hover { box-shadow: none; transform: none; }

.step-header {
    background: transparent;
    color: var(--bq-ink);
    padding: 24px 32px 14px;
    margin: 0 40px 28px;
    padding: 24px 0 14px;
    border-bottom: 1px solid var(--bq-line);
    border-radius: 0;
}
.step-title {
    font-family: var(--bq-serif);
    font-size: 21px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
}
/* green rounded-square number marker */
.step-header .step-number,
.step-title .step-number {
    background: var(--bq-green) !important;
    color: #fff !important;
    flex: 0 0 auto;
    width: 30px; min-width: 30px; max-width: 30px;
    height: 30px; min-height: 30px; max-height: 30px;
    border-radius: var(--bq-r-ctrl);
    font-family: var(--bq-sans);
    font-size: 15px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    margin: 0;
}
.step-content { padding: 0 32px 24px; }

/* ---------- Cards / panels ------------------------------------------ */

.card {
    background-color: var(--bq-paper) !important;
    border: 1px solid var(--bq-border) !important;
    border-radius: var(--bq-r-card);
    box-shadow: none !important;
}
.card.shadow, .card.shadow-lg { box-shadow: none !important; }
.card-header {
    background-color: var(--bq-paper) !important;
    border-bottom: 1px solid var(--bq-line) !important;
    border-radius: var(--bq-r-card) var(--bq-r-card) 0 0 !important;
    padding: 14px 20px;
}
.card-title {
    font-family: var(--bq-serif);
    color: var(--bq-ink) !important;
    font-size: 19px; font-weight: 600;
    display: flex; align-items: center; gap: 14px;
    margin: 0;
}
.card-header .fas, .card-header .far, .card-header .fab { color: var(--bq-green-ink) !important; }
.card-body { padding: 20px; color: var(--bq-body); }
.card-body p { max-width: 68ch; margin-bottom: 10px; line-height: 1.6; }
.card-body p:last-child { margin-bottom: 0; }
.card-hover { transition: border-color .15s ease; }
.card-hover:hover { border-color: var(--bq-field) !important; transform: none; }

/* section number inside output card titles */
.card-title .step-number {
    background: transparent !important;
    color: var(--bq-green-ink) !important;
    font-family: var(--bq-serif);
    width: 18px; min-width: 18px; max-width: 18px;
    height: auto; min-height: 0; max-height: none;
    border-radius: 0;
    font-size: 16px; font-weight: 600;
    margin: 0;
}

/* the needle-options panel sits on the warm band */
.needle-options.card, .card.bq-warm-panel { background-color: var(--bq-warm) !important; }

/* green callout, e.g. target foot length */
.bq-callout {
    background: var(--bq-green-tint);
    border-left: 2px solid var(--bq-green);
    color: var(--bq-green-deep);
    padding: 14px 18px;
}

/* ---------- Form controls ------------------------------------------- */

.form-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bq-label);
    margin-bottom: 10px;
}
.form-control, .form-select {
    height: var(--bq-control);
    background-color: var(--bq-paper);
    border: 1px solid var(--bq-field);
    border-radius: var(--bq-r-ctrl);
    color: var(--bq-ink);
    font-size: 16px;
    padding: 0 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-select { padding-right: 44px; }
.form-control:hover, .form-select:hover { border-color: var(--bq-field-hover); }
.form-control:focus, .form-select:focus {
    border-color: var(--bq-green);
    box-shadow: 0 0 0 3px rgba(71, 128, 61, 0.25);
    background-color: var(--bq-paper);
}
.form-control::placeholder { color: #9A9A96; }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--bq-danger); }
.invalid-feedback { color: var(--bq-danger); font-size: 14px; }

/* "Or use custom measurements" divider */
.bq-divider { display: flex; align-items: center; gap: 20px; margin: 32px 0 22px; }
.bq-divider::before, .bq-divider::after { content: ""; flex: 1; height: 1px; background: var(--bq-line); }
.bq-divider span {
    font-family: var(--bq-serif);
    font-size: 14px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bq-muted);
}

/* choice cards — optional upgrade for construction / heel selects */
.bq-choice {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 18px;
    border: 1px solid var(--bq-border);
    border-radius: 8px;
    background: var(--bq-paper);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}
.bq-choice:hover { border-color: var(--bq-green); }
.bq-choice.is-selected { border-color: var(--bq-green); background: var(--bq-green-tint); }
.bq-choice .bq-radio {
    flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
    border: 1px solid #C6C2B8; background: #fff;
    display: flex; align-items: center; justify-content: center;
}
.bq-choice.is-selected .bq-radio { border-color: var(--bq-green); }
.bq-choice .bq-radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: transparent; }
.bq-choice.is-selected .bq-radio::after { background: var(--bq-green); }
.bq-choice-title { font-family: var(--bq-serif); font-size: 18px; font-weight: 600; color: var(--bq-ink); }
.bq-choice-hint { display: block; font-size: 14px; color: var(--bq-secondary); margin-top: 4px; }

/* ---------- Buttons — EXACTLY TWO STYLES ---------------------------- */

.btn {
    height: var(--bq-control);
    padding: 0 28px;
    border-radius: var(--bq-r-ctrl);
    font-family: var(--bq-sans);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-sm { height: 38px; padding: 0 16px; }
.btn-lg { height: 54px; padding: 0 28px; }

/* PRIMARY — green fill, white caps */
.btn-primary, .btn-primary:visited {
    background-color: var(--bq-green);
    border: 1px solid var(--bq-green);
    color: #fff;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--bq-green-hover) !important;
    border-color: var(--bq-green-hover) !important;
    color: #fff !important;
    transform: none; box-shadow: none;
}
.btn-primary .fas, .btn-primary .fab { color: #fff !important; }

/* SECONDARY — white fill, hairline border, black caps */
.btn-outline-secondary, .btn-outline-primary, .btn-outline-info,
.btn-outline-success, .btn-outline-danger, .btn-secondary, .btn-light {
    background-color: var(--bq-paper);
    border: 1px solid var(--bq-field);
    color: var(--bq-ink);
}
.btn-outline-secondary:hover, .btn-outline-primary:hover, .btn-outline-info:hover,
.btn-outline-success:hover, .btn-outline-danger:hover, .btn-secondary:hover, .btn-light:hover {
    background-color: var(--bq-warm-hover);
    border-color: var(--bq-field-hover);
    color: var(--bq-ink);
}
.btn:focus-visible { outline: 3px solid rgba(71, 128, 61, 0.45); outline-offset: 2px; box-shadow: none; }

/* ---------- Tables / summary rows ----------------------------------- */

.bq-table { border: 1px solid var(--bq-border); border-radius: 8px; overflow: hidden; }
.bq-table .bq-thead {
    display: flex;
    background: var(--bq-warm);
    border-bottom: 1px solid var(--bq-border);
    font-family: var(--bq-serif);
    font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--bq-muted);
}
.bq-table .bq-row { display: flex; border-bottom: 1px solid var(--bq-line); font-size: 15px; }
.bq-table .bq-row:last-child { border-bottom: 0; }
.bq-table .bq-cell { padding: 10px 16px; }
.bq-table .bq-cell + .bq-cell { border-left: 1px solid var(--bq-line); }

.bq-stat { padding: 14px 18px; }
.bq-stat-label { font-size: 15px; color: var(--bq-secondary); margin-bottom: 6px; }
.bq-stat-value { font-family: var(--bq-serif); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }

.bq-progress { height: 4px; background: var(--bq-line); border-radius: 99px; overflow: hidden; }
.bq-progress > span { display: block; height: 4px; background: var(--bq-green); }

/* ---------- Dropdown / alerts --------------------------------------- */

.dropdown-menu {
    background-color: var(--bq-paper);
    border: 1px solid var(--bq-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.07);
    padding: 6px;
}
.dropdown-item { color: var(--bq-ink); border-radius: var(--bq-r-ctrl); padding: 10px 12px; font-size: 16px; }
.dropdown-item:hover, .dropdown-item:focus, .dropdown-item:active {
    background-color: var(--bq-warm) !important;
    color: var(--bq-ink) !important;
}

.alert-warning {
    background: var(--bq-danger-bg);
    border: 1px solid var(--bq-danger-line);
    color: var(--bq-danger);
    border-radius: var(--bq-r-card);
    font-size: 17px;
}

/* ---------- Print --------------------------------------------------- */

@media print {
    body { background: #fff; font-size: 12pt; }
    .hero-navbar, .branding-footer, .btn, .dropdown, .bq-progress, .bq-hero { display: none !important; }
    .card, .step-container { border: 1px solid #ccc !important; break-inside: avoid; }
    .card-header { background: #fff !important; }
    a { color: #000; text-decoration: none; }
}

/* ---------- Small screens ------------------------------------------- */

@media (max-width: 768px) {
    body { font-size: 15px; }
    h1, .display-5 { font-size: 26px; }
    /* keep the row layout on mobile: the mark shrinks instead of stacking
       below the text, so the hero stays compact */
    .bq-hero { align-items: flex-start; padding: 22px 20px; margin-bottom: 24px; gap: 16px; }
    .bq-hero h1 { font-size: 24px; }
    .bq-hero p { font-size: 15px; }
    .bq-hero-mark { width: 48px; height: 48px; align-self: flex-start; margin-top: 2px; }
    .bq-hero .bq-hero-kicker { font-size: 11px; margin-bottom: 8px; }
    .step-header { padding: 22px 0 16px; margin: 0 20px 20px; }
    .step-title { font-size: 18px; line-height: 1.25; gap: 10px; }
    .step-title .step-number { width: 28px; min-width: 28px; max-width: 28px; height: 28px; min-height: 28px; }
    .step-content { padding: 0 20px 22px; }
    .card-body, .card-header { padding: 14px; }
    .btn { width: 100%; }
}

/* ================================================================
   Embed & app-specific additions (kept across redesigns)
   ================================================================ */

/* Iframe embed (Shopify): transparent page, parent controls width */
html, body { background: transparent !important; }
body { padding: 0; margin: 0; }
.container, .container-lg, .container-md {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* In-page select menu (native popups fail in cross-origin iframes) */
.bq-select-menu {
    position: absolute;
    z-index: 1050;
    background: var(--bq-paper);
    border: 1px solid var(--bq-field);
    border-radius: var(--bq-r-ctrl);
    padding: 6px;
    box-shadow: 0 8px 24px rgba(27, 27, 27, 0.10);
    max-height: 320px;
    overflow-y: auto;
}
.bq-select-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 15px;
    font-family: var(--bq-sans);
    color: var(--bq-ink);
    cursor: pointer;
}
.bq-select-item:hover { background: var(--bq-warm-hover); }
.bq-select-item.is-selected { background: var(--bq-green-tint); color: var(--bq-green-deep); font-weight: 600; }

/* step sections must not clip the select menu */
.step-container { overflow: visible !important; }

/* Equal-height summary cards on the pattern page */
.equal-height-cards { display: flex; flex-wrap: wrap; }
.equal-height-cards > [class*='col-'] { display: flex; flex-direction: column; }
.equal-height-cards .card { flex: 1; }

/* Back-to-top button (pattern page, desktop) */
.back-to-top-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bq-green);
    border: none;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.back-to-top-btn i { color: #FFFFFF !important; }
.back-to-top-btn:hover { background: var(--bq-green-hover); }
.back-to-top-btn:focus { outline: 3px solid var(--bq-green-tint); outline-offset: 2px; }
@media (max-width: 768px) { .back-to-top-btn { display: none; } }

/* radio-card choices: native inputs, CSS-driven selected state */
.bq-choice { height: 100%; }
.bq-choice input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.bq-choice:has(input:checked) { border-color: var(--bq-green); background: var(--bq-green-tint); }
.bq-choice:has(input:checked) .bq-radio { border-color: var(--bq-green); }
.bq-choice:has(input:checked) .bq-radio::after { background: var(--bq-green); }
.bq-choice:focus-within { outline: 3px solid var(--bq-green-tint); outline-offset: 2px; }
.bq-choice-group.is-invalid .bq-choice { border-color: var(--bq-danger); }

/* Pattern page: title, sticky sidebar, sections nav, step checkboxes */
.pattern-title { font-family: var(--bq-serif); font-weight: 600; color: var(--bq-ink); font-size: 32px; }
.bq-stat-sm { font-size: 17px; }
.bq-sidebar { position: sticky; top: 24px; }
.bq-section-list { list-style: none; margin: 0; padding: 0; counter-reset: bq-sec; }
.bq-section-list li { border-bottom: 1px solid var(--bq-line); }
.bq-section-list li:last-child { border-bottom: 0; }
.bq-section-list a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 2px; font-size: 16px; color: var(--bq-body);
    text-decoration: none;
}
.bq-section-list a:hover { color: var(--bq-green-ink); text-decoration: none; }
.bq-section-list .bq-sec-num {
    flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
    border: 1px solid var(--bq-field); color: var(--bq-secondary);
    font-size: 13px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
}
.bq-section-list li.is-done .bq-sec-num { background: var(--bq-green); border-color: var(--bq-green); color: #fff; }
.bq-section-list li.is-done a { color: var(--bq-secondary); }

.bq-step-check {
    appearance: none; -webkit-appearance: none;
    flex: 0 0 auto; width: 24px; height: 24px; margin-left: auto;
    border: 1px solid var(--bq-field); border-radius: 6px; background: #fff;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.bq-step-check:checked { background: var(--bq-green); border-color: var(--bq-green); }
.bq-step-check:checked::after {
    content: ""; width: 6px; height: 11px; margin-top: -2px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
#patternInstructions .card-title { display: flex; align-items: center; }
#patternInstructions .card.is-done .card-title { color: var(--bq-secondary); }
@media print {
    .bq-sidebar-col { display: block; }
    .bq-step-check, #sectionsCard, .pattern-header-actions { display: none !important; }
    .bq-sidebar { position: static; }
}

/* website credit: only visible on the printed pattern */
.bq-print-credit { display: none; }
@media print {
    .bq-print-credit {
        display: block;
        margin-top: 10pt;
        padding-top: 6pt;
        border-top: 1px solid #bbb;
        font-size: 9pt;
        color: #444 !important;
        text-align: center;
    }
}
