/**
 * WooCommerce Product Finder — Frontend Styles
 * Version 1.0.0
 * Author: Luxe Vision Limited
 *
 * Uses CSS custom properties for per-finder theming:
 *   --wcpf-primary
 *   --wcpf-secondary
 *   --wcpf-radius
 */

/* ─── Base Container ───────────────────────────── */
.wcpf-finder {
    --wcpf-primary: #2563eb;
    --wcpf-secondary: #1e40af;
    --wcpf-radius: 12px;
    --wcpf-shadow: 0 2px 12px rgba(0,0,0,0.06);
    --wcpf-text: #1f2937;
    --wcpf-muted: #6b7280;
    --wcpf-bg: #ffffff;
    --wcpf-bg-alt: #f9fafb;
    --wcpf-border: #e5e7eb;
    --wcpf-transition: 0.35s cubic-bezier(0.4,0,0.2,1);

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--wcpf-text);
    width: 100%;
    margin: 0 auto;
    position: relative;
    box-sizing: border-box;

    /* Container queries — breakpoints respond to finder width, not viewport */
    container-type: inline-size;
    container-name: wcpf;
}
.wcpf-finder *, .wcpf-finder *::before, .wcpf-finder *::after {
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ─── Screens ──────────────────────────────────── */
.wcpf-screen {
    display: none;
}
.wcpf-screen.wcpf-active {
    display: block;
    animation: wcpfFadeIn var(--wcpf-transition) both;
}

@keyframes wcpfFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes wcpfSlideIn {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes wcpfSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(-24px); }
}

.wcpf-animate-in {
    animation: wcpfSlideIn var(--wcpf-transition) both;
}
.wcpf-animate-out {
    animation: wcpfSlideOut 0.2s ease-in both;
}

/* ─── Intro Screen ─────────────────────────────── */
.wcpf-intro {
    text-align: center;
    padding: 36px 20px;
    background: var(--wcpf-bg);
    border: 1px solid var(--wcpf-border);
    border-radius: var(--wcpf-radius);
    box-shadow: var(--wcpf-shadow);
}
.wcpf-intro-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.3;
    color: var(--wcpf-text);
}
.wcpf-intro-desc {
    font-size: 16px;
    color: var(--wcpf-muted);
    margin: 0 0 28px;
    line-height: 1.6;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

/* ─── Buttons ──────────────────────────────────── */
.wcpf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    border-radius: var(--wcpf-radius);
    transition: all 0.2s ease;
    line-height: 1;
    text-decoration: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}
.wcpf-btn-primary {
    background: var(--wcpf-primary);
    color: #fff;
}
.wcpf-btn-primary:hover {
    background: var(--wcpf-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37,99,235,0.35);
}
.wcpf-btn-secondary {
    background: var(--wcpf-bg-alt);
    color: var(--wcpf-text);
    border: 1px solid var(--wcpf-border);
}
.wcpf-btn-secondary:hover {
    background: var(--wcpf-border);
}

/* ─── Progress Bar ─────────────────────────────── */
.wcpf-progress {
    margin-bottom: 20px;
}
.wcpf-progress-bar {
    height: 6px;
    background: var(--wcpf-border);
    border-radius: 3px;
    overflow: hidden;
}
.wcpf-progress-fill {
    height: 100%;
    background: var(--wcpf-primary);
    border-radius: 3px;
    transition: width var(--wcpf-transition);
    width: 0;
}
.wcpf-step-count {
    display: block;
    text-align: right;
    font-size: 13px;
    color: var(--wcpf-muted);
    margin-top: 6px;
    font-weight: 500;
}

/* ─── Question Screen ──────────────────────────── */
.wcpf-question-screen {
    background: var(--wcpf-bg);
    border: 1px solid var(--wcpf-border);
    border-radius: var(--wcpf-radius);
    box-shadow: var(--wcpf-shadow);
    padding: 24px 20px 20px;
}
.wcpf-q-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--wcpf-text);
    line-height: 1.35;
}
.wcpf-q-description {
    font-size: 14px;
    color: var(--wcpf-muted);
    margin: 0 0 18px;
    line-height: 1.5;
}

/* ─── Answer Options ───────────────────────────── */
.wcpf-options {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
    grid-template-columns: 1fr; /* Default: single column, always works */
}
/* Fixed column overrides */
.wcpf-options-cols-1 { grid-template-columns: 1fr; }
.wcpf-options-cols-2 { grid-template-columns: repeat(2, 1fr); }
.wcpf-options-cols-3 { grid-template-columns: repeat(3, 1fr); }

/* Auto columns — adapts to container width via container query */
.wcpf-options-cols-auto {
    grid-template-columns: 1fr;
}
@container wcpf (min-width: 460px) {
    .wcpf-options-cols-auto { grid-template-columns: repeat(2, 1fr); }
}
@container wcpf (min-width: 700px) {
    .wcpf-options-cols-3 { grid-template-columns: repeat(3, 1fr); }
}
/* Fallback for browsers without container query support */
@supports not (container-type: inline-size) {
    @media (min-width: 460px) {
        .wcpf-options-cols-auto { grid-template-columns: repeat(2, 1fr); }
    }
}

/* Force single column in narrow containers for all fixed cols */
@container wcpf (max-width: 400px) {
    .wcpf-options-cols-2,
    .wcpf-options-cols-3 {
        grid-template-columns: 1fr !important;
    }
}
@supports not (container-type: inline-size) {
    @media (max-width: 400px) {
        .wcpf-options-cols-2,
        .wcpf-options-cols-3 {
            grid-template-columns: 1fr !important;
        }
    }
}

.wcpf-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--wcpf-bg);
    border: 2px solid var(--wcpf-border);
    border-radius: var(--wcpf-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
    min-width: 0; /* Allow grid item to shrink below content width */
}

/* Layout mode: horizontal (default — icon + text side by side) */
.wcpf-optlayout-horizontal .wcpf-option {
    flex-direction: row;
    align-items: center;
}
/* Layout mode: vertical (image/icon on top, text below) */
.wcpf-optlayout-vertical .wcpf-option {
    flex-direction: column;
    text-align: center;
    align-items: center;
}
.wcpf-optlayout-vertical .wcpf-option-text {
    text-align: center;
}
.wcpf-optlayout-vertical .wcpf-option.wcpf-selected::after {
    top: 4px;
    right: 6px;
}
.wcpf-option:hover {
    border-color: var(--wcpf-primary);
    background: rgba(37,99,235,0.03);
}
.wcpf-option.wcpf-selected {
    border-color: var(--wcpf-primary);
    background: rgba(37,99,235,0.06);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.wcpf-option.wcpf-selected::after {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: var(--wcpf-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

/* Option image */
.wcpf-option-img {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

/* Image choice — larger cards */
.wcpf-type-image .wcpf-option {
    flex-direction: column;
    text-align: center;
    padding: 12px 10px;
}
.wcpf-type-image .wcpf-option-img {
    width: 100%;
    height: 100px;
    border-radius: 6px;
    margin-bottom: 4px;
}

/* Icon choice */
.wcpf-option-icon {
    font-size: 22px;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--wcpf-bg-alt);
    border-radius: 8px;
}

.wcpf-option-text {
    flex: 1;
    min-width: 0;
    width: 100%;
}
.wcpf-option-label {
    font-size: 14px;
    font-weight: 600;
    display: block;
    width: 100%;
    line-height: 1.35;
}
.wcpf-option-desc {
    font-size: 12px;
    color: var(--wcpf-muted);
    line-height: 1.4;
    margin-top: 2px;
    width: 100%;
}

/* Dropdown type */
.wcpf-dropdown-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 2px solid var(--wcpf-border);
    border-radius: var(--wcpf-radius);
    background: var(--wcpf-bg);
    color: var(--wcpf-text);
    appearance: auto;
    cursor: pointer;
    margin-bottom: 20px;
}
.wcpf-dropdown-select:focus {
    border-color: var(--wcpf-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

/* ─── Navigation ───────────────────────────────── */
.wcpf-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.wcpf-nav .wcpf-btn {
    min-width: 120px;
}
.wcpf-prev-btn {
    margin-right: auto;
}
.wcpf-next-btn {
    margin-left: auto;
}

/* Validation shake */
.wcpf-validation-error {
    animation: wcpfShake 0.4s ease-in-out;
}
@keyframes wcpfShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
.wcpf-validation-msg {
    color: #dc2626;
    font-size: 13px;
    margin-bottom: 12px;
    display: none;
}

/* ─── Loading Screen ───────────────────────────── */
.wcpf-loading-screen {
    text-align: center;
    padding: 60px 24px;
    background: var(--wcpf-bg);
    border: 1px solid var(--wcpf-border);
    border-radius: var(--wcpf-radius);
    box-shadow: var(--wcpf-shadow);
}
.wcpf-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid var(--wcpf-border);
    border-top-color: var(--wcpf-primary);
    border-radius: 50%;
    animation: wcpfSpin 0.7s linear infinite;
    margin: 0 auto 16px;
}
@keyframes wcpfSpin {
    to { transform: rotate(360deg); }
}
.wcpf-loading-screen p {
    color: var(--wcpf-muted);
    font-size: 15px;
}

/* ─── Results Screen ───────────────────────────── */
.wcpf-results-screen {
    padding: 36px 0 0;
}
.wcpf-results-heading {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 24px;
    text-align: center;
    color: var(--wcpf-text);
}

/* Results grid — responsive columns via CSS variables */
.wcpf-results-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(var(--wcpf-cols-desktop, 3), 1fr);
}
.wcpf-result-grid {
    display: grid;
}

/* Product card */
.wcpf-product-card {
    background: var(--wcpf-bg);
    border: 1px solid var(--wcpf-border);
    border-radius: var(--wcpf-radius);
    overflow: hidden;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    box-shadow: var(--wcpf-shadow);
}
.wcpf-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.wcpf-product-card-image {
    position: relative;
    overflow: hidden;
    background: var(--wcpf-bg-alt);
}
/* Grid view — fixed ratio, cover fill */
.wcpf-result-grid .wcpf-product-card-image {
    aspect-ratio: 4/3;
}
.wcpf-result-grid .wcpf-product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.wcpf-result-grid .wcpf-product-card:hover .wcpf-product-card-image img {
    transform: scale(1.04);
}
.wcpf-product-card-body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.wcpf-product-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px;
    line-height: 1.3;
}
.wcpf-product-card-title a {
    color: var(--wcpf-text);
    text-decoration: none;
}
.wcpf-product-card-title a:hover {
    color: var(--wcpf-primary);
}

/* Answer pills */
.wcpf-answer-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 4px 0 10px;
}
.wcpf-answer-pill {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--wcpf-primary);
    background: rgba(37,99,235,0.08);
    border: 1px solid rgba(37,99,235,0.18);
    border-radius: 999px;
    white-space: nowrap;
}

.wcpf-product-card-desc {
    font-size: 14px;
    color: var(--wcpf-muted);
    margin: 0 0 12px;
    line-height: 1.5;
    flex: 1;
}
.wcpf-product-card-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--wcpf-text);
    margin: 0 0 14px;
}
.wcpf-product-card-price del {
    color: var(--wcpf-muted);
    font-weight: 400;
    font-size: 14px;
}
.wcpf-product-card-price ins {
    text-decoration: none;
    color: #dc2626;
}
.wcpf-product-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}
.wcpf-product-card-actions .wcpf-btn {
    flex: 1;
    padding: 10px 14px;
    font-size: 14px;
}
/* Result button style overrides via admin CSS variables */
.wcpf-product-card-actions .wcpf-btn-primary {
    background: var(--wcpf-btn-bg, var(--wcpf-primary));
    color: var(--wcpf-btn-color, #fff);
    border-radius: var(--wcpf-btn-radius, var(--wcpf-radius));
}
.wcpf-product-card-actions .wcpf-btn-primary:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}
.wcpf-product-card-actions .wcpf-btn-secondary {
    border-radius: var(--wcpf-btn-radius, var(--wcpf-radius));
}

/* Match score badge */
.wcpf-match-badge {
    display: inline-block;
    background: rgba(37,99,235,0.1);
    color: var(--wcpf-primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Product label overlay — background set via inline style from admin color picker */
.wcpf-product-label {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    z-index: 2;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    line-height: 1.4;
}
.wcpf-product-card-image {
    position: relative;
}

/* Rank badge */
.wcpf-rank-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.wcpf-rank-top {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
}
.wcpf-rank-mid {
    background: rgba(16,185,129,0.12);
    color: #065f46;
}

/* Per-product reason */
.wcpf-product-reason {
    font-size: 13px;
    color: var(--wcpf-muted);
    margin: 0 0 12px;
    line-height: 1.5;
    padding: 8px 12px;
    background: var(--wcpf-bg-alt);
    border-radius: 8px;
    border-left: 3px solid var(--wcpf-primary);
}
.wcpf-product-reason-icon {
    margin-right: 4px;
}

/* ─── Variations (minimal) ─────────────────── */
.wcpf-variations {
    margin: 10px 0 14px;
}
.wcpf-variations-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--wcpf-muted);
    margin-bottom: 6px;
}
.wcpf-variations-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.wcpf-var-btn {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--wcpf-border);
    border-radius: 4px;
    background: var(--wcpf-bg);
    color: var(--wcpf-text);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    line-height: 1.4;
}
.wcpf-var-btn:hover {
    border-color: var(--wcpf-primary);
    color: var(--wcpf-primary);
}
.wcpf-var-btn.wcpf-var-selected {
    border-color: var(--wcpf-primary);
    background: var(--wcpf-primary);
    color: #fff;
}
.wcpf-var-btn.wcpf-var-oos {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}
.wcpf-var-btn small {
    font-size: 9px;
    opacity: 0.7;
}
.wcpf-var-detail {
    margin-top: 6px;
    font-size: 12px;
    color: var(--wcpf-muted);
    display: flex;
    gap: 8px;
    align-items: center;
}
.wcpf-var-price {
    font-weight: 600;
    color: var(--wcpf-text);
    font-size: 13px;
}
.wcpf-var-desc {
    font-size: 11px;
}
.wcpf-var-select {
    width: 100%;
    max-width: 280px;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid var(--wcpf-border);
    border-radius: var(--wcpf-radius, 6px);
    background: var(--wcpf-bg);
    color: var(--wcpf-text);
    font-family: inherit;
    cursor: pointer;
}
.wcpf-var-select:focus {
    border-color: var(--wcpf-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}

/* Variation validation */
.wcpf-var-validation {
    margin-top: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    animation: wcpfFadeIn 0.2s ease;
}
.wcpf-var-highlight {
    animation: wcpfVarShake 0.4s ease-in-out;
    box-shadow: 0 0 0 2px rgba(220,38,38,0.3);
    border-radius: 6px;
}
@keyframes wcpfVarShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

/* No results */
.wcpf-no-results {
    text-align: center;
    padding: 48px 24px;
    background: var(--wcpf-bg);
    border: 1px solid var(--wcpf-border);
    border-radius: var(--wcpf-radius);
}
.wcpf-no-results p {
    font-size: 16px;
    color: var(--wcpf-muted);
}

/* ─── Recommendation Reasons Callout ───────── */
.wcpf-recommendation-reasons {
    margin-bottom: 28px;
    border-radius: var(--wcpf-radius);
    background: linear-gradient(135deg, rgba(79,70,229,0.04) 0%, rgba(99,102,241,0.08) 100%);
    border: 1px solid rgba(79,70,229,0.14);
    overflow: hidden;
}
.wcpf-reasons-inner {
    display: flex;
    gap: 18px;
    padding: 24px 28px;
    align-items: flex-start;
}
.wcpf-reasons-icon {
    font-size: 28px;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 2px;
}
.wcpf-reasons-content {
    flex: 1;
    min-width: 0;
}
.wcpf-reasons-heading {
    font-size: 16px;
    font-weight: 700;
    color: var(--wcpf-text);
    margin: 0 0 10px;
    line-height: 1.3;
}
.wcpf-reasons-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.wcpf-reasons-list li {
    font-size: 14px;
    color: var(--wcpf-text);
    line-height: 1.5;
    padding-left: 22px;
    position: relative;
}
.wcpf-reasons-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--wcpf-primary);
    font-weight: 700;
    font-size: 13px;
}

/* Results actions */
.wcpf-results-actions {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--wcpf-border);
}

/* ─── Error message ────────────────────────────── */
.wcpf-error {
    background: #fef2f2;
    color: #991b1b;
    padding: 12px 18px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 14px;
}

/* ─── RESULT STYLE: List View ─────────────── */
.wcpf-result-list {
    display: flex !important;
    flex-direction: column;
    gap: 14px;
}
.wcpf-result-list .wcpf-product-card {
    flex-direction: row;
    align-items: center;
}
.wcpf-result-list .wcpf-product-card:hover {
    transform: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
/* List image — original ratio, centred, padded */
.wcpf-result-list .wcpf-product-card-image {
    width: 200px;
    min-width: 200px;
    flex-shrink: 0;
    aspect-ratio: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    background: var(--wcpf-bg-alt);
    align-self: stretch;
    border-right: 1px solid var(--wcpf-border);
}
.wcpf-result-list .wcpf-product-card-image img {
    width: 100%;
    height: auto;
    max-height: 180px;
    object-fit: contain;
    display: block;
    border-radius: calc(var(--wcpf-radius, 12px) * 0.4);
    transition: transform 0.3s ease;
}
.wcpf-result-list .wcpf-product-card:hover .wcpf-product-card-image img {
    transform: scale(1.03);
}
.wcpf-result-list .wcpf-product-card-body {
    flex: 1;
    padding: 16px 20px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
/* List: price and actions on same row at bottom */
.wcpf-result-list .wcpf-product-card-price {
    font-size: 16px;
    margin-bottom: 10px;
}
.wcpf-result-list .wcpf-product-card-actions {
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: auto;
}
.wcpf-result-list .wcpf-product-card-actions .wcpf-btn {
    flex: 0 0 auto;
    padding: 8px 16px;
    font-size: 13px;
}
/* List: smaller badges */
.wcpf-result-list .wcpf-rank-badge {
    font-size: 10px;
    padding: 2px 8px;
}
.wcpf-result-list .wcpf-match-badge {
    font-size: 11px;
    padding: 3px 8px;
}
/* List: label on image */
.wcpf-result-list .wcpf-product-label {
    top: 8px;
    left: 8px;
    font-size: 11px;
    padding: 3px 10px;
}
/* List: compact reason */
.wcpf-result-list .wcpf-product-reason {
    padding: 6px 10px;
    font-size: 12px;
    margin-bottom: 8px;
}
/* List: compact variations */
.wcpf-result-list .wcpf-variations {
    margin: 6px 0 10px;
}
.wcpf-result-list .wcpf-var-btn {
    padding: 3px 8px;
    font-size: 11px;
}
/* List: compact pills */
.wcpf-result-list .wcpf-answer-pill {
    font-size: 10px;
    padding: 2px 7px;
}
.wcpf-result-list .wcpf-answer-pills {
    margin: 2px 0 6px;
    gap: 4px;
}

/* ─── QUESTION STYLE: Buttons ─────────────── */
.wcpf-qstyle-buttons .wcpf-option {
    padding: 12px 20px;
    border-width: 2px;
    gap: 10px;
    font-weight: 600;
}
.wcpf-qstyle-buttons .wcpf-option-desc {
    display: none;
}
.wcpf-qstyle-buttons .wcpf-option-img {
    width: 32px;
    height: 32px;
}
.wcpf-qstyle-buttons .wcpf-type-image .wcpf-option-img {
    width: 60px;
    height: 60px;
}

/* ─── QUESTION STYLE: Minimal ─────────────── */
.wcpf-qstyle-minimal .wcpf-option {
    padding: 10px 16px;
    border: 1px solid var(--wcpf-border);
    border-radius: 6px;
    background: transparent;
    gap: 10px;
}
.wcpf-qstyle-minimal .wcpf-option:hover {
    background: var(--wcpf-bg-alt);
}
.wcpf-qstyle-minimal .wcpf-option.wcpf-selected {
    border-color: var(--wcpf-primary);
    background: rgba(37,99,235,0.04);
    box-shadow: none;
}
.wcpf-qstyle-minimal .wcpf-option.wcpf-selected::after {
    width: 20px; height: 20px; font-size: 11px; top: 6px; right: 8px;
}
.wcpf-qstyle-minimal .wcpf-option-img {
    width: 36px; height: 36px; border-radius: 4px;
}
.wcpf-qstyle-minimal .wcpf-option-label { font-size: 14px; }
.wcpf-qstyle-minimal .wcpf-option-desc { font-size: 12px; }

/* ─── BUTTON STYLE: Pill ──────────────────── */
.wcpf-btnstyle-pill .wcpf-btn { border-radius: 999px; }
.wcpf-btnstyle-pill .wcpf-option { border-radius: 999px; }
.wcpf-btnstyle-pill .wcpf-product-card { border-radius: 20px; }

/* ─── BUTTON STYLE: Square ────────────────── */
.wcpf-btnstyle-square .wcpf-btn { border-radius: 0; }
.wcpf-btnstyle-square .wcpf-option { border-radius: 0; }
.wcpf-btnstyle-square .wcpf-product-card { border-radius: 0; }
.wcpf-btnstyle-square .wcpf-option-img { border-radius: 0; }

/* ─── SPACING: Compact ────────────────────── */
.wcpf-spacing-compact .wcpf-options { gap: 6px; }
.wcpf-spacing-compact .wcpf-option { padding: 8px 10px; }
.wcpf-spacing-compact .wcpf-product-card-body { padding: 10px; }
.wcpf-spacing-compact .wcpf-results-grid { gap: 10px; }
.wcpf-spacing-compact .wcpf-q-title { margin-bottom: 8px; }
.wcpf-spacing-compact .wcpf-question-screen { padding: 18px 16px 16px; }

/* ─── SPACING: Spacious ───────────────────── */
.wcpf-spacing-spacious .wcpf-options { gap: 14px; }
.wcpf-spacing-spacious .wcpf-option { padding: 16px 18px; }
.wcpf-spacing-spacious .wcpf-product-card-body { padding: 22px; }
.wcpf-spacing-spacious .wcpf-results-grid { gap: 24px; }
.wcpf-spacing-spacious .wcpf-q-title { margin-bottom: 20px; font-size: 24px; }
.wcpf-spacing-spacious .wcpf-question-screen { padding: 32px 28px 28px; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE — Container Queries (primary)
   Breakpoints based on the FINDER'S WIDTH, not viewport.
   This ensures correct layout when embedded in narrow
   page sections, sidebars, or partial-width columns.
   ═══════════════════════════════════════════════════ */

/* ─── Narrow container (< 500px) ──────────────── */
@container wcpf (max-width: 500px) {
    .wcpf-intro {
        padding: 24px 14px;
    }
    .wcpf-intro-title {
        font-size: 20px;
    }
    .wcpf-intro-desc {
        font-size: 13px;
        margin-bottom: 18px;
    }
    .wcpf-question-screen {
        padding: 16px 12px 14px;
    }
    .wcpf-q-title {
        font-size: 17px;
    }
    .wcpf-q-description {
        font-size: 13px;
        margin-bottom: 12px;
    }
    .wcpf-options {
        grid-template-columns: 1fr !important;
        gap: 6px;
        margin-bottom: 14px;
    }
    .wcpf-option {
        padding: 9px 10px;
        gap: 8px;
    }
    /* Force horizontal in narrow containers for readability */
    .wcpf-optlayout-vertical .wcpf-option {
        flex-direction: row;
        text-align: left;
    }
    .wcpf-optlayout-vertical .wcpf-option-text {
        text-align: left;
    }
    .wcpf-option-img {
        width: 34px;
        height: 34px;
        border-radius: 6px;
    }
    .wcpf-option-label { font-size: 13px; }
    .wcpf-option-desc { font-size: 11px; }
    .wcpf-option.wcpf-selected::after {
        width: 18px; height: 18px; font-size: 10px; top: 5px; right: 6px;
    }
    .wcpf-option-icon {
        width: 28px; height: 28px; font-size: 16px; border-radius: 6px;
    }
    .wcpf-type-image .wcpf-option { padding: 8px; }
    .wcpf-type-image .wcpf-option-img { height: 72px; }
    .wcpf-dropdown-select {
        padding: 9px 10px; font-size: 13px; margin-bottom: 14px;
    }
    .wcpf-progress { margin-bottom: 12px; }
    .wcpf-btn {
        padding: 10px 16px; font-size: 14px; width: 100%;
    }
    .wcpf-nav {
        flex-direction: column-reverse; gap: 6px;
    }
    .wcpf-nav .wcpf-btn {
        width: 100%; min-width: unset;
    }
    /* Grid: use mobile columns */
    .wcpf-results-grid {
        grid-template-columns: repeat(var(--wcpf-cols-mobile, 1), 1fr) !important;
        gap: 12px;
    }
    /* List: stack vertically */
    .wcpf-result-list .wcpf-product-card {
        flex-direction: column;
    }
    .wcpf-result-list .wcpf-product-card-image {
        width: 100%; min-width: unset; padding: 16px;
    }
    .wcpf-result-list .wcpf-product-card-image img {
        max-height: 200px; margin: 0 auto;
    }
    .wcpf-product-card-body { padding: 14px; }
    .wcpf-product-card-title { font-size: 15px; }
    .wcpf-product-card-price { font-size: 16px; margin-bottom: 10px; }
    .wcpf-product-card-actions .wcpf-btn {
        padding: 8px 12px; font-size: 13px;
    }
    .wcpf-answer-pill { font-size: 10px; padding: 2px 8px; }
}

/* ─── Medium container (501–768px) ────────────── */
@container wcpf (min-width: 501px) and (max-width: 768px) {
    .wcpf-intro { padding: 28px 18px; }
    .wcpf-question-screen { padding: 20px 16px 16px; }
    .wcpf-q-title { font-size: 18px; }
    .wcpf-options {
        gap: 8px; margin-bottom: 16px;
    }
    .wcpf-options-cols-3 { grid-template-columns: 1fr 1fr; }
    .wcpf-option { padding: 10px 12px; }
    .wcpf-btn { padding: 10px 20px; font-size: 14px; }
    /* Grid: use tablet columns */
    .wcpf-results-grid {
        grid-template-columns: repeat(var(--wcpf-cols-tablet, 2), 1fr);
        gap: 16px;
    }
    /* List: narrower image */
    .wcpf-result-list .wcpf-product-card-image {
        width: 160px; min-width: 160px; padding: 12px;
    }
    .wcpf-result-list .wcpf-product-card-image img {
        max-height: 150px;
    }
    .wcpf-result-list .wcpf-product-card-body {
        padding: 14px 16px;
    }
}

/* ─── Wide container (769px+) — desktop defaults ── */
@container wcpf (min-width: 769px) {
    .wcpf-results-grid {
        grid-template-columns: repeat(var(--wcpf-cols-desktop, 3), 1fr);
    }
    .wcpf-options-cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}

/* ═══════════════════════════════════════════════════
   FALLBACK — Media Queries for older browsers that
   don't support @container. These use viewport width.
   ═══════════════════════════════════════════════════ */
@supports not (container-type: inline-size) {
    @media screen and (max-width: 500px) {
        .wcpf-intro { padding: 24px 14px; }
        .wcpf-intro-title { font-size: 20px; }
        .wcpf-question-screen { padding: 16px 12px 14px; }
        .wcpf-q-title { font-size: 17px; }
        .wcpf-options { grid-template-columns: 1fr !important; gap: 6px; margin-bottom: 14px; }
        .wcpf-option { padding: 9px 10px; gap: 8px; }
        .wcpf-optlayout-vertical .wcpf-option { flex-direction: row; text-align: left; }
        .wcpf-option-img { width: 34px; height: 34px; }
        .wcpf-option-label { font-size: 13px; }
        .wcpf-btn { padding: 10px 16px; font-size: 14px; width: 100%; }
        .wcpf-nav { flex-direction: column-reverse; gap: 6px; }
        .wcpf-nav .wcpf-btn { width: 100%; min-width: unset; }
        .wcpf-results-grid { grid-template-columns: repeat(var(--wcpf-cols-mobile, 1), 1fr) !important; }
        .wcpf-result-list .wcpf-product-card { flex-direction: column; }
        .wcpf-result-list .wcpf-product-card-image { width: 100%; min-width: unset; padding: 16px; }
        .wcpf-product-card-body { padding: 14px; }
    }
    @media screen and (min-width: 501px) and (max-width: 768px) {
        .wcpf-question-screen { padding: 20px 16px 16px; }
        .wcpf-options-cols-3 { grid-template-columns: 1fr 1fr; }
        .wcpf-results-grid { grid-template-columns: repeat(var(--wcpf-cols-tablet, 2), 1fr); }
        .wcpf-result-list .wcpf-product-card-image { width: 160px; min-width: 160px; padding: 12px; }
    }
    @media screen and (min-width: 769px) {
        .wcpf-results-grid { grid-template-columns: repeat(var(--wcpf-cols-desktop, 3), 1fr); }
    }
}
