/* ============================================================
   HFC Sauce Addon System — style.css
   Premium food-app inspired UI
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
    --hfc-red:          #D61A09;
    --hfc-red-dark:     #b31508;
    --hfc-red-light:    #ff3b2a;
    --hfc-red-bg:       rgba(214, 26, 9, 0.07);
    --hfc-text:         #1a1a1a;
    --hfc-text-muted:   #666;
    --hfc-bg:           #fff;
    --hfc-surface:      #f8f8f8;
    --hfc-border:       #e8e8e8;
    --hfc-shadow-sm:    0 2px 8px rgba(0,0,0,.06);
    --hfc-shadow-md:    0 4px 20px rgba(0,0,0,.10);
    --hfc-shadow-pill:  0 2px 6px rgba(214,26,9,.20);
    --hfc-radius-sm:    8px;
    --hfc-radius-md:    12px;
    --hfc-radius-lg:    16px;
    --hfc-transition:   .18s cubic-bezier(.4,0,.2,1);
}

/* ── Container ─────────────────────────────────────────────── */
.hfc-sauce-container {
    background: var(--hfc-bg);
    border: 1.5px solid var(--hfc-border);
    border-radius: var(--hfc-radius-lg);
    padding: 20px 22px 24px;
    margin: 24px 0 20px;
    box-shadow: var(--hfc-shadow-sm);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: box-shadow var(--hfc-transition);
}
.hfc-sauce-container:hover {
    box-shadow: var(--hfc-shadow-md);
}

/* ── Section Header ─────────────────────────────────────────── */
.hfc-sauce-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}
.hfc-sauce-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}
.hfc-sauce-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--hfc-text);
    margin: 0 0 3px;
    letter-spacing: -.02em;
}
.hfc-sauce-price-badge {
    display: inline-block;
    background: var(--hfc-red-bg);
    color: var(--hfc-red);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: .01em;
}

/* ── Sauce Pill Grid ────────────────────────────────────────── */
.hfc-sauce-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

/* ── Individual Pill ────────────────────────────────────────── */
.hfc-sauce-pill {
    position: relative;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.hfc-sauce-pill input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.hfc-pill-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    background: var(--hfc-surface);
    border: 1.5px solid var(--hfc-border);
    border-radius: 50px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--hfc-text);
    transition:
        background var(--hfc-transition),
        border-color var(--hfc-transition),
        color var(--hfc-transition),
        box-shadow var(--hfc-transition),
        transform var(--hfc-transition);
    line-height: 1.2;
    white-space: nowrap;
}

/* Hover state */
.hfc-sauce-pill:hover .hfc-pill-label {
    border-color: var(--hfc-red);
    color: var(--hfc-red);
    background: var(--hfc-red-bg);
    transform: translateY(-1px);
    box-shadow: var(--hfc-shadow-pill);
}

/* Selected state */
.hfc-sauce-pill input[type="checkbox"]:checked + .hfc-pill-label {
    background: var(--hfc-red);
    border-color: var(--hfc-red);
    color: #fff;
    box-shadow: var(--hfc-shadow-pill);
    transform: translateY(-1px);
}

/* Active / press */
.hfc-sauce-pill:active .hfc-pill-label {
    transform: translateY(0) scale(.97);
    box-shadow: none;
}

/* No-Sauce pill specific */
.hfc-no-sauce-pill .hfc-pill-label {
    border-style: dashed;
    color: var(--hfc-text-muted);
}
.hfc-no-sauce-pill:hover .hfc-pill-label {
    border-color: #888;
    color: var(--hfc-text);
    background: #f0f0f0;
}
.hfc-no-sauce-pill input[type="checkbox"]:checked + .hfc-pill-label {
    background: #333;
    border-color: #333;
    border-style: solid;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

/* ── Preference Section ─────────────────────────────────────── */
.hfc-preference-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1.5px solid var(--hfc-border);
    animation: hfc-slide-down .22s ease;
}
@keyframes hfc-slide-down {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0);    }
}

.hfc-preference-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.hfc-pref-icon {
    font-size: 22px;
    line-height: 1;
}
.hfc-preference-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--hfc-text);
    margin: 0;
    letter-spacing: -.01em;
}

/* ── Segmented / Toggle Buttons ─────────────────────────────── */
.hfc-preference-toggle {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.hfc-toggle-option {
    position: relative;
    cursor: pointer;
    flex: 1;
    min-width: 120px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.hfc-toggle-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.hfc-toggle-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 20px;
    background: var(--hfc-surface);
    border: 2px solid var(--hfc-border);
    border-radius: var(--hfc-radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--hfc-text-muted);
    transition:
        background var(--hfc-transition),
        border-color var(--hfc-transition),
        color var(--hfc-transition),
        box-shadow var(--hfc-transition),
        transform var(--hfc-transition);
    text-align: center;
}
.hfc-toggle-icon {
    font-size: 18px;
    line-height: 1;
}

/* Hover */
.hfc-toggle-option:hover .hfc-toggle-label {
    border-color: var(--hfc-red);
    color: var(--hfc-red);
    background: var(--hfc-red-bg);
    transform: translateY(-1px);
}

/* Selected */
.hfc-toggle-option input[type="radio"]:checked + .hfc-toggle-label {
    background: var(--hfc-red);
    border-color: var(--hfc-red);
    color: #fff;
    box-shadow: 0 4px 12px rgba(214,26,9,.30);
    transform: translateY(-1px);
}
.hfc-toggle-option:active .hfc-toggle-label {
    transform: translateY(0);
    box-shadow: none;
}

/* ── Price Summary Bar ──────────────────────────────────────── */
.hfc-sauce-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    padding: 10px 14px;
    background: var(--hfc-red-bg);
    border: 1px solid rgba(214,26,9,.15);
    border-radius: var(--hfc-radius-sm);
    animation: hfc-slide-down .2s ease;
}
.hfc-summary-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--hfc-red-dark);
}
.hfc-summary-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--hfc-red);
}

/* ── Error Message ──────────────────────────────────────────── */
.hfc-sauce-error {
    margin-top: 12px;
    padding: 10px 14px;
    background: #fff3f2;
    border: 1px solid #f5c6c2;
    border-left: 4px solid var(--hfc-red);
    border-radius: var(--hfc-radius-sm);
    font-size: 13px;
    color: #c0392b;
    font-weight: 500;
    animation: hfc-slide-down .2s ease;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
    .hfc-sauce-container {
        padding: 16px;
        border-radius: var(--hfc-radius-md);
        margin: 18px 0 16px;
    }
    .hfc-sauce-title {
        font-size: 15px;
    }
    .hfc-pill-label {
        font-size: 12.5px;
        padding: 6px 12px;
    }
    .hfc-toggle-label {
        padding: 9px 14px;
        font-size: 13px;
    }
}
