:root {
    --bg: #f6f4ef;
    --card: #ffffff;
    --ink: #1f2937;
    --muted: #6b7280;
    --line: #e5ded3;
    --accent: #1f7a63;
    --accent-2: #f59e0b;
    --soft: #eef7f3;
    --danger: #b91c1c;
    --shadow: 0 18px 50px rgba(31, 41, 55, 0.08);
    --radius: 24px;
    --store-header-offset: 86px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ink);
    background: linear-gradient(180deg, #fbf9f6 0%, #f5f1ea 100%);
}

body.modal-open { overflow: hidden; }

.wc-modal {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.wc-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, .56);
}

.wc-modal-dialog {
    position: relative;
    z-index: 2;
    width: min(920px, calc(100vw - 24px));
    max-height: calc(100vh - 36px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.wc-modal-dialog-search,
.wc-modal-dialog-selection {
    width: min(760px, calc(100vw - 24px));
}

.wc-modal-content {
    padding: 58px 24px 24px;
    overflow: auto;
    max-height: calc(100vh - 36px);
}

.wc-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 8px 24px rgba(17, 24, 39, .12);
    font-size: 1.6rem;
    line-height: 1;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.page-shell {
    width: min(1380px, calc(100% - 28px));
    margin: 0 auto;
    padding: 22px 0 60px;
}

body.has-store-header .page-shell {
    padding-top: 126px;
}

.wizard-page,
.wizard-top-panel,
.facet-steps {
    display: grid;
    gap: 18px;
}

.wizard-toolbar,
.results-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar-pill {
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--soft);
    color: var(--accent);
    font-size: .82rem;
    font-weight: 800;
    margin-left: 8px;
}

.btn-toolbar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.selection-sticky-bar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    top: calc(var(--store-header-offset) + 8px);
    width: min(1380px, calc(100% - 28px));
    z-index: 9998;
    pointer-events: none;
}

.selection-sticky-inner {
    display: flex;
    justify-content: flex-start;
}

.selection-sticky-bar .btn-toolbar {
    pointer-events: auto;
    box-shadow: 0 14px 36px rgba(31, 41, 55, .16);
}

.questions-fab {
    position: fixed;
    left: 15px;
    bottom: 92px;
    z-index: 9998;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 16px 34px rgba(17, 24, 39, .22);
}

.questions-fab i {
    font-size: 1.35rem;
}

.questions-fab:hover,
.questions-fab:focus-visible {
    background: #000;
    color: #fff;
}

.results-title {
    margin: 0;
    font-size: 1.15rem;
}

.results-total {
    color: var(--muted);
    font-weight: 700;
}

.wc-accordion {
    overflow: hidden;
}

.wc-accordion-summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    font-weight: 800;
}

.wc-accordion-summary::-webkit-details-marker { display: none; }

.wc-accordion-title {
    font-size: 1.05rem;
}

.wc-accordion-meta {
    color: var(--muted);
    font-weight: 700;
}

.wc-accordion-body {
    padding-top: 14px;
}

.results-summary strong {
    color: var(--ink);
}

.active-filters-wrap,
.step-card,
.results-panel,
.state-card,
.wc-modal-dialog {
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(229, 222, 211, .85);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.wizard-secondary-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.active-filters-wrap,
.step-card,
.results-panel {
    padding: 18px 20px;
}

.active-filters-header,
.results-header,
.result-meta-row,
.result-footer,
.step-actions,
.cart-floating-bar,
.cart-floating-info,
.cart-floating-actions,
.option-meta,
.search-modal-actions,
.wc-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.active-filters-help,
.step-note,
.results-header p,
.empty-text,
.mini-help,
.state-card p,
.product-modal-copy p,
.wc-modal-head p,
.product-field small,
.result-stock,
.result-category,
.result-price-old,
.btn-link { color: var(--muted); }

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.active-filters.empty {
    min-height: 44px;
    align-items: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: .82rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--accent);
}

.filter-chip,
.option-btn,
.quick-pick {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    transition: .18s ease;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-weight: 600;
}

.filter-chip .chip-remove {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: #f3f4f6;
    font-size: .9rem;
}

.step-card.current-step {
    border-color: rgba(31, 122, 99, .35);
    box-shadow: 0 18px 44px rgba(31, 122, 99, .11);
}

.full-step { width: 100%; }
.done-step { border-style: dashed; }

.step-head {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.step-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.step-number {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: var(--soft);
    color: var(--accent);
    font-weight: 800;
}

.step-head h3,
.results-header h2,
.wc-modal-head h3 {
    margin: 0;
    line-height: 1.15;
}

.step-head h3 { font-size: clamp(1.25rem, 2vw, 1.8rem); }
.wc-modal-head h3 { font-size: clamp(1.2rem, 2vw, 1.65rem); }

.option-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.option-list-large .option-btn {
    min-width: min(100%, 260px);
    min-height: 58px;
    padding: 12px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-weight: 700;
    color: var(--ink);
}

.option-btn:hover,
.filter-chip:hover,
.quick-pick:hover,
.btn:hover,
.result-card:hover {
    transform: translateY(-1px);
}

.option-btn.is-selected {
    background: var(--soft);
    border-color: rgba(31, 122, 99, .5);
    color: var(--accent);
}

.option-btn-nav {
    justify-content: center !important;
    background: #fff;
    border-style: dashed;
    color: var(--muted);
}

.option-btn-next {
    background: #fff;
    border-style: dashed;
    color: var(--muted);
}

.option-count {
    min-width: 30px;
    padding: 5px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    color: var(--muted);
    font-size: .8rem;
    text-align: center;
}


.step-empty-options {
    width: 100%;
    border: 1px dashed var(--line);
    border-radius: 18px;
    padding: 16px;
    background: #faf8f4;
    color: var(--muted);
    font-weight: 600;
}

.btn {
    appearance: none;
    border: none;
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 700;
    transition: .18s ease;
}

.btn-sm {
    padding: 8px 12px;
    font-size: .92rem;
    line-height: 1.2;
    border-radius: 12px;
}

.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-secondary {
    background: var(--accent-2);
    color: #1f2937;
}

.btn-warning {
    background: #ffc107;
    color: #1f2937;
}

.btn-warning:hover,
.btn-warning:focus-visible {
    background: #212529;
    color: #fff;
}

.btn-dark {
    background: #212529;
    color: #fff;
}

.btn-dark:hover,
.btn-dark:focus-visible {
    background: #000;
    color: #fff;
}

.btn-ghost,
.btn-soft {
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
}

.btn-link {
    background: transparent;
    padding: 0;
    border: 0;
    font-weight: 700;
}

.btn-search-inline { white-space: nowrap; }

.results-panel {
    min-height: 40vh;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
}

.result-card {
    border: 1px solid rgba(229, 222, 211, .85);
    border-radius: 22px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    transition: .18s ease;
    box-shadow: 0 12px 26px rgba(31, 41, 55, .05);
}

.result-image-wrap {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f8f6f2;
    overflow: hidden;
    appearance: none;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    padding: 0;
    color: inherit;
}

.result-image-wrap:focus { outline: none; box-shadow: none; }

.result-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

.result-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.result-body-compact {
    gap: 10px;
}

.result-category {
    font-size: .88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.result-stock {
    font-size: .85rem;
    font-weight: 700;
}

.result-stock.is-available { color: var(--accent); }
.result-stock.is-unavailable { color: var(--danger); }

.result-title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.32;
    min-height: 2.64em;
}

.result-link-button {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 0;
    text-align: left;
    font: inherit;
    color: inherit;
    width: 100%;
    cursor: pointer;
}

.result-title .result-link-button:hover,
.result-image-wrap:hover { color: var(--accent); }

.result-footer {
    align-items: stretch;
    flex-direction: column;
    margin-top: auto;
}

.result-prices {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}

.compact-prices {
    margin-bottom: 2px;
}

.result-price {
    font-size: 1.4rem;
    line-height: 1;
}

.result-price-old {
    text-decoration: line-through;
    font-size: .92rem;
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: stretch;
    gap: 10px;
    width: 100%;
}

.result-actions .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
}

.result-actions .btn.btn-sm {
    min-height: 38px;
}

.load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 38px;
    padding-top: 8px;
}

.is-hidden { display: none !important; }

.state-card {
    padding: 28px;
    text-align: center;
}

.error-card {
    border-color: rgba(185, 28, 28, .18);
}

.quick-pick {
    padding: 11px 14px;
    font-weight: 600;
}

.search-modal-box {
    display: grid;
    gap: 14px;
}

.search-modal-box input {
    width: 100%;
    min-height: 60px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    font-size: 1.04rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.search-modal-box input:focus {
    outline: none;
    border-color: rgba(31, 122, 99, .45);
    box-shadow: 0 0 0 4px rgba(31, 122, 99, .08);
}

.search-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.search-modal-actions .btn {
    min-width: 140px;
}

.modal-quick-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.product-modal-grid {
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
    gap: 22px;
}

.product-modal-image {
    aspect-ratio: 1 / 1;
    border-radius: 22px;
    overflow: hidden;
    background: #f8f6f2;
}

.product-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-modal-copy {
    display: grid;
    gap: 16px;
}

.product-modal-copy h2 {
    margin: 0;
    font-size: clamp(1.35rem, 2vw, 2rem);
    line-height: 1.15;
}

.product-modal-prices {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.product-modal-price {
    font-size: 1.7rem;
    font-weight: 800;
}

.product-modal-price-old {
    color: var(--muted);
    text-decoration: line-through;
    font-weight: 600;
}

.product-modal-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.product-modal-form,
.product-modal-actions { display: grid; gap: 14px; }
.product-fields { display: grid; gap: 12px; }

.product-field {
    display: grid;
    gap: 8px;
}

.product-field label {
    font-weight: 700;
}

.product-field input,
.product-field select,
.product-field textarea {
    width: 100%;
    min-height: 50px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 12px;
    background: #fff;
}

.product-field textarea { min-height: 92px; resize: vertical; }
.product-field.is-invalid label { color: var(--danger); }
.product-field.is-invalid input,
.product-field.is-invalid select,
.product-field.is-invalid textarea { border-color: rgba(185, 28, 28, .5); }

.product-modal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 6px;
}

.product-modal-link {
    color: var(--accent);
    font-weight: 700;
}

.product-modal-loading {
    display: grid;
    place-items: center;
    min-height: 220px;
    color: var(--muted);
    font-weight: 700;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@media (max-width: 860px) {
    .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-modal-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .page-shell { width: min(100% - 16px, 100%); padding-bottom: 32px; }
    .selection-sticky-bar { width: min(100% - 16px, 100%); }
    .selection-sticky-inner { justify-content: stretch; }
    .selection-sticky-bar .btn-toolbar { width: 100%; }
    .questions-fab { left: 15px; bottom: 88px; width: 50px; height: 50px; }
    body.has-store-header .page-shell { padding-top: 118px; }
    .active-filters-wrap, .step-card, .results-panel { padding: 16px; }
    .wc-modal-content { padding: 56px 16px 16px; }
    .result-footer,
    .result-actions,
    .search-modal-actions,
    .product-modal-footer {
        align-items: flex-start;
        flex-direction: column;
    }
    .option-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .option-list-large .option-btn {
        width: 100%;
        min-width: 0;
        min-height: 52px;
        justify-content: center;
        text-align: center;
        gap: 8px;
        padding: 10px 12px;
    }
    .step-empty-options {
        grid-column: 1 / -1;
    }
    .search-modal-actions .btn,
    .result-actions .btn,
    .product-modal-footer .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
    .step-topline { align-items: flex-start; flex-direction: column; }
    .wizard-toolbar { flex-direction: column; align-items: stretch; }
    .wizard-toolbar .btn { width: 100%; }
    .wc-modal { padding: 12px; }
    .wc-modal-dialog { width: min(100%, calc(100vw - 12px)); max-height: calc(100vh - 24px); }
    .wc-modal-content { max-height: calc(100vh - 24px); }
}

.active-filters-modal { margin-top: 14px; }
.wc-modal-meta { color: var(--muted); font-weight: 700; }
