
/* Cozy Cottage Oven — component styles. Mobile first: base rules are the phone layout,
   min-width queries (USWDS breakpoints) add up from there. Every color, space and radius
   is a token variable from tokens.json. Class prefix: cco- (use as Bricks global classes). */

/* ---------- Base ---------- */
body {
  margin: 0;
  background: var(--surface-page);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}
*, *::before, *::after { box-sizing: border-box; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 3px; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.cco-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Type ---------- */
.cco-display, .cco-h1, .cco-h2, .cco-h3 { font-family: var(--font-serif); color: var(--ink); margin: 0; text-wrap: balance; }
.cco-display { font-size: 40px; line-height: 1.1; font-weight: 400; }
.cco-h1 { font-size: 32px; line-height: 1.2; font-weight: 400; }
.cco-h2 { font-size: 28px; line-height: 1.2; font-weight: 400; }
.cco-h3 { font-size: 22px; line-height: 1.35; font-weight: 700; }
.cco-h4 { font-family: var(--font-sans); font-size: 18px; line-height: 1.35; font-weight: 700; margin: 0; }
.cco-eyebrow { font-family: var(--font-sans); font-size: 13px; line-height: 1.35; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sage-700); margin: 0; }
.cco-lead { font-size: 20px; line-height: 1.62; max-width: var(--measure); margin: 0; }
.cco-body { font-size: 17px; line-height: 1.62; max-width: var(--measure); }
.cco-body-sm { font-size: 15px; line-height: 1.5; }
.cco-caption { font-size: 13px; line-height: 1.35; color: var(--ink-muted); }
.cco-muted { color: var(--ink-muted); }
.cco-price { font-family: var(--font-serif); font-size: 20px; line-height: 1.2; font-weight: 700; color: var(--ink); }
@media (min-width: 1024px) {
  .cco-display { font-size: 56px; }
  .cco-h1 { font-size: 40px; }
  .cco-h2 { font-size: 32px; }
  .cco-h3 { font-size: 24px; }
}

/* ---------- Layout ---------- */
.cco-container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--units-2); }
.cco-section { padding-block: var(--units-6); }
.cco-section--alt { background: var(--surface-alt); }
.cco-section--sage { background: var(--surface-sage); }
@media (min-width: 640px) { .cco-section { padding-block: var(--units-8); } }
@media (min-width: 1024px) {
  .cco-container { padding-inline: var(--units-4); }
  .cco-section { padding-block: var(--units-10); }
}

/* ---------- Section heading ---------- */
.cco-section-heading { display: grid; gap: var(--units-1); justify-items: start; margin-bottom: var(--units-5); }
.cco-section-heading--center { justify-items: center; text-align: center; }
.cco-section-heading__rule { width: 48px; height: 2px; background: var(--oak-400); border: 0; margin: var(--units-1) 0 0; }
.cco-section-heading p { margin: 0; color: var(--ink-muted); max-width: var(--measure); }

/* ---------- Button ---------- */
.cco-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--units-1);
  min-height: var(--target-min);
  padding: var(--units-105) var(--units-3);
  font-family: var(--font-sans); font-size: 16px; line-height: 1.35; font-weight: 600; letter-spacing: 0.02em;
  text-decoration: none; cursor: pointer;
  border: 2px solid transparent; border-radius: var(--radius-sm);
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.cco-btn--primary { background: var(--action); color: var(--on-action); }
.cco-btn--primary:hover { background: var(--action-hover); }
.cco-btn--secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.cco-btn--secondary:hover { background: var(--ink); color: var(--ink-inverse); }
.cco-btn--sage { background: var(--sage-700); color: var(--on-sage); }
.cco-btn--sage:hover { background: var(--ink); color: var(--ink-inverse); }
.cco-btn--text { background: transparent; color: var(--link); padding-inline: var(--units-1); text-decoration: underline; text-underline-offset: 0.2em; }
.cco-btn--text:hover { text-decoration-thickness: 3px; }
.cco-btn--block { width: 100%; }
.cco-btn[disabled], .cco-btn[aria-disabled="true"] { background: var(--surface-alt); color: var(--ink-muted); border-color: var(--border-subtle); cursor: not-allowed; }
.cco-btn svg { width: 20px; height: 20px; flex: none; }
.cco-btn--block-mobile { width: 100%; }
@media (min-width: 640px) { .cco-btn--block-mobile { width: auto; } }

/* ---------- Badge ---------- */
.cco-badge {
  display: inline-flex; align-items: center; gap: var(--units-05);
  padding: 2px var(--units-1);
  font-family: var(--font-sans); font-size: 13px; line-height: 1.35; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  border-radius: var(--radius-md);
  background: var(--surface-alt); color: var(--ink);
}
.cco-badge--fresh { background: var(--crust-100); color: var(--crust-600); }
.cco-badge--sage { background: var(--surface-sage); color: var(--sage-700); }
.cco-badge--soldout { background: var(--surface-raised); color: var(--ink-muted); border: 1px solid var(--border-control); }

/* ---------- Alert (USWDS alert anatomy) ---------- */
.cco-alert {
  display: grid; grid-template-columns: 24px 1fr; gap: var(--units-105);
  padding: var(--units-2);
  border-left: 8px solid var(--info); border-radius: var(--radius-md);
  background: var(--info-bg); color: var(--ink);
}
.cco-alert svg { width: 24px; height: 24px; color: var(--info); }
.cco-alert__heading { font-family: var(--font-sans); font-size: 18px; line-height: 1.35; font-weight: 700; margin: 0 0 var(--units-05); }
.cco-alert__text { margin: 0; font-size: 15px; line-height: 1.5; }
.cco-alert--success { background: var(--success-bg); border-left-color: var(--success); }
.cco-alert--success svg { color: var(--success); }
.cco-alert--warning { background: var(--warning-bg); border-left-color: var(--warning); }
.cco-alert--warning svg { color: var(--warning); }
.cco-alert--error { background: var(--error-bg); border-left-color: var(--error); }
.cco-alert--error svg { color: var(--error); }
.cco-alert--slim { padding-block: var(--units-1); align-items: center; }

/* ---------- Form fields (USWDS form anatomy; maps onto Fluent Forms) ---------- */
.cco-form { display: grid; gap: var(--units-3); max-width: 30rem; }
.cco-field { display: grid; gap: var(--units-1); }
.cco-label { font-size: 16px; line-height: 1.35; font-weight: 600; color: var(--ink); }
.cco-label .cco-required { color: var(--error); font-weight: 700; }
.cco-hint { font-size: 13px; line-height: 1.35; color: var(--ink-muted); margin: 0; }
.cco-input, .cco-select, .cco-textarea {
  width: 100%; min-height: var(--target-min);
  padding: 10px var(--units-105);
  font: 400 17px/1.35 var(--font-sans); color: var(--ink);
  background: var(--surface-raised);
  border: 1px solid var(--border-control); border-radius: var(--radius-sm);
}
.cco-textarea { min-height: 8rem; resize: vertical; line-height: 1.5; }
.cco-select { appearance: none; padding-right: var(--units-5);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.cco-input::placeholder, .cco-textarea::placeholder { color: var(--ink-muted); }
.cco-field--error { border-left: 4px solid var(--error); padding-left: var(--units-2); }
.cco-field--error .cco-input, .cco-field--error .cco-select, .cco-field--error .cco-textarea { border: 2px solid var(--error); }
.cco-error-message { font-size: 15px; line-height: 1.35; font-weight: 700; color: var(--error); margin: 0; }
.cco-fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: var(--units-1); }
.cco-fieldset legend { padding: 0; margin-bottom: var(--units-1); }
.cco-choice { display: flex; align-items: center; gap: var(--units-105); min-height: var(--target-min); cursor: pointer; font-size: 17px; }
.cco-choice input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--action); }
.cco-choice--tile { padding: var(--units-1) var(--units-2); background: var(--surface-raised); border: 1px solid var(--border-control); border-radius: var(--radius-sm); }
.cco-choice--tile:has(input:checked) { border: 2px solid var(--ink); padding: calc(var(--units-1) - 1px) calc(var(--units-2) - 1px); }

/* ---------- Quantity stepper ---------- */
.cco-qty { display: inline-flex; align-items: stretch; border: 1px solid var(--border-control); border-radius: var(--radius-pill); background: var(--surface-raised); overflow: hidden; }
.cco-qty button { width: var(--target-min); height: var(--target-min); border: 0; background: transparent; color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; }
.cco-qty button:hover { background: var(--surface-alt); }
.cco-qty input { width: 3ch; border: 0; background: transparent; text-align: center; font: 600 17px/1 var(--font-sans); color: var(--ink); -moz-appearance: textfield; }
.cco-qty input::-webkit-inner-spin-button, .cco-qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Product card (FluentCart product loop item) ---------- */
.cco-product-grid { display: grid; grid-template-columns: 1fr; gap: var(--units-3); list-style: none; padding: 0; margin: 0; }
@media (min-width: 480px) { .cco-product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 880px) { .cco-product-grid { grid-template-columns: repeat(3, 1fr); } }
.cco-product-card { position: relative; display: grid; grid-template-rows: auto 1fr; background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); overflow: hidden; transition: box-shadow 160ms ease; }
.cco-product-card:hover { box-shadow: var(--shadow-lift); }
.cco-product-card__media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-alt); }
.cco-product-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cco-product-card__media .cco-badge { position: absolute; top: var(--units-105); left: var(--units-105); }
.cco-product-card__body { display: grid; gap: var(--units-1); padding: var(--units-2); align-content: start; }
.cco-product-card__title { font-family: var(--font-serif); font-size: 22px; line-height: 1.35; font-weight: 700; margin: 0; }
.cco-product-card__title a { color: var(--ink); text-decoration: none; }
.cco-product-card__title a::after { content: ""; position: absolute; inset: 0; } /* whole card is the link target */
.cco-product-card__title a:hover { text-decoration: underline; }
.cco-product-card__desc { font-size: 15px; line-height: 1.5; color: var(--ink-muted); margin: 0; }
.cco-product-card__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--units-2); margin-top: var(--units-1); }
.cco-product-card__foot .cco-btn { position: relative; z-index: 1; }
.cco-product-card__foot .cco-price { white-space: nowrap; }

/* ---------- Site header ---------- */
.cco-announce { background: var(--surface-inverse); color: var(--ink-inverse); text-align: center; font-size: 15px; line-height: 1.35; padding: var(--units-1) var(--units-2); }
.cco-announce a { color: inherit; }
.cco-header { background: var(--surface-page); border-bottom: 1px solid var(--border-subtle); }
.cco-header__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--units-1); min-height: var(--header-height); }
.cco-wordmark { font-family: var(--font-serif); font-size: 22px; line-height: 1.1; color: var(--ink); text-decoration: none; letter-spacing: 0.01em; }
.cco-wordmark small { display: block; font-family: var(--font-sans); font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-muted); margin-top: 2px; }
.cco-icon-btn { position: relative; display: inline-grid; place-items: center; width: var(--target-min); height: var(--target-min); border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink); cursor: pointer; }
.cco-icon-btn:hover { background: var(--surface-alt); }
.cco-icon-btn svg { width: 24px; height: 24px; }
.cco-cart-count { position: absolute; top: 4px; right: 2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: var(--radius-pill); background: var(--crust-600); color: var(--surface-raised); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.cco-header__actions { display: flex; align-items: center; gap: var(--units-05); }
.cco-nav { display: none; }
.cco-nav ul { display: flex; gap: var(--units-3); list-style: none; margin: 0; padding: 0; }
.cco-nav a { display: inline-flex; align-items: center; min-height: var(--target-min); color: var(--ink); font-weight: 600; font-size: 16px; text-decoration: none; border-bottom: 2px solid transparent; }
.cco-nav a:hover, .cco-nav a[aria-current="page"] { border-bottom-color: var(--oak-400); }
.cco-drawer { background: var(--surface-raised); border-top: 1px solid var(--border-subtle); box-shadow: var(--shadow-overlay); }
.cco-drawer ul { list-style: none; margin: 0; padding: var(--units-1) 0; }
.cco-drawer a { display: flex; align-items: center; min-height: 52px; padding-inline: var(--units-2); color: var(--ink); font-family: var(--font-serif); font-size: 22px; text-decoration: none; border-bottom: 1px solid var(--border-subtle); }
.cco-drawer a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--oak-400); }
@media (min-width: 1024px) {
  .cco-header__bar { min-height: 80px; }
  .cco-wordmark { font-size: 28px; }
  .cco-nav { display: block; }
  .cco-menu-toggle, .cco-drawer { display: none; }
}

/* ---------- Hero ---------- */
.cco-hero { display: grid; background: var(--surface-alt); }
.cco-hero__media { aspect-ratio: 4 / 3; background: var(--oak-400); }
.cco-hero__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cco-hero__content { display: grid; gap: var(--units-2); padding: var(--units-5) var(--units-2) var(--units-6); justify-items: start; }
.cco-hero__actions { display: grid; gap: var(--units-105); width: 100%; margin-top: var(--units-1); }
@media (min-width: 640px) { .cco-hero__actions { display: flex; width: auto; } }
@media (min-width: 1024px) {
  .cco-hero { grid-template-columns: 1fr 1fr; align-items: center; }
  .cco-hero__media { aspect-ratio: auto; height: 100%; min-height: 560px; order: 2; }
  .cco-hero__content { padding: var(--units-15) var(--units-8); }
}

/* ---------- Cart summary ---------- */
.cco-cart { display: grid; gap: var(--units-2); background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: var(--units-2); }
.cco-cart__line { display: grid; grid-template-columns: 64px 1fr auto; gap: var(--units-105); align-items: start; padding-bottom: var(--units-2); border-bottom: 1px solid var(--border-subtle); }
.cco-cart__thumb { width: 64px; height: 64px; background: var(--surface-alt); border-radius: var(--radius-sm); }
.cco-cart__name { font-weight: 600; margin: 0; font-size: 16px; line-height: 1.35; }
.cco-cart__meta { margin: 2px 0 var(--units-1); font-size: 13px; color: var(--ink-muted); }
.cco-cart__rows { display: grid; gap: var(--units-05); margin: 0; }
.cco-cart__rows div { display: flex; justify-content: space-between; font-size: 15px; }
.cco-cart__rows dt, .cco-cart__rows dd { margin: 0; }
.cco-cart__total { border-top: 1px solid var(--border-control); padding-top: var(--units-1); margin-top: var(--units-05); align-items: baseline; }
.cco-cart__total dt { font-weight: 700; font-size: 17px; }

/* ---------- Footer ---------- */
.cco-footer { background: var(--surface-alt); color: var(--ink); padding-block: var(--units-6) var(--units-3); border-top: 1px solid var(--border-subtle); }
.cco-footer__grid { display: grid; gap: var(--units-4); }
.cco-footer ul { list-style: none; margin: var(--units-1) 0 0; padding: 0; display: grid; }
.cco-footer ul a { display: inline-flex; align-items: center; min-height: var(--target-min); color: var(--ink); font-size: 15px; text-decoration: none; }
.cco-footer ul a:hover { text-decoration: underline; }
.cco-footer__legal { margin-top: var(--units-4); padding-top: var(--units-2); border-top: 1px solid var(--border-subtle); font-size: 13px; color: var(--ink-muted); }
@media (min-width: 640px) { .cco-footer__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cco-footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }

/* ---------- Category chips (shop filter) ---------- */
.cco-chips { display: flex; gap: var(--units-1); list-style: none; margin: 0; padding: 0 var(--units-2) var(--units-05); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
.cco-chips::-webkit-scrollbar { display: none; }
.cco-chips li { flex: none; scroll-snap-align: start; }
.cco-chips a { display: inline-flex; align-items: center; min-height: var(--target-min); padding: 0 var(--units-2); border: 1px solid var(--border-control); border-radius: var(--radius-pill); background: var(--surface-raised); color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.cco-chips a:hover { border-color: var(--ink); }
.cco-chips a[aria-current="page"] { background: var(--action); border-color: var(--action); color: var(--on-action); }
@media (min-width: 1024px) { .cco-chips { flex-wrap: wrap; overflow: visible; padding-inline: 0; } }

/* ---------- Product options (variants, pack sizes) ---------- */
.cco-options { display: grid; gap: var(--units-3); max-width: 30rem; }
.cco-option-list { display: grid; gap: var(--units-1); }
.cco-option-list--2col { grid-template-columns: 1fr 1fr; }
.cco-choice--tile .cco-choice__text { display: grid; flex: 1; gap: 2px; line-height: 1.35; }
.cco-choice__meta { font-size: 13px; color: var(--ink-muted); }
.cco-choice__price { margin-left: auto; font-weight: 600; font-size: 15px; white-space: nowrap; }
.cco-allergens { font-size: 15px; line-height: 1.5; margin: 0; }
.cco-allergens strong { font-weight: 700; }
.cco-buy-row { display: flex; gap: var(--units-105); align-items: center; }
.cco-buy-row .cco-btn { flex: 1; }
