/* Bossche Bol Vol Liefde — warm, ambachtelijk kleurenpalet en typografie. */

:root {
  --background: #fbf1e2;
  --foreground: #3a2a1e;
  --card: #fffbf3;
  --card-foreground: #3a2a1e;
  --primary: #a2321f;
  --primary-foreground: #fff6e9;
  --secondary: #cf9a52;
  --secondary-foreground: #362010;
  --muted: #f0e3c8;
  --muted-foreground: #7c6a51;
  --accent: #e0a930;
  --success: #4f7a45;
  --success-bg: rgba(79, 122, 69, 0.15);
  --destructive: #a2321f;
  --destructive-bg: rgba(162, 50, 31, 0.12);
  --destructive-foreground: #fff6e9;
  --border: #e6d5ae;
  --radius: 0.7rem;
  --radius-sm: 0.4rem;
  --font-sans: "Figtree", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Fraunces", ui-serif, Georgia, serif;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

img, svg {
  max-width: 100%;
}

a {
  color: inherit;
}

.font-display {
  font-family: var(--font-display);
}

/* Layout */

.site-header {
  border-bottom: 1px solid rgba(230, 213, 174, 0.7);
}

.site-header-inner {
  max-width: 48rem;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  border-radius: 0.2rem;
}

.brand img {
  width: 2rem;
  height: 2rem;
}

.brand span {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--foreground);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.95rem;
}

.site-nav a {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
  color: rgba(58, 42, 30, 0.8);
  transition: background-color 0.15s, color 0.15s;
}

.site-nav a:hover {
  background: var(--muted);
  color: var(--foreground);
}

main {
  flex: 1;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid rgba(230, 213, 174, 0.7);
}

.site-footer-inner {
  max-width: 48rem;
  margin: 0 auto;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted-foreground);
}

.container {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.container-narrow {
  max-width: 34rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* Typography helpers */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  margin: 0;
}

.text-muted {
  color: var(--muted-foreground);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  height: 2.75rem;
  padding: 0 1.25rem;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s, background-color 0.15s;
}

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

.btn-lg {
  height: 3rem;
  padding: 0 1.75rem;
  font-size: 1rem;
}

.btn-sm {
  height: 2.25rem;
  padding: 0 0.9rem;
  font-size: 0.875rem;
}

.btn-icon {
  height: 2.25rem;
  width: 2.25rem;
  padding: 0;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); }

.btn-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
}
.btn-secondary:hover:not(:disabled) { filter: brightness(1.05); }

.btn-outline {
  background: transparent;
  color: var(--foreground);
  border: 1px solid var(--border);
}
.btn-outline:hover:not(:disabled) { background: var(--muted); }

.btn-ghost {
  background: transparent;
  color: var(--foreground);
}
.btn-ghost:hover:not(:disabled) { background: var(--muted); }

.btn-subtle {
  background: var(--muted);
  color: var(--foreground);
}
.btn-subtle:hover:not(:disabled) { filter: brightness(0.97); }

.btn-destructive {
  background: var(--destructive);
  color: var(--destructive-foreground);
}
.btn-destructive:hover:not(:disabled) { filter: brightness(1.1); }

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Form controls */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.field:last-child { margin-bottom: 0; }

label {
  font-size: 0.9rem;
  font-weight: 500;
}

input[type="text"],
input[type="url"],
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--foreground);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
}

textarea {
  min-height: 5.5rem;
  resize: vertical;
}

input:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(162, 50, 31, 0.25);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--destructive);
}

.error-text {
  color: var(--destructive);
  font-size: 0.875rem;
  margin: 0;
}

/* Stepper */

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  width: fit-content;
}

.stepper button {
  border: none;
  background: transparent;
  color: var(--primary);
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.stepper button:hover:not(:disabled) { background: var(--muted); }
.stepper button:disabled { opacity: 0.3; cursor: not-allowed; }

.stepper output {
  width: 3.25rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 500;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* Card */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

@media (min-width: 640px) {
  .card { padding: 1.5rem; }
}

/* Badge */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.badge-open { background: var(--success-bg); color: var(--success); }
.badge-closed { background: var(--destructive-bg); color: var(--destructive); }

/* Switch */

.switch {
  position: relative;
  display: inline-block;
  width: 2.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .track {
  position: absolute;
  inset: 0;
  background: var(--muted);
  border-radius: 999px;
  transition: background-color 0.15s;
}

.switch .thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.25rem;
  height: 1.25rem;
  background: white;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  transition: transform 0.15s;
}

.switch input:checked + .track { background: var(--success); }
.switch input:checked + .track .thumb { transform: translateX(1rem); }
.switch input:focus-visible + .track { outline: 2px solid var(--primary); outline-offset: 2px; }

.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Dialogs (native <dialog>) */

dialog {
  border: none;
  border-radius: var(--radius);
  padding: 1.5rem;
  width: calc(100% - 2rem);
  max-width: 26rem;
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: 0 20px 40px rgba(58, 42, 30, 0.25);
}

dialog::backdrop {
  background: rgba(58, 42, 30, 0.4);
  backdrop-filter: blur(2px);
}

.dialog-header { margin-bottom: 1rem; }
.dialog-header h3 { font-size: 1.15rem; }
.dialog-header p { margin: 0.35rem 0 0; color: var(--muted-foreground); font-size: 0.9rem; }

.dialog-footer {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dialog-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted-foreground);
  font-size: 1.1rem;
  line-height: 1;
}

dialog > form { position: relative; }

/* Toasts */

#toast-container {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  width: calc(100% - 2rem);
  max-width: 24rem;
}

.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  box-shadow: 0 8px 24px rgba(58, 42, 30, 0.18);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toast-in 0.15s ease-out;
}

.toast.toast-error { border-color: rgba(162, 50, 31, 0.4); }
.toast.toast-success { border-color: rgba(79, 122, 69, 0.4); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero (homepage) */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.hero h1 {
  font-size: 2.5rem;
  line-height: 1.1;
}

@media (min-width: 640px) {
  .hero h1 { font-size: 3rem; }
}

.hero p.lead {
  max-width: 28rem;
  color: var(--muted-foreground);
  font-size: 1.1rem;
}

.hero .date-line {
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.hero .date-line strong {
  color: var(--primary);
  font-weight: 500;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

/* Overzicht page */

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.totals-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.totals-row .stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1;
}

.totals-row .stat span {
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

.totals-divider {
  width: 1px;
  height: 2rem;
  background: var(--border);
}

.totals-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.order-list {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.order-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.order-item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.order-item .naam {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
}

.order-item .meta {
  color: var(--muted-foreground);
}

.order-item .notitie {
  margin-top: 0.25rem;
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

.order-item-actions {
  display: flex;
  gap: 0.25rem;
}

.order-item-toggles {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(230, 213, 174, 0.7);
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  color: var(--muted-foreground);
  background: rgba(255, 251, 243, 0.5);
}

.sort-row {
  display: flex;
  justify-content: flex-end;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.sort-btn[aria-pressed="true"] {
  background: var(--muted);
  color: var(--foreground);
}

.history-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.history-item .count {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--foreground);
}

/* Sterren / recensies */

.star-picker {
  display: inline-flex;
  gap: 0.2rem;
}

.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
  padding: 0.15rem;
  color: var(--border);
}

.star-btn:hover,
.star-btn.active {
  color: var(--accent);
}

.stars-static {
  color: var(--accent);
  letter-spacing: 0.05em;
}

.review-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.review-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  background: rgba(255, 251, 243, 0.6);
}

.review-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.review-item .tekst {
  margin: 0.35rem 0 0;
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

/* Bakkers-pagina */

.bakker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.bakker-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bakker-card .bakker-naam {
  font-family: var(--font-display);
  font-size: 1.15rem;
}

/* Utility */

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.center { text-align: center; }
.hidden { display: none !important; }

@media (max-width: 480px) {
  .container, .container-narrow { padding: 1.75rem 1rem; }
}
