/* ==========================================================================
   BBQ Sidekick Configurator — Stylesheet
   Mobile-first, no external dependencies
   ========================================================================== */

/* ── Custom properties ───────────────────────────────────────────────────── */
:root {
    --color-primary:   #00254d;
    --color-accent:    #ff5500;
    --color-hover:     #eb0801;
    --color-bg:        #ffffff;
    --color-text:      #1a1a1a;
    --color-muted:     #6b7280;
    --color-border:    #d1d5db;
    --color-success:   #16a34a;
    --color-success-bg:#f0fdf4;
    --color-error:     #dc2626;
    --color-error-bg:  #fef2f2;
    --color-track:     #e5e7eb;
    --radius-sm:       4px;
    --radius:          8px;
    --radius-lg:       12px;
    --shadow-card:     0 2px 16px rgba(0, 0, 0, 0.08);
    --shadow-modal:    0 8px 40px rgba(0, 0, 0, 0.22);
    --transition:      0.22s ease;
    --max-width:       620px;
}

/* ── Reset scoped to configurator ───────────────────────────────────────── */
/* Only enforce box-sizing — do NOT zero margins/padding here, that would
   override every component rule that sets padding (inputs, buttons, etc.). */
#bbq-configurator,
#bbq-configurator *,
#bbq-configurator *::before,
#bbq-configurator *::after {
    box-sizing: border-box;
}

/* ── Wrapper ─────────────────────────────────────────────────────────────── */
#bbq-configurator {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.25rem 1rem 2rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 1rem;
    color: var(--color-text);
    background: transparent;
}

/* ── Progress bar ────────────────────────────────────────────────────────── */
.bbq-progress {
    margin-bottom: 1.75rem;
}

.bbq-progress__track {
    height: 6px;
    background: var(--color-track);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 0.625rem;
}

.bbq-progress__fill {
    height: 100%;
    width: 33.33%;
    background: var(--color-accent);
    border-radius: 99px;
    transition: width 0.4s ease;
}

.bbq-progress__labels {
    display: flex;
    justify-content: space-between;
}

.bbq-progress__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-muted);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    transition: color var(--transition);
}

.bbq-progress__label.is-active {
    color: var(--color-accent);
}

/* ── Step card ───────────────────────────────────────────────────────────── */
.bbq-step {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-card);
    /* Entry transition */
    opacity: 0;
    transform: translateY(8px);
    transition: opacity var(--transition), transform var(--transition);
}

.bbq-step.is-active {
    opacity: 1;
    transform: translateY(0);
}

.bbq-step__title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.625rem;
}

.bbq-step__intro {
    font-size: 0.9rem;
    color: var(--color-muted);
    margin-bottom: 1.75rem;
    line-height: 1.5;
}

/* ── Form fields ─────────────────────────────────────────────────────────── */
.bbq-field {
    margin-bottom: 1.5rem;
}

.bbq-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.375rem;
}

.bbq-input,
.bbq-select {
    display: block;
    width: 100%;
    padding: 0.7rem 0.875rem;
    font-size: 1rem;
    color: var(--color-text);
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    appearance: none;
    -webkit-appearance: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    line-height: 1.4;
}

.bbq-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

.bbq-input:focus,
.bbq-select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(255, 85, 0, 0.15);
}

.bbq-input::placeholder {
    color: var(--color-muted);
}

/* ── Error message ───────────────────────────────────────────────────────── */
.bbq-error {
    background: var(--color-error-bg);
    border: 1px solid var(--color-error);
    color: var(--color-error);
    border-radius: var(--radius-sm);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.bbq-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.75rem 1.375rem;
    font-size: 0.975rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition), color var(--transition), opacity var(--transition);
    white-space: nowrap;
    line-height: 1;
}

.bbq-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

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

.bbq-btn--primary:hover:not(:disabled) {
    background: var(--color-hover);
    border-color: var(--color-hover);
}

.bbq-btn--secondary {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.bbq-btn--secondary:hover:not(:disabled) {
    background: #003870;
    border-color: #003870;
}

.bbq-btn--outline {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.bbq-btn--outline:hover:not(:disabled) {
    background: var(--color-primary);
    color: #fff;
}

.bbq-btn--full {
    width: 100%;
    margin-top: 0.75rem;
}

/* ── Navigation row (step 2) ─────────────────────────────────────────────── */
.bbq-nav {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.bbq-nav .bbq-btn {
    flex: 1;
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
}

/* ── Link button ─────────────────────────────────────────────────────────── */
.bbq-link-btn {
    background: none;
    border: none;
    color: var(--color-muted);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.25rem 0;
    text-decoration: underline;
    transition: color var(--transition);
}

.bbq-link-btn:hover {
    color: var(--color-accent);
}

/* ── Modal ───────────────────────────────────────────────────────────────── */
.bbq-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-end;    /* bottom sheet on mobile */
    justify-content: center;
    padding: 0;
}

.bbq-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

.bbq-modal__box {
    position: relative;
    z-index: 1;
    background: var(--color-bg);
    width: 100%;
    max-height: 92dvh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow-y: auto;
    padding: 2.25rem 2rem 2.75rem;
    box-shadow: var(--shadow-modal);
    -webkit-overflow-scrolling: touch;
}

.bbq-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--color-track);
    border: none;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: var(--color-text);
    cursor: pointer;
    transition: background var(--transition);
    flex-shrink: 0;
}

.bbq-modal__close:hover {
    background: var(--color-border);
}

.bbq-modal__title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1rem;
    padding-right: 2.5rem; /* avoid overlap with close button */
}

.bbq-modal__summary {
    font-size: 0.875rem;
    color: var(--color-muted);
    margin-bottom: 1.75rem;
    line-height: 1.5;
}

/* ── Checklist ───────────────────────────────────────────────────────────── */
.bbq-checklist {
    list-style: none;
    margin-bottom: 2rem;
}

.bbq-checklist__item {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--color-track);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.bbq-checklist__item:last-child {
    border-bottom: none;
}

.bbq-checklist__text {
    min-width: 0;          /* allow flex child to shrink below content size */
    overflow-wrap: break-word;
    word-break: break-word;
}

.bbq-checklist__icon {
    flex-shrink: 0;
    width: 1.375rem;
    height: 1.375rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 0.1rem;
}

.bbq-check--ok .bbq-checklist__icon {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.bbq-check--adjust .bbq-checklist__icon {
    background: #fff3ee;
    color: var(--color-accent);
}

.bbq-check--ok .bbq-checklist__text {
    color: var(--color-success);
    font-weight: 500;
}

.bbq-check--warn .bbq-checklist__icon {
    background: #fef3c7;
    color: #d97706;
}

.bbq-check--info .bbq-checklist__icon {
    background: #f0f9ff;
    color: #0369a1;
}

.bbq-check--info .bbq-checklist__text {
    color: var(--color-muted);
    font-size: 0.825rem;
    font-style: italic;
}

.bbq-checklist__text {
    white-space: pre-wrap;
}

/* ── Modal action buttons ────────────────────────────────────────────────── */
.bbq-modal__actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.bbq-modal__actions .bbq-btn {
    width: 100%;
}

.bbq-modal__footer {
    text-align: center;
    margin-top: 0.5rem;
}

/* ── Print-only elements (hidden on screen) ──────────────────────────────── */
.bbq-print-header,
.bbq-print-cta {
    display: none;
}

/* ── Tablet / desktop ────────────────────────────────────────────────────── */
@media (min-width: 600px) {
    #bbq-configurator {
        padding: 2rem 1.5rem 3rem;
    }

    .bbq-step {
        padding: 3rem 2.5rem;
    }

    .bbq-step__title {
        font-size: 1.375rem;
    }

    /* Center modal like a dialog on larger screens */
    .bbq-modal {
        align-items: center;
        padding: 1.5rem;
    }

    .bbq-modal__box {
        width: 100%;
        max-width: 750px;
        border-radius: var(--radius-lg);
        padding: 2.75rem 2.5rem 3rem;
        max-height: 95dvh;
    }

    .bbq-modal__actions {
        flex-direction: row;
    }

    .bbq-modal__actions .bbq-btn {
        width: auto;
        flex: 1;
    }

}

/* ── Info notice ─────────────────────────────────────────────────────────── */
.bbq-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.bbq-notice--info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.bbq-notice__icon {
    flex-shrink: 0;
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: 0.05rem;
}

/* ── Side choice ─────────────────────────────────────────────────────────── */
.bbq-side-choice {
    background: #fff3ee;
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-sm);
    padding: 0.875rem 1rem;
}

.bbq-side-choice__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.625rem;
    display: flex;
    gap: 0.4rem;
    align-items: flex-start;
}

.bbq-side-choice__options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bbq-radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    cursor: pointer;
}

.bbq-radio-label input[type="radio"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--color-accent);
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Print / PDF ─────────────────────────────────────────────────────────── */
/* PDF is now generated client-side via jsPDF — no @media print rules needed.
   The .bbq-print-header and .bbq-print-cta elements in the HTML are unused
   leftovers and remain hidden. */
.bbq-print-header,
.bbq-print-cta {
    display: none;
}
