/* FarmFresh — screen-specific layouts. Screens use only these classes plus
   the shared vocabulary in base.css / components.css. */

/* ========================== Home ========================================= */
.home-hero {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-600) 62%, var(--brand-700) 100%);
}
.home-hero__inner {
  display: grid; gap: var(--s-5); align-items: center;
  padding-block: var(--s-8) var(--s-9);
}
@media (min-width: 860px) {
  .home-hero__inner { grid-template-columns: 1.1fr .9fr; padding-block: var(--s-10); gap: var(--s-8); }
}
.home-hero h1 { color: #fff; font-size: var(--t-3xl); max-width: 16ch; }
@media (min-width: 860px) { .home-hero h1 { font-size: var(--t-4xl); } }
.home-hero p.lede { color: rgba(255,255,255,.88); font-size: var(--t-md); max-width: 46ch; }
.home-hero__art { position: relative; border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 5/4; }
.home-hero__art > svg, .home-hero__art > img { width: 100%; height: 100%; object-fit: cover; }
.home-hero__badges { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.home-hero__badges span {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3);
  padding: 7px 15px; border-radius: var(--r-pill); font-size: var(--t-xs); font-weight: 700;
}
.home-hero__badges span svg { width: 18px; height: 18px; flex: none; }
.home-hero__swoosh {
  position: absolute; inset: 0; opacity: .13; pointer-events: none;
  background-image: var(--swoosh); background-repeat: no-repeat;
  background-position: center; background-size: cover;
}

.season-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: var(--s-3); text-align: center;
}
.season-strip a { display: grid; gap: var(--s-2); justify-items: center; color: var(--ink); }
.season-strip a:hover { text-decoration: none; }
.season-strip .plate {
  width: 72px; height: 72px; border-radius: 50%; background: var(--paper);
  display: grid; place-items: center; box-shadow: var(--shadow-xs); border: 1px solid var(--line);
  transition: transform var(--dur) var(--ease);
}
.season-strip a:hover .plate { transform: translateY(-3px); }
.season-strip .plate svg { width: 74%; height: 74%; }
.season-strip span { font-size: var(--t-xs); font-weight: 700; line-height: var(--lh-snug); }

.how-steps { counter-reset: step; display: grid; gap: var(--s-4); }
@media (min-width: 760px) { .how-steps { grid-template-columns: repeat(3, 1fr); gap: var(--s-5); } }
.how-steps li {
  list-style: none; position: relative; display: grid; gap: var(--s-3);
  align-content: start; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--s-6); box-shadow: var(--shadow-xs);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.how-steps li:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--brand);
}
.how-steps__icon {
  width: 56px; height: 56px; border-radius: var(--r-lg); display: grid; place-items: center;
  background: var(--mint-100); color: var(--forest);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.how-steps li:hover .how-steps__icon { background: var(--brand); color: #06251A; }
.how-steps__icon svg { width: 28px; height: 28px; }
.how-steps h3 { margin: 0; }
.how-steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: var(--s-5); right: var(--s-5);
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--mint-100); color: var(--forest);
  font-family: var(--font-display); font-weight: 700; font-size: var(--t-sm);
}

/* ========================== Shop ======================================== */
.shop-layout { display: grid; gap: var(--s-5); }
@media (min-width: 1000px) { .shop-layout { grid-template-columns: 236px 1fr; align-items: start; } }
.shop-aside { display: none; }
@media (min-width: 1000px) { .shop-aside { display: block; position: sticky; top: calc(var(--header-h) + var(--s-4)); } }
.shop-toolbar {
  display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap;
  padding-bottom: var(--s-4); border-bottom: 1px solid var(--line); margin-bottom: var(--s-5);
}
.shop-toolbar .select { width: auto; min-width: 150px; min-height: 38px; }
.shop-count { font-size: var(--t-sm); color: var(--ink-3); }

/* ========================== Product detail ============================== */
.pdp { display: grid; gap: var(--s-5); }
@media (min-width: 880px) { .pdp { grid-template-columns: 1.05fr .95fr; gap: var(--s-8); align-items: start; } }
.pdp__hero {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  aspect-ratio: 4/3; display: grid; place-items: center; position: relative; overflow: hidden;
}
.pdp__hero svg { width: 82%; height: 82%; }
.pdp__hero .ribbon { top: 16px; }
.pdp__title { margin-bottom: var(--s-1); }
.pdp__varietal { color: var(--ink-3); font-weight: 600; margin-bottom: var(--s-3); }
.pdp__price { font-size: var(--t-2xl); font-family: var(--font-display); font-weight: 700; color: var(--ink); }
.pdp__promise {
  display: grid; gap: 2px; padding: var(--s-3) var(--s-4); background: var(--mint);
  border-radius: var(--r-md); font-size: var(--t-sm); color: var(--forest); font-weight: 700;
}
.pdp__buy { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.pdp__buy .btn { flex: 1; min-width: 180px; }
.pdp__farmstrip {
  display: flex; gap: var(--s-3); align-items: center; padding: var(--s-4);
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
}
.pdp__farmstrip .avatar { width: 46px; height: 46px; }
.nutrition-table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.nutrition-table td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.nutrition-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

.rating-breakdown { display: grid; gap: var(--s-2); }
.rating-bar { display: grid; grid-template-columns: 44px 1fr 36px; gap: var(--s-3); align-items: center; font-size: var(--t-xs); }
.rating-bar .track { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.rating-bar .fill { height: 100%; background: var(--gold); }

/* ========================== Farm storefront ============================= */
.farm-hero { position: relative; overflow: hidden; }
.farm-hero__cover { position: absolute; inset: 0; }
.farm-hero__cover > svg, .farm-hero__cover > img { width: 100%; height: 100%; object-fit: cover; }
.farm-hero__cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(0,54,42,.92) 30%, rgba(0,54,42,.45)); }
.farm-hero__inner { position: relative; padding-block: var(--s-8); color: #fff; display: grid; gap: var(--s-4); }
.farm-hero h1 { color: #fff; font-size: var(--t-2xl); }
@media (min-width: 860px) { .farm-hero h1 { font-size: var(--t-3xl); } }
.farm-hero__meta { display: flex; flex-wrap: wrap; gap: var(--s-4); font-size: var(--t-sm); color: rgba(255,255,255,.88); }
.farm-hero__actions { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.farm-nav { position: sticky; top: calc(var(--header-h) + var(--safe-top)); z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.farm-nav .wrap { display: flex; gap: var(--s-1); overflow-x: auto; scrollbar-width: none; }
.farm-nav .wrap::-webkit-scrollbar { display: none; }
.farm-nav a {
  padding: var(--s-3) var(--s-4); font-size: var(--t-xs); font-weight: 800;
  letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3);
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.farm-nav a.is-on, .farm-nav a:hover { color: var(--forest); border-bottom-color: var(--brand); text-decoration: none; }
.crop-circles { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: var(--s-4); text-align: center; }
.crop-circles .plate { width: 76px; height: 76px; margin-inline: auto; border-radius: 50%; background: var(--paper); display: grid; place-items: center; box-shadow: var(--shadow-xs); }
.crop-circles .plate svg { width: 74%; height: 74%; }
.crop-circles span { display: block; font-size: var(--t-xs); margin-top: var(--s-2); font-weight: 600; }

.contact-grid { display: grid; gap: var(--s-5); }
@media (min-width: 760px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.map-plate {
  position: relative; aspect-ratio: 16/10; border-radius: var(--r-md); overflow: hidden;
  background: var(--mint); border: 1px solid var(--line);
}
.map-plate svg { width: 100%; height: 100%; }

/* ========================== Recipe ====================================== */
.recipe-layout { display: grid; gap: var(--s-6); }
@media (min-width: 900px) { .recipe-layout { grid-template-columns: 1fr 340px; align-items: start; } }
.recipe-hero { border-radius: var(--r-lg); overflow: hidden; position: relative; aspect-ratio: 16/9; background: var(--mint); }
.recipe-hero > svg { width: 100%; height: 100%; object-fit: cover; }
.recipe-meta { display: flex; flex-wrap: wrap; gap: var(--s-4); font-size: var(--t-sm); color: var(--ink-2); }
.ingredient-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.ingredient-list li {
  display: grid; grid-template-columns: 40px 1fr auto; gap: var(--s-3); align-items: center;
  padding: var(--s-2); border-radius: var(--r-sm); background: var(--surface);
}
.ingredient-list .plate { width: 40px; height: 40px; border-radius: 50%; background: var(--mint); display: grid; place-items: center; overflow: hidden; }
.ingredient-list .plate svg { width: 76%; height: 76%; }
.steps { counter-reset: s; display: grid; gap: var(--s-4); margin: 0; padding: 0; }
.steps li { list-style: none; display: grid; grid-template-columns: 34px 1fr; gap: var(--s-3); }
.steps li::before {
  counter-increment: s; content: "Step " counter(s);
  grid-column: 1 / -1; font-size: var(--t-xs); font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--brand-700);
}
.steps li p { grid-column: 1 / -1; margin: 0; }
.steps li.is-done p { opacity: .55; text-decoration: line-through; }
.step-check { grid-column: 1; width: 26px; height: 26px; accent-color: var(--forest); }

/* ========================== Cart / checkout ============================= */
.cart-layout { display: grid; gap: var(--s-5); }
@media (min-width: 960px) { .cart-layout { grid-template-columns: 1fr 350px; align-items: start; } }
.cart-farm {
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  overflow: hidden; margin-bottom: var(--s-4);
}
.cart-farm__head {
  display: flex; gap: var(--s-3); align-items: center; padding: var(--s-4);
  background: var(--mint); border-bottom: 1px solid var(--line);
}
.cart-farm__head .avatar { width: 38px; height: 38px; }
.cart-farm__body { padding: var(--s-4); display: grid; gap: var(--s-3); }
.checkout-aside { position: sticky; top: calc(var(--header-h) + var(--s-4)); }
.checkout-step { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: var(--s-5); margin-bottom: var(--s-4); }
.checkout-step h3 { display: flex; align-items: center; gap: var(--s-3); }
.checkout-step h3 .n {
  width: 28px; height: 28px; border-radius: 50%; background: var(--forest); color: #fff;
  display: grid; place-items: center; font-size: var(--t-sm); flex: none;
}
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s-2); }
.slot-grid label {
  display: grid; gap: 2px; padding: var(--s-3); border: 1.5px solid var(--line-strong);
  border-radius: var(--r-sm); cursor: pointer; font-size: var(--t-sm); background: var(--surface);
}
.slot-grid label:has(input:checked) { border-color: var(--forest); background: var(--mint); }
.slot-grid input { position: absolute; opacity: 0; pointer-events: none; }
.slot-grid .d { font-weight: 800; }
.slot-grid .t { font-size: var(--t-xs); color: var(--ink-3); }

.order-confirm { text-align: center; display: grid; gap: var(--s-4); justify-items: center; padding-block: var(--s-8); }
.order-confirm .tick {
  width: 78px; height: 78px; border-radius: 50%; background: var(--brand);
  display: grid; place-items: center; color: #fff;
}
.order-confirm .tick svg { width: 44px; height: 44px; }

/* ========================== Account / orders ============================ */
.account-layout { display: grid; gap: var(--s-5); }
@media (min-width: 900px) { .account-layout { grid-template-columns: 240px 1fr; align-items: start; } }
.account-nav { display: grid; gap: 2px; }
.account-nav a, .account-nav button {
  display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3);
  border-radius: var(--r-md); color: var(--ink-2); background: none; border: 0;
  cursor: pointer; text-align: left; font-size: var(--t-sm); font-weight: 600; width: 100%;
}
.account-nav a:hover, .account-nav button:hover { background: var(--mint); text-decoration: none; }
.account-nav .is-on { background: var(--mint); color: var(--forest); font-weight: 800; }

.order-card { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.order-card__head { display: flex; justify-content: space-between; gap: var(--s-3); align-items: center; padding: var(--s-4); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.order-card__body { padding: var(--s-4); display: grid; gap: var(--s-3); }
.order-thumbs { display: flex; }
.order-thumbs .plate {
  width: 42px; height: 42px; border-radius: 50%; background: var(--paper);
  border: 2px solid var(--surface); display: grid; place-items: center; margin-left: -10px; overflow: hidden;
}
.order-thumbs .plate:first-child { margin-left: 0; }
.order-thumbs .plate svg { width: 74%; height: 74%; }

/* ========================== Auth ======================================== */
.auth-screen { display: grid; min-height: calc(100dvh - var(--header-h) - var(--tabbar-h)); }
@media (min-width: 900px) { .auth-screen { grid-template-columns: 1fr 1fr; } }
.auth-art { position: relative; display: none; }
@media (min-width: 900px) { .auth-art { display: block; } }
.auth-art > svg, .auth-art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth-panel {
  background: var(--forest); color: #fff; display: grid; align-content: center; gap: var(--s-4);
  padding: var(--s-8) max(var(--s-5), var(--safe-left));
}
.auth-panel h1 { color: #fff; }
.auth-panel .input--underline { font-size: var(--t-md); }
.auth-panel a { color: var(--amber); font-weight: 700; }
.demo-logins { display: grid; gap: var(--s-2); margin-top: var(--s-3); }
.demo-logins button {
  display: flex; gap: var(--s-3); align-items: center; width: 100%; text-align: left;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  color: #fff; border-radius: var(--r-md); padding: var(--s-3); cursor: pointer; font-size: var(--t-sm);
}
.demo-logins button:hover { background: rgba(255,255,255,.2); }
.demo-logins .avatar { width: 34px; height: 34px; }

/* ========================== Seller ====================================== */
.seller-layout { display: grid; gap: var(--s-5); }
@media (min-width: 1000px) { .seller-layout { grid-template-columns: 220px 1fr; align-items: start; } }
.seller-nav { display: grid; gap: 2px; position: sticky; top: calc(var(--header-h) + var(--s-4)); }
.seller-nav a {
  display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3);
  border-radius: var(--r-md); color: var(--ink-2); font-size: var(--t-sm); font-weight: 600;
}
.seller-nav a:hover { background: var(--mint); text-decoration: none; }
.seller-nav a.is-on { background: var(--forest); color: #fff; font-weight: 700; }
.seller-nav a svg { width: 18px; height: 18px; }
.seller-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-5); }
.seller-head h1 { margin: 0; }
.seller-mobile-nav { display: block; margin-bottom: var(--s-4); }
@media (min-width: 1000px) { .seller-mobile-nav { display: none; } }

.editor-grid { display: grid; gap: var(--s-5); }
@media (min-width: 900px) { .editor-grid { grid-template-columns: 1fr 320px; align-items: start; } }
.editor-card { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: var(--s-5); margin-bottom: var(--s-4); }
.editor-card h3 { margin-bottom: var(--s-4); }
.editor-preview { position: sticky; top: calc(var(--header-h) + var(--s-4)); display: grid; gap: var(--s-3); }
.field-row { display: grid; gap: var(--s-3); }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
.field-row .field { margin-bottom: 0; }

.repeater { display: grid; gap: var(--s-2); }
.repeater__row { display: grid; grid-template-columns: 1fr auto; gap: var(--s-2); align-items: start; }
.repeater__row .input, .repeater__row .textarea { min-height: 40px; }

.art-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: var(--s-2); }
.art-picker label {
  aspect-ratio: 1; display: grid; place-items: center; border-radius: var(--r-sm);
  border: 2px solid var(--line); background: var(--surface); cursor: pointer; padding: 5px;
}
.art-picker label:has(input:checked) { border-color: var(--forest); background: var(--mint); }
.art-picker input { position: absolute; opacity: 0; pointer-events: none; }
.art-picker svg { width: 100%; height: 100%; }

/* ========================== Static pages ================================ */
.prose { max-width: 68ch; }
.prose h2 { margin-top: var(--s-7); }
.prose h3 { margin-top: var(--s-5); }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li { margin-bottom: var(--s-2); }
.faq { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); margin-bottom: var(--s-2); }
.faq summary { padding: var(--s-4); cursor: pointer; font-weight: 700; color: var(--forest); list-style: none; display: flex; justify-content: space-between; gap: var(--s-3); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: var(--t-lg); line-height: 1; }
.faq[open] summary::after { content: "−"; }
.faq__body { padding: 0 var(--s-4) var(--s-4); }

/* ========================== Markets directory =========================== */
.markets-hero {
  background: linear-gradient(130deg, var(--forest) 0%, var(--forest-600) 70%);
  color: #fff; position: relative; overflow: hidden;
}
.markets-hero__inner { padding-block: var(--s-7) var(--s-8); display: grid; gap: var(--s-3); }
.markets-hero h1 { color: #fff; max-width: 18ch; }
.markets-hero p { color: rgba(255,255,255,.86); max-width: 52ch; margin: 0; }

.market-group { margin-bottom: var(--s-6); }
.market-group__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-3);
  padding-bottom: var(--s-2); border-bottom: 2px solid var(--brand);
}
.market-group__head h2 { margin: 0; font-size: var(--t-lg); }
.market-group__head .where { font-size: var(--t-sm); color: var(--ink-3); }

.market-row {
  display: grid; grid-template-columns: 44px 1fr auto; gap: var(--s-3);
  align-items: center; padding: var(--s-3);
  border-bottom: 1px solid var(--line);
}
.market-row:last-child { border-bottom: 0; }
.market-row .avatar { width: 44px; height: 44px; }
.market-row__who { display: grid; gap: 2px; min-width: 0; }
.market-row__name { font-weight: 700; color: var(--ink); }
.market-row__meta { font-size: var(--t-xs); color: var(--ink-3); }
@media (max-width: 560px) {
  .market-row { grid-template-columns: 44px 1fr; }
  .market-row > :last-child { grid-column: 2; justify-self: start; }
}
