/* ============================================================
   Parkrestaurant Kurhaus Krün - Shared base stylesheet
   Mobile-first, used by guest + admin views.
   ============================================================ */

:root {
  --c-primary: #004e20;        /* Tannengrün */
  --c-primary-dark: #003717;
  --c-primary-soft: #e6efe9;
  --c-accent: #b4b784;         /* Salbei */
  --c-accent-soft: #ecedde;
  --c-bg: #fbfbfb;
  --c-surface: #ffffff;
  --c-text: #151414;
  --c-muted: #454545;
  --c-border: #e5e5e0;
  --c-danger: #b3261e;
  --c-success: #2e7d32;
  --c-warning: #b88600;

  --radius: 8px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 -8px 28px rgba(0, 0, 0, 0.18);

  --font-sans: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --tap: 44px;

  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

/* -------- Reset -------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; padding: 0; margin: 0; }

/* -------- Typography -------- */
h1, h2, h3, h4 {
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 0.5rem;
  color: var(--c-text);
}
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.75rem; }
.muted { color: var(--c-muted); font-size: 0.9rem; }
.small { font-size: 0.85rem; }
.center { text-align: center; }

/* -------- Layout helpers -------- */
.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem;
}
.stack > * + * { margin-top: 0.75rem; }
.stack-lg > * + * { margin-top: 1.25rem; }
.row { display: flex; align-items: center; gap: 0.5rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* -------- Buttons -------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--tap);
  padding: 0.6rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--c-surface);
  color: var(--c-text);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}
.btn-primary:hover:not(:disabled) { background: var(--c-primary-dark); }

.btn-outline {
  background: transparent;
  border-color: var(--c-accent);
  color: var(--c-primary);
}
.btn-outline:hover:not(:disabled) { background: var(--c-accent-soft); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--c-primary);
}
.btn-ghost:hover:not(:disabled) { background: var(--c-primary-soft); }

.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0.35rem 0.75rem; font-size: 0.9rem; }

/* Round icon button (e.g. plus / stepper) */
.icon-btn {
  width: var(--tap);
  height: var(--tap);
  min-height: var(--tap);
  padding: 0;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  border: none;
  font-size: 1.4rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { transform: scale(0.95); }
.icon-btn:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.icon-btn-ghost {
  background: transparent;
  color: var(--c-primary);
  border: 1px solid var(--c-accent);
  box-shadow: none;
}
.icon-btn-danger {
  background: transparent;
  color: var(--c-danger);
  border: 1px solid var(--c-border);
  box-shadow: none;
  width: 36px;
  height: 36px;
  min-height: 36px;
  font-size: 1.1rem;
}

/* -------- Cards -------- */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow-sm);
}

/* -------- Chips / pills -------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: var(--c-surface);
  border: 1px solid var(--c-accent);
  color: var(--c-primary);
  font-weight: 500;
  font-size: 0.9rem;
  min-height: 36px;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.chip:hover { background: var(--c-accent-soft); }
.chip[aria-selected="true"],
.chip.is-active {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}
.chip-static {
  cursor: default;
  background: var(--c-primary-soft);
  border-color: var(--c-primary-soft);
  color: var(--c-primary);
}

/* -------- Forms -------- */
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  min-height: var(--tap);
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 1rem;
  font-weight: 300;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.form-textarea { min-height: 80px; resize: vertical; line-height: 1.45; }
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 2px var(--c-primary-soft);
}
.form-label {
  display: block;
  font-size: 0.85rem;
  color: var(--c-muted);
  margin-bottom: 0.25rem;
  font-weight: 500;
}
.form-help {
  font-size: 0.8rem;
  color: var(--c-muted);
  margin-top: 0.25rem;
}

/* -------- Toast -------- */
.toast-container {
  position: fixed;
  top: calc(0.75rem + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  width: min(90vw, 480px);
}
.toast {
  background: var(--c-text);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  font-size: 0.95rem;
  font-weight: 500;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 200ms ease, transform 200ms ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--c-primary); }
.toast-error { background: var(--c-danger); }

/* -------- Spinner -------- */
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--c-accent);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -------- Divider -------- */
.divider {
  height: 1px;
  background: var(--c-border);
  border: 0;
  margin: 1rem 0;
}

/* -------- Utility breakpoints -------- */
@media (min-width: 600px) {
  h1 { font-size: 1.85rem; }
  body { font-size: 17px; }
}
