/* Chamarel Farms shop. Inherits the theme's fonts and accent color, and draws
   lines from currentColor. Sizes are in px so it works under any theme. */
.cs-shop {
  --cs-accent: var(--ghost-accent-color, #3e6b3a);
  --cs-line: color-mix(in srgb, currentColor 15%, transparent);
  --cs-soft: color-mix(in srgb, currentColor 5%, transparent);
  font-size: 16px;
  line-height: 1.5;
  container-type: inline-size;
}
.cs-shop h2 { margin: 0 0 12px; font-size: 22px; }
.cs-shop h3 { margin: 0 0 4px; font-size: 18px; }
.cs-shop p { margin: 0 0 8px; }
.cs-muted { opacity: .7; font-size: .9em; }
.cs-error { color: #c0392b; font-weight: 600; }
.cs-error:empty { display: none; }

.cs-layout { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.cs-category { margin-bottom: 32px; }
.cs-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.cs-card { border: 1px solid var(--cs-line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.cs-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; margin: 0; }
.cs-card-body { padding: 14px; display: flex; flex-direction: column; flex: 1; }
.cs-card-body > :last-child { margin-top: auto; }
.cs-soldout img { filter: grayscale(1); opacity: .6; }
.cs-price { font-weight: 600; }

/* CSA share card: size and frequency pickers */
.cs-share { grid-column: 1 / -1; }
.cs-share .cs-card-body > :last-child { margin-top: 4px; }
.cs-pills { border: 0; padding: 0; margin: 4px 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.cs-pills legend { font-weight: 600; margin-bottom: 6px; padding: 0; width: 100%; }
.cs-pill { position: relative; cursor: pointer; }
.cs-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cs-pill span { display: flex; flex-direction: column; justify-content: center; min-height: 44px; padding: 6px 16px;
  border: 1px solid var(--cs-line); border-radius: 8px; font-weight: 600; line-height: 1.25; }
.cs-pill small { font-weight: 400; opacity: .7; font-size: 13px; }
.cs-pill input:checked + span { border-color: var(--cs-accent); box-shadow: inset 0 0 0 1px var(--cs-accent); background: var(--cs-soft); }
.cs-pill input:focus-visible + span { outline: 2px solid var(--cs-accent); outline-offset: 2px; }
@media (min-width: 640px) {
  .cs-share:has(img) { flex-direction: row; }
  .cs-share:has(img) img { width: 40%; aspect-ratio: auto; }
}
.cs-badge { display: inline-block; padding: 3px 9px; border-radius: 99px; background: var(--cs-soft); font-size: .85em; }

.cs-btn {
  appearance: none; border: 0; border-radius: 6px; cursor: pointer;
  background: var(--cs-accent); color: #fff; font: inherit; font-weight: 600;
  padding: 8px 14px; min-height: 44px;
}
.cs-btn:hover { filter: brightness(1.08); }
.cs-btn:disabled { opacity: .6; cursor: progress; }
.cs-btn:focus-visible, .cs-stepper button:focus-visible { outline: 2px solid var(--cs-accent); outline-offset: 2px; }

.cs-stepper { display: inline-flex; align-items: center; border: 1px solid var(--cs-line); border-radius: 6px; width: fit-content; }
.cs-stepper button {
  appearance: none; background: none; border: 0; color: inherit; font: inherit; font-size: 1.2em;
  width: 44px; height: 44px; cursor: pointer;
}
.cs-stepper span { min-width: 30px; text-align: center; font-weight: 600; }

.cs-cart { position: sticky; top: var(--cs-sticky-top, 20px); border: 1px solid var(--cs-line); border-radius: 8px; padding: 18px; background: var(--cs-soft); }
.cs-lines { list-style: none; margin: 0 0 12px; padding: 0; }
.cs-lines li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--cs-line); margin: 0; }
.cs-lines li.cs-line { flex-direction: column; gap: 6px; padding: 10px 0; }
.cs-line-top { display: flex; justify-content: space-between; gap: 10px; }
.cs-line-top span:last-child { white-space: nowrap; }
.cs-line-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cs-line-controls .cs-stepper { background: #fff; }
.cs-line-controls .cs-stepper button { width: 40px; height: 40px; }
.cs-remove {
  appearance: none; background: none; border: 0; padding: 8px 0; min-height: 40px; color: var(--cs-accent);
  font: inherit; font-size: .92em; text-decoration: underline; cursor: pointer;
}
.cs-remove:focus-visible { outline: 2px solid var(--cs-accent); outline-offset: 2px; }
.cs-total { display: flex; justify-content: space-between; }
.cs-fulfillment { border: 0; padding: 0; margin: 12px 0; }
.cs-fulfillment legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.cs-when { margin: 0 0 10px; }
.cs-when p { margin: 0; }
.cs-option { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; margin: 0 0 6px; border: 1px solid var(--cs-line); border-radius: 6px; cursor: pointer; }
.cs-option:has(input:checked) { border-color: var(--cs-accent); box-shadow: inset 0 0 0 1px var(--cs-accent); }
.cs-option input { margin: 4px 0 0; flex: none; accent-color: var(--cs-accent); }
.cs-option strong { display: block; font-weight: 600; }
.cs-option small { display: block; opacity: .7; font-size: 14px; line-height: 1.35; }
.cs-field { display: block; margin: 0 0 12px; }
.cs-field span { display: block; font-weight: 600; margin-bottom: 4px; }
.cs-field input { box-sizing: border-box; width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--cs-line); border-radius: 6px; font: inherit; background: #fff; color: inherit; }
.cs-field input:focus-visible { outline: 2px solid var(--cs-accent); outline-offset: 1px; }
.cs-field small { display: block; opacity: .7; font-size: 14px; margin-top: 3px; }
.cs-where { margin: 12px 0 0; }
.cs-where p { margin: 0 0 4px; }
.cs-disabled { opacity: .5; cursor: not-allowed !important; }
.cs-checkout { width: 100%; margin-bottom: 8px; }

/* Stack the cart under the products when the shop itself is narrow
   (a narrow theme column or a phone), not only on narrow screens. */
@container (max-width: 760px) {
  .cs-layout { grid-template-columns: 1fr; }
  .cs-cart { position: static; }
}
