/* Gluten-free order app — styled with the site's PaperMod variables */
.gf {
  --gf-ok: #047857; --gf-warn: #b45309; --gf-bad: #b91c1c;
  margin: 0.5rem 0 1.5rem; font-size: 0.95rem;
}
:root[data-theme="dark"] .gf { --gf-ok: #34d399; --gf-warn: #fbbf24; --gf-bad: #f87171; }
.gf *, .gf *::before, .gf *::after { box-sizing: border-box; }

.gf-card {
  background: var(--entry); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.15rem; margin-bottom: 1rem;
}
.gf-head, .gf-details > summary {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--secondary); display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.7rem;
}
.gf-details > summary { cursor: pointer; margin-bottom: 0; list-style: none; }
.gf-details > summary::-webkit-details-marker { display: none; }
.gf-details > summary::after { content: "▾"; margin-left: auto; }
.gf-details[open] > summary { margin-bottom: 0.7rem; }
.gf-details[open] > summary::after { content: "▴"; }
.gf-sub { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--primary); }
.gf-step {
  display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 50%;
  background: var(--accent-subtle); color: var(--accent); font-size: 0.72rem; flex: none;
}

/* fields */
.gf-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 0.9rem; }
@media (max-width: 560px) { .gf-fields { grid-template-columns: 1fr; } }
.gf-wide { grid-column: 1 / -1; }
.gf-field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; color: var(--secondary); }
.gf-end { justify-content: flex-end; }
.gf input:not([type="checkbox"]), .gf select, .gf textarea {
  font: inherit; font-size: 0.95rem; color: var(--primary); background: var(--theme);
  border: 1px solid var(--border); border-radius: 8px; padding: 0.45rem 0.6rem; width: 100%;
}
.gf textarea { resize: vertical; }
.gf input:focus, .gf select:focus, .gf textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.gf-check { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.8rem; font-size: 0.9rem; }
.gf-note { font-size: 0.8rem; color: var(--secondary); margin: 0.6rem 0 0; }

/* catalogue */
.gf-search { margin-bottom: 0.4rem; }
.gf-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.3rem 0 0.2rem; }
.gf-chip {
  border: 1px solid var(--border); background: var(--theme); color: var(--primary); border-radius: 999px;
  padding: 0.25rem 0.7rem; font: inherit; font-size: 0.8rem; cursor: pointer;
}
.gf-chip:hover { border-color: var(--accent); }
.gf-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .gf-chip[aria-pressed="true"] { color: #0c1222; }
.gf-cat {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--secondary); margin: 1.1rem 0 0.2rem;
}
.gf-item {
  display: grid; grid-template-columns: 1fr auto auto; gap: 0.75rem; align-items: center;
  padding: 0.5rem 0.4rem; border-top: 1px solid var(--border); border-radius: 6px;
}
.gf-item.on { background: var(--accent-subtle); }
.gf-name { font-weight: 500; color: var(--primary); line-height: 1.3; }
.gf-meta { font-size: 0.78rem; color: var(--secondary); }
.gf-tag {
  font-size: 0.68rem; padding: 0.05rem 0.45rem; border-radius: 999px; margin-left: 0.3rem;
  border: 1px solid var(--accent); color: var(--accent); white-space: nowrap;
}
.gf-u { font-size: 0.8rem; color: var(--secondary); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gf-stepper { display: flex; align-items: center; gap: 0.3rem; }
.gf-stepper button {
  width: 2rem; height: 2rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--theme); color: var(--primary); font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.gf-stepper button:hover:not(:disabled) { border-color: var(--accent); }
.gf-stepper button:disabled { opacity: 0.35; cursor: not-allowed; }
.gf-qty { min-width: 1.3rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.gf-custom { margin-top: 1rem; }
.gf-custom > summary, .gf-preview > summary { cursor: pointer; font-size: 0.9rem; color: var(--accent); margin-bottom: 0.6rem; }

/* sticky running total */
.gf-bar {
  position: sticky; bottom: 0.6rem; z-index: 5; display: flex; align-items: center; gap: 0.8rem;
  background: var(--theme); border: 1px solid var(--accent); border-radius: 999px;
  padding: 0.5rem 1rem; margin: -0.3rem 0 1rem; box-shadow: 0 4px 16px rgba(0,0,0,.12); font-size: 0.9rem;
}
.gf-meter { flex: 1; height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.gf-meter > div { height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }
.gf-bar.full .gf-meter > div { background: var(--gf-ok); }
.gf-bar.over .gf-meter > div { background: var(--gf-bad); }
.gf-barlink { font-size: 0.82rem; white-space: nowrap; }
.gf .gf-barlink { box-shadow: none; }

/* order */
.gf-total { display: block; align-self: end; text-align: right; font-size: 1.3rem; font-weight: 700; color: var(--primary); }
.gf-total small { font-size: 0.8rem; font-weight: 500; color: var(--secondary); }
.gf .gf-basket { list-style: none; margin: 0.8rem 0 0; padding: 0; font-size: 0.88rem; }
.gf .gf-basket li { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.35rem 0; border-top: 1px dashed var(--border); margin: 0; }
.gf .gf-basket li:first-child { border-top: 0; }
.gf-warn { color: var(--gf-warn); font-size: 0.85rem; margin-top: 0.5rem; }
.gf-warn:empty { display: none; }

/* buttons */
.gf-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.gf-actions > * { flex: 1 1 10rem; }
.gf-minor { margin-top: 0.5rem; }
.gf-btn {
  display: inline-flex; justify-content: center; align-items: center; font: inherit; font-weight: 600;
  padding: 0.6rem 0.9rem; border-radius: 8px; cursor: pointer; text-align: center; text-decoration: none;
}
.gf a.gf-btn, .post-content .gf a.gf-btn, .post-content .gf a.gf-btn:hover { box-shadow: none; text-decoration: none; }
.gf-primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
:root[data-theme="dark"] .gf-primary { color: #0c1222; }
.gf-ghost { background: var(--theme); color: var(--primary); border: 1px solid var(--border); }
.gf-ghost:hover { border-color: var(--accent); }
.gf-small { font-size: 0.82rem; padding: 0.4rem 0.7rem; font-weight: 500; }
.gf-btn:disabled, .gf-btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.gf-btn:focus-visible, .gf-linkbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gf-details .gf-btn { margin-top: 0.7rem; }
.gf-preview { margin-top: 0.9rem; }
.gf-preview textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.8rem; }

.gf-reset { font-size: 0.8rem; color: var(--secondary); }
.gf-linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--gf-bad); text-decoration: underline; cursor: pointer; }

.gf-toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 50;
  background: var(--primary); color: var(--theme); padding: 0.6rem 1rem; border-radius: 8px;
  font-size: 0.9rem; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw;
}
.gf-toast.show { opacity: 1; }
