/* Ingredient filter — frontend styles */

/* ── Toggle bar ──────────────────────────────────────────────────────── */
.sfm-ingredient-toggle-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 16px;
    margin-bottom: 20px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

.sfm-ingredient-toggle-bar--showing-all {
    background: #e8f5e9;
    border-color: #a5d6a7;
}

.sfm-ingredient-toggle-text {
    flex: 1 1 auto;
    color: #555;
}

.sfm-ingredient-toggle-form {
    margin: 0;
}

.sfm-ingredient-toggle-btn {
    white-space: nowrap;
    font-size: 13px !important;
}

.sfm-ingredient-prefs-link {
    font-size: 12px;
    color: #888;
    text-decoration: underline;
    white-space: nowrap;
}

.sfm-ingredient-prefs-link:hover {
    color: #555;
}

/* ── Single product warning flag (above the product photo) ───────────── */
.sfm-ingredient-warning-flag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    margin-bottom: 10px;
    background: #fff3e0;
    border-left: 3px solid #ff9800;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
    color: #7a4a00;
}

.sfm-ingredient-warning-icon {
    font-size: 13px;
    line-height: 1;
    flex-shrink: 0;
}

/* ── Ingredients section on the product page ────────────────────────── */
.sfm-ingredient-product-ingredients {
    margin: 20px 0;
    padding: 16px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
}

.sfm-ingredient-heading {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
}

.sfm-ingredient-text {
    margin: 0 0 10px;
    color: #444;
}

.sfm-ingredient-allergen-list {
    margin: 0;
    color: #e65100;
    font-size: 13px;
}

/* ── My Account preferences ─────────────────────────────────────────── */
.sfm-ingredient-preferences-form fieldset {
    border: none;
    padding: 0;
    margin: 0 0 20px;
}

.sfm-ingredient-allergen-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.sfm-ingredient-allergen-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    cursor: pointer;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    transition: background 0.15s;
}

.sfm-ingredient-allergen-label:hover {
    background: #f5f5f5;
}

.sfm-ingredient-allergen-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

/* Keep longer allergen lists compact inside the My Account content panel. */
.sfm-account-content .sfm-ingredient-allergen-checkboxes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 12px;
}

.sfm-account-content .sfm-ingredient-allergen-label {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 46px;
    margin: 0;
    padding: 10px 12px;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}

@media (max-width: 960px) {
    .sfm-account-content .sfm-ingredient-allergen-checkboxes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .sfm-account-content .sfm-ingredient-allergen-checkboxes {
        grid-template-columns: minmax(0, 1fr);
    }
}
