:root {
  --cream: #f4f8f1;
  --butter: #dcebd5;
  --crust: #2f7d4f;
  --crust-dark: #1e5535;
  --cocoa: #1f3326;
  --muted: #4e6656;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

/* Anything with the hidden attribute stays hidden, even if a rule gives it a display style */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--cocoa);
  background: var(--cream);
  line-height: 1.6;
}

h1, h2, h3, .logo {
  font-family: "Fraunces", Georgia, serif;
  line-height: 1.2;
}

h2,
.page-title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0 0 1rem;
}

.container {
  width: min(1100px, 100% - 2.5rem);
  margin-inline: auto;
}

.narrow {
  max-width: 560px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border: 2px solid var(--crust);
  border-radius: 999px;
  background: var(--crust);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.btn:hover {
  background: var(--crust-dark);
  border-color: var(--crust-dark);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--crust);
}

.btn-outline:hover {
  color: #fff;
}

.btn-small {
  padding: 0.45rem 1.1rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(244, 248, 241, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--butter);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: clamp(1.6rem, 4vw, 2.1rem); /* bigger on wide screens, still fits beside the buttons on phones */
  font-weight: 700;
  color: var(--crust-dark);
  text-decoration: none;
}

/* The Mb logo (images/logo.png) beside the name */
.logo-mark {
  width: auto;
  height: clamp(2.6rem, 6vw, 3.4rem);
  flex-shrink: 0;
}

/* Phones: a smaller name so the logo, name, cart and menu button fit on one row */
@media (max-width: 480px) {
  .logo {
    font-size: 1.2rem;
    gap: 0.5rem;
  }

  .logo-mark {
    height: 2.4rem;
  }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-links a:not(.btn) {
  color: var(--cocoa);
  text-decoration: none;
  font-weight: 500;
}

.nav-links a:not(.btn):hover,
.nav-links a[aria-current="page"]:not(.btn) {
  color: var(--crust);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.cart-button {
  position: relative;
  display: flex;
  padding: 0.3rem;
  background: none;
  border: none;
  color: var(--cocoa);
  cursor: pointer;
}

.cart-button:hover {
  color: var(--crust);
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--crust);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3rem;
  text-align: center;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--cocoa);
  cursor: pointer;
}

/* Hero */
.hero {
  padding-block: clamp(4rem, 12vw, 8rem);
  background:
    radial-gradient(circle at 85% 20%, var(--butter) 0, transparent 45%),
    radial-gradient(circle at 10% 90%, #c9e2c0 0, transparent 40%);
}

.hero-inner {
  position: relative; /* above the slideshow */
  max-width: 720px;
}

/* Slideshow behind the main panel (photos are added on the owner page) */
.hero {
  position: relative;
  overflow: hidden;
}

.hero-slides {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-track {
  display: flex;
  height: 100%;
  transition: transform 1s ease-in-out;
}

.hero-track img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Darkens the photos so the white text stays readable */
.hero-slides::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(20, 38, 26, 0.78), rgba(20, 38, 26, 0.35));
}

.hero:not(.has-slides) .hero-slides {
  display: none;
}

.hero.has-slides h1 {
  color: #fff;
}

.hero.has-slides .lead {
  color: rgba(255, 255, 255, 0.88);
}

.hero.has-slides .eyebrow {
  color: #cfe6c6;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--crust);
  margin: 0 0 1rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  margin: 0 0 1.25rem;
}

.lead {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Sections */
.section {
  padding-block: 5rem;
}

.section-alt {
  background: var(--butter);
}

/* Featured */
.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.section-heading h2 {
  margin: 0;
}

.text-link {
  color: var(--crust);
  font-weight: 600;
  text-decoration: none;
}

.text-link:hover {
  color: var(--crust-dark);
  text-decoration: underline;
}

#featured .menu-grid {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 1rem;
}

@media (max-width: 560px) {
  #featured .menu-grid {
    grid-template-columns: 1fr;
  }
}

/* Menu */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.filter {
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--crust);
  border-radius: 999px;
  background: transparent;
  color: var(--crust);
  font: inherit;
  cursor: pointer;
}

.filter.active,
.filter:hover {
  background: var(--crust);
  color: #fff;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

/* Order page: big cards, 2 per row (1 on phones). The whole 4:5 photo fills the top of the card,
   edge to edge, with the name, description, size and button on a white panel below it. */
#menu .menu-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

@media (max-width: 640px) {
  #menu .menu-grid {
    grid-template-columns: 1fr;
  }
}

/* .order-preview is the preview of an item on the owner page, which uses the same card styles */
#menu .card,
.order-preview .card {
  padding: 0;
  overflow: hidden; /* clips the photo to the card's rounded top corners */
}

/* The full photo, uncropped (it's saved in this 4:5 shape) */
#menu .card-image,
.order-preview .card-image {
  border-radius: 0;
}

#menu .card .price,
.order-preview .card .price {
  top: 1rem;
  right: 1rem;
}

/* Solid white panel under the photo */
#menu .card-body,
.order-preview .card-body {
  padding: 1.25rem 1.5rem 1.5rem;
  background: #fff;
}

#menu .card h3,
.order-preview .card h3 {
  margin-top: 0;
  font-size: 1.5rem;
}

#menu .card p,
.order-preview .card p {
  font-size: 1.05rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.75rem;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 4px 18px rgba(31, 51, 38, 0.07);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(31, 51, 38, 0.12);
}

.card[hidden] {
  display: none;
}

/* Product photo (4:5, the shape the owner page saves); a plain pale green box until the owner uploads one */
.card-image {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: calc(var(--radius) - 4px);
  background: var(--butter);
}

/* With a photo, no box behind it, so a transparent (PNG) background shows the white card */
.card-image:has(img) {
  background: none;
}

.card-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* A card's photos side by side: swipe or scroll sideways, and each one snaps into place */
.card-carousel {
  position: absolute;
  inset: 0;
}

.card-photos {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.card-photos::-webkit-scrollbar {
  display: none;
}

.card-image .card-photos img {
  position: static;
  flex: 0 0 100%;
  scroll-snap-align: start;
}

/* Arrows: shown when the mouse is over the photo (phones swipe instead) */
.photo-nav {
  position: absolute;
  top: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0 0 0.15rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(31, 51, 38, 0.15);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--cocoa);
  cursor: pointer;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.2s;
}

.photo-nav.prev {
  left: 0.6rem;
}

.photo-nav.next {
  right: 0.6rem;
}

.card-carousel:hover .photo-nav,
.photo-nav:focus-visible {
  opacity: 1;
}

@media (hover: none) {
  .photo-nav {
    display: none;
  }
}

/* One dot per photo; the filled one is showing */
.photo-dots {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  z-index: 1;
  display: flex;
  gap: 0.4rem;
  transform: translateX(-50%);
}

.photo-dots span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.35);
}

.photo-dots span.active {
  background: #fff;
}

/* Name, description, size and button */
.card-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card h3 {
  margin: 1rem 0 0.4rem;
}

.card p {
  flex-grow: 1;
  margin: 0;
  color: var(--muted);
}

.pack-size {
  margin-top: 1.25rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid #bfd8b8;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.pack-size:focus {
  outline: 2px solid var(--crust);
  outline-offset: 1px;
}

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

.add-to-cart {
  align-self: flex-start;
  margin-top: 0.75rem;
}

/* Price tag in the top corner of the photo */
.price {
  position: absolute;
  top: 2.5rem;
  right: 2.5rem;
  z-index: 1;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(31, 51, 38, 0.12);
  font-weight: 600;
  color: var(--crust);
}

/* About */
.about {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
  align-items: center;
}

/* The logo beside the Our Story text (below it on phones) */
.about-logo {
  width: min(100%, 22rem);
  height: auto;
  justify-self: center;
}

/* Cart drawer */
body.cart-open {
  overflow: hidden;
}

.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(31, 51, 38, 0.4);
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--cream);
  box-shadow: -8px 0 30px rgba(31, 51, 38, 0.15);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.3s ease, visibility 0.3s;
}

.cart-drawer.open {
  transform: none;
  visibility: visible;
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--butter);
}

.cart-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.cart-close {
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: var(--cocoa);
  cursor: pointer;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0 1.5rem;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--butter);
}

.cart-item-info {
  display: grid;
}

.cart-item-name {
  font-weight: 600;
}

.cart-item-price {
  color: var(--muted);
}

.quantity {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.quantity button {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--crust);
  border-radius: 50%;
  background: #fff;
  color: var(--crust);
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.quantity button:hover {
  background: var(--crust);
  color: #fff;
}

.cart-empty {
  flex: 1;
  margin: 2rem 1.5rem;
  color: var(--muted);
}

.cart-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--butter);
  background: #fff;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

/* Checkout page */
.checkout {
  display: grid;
  gap: 1.5rem;
}

.checkout .page-title {
  margin: 0;
}

.checkout-card {
  padding: 1.75rem;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 4px 18px rgba(31, 51, 38, 0.07);
}

.checkout-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

/* The order summary reuses the cart's item list, without the drawer's scrolling */
.order-summary {
  flex: none;
  overflow: visible;
  padding: 0;
}

.checkout-card .cart-empty {
  margin: 1rem 0;
}

.checkout-card .cart-total {
  margin: 1rem 0 0;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.details-grid label {
  display: grid;
  gap: 0.35rem;
  font-weight: 500;
  color: var(--muted);
}

.details-grid input,
.details-grid textarea,
.details-grid select {
  padding: 0.75rem 0.9rem;
  border: 1px solid #bfd8b8;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: var(--cocoa);
}

.details-grid input:focus,
.details-grid textarea:focus,
.details-grid select:focus {
  outline: 2px solid var(--crust);
  outline-offset: 1px;
}

@media (max-width: 480px) {
  .details-grid {
    grid-template-columns: 1fr;
  }
}

.terms {
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 1.25rem;
  padding: 0.25rem 1rem;
  border: 1px solid var(--butter);
  border-radius: 10px;
  font-size: 0.92rem;
  color: var(--muted);
}

.terms h3 {
  margin: 0.9rem 0 0.25rem;
  font-size: 1rem;
  color: var(--cocoa);
}

.terms p {
  margin: 0 0 0.5rem;
}

.terms-agree {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  font-weight: 500;
  cursor: pointer;
}

.terms-agree input {
  width: 1.2rem;
  height: 1.2rem;
  margin: 0.1rem 0 0;
  flex-shrink: 0;
  accent-color: var(--crust);
}

.pay-button,
.cart-checkout {
  width: 100%;
}

.btn:disabled,
.btn:disabled:hover {
  opacity: 0.5;
  background: var(--crust);
  border-color: var(--crust);
  transform: none;
  cursor: not-allowed;
}

.cart-note {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

/* "Added to cart" pop-up */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: max-content;
  max-width: calc(100% - 2rem);
  padding: 0.75rem 0.85rem 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--cocoa);
  color: #fff;
  box-shadow: 0 10px 30px rgba(31, 51, 38, 0.25);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 1rem);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.toast-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--crust);
  font-size: 0.85rem;
  font-weight: 700;
}

.toast-view {
  flex-shrink: 0;
  padding: 0.35rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: none;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.toast-view:hover {
  background: #fff;
  color: var(--cocoa);
}

/* Banner shown when the owner turns orders off */
.closed-banner {
  padding: 0.85rem 1.25rem;
  background: var(--cocoa);
  color: #fff;
  text-align: center;
  font-weight: 500;
}

/* Owner page */
.admin-tag {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--butter);
  color: var(--crust-dark);
  font-size: 0.85rem;
  font-weight: 600;
}

.admin-panel {
  display: grid;
  gap: 1.5rem;
}

.admin-panel .page-title {
  margin: 0;
}

.admin-card {
  display: grid;
  gap: 0.75rem;
  padding: 1.75rem;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 4px 18px rgba(31, 51, 38, 0.07);
}

.admin-card h2 {
  margin: 0;
  font-size: 1.35rem;
}

.admin-card label {
  font-weight: 500;
  color: var(--muted);
}

.admin-card input[type="password"],
.admin-card textarea {
  padding: 0.85rem 1rem;
  border: 1px solid #bfd8b8;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: inherit;
}

.admin-card input[type="password"]:focus,
.admin-card textarea:focus {
  outline: 2px solid var(--crust);
  outline-offset: 1px;
}

.admin-card .btn {
  justify-self: start;
}

.admin-loading {
  margin: 0;
  color: var(--muted);
}

.admin-hint {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Menu items editor */
.product-list {
  display: grid;
  gap: 0.5rem;
}

.product-editor {
  border: 1px solid var(--butter);
  border-radius: 10px;
}

.product-editor[open] {
  border-color: var(--crust);
}

.product-editor summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  font-weight: 600;
  cursor: pointer;
}

#new-product > summary {
  color: var(--crust);
}

.summary-name {
  flex: 1;
}

/* Small photo in each item's row; a plain box when there's no photo */
.summary-photo {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  overflow: hidden;
  border-radius: 6px;
  background: var(--butter);
}

.summary-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The Order page preview, with the photo buttons beside it (below it on narrow screens) */
.photo-field {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem;
}

.photo-field .photo-actions {
  flex: 1 1 14rem;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.photo-count {
  margin: 0;
}

/* The item's photos in order; the outlined one is shown in the preview */
.photo-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.photo-thumb {
  width: 4rem;
  aspect-ratio: 4 / 5;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--butter);
  cursor: pointer;
}

.photo-thumb[aria-pressed="true"] {
  border-color: var(--crust);
  box-shadow: 0 0 0 2px var(--butter);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.selected-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.selected-photo-actions button:disabled {
  opacity: 0.4;
  cursor: default;
}

.photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Owner page: how the item looks on the Order page, about the width of a real card */
.order-preview {
  width: min(100%, 22rem);
}

.order-preview .card:hover {
  transform: none;
}

.order-preview-label {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

/* Photo editor (owner page): the box takes the shape of where the photo goes (set in admin-settings.js) */
.crop-dialog {
  width: min(560px, calc(100% - 2rem));
  padding: 0;
  border: none;
  border-radius: var(--radius);
  color: var(--cocoa);
  box-shadow: 0 20px 60px rgba(31, 51, 38, 0.3);
}

.crop-dialog::backdrop {
  background: rgba(31, 51, 38, 0.5);
}

.crop-form {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
}

.crop-form h2 {
  margin: 0;
  font-size: 1.35rem;
}

.crop-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  margin-inline: auto;
  overflow: hidden;
  border-radius: calc(var(--radius) - 4px);
  background: var(--butter);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

/* Menu photos are PNGs: a checkerboard shows which parts will be see-through */
.crop-frame.transparent {
  background: repeating-conic-gradient(#e6e6e6 0 25%, #fff 0 50%) 0 0 / 20px 20px;
}

.crop-frame:active {
  cursor: grabbing;
}

.crop-frame:focus-visible {
  outline: 2px solid var(--crust);
  outline-offset: 2px;
}

.crop-frame img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  pointer-events: none;
}

.crop-zoom {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

.crop-zoom input {
  flex: 1;
  accent-color: var(--crust);
}

.summary-price {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

.summary-tag {
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: #f3e1da;
  color: #b23c17;
  font-size: 0.75rem;
}

.product-form {
  display: grid;
  gap: 0.75rem;
  padding: 0 1rem 1rem;
}

.product-form label,
.pickup-form label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}

.product-form input:not([type="checkbox"]),
.pickup-form input[type="time"],
.pickup-form select,
.product-form textarea,
.product-form select {
  padding: 0.6rem 0.75rem;
  border: 1px solid #bfd8b8;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: var(--cocoa);
}

.product-form input:focus,
.pickup-form input:focus,
.pickup-form select:focus,
.product-form textarea:focus,
.product-form select:focus {
  outline: 2px solid var(--crust);
  outline-offset: 1px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
}

/* Sizes and prices: one row per size, a checkbox to offer it and its price */
.size-prices {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0.75rem 1rem 1rem;
  border: 1px solid var(--butter);
  border-radius: 8px;
}

.size-prices legend {
  padding: 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}

.size-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.product-form .size-price {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--cocoa);
}

.size-price input {
  width: 7rem;
}

.size-price input:disabled {
  opacity: 0.4;
}

.product-form .check,
.pickup-day .check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--cocoa);
}

.product-form .check input,
.pickup-day .check input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--crust);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

/* Shown in a product grid while the menu loads, or if it can't */
.menu-message {
  margin: 0;
  color: var(--muted);
}

.admin-error {
  margin: 0;
  font-weight: 500;
  color: #b23c17;
}

.admin-saved {
  margin: 0;
  font-weight: 500;
  color: var(--crust);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.orders-status {
  margin: 0.25rem 0 0;
  font-weight: 600;
  color: var(--crust);
}

.orders-status.off {
  color: #b23c17;
}

/* On/off switch: a checkbox styled as a sliding toggle */
.switch {
  position: relative;
  flex-shrink: 0;
  width: 4rem;
  height: 2.25rem;
}

.switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c4c4c4;
  transition: background 0.2s;
}

.switch-slider::before {
  content: "";
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.switch input:checked + .switch-slider {
  background: var(--crust);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(1.75rem);
}

.switch input:focus-visible + .switch-slider {
  outline: 2px solid var(--crust);
  outline-offset: 2px;
}

.switch input:disabled + .switch-slider {
  opacity: 0.6;
}

/* Footer */
.site-footer {
  padding-block: 2rem;
  background: var(--cocoa);
  color: var(--butter);
  text-align: center;
  font-size: 0.9rem;
}

/* Minnesota cottage food license notice */
.footer-license {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  opacity: 0.8;
}

/* Instagram link in the home page footer */
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  color: var(--butter);
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.social-link:hover span {
  text-decoration: underline;
}

.instagram-icon {
  flex-shrink: 0;
  border-radius: 7px;
}

/* Instagram link in the About text: small icon right before the name */
.instagram-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  vertical-align: bottom;
}

.instagram-inline .instagram-icon {
  border-radius: 5px;
}

/* Read by screen readers, not shown */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Mobile */
@media (max-width: 760px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 1.5rem;
    background: var(--cream);
    border-bottom: 1px solid var(--butter);
  }

  .nav-links.open {
    display: flex;
  }

  .about {
    grid-template-columns: 1fr;
  }
}

/* Owner page: pickup days and times, one row per day */
.pickup-days {
  display: grid;
  gap: 0.5rem;
}

.pickup-day {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.pickup-day .check {
  width: 8.5rem;
}

.pickup-hours {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
}

.pickup-hours input:disabled {
  opacity: 0.4;
}

/* Checkout page: pickup day calendar */
.pickup-day-field {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.35rem;
}

.field-label {
  font-weight: 500;
  color: var(--muted);
}

.calendar {
  max-width: 340px;
  padding: 0.75rem;
  border: 1px solid #bfd8b8;
  border-radius: 10px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.calendar-month {
  font-weight: 600;
  color: var(--cocoa);
}

.calendar-nav {
  width: 2.2rem;
  height: 2.2rem;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--crust);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.calendar-nav:hover:not(:disabled) {
  background: var(--butter);
}

.calendar-nav:disabled {
  opacity: 0.25;
  cursor: default;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.2rem;
  text-align: center;
}

.calendar-grid > span {
  padding-block: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.calendar-day {
  aspect-ratio: 1;
  border: none;
  border-radius: 50%;
  background: var(--butter);
  color: var(--cocoa);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.calendar-day:hover:not(:disabled) {
  background: #bfd8b8;
}

/* Closed, too soon or too far ahead */
.calendar-day:disabled {
  background: none;
  color: var(--muted);
  font-weight: 400;
  opacity: 0.45;
  cursor: default;
}

.calendar-day[aria-pressed="true"] {
  background: var(--crust);
  color: #fff;
}

.calendar-day:focus-visible,
.calendar-nav:focus-visible {
  outline: 2px solid var(--crust);
  outline-offset: 2px;
}

.calendar-message,
.pickup-notice {
  margin: 0;
  color: var(--muted);
}

.pickup-notice {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

/* "Order 2 days ahead" on a menu card */
.card .card-notice,
#menu .card .card-notice,
.order-preview .card .card-notice {
  flex-grow: 0;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--crust);
}

/* Catering page */
.checkout .lead {
  margin: 0;
}

.details-grid .full-width {
  grid-column: 1 / -1;
}

.details-grid textarea {
  resize: vertical;
}

/* Spam trap: hidden from people, but bots still fill it in */
.trap {
  position: absolute;
  left: -9999px;
}

.catering-submit {
  margin-top: 1.25rem;
}

#catering-sent p {
  margin: 0;
}

/* Owner page: home page slideshow photos */
.slide-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.slide-item {
  display: grid;
  gap: 0.4rem;
}

.slide-item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  background: var(--butter);
}

.slide-actions {
  display: flex;
  gap: 0.35rem;
}

.slide-actions .btn {
  padding: 0.3rem 0.7rem;
}

.slide-list .admin-hint {
  grid-column: 1 / -1;
}
