/* Veg mix builder (/veg-mix/). Ported from the prototype's "Build your veg mix" view. */
.vmx { padding-top: 22px; padding-bottom: 56px; }
.vmx-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-top: 10px; }
.vmx-head h1 { font-size: clamp(2rem, 1.2rem + 3vw, 3.4rem); font-weight: 800; margin-top: 6px; }
.vmx-head p { color: var(--ink-2); margin: 8px 0 0; max-width: 56ch; }

.vmx .stp { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-size: 1.2rem; letter-spacing: -.02em; margin: 30px 0 14px; }
.vmx .stp i { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: .78rem; flex-shrink: 0; font-family: var(--f-body); letter-spacing: 0; }
.vmx .stp small { font-family: var(--f-body); font-size: .8rem; color: var(--muted); font-weight: 600; letter-spacing: 0; margin-left: auto; }
.vmx .stp.sm { font-size: 1rem; margin: 18px 0 10px; }

/* step 1: dishes (photo cards; text sits on a dark gradient in both themes) */
.dishes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.dish { position: relative; display: block; border-radius: 22px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--navy-2); color: var(--white); isolation: isolate; box-shadow: var(--shadow); transition: transform .45s var(--ease), box-shadow .3s; }
.dish img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .9s var(--ease); }
.dish::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(4,26,64,0) 30%, rgba(4,26,64,.88) 100%); }
.dish:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.dish:hover img { transform: scale(1.07); }
.dish:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.dish .dt { position: absolute; left: 16px; right: 16px; bottom: 14px; }
.dish b { display: block; font-family: var(--f-display); font-size: 1.35rem; letter-spacing: -.03em; line-height: 1.1; }
.dish small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .8rem; opacity: .88; margin-top: 2px; line-height: 1.35; }
.dish .dn { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: top; margin-top: 8px; font-size: .7rem; font-weight: 800; letter-spacing: .06em; background: rgba(255,255,255,.18); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); padding: 4px 9px; border-radius: 99px; }
.dish .tick { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%; background: var(--white); color: var(--brand); display: grid; place-items: center; transform: scale(0); transition: transform .45s var(--spring); }
.dish .tick svg { width: 16px; }
.dish.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--brand), var(--shadow-lg); }
.dish.on .tick { transform: scale(1); }

/* step 2: vegetables */
.mix-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr); gap: 26px; align-items: start; }
.vegs { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.vg { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 18px; padding: 10px; box-shadow: var(--shadow); transition: box-shadow .25s, transform .3s var(--ease); min-height: 72px; }
.vg:hover { transform: translateY(-2px); }
.vg.on { box-shadow: inset 0 0 0 2px var(--brand), var(--shadow); }
.vg-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 0; text-align: left; color: var(--ink); }
.vg-main i { width: 50px; height: 50px; border-radius: 15px; background: var(--tint, var(--mint)); display: grid; place-items: center; font-size: 1.7rem; font-style: normal; flex-shrink: 0; overflow: hidden; transition: transform .45s var(--spring); }
.vg-main i img { width: 100%; height: 100%; object-fit: cover; }
.vg.on .vg-main i { transform: rotate(-8deg) scale(1.06); }
.vg-txt { min-width: 0; }
.vg-main b { display: block; font-size: .92rem; line-height: 1.2; }
.vg-main small { color: var(--muted); font-size: .76rem; }
.vg.on .vg-main small [data-vg-line] { color: var(--brand); font-weight: 800; }
.vg .plus { width: 36px; height: 36px; border-radius: 12px; border: 0; background: var(--surface-2); color: var(--brand); font-size: 1.3rem; font-weight: 800; line-height: 1; flex-shrink: 0; transition: background .2s, color .2s, transform .3s var(--spring); }
.vg .plus:hover { background: var(--brand); color: var(--on-brand); transform: rotate(90deg); }
.vg .plus:disabled { opacity: .4; cursor: not-allowed; transform: none; background: var(--surface-2); color: var(--muted); }
.vg-ctl { display: contents; }
.gstep { display: flex; align-items: center; background: var(--brand); color: var(--on-brand); border-radius: 12px; height: 36px; overflow: hidden; flex-shrink: 0; animation: stepIn .4s var(--spring); }
.gstep button { border: 0; background: none; color: inherit; width: 30px; height: 100%; font-weight: 800; font-size: 1rem; }
.gstep button:hover { background: rgba(255,255,255,.15); }
.gstep button:disabled { opacity: .4; cursor: not-allowed; }
.gstep output { font-size: .78rem; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 46px; text-align: center; }
.vmx-limits { font-size: .78rem; color: var(--muted); margin: 12px 0 0; }

/* step 3: the sticky pack */
.pack { position: sticky; top: calc(var(--hdr-h) + 72px); margin-top: 30px; background: var(--surface); border-radius: 26px; box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; max-height: calc(100vh - var(--hdr-h) - 92px); }
.pack-hero { position: relative; height: 150px; flex-shrink: 0; color: var(--white); isolation: isolate; overflow: hidden; background: var(--navy-2); }
.pack-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.pack-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(4,26,64,.1), rgba(4,26,64,.85)); }
.pack-hero-txt { position: absolute; left: 18px; right: 18px; bottom: 14px; }
.pack-hero-txt small { font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--sun); }
.pack-hero-txt b { display: block; font-family: var(--f-display); font-size: 1.6rem; letter-spacing: -.03em; line-height: 1.1; }
.pack-hero-txt span { font-size: .82rem; opacity: .9; }
.pack-body { padding: 14px 18px 12px; overflow-y: auto; flex: 1; }
.comp-list { display: grid; gap: 4px; }
.comp-list .cr { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 10px; animation: lineIn .4s var(--ease) both; }
.comp-list .cr.still { animation: none; }
.comp-list .cr:hover { background: var(--surface-2); }
.comp-list .cr i { font-style: normal; font-size: 1.2rem; text-align: center; width: 30px; height: 30px; border-radius: 9px; overflow: hidden; display: grid; place-items: center; }
.comp-list .cr i img { width: 100%; height: 100%; object-fit: cover; }
.comp-list .cr b { font-size: .86rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp-list .cr span { font-size: .8rem; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.comp-list .cr button { border: 0; background: none; color: var(--muted); width: 26px; height: 26px; border-radius: 8px; font-size: 1.05rem; line-height: 1; }
.comp-list .cr button:hover { background: var(--hot); color: var(--on-hot); }
.comp-empty { padding: 20px 6px; color: var(--muted); font-size: .86rem; text-align: center; margin: 0; }
.cut-pills { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cut-pill { position: relative; cursor: pointer; }
.cut-pill > span { display: block; height: 100%; border-radius: 12px; padding: 9px 11px; background: var(--surface-2); color: var(--ink); font-weight: 700; font-size: .8rem; line-height: 1.25; transition: background .25s var(--ease), color .25s var(--ease); }
.cut-pill small { display: block; font-weight: 600; font-size: .7rem; color: var(--muted); margin-top: 1px; }
.cut-pill:hover > span { box-shadow: inset 0 0 0 1.5px var(--brand); }
.cut-pill input:checked + span { background: var(--brand); color: var(--on-brand); }
.cut-pill input:checked + span small { color: inherit; opacity: .85; }
.cut-pill input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.vmx-lbl { margin: 16px 0 8px; }
.vmx-lbl span { color: var(--muted); font-weight: 600; }
.pack .note textarea { min-height: 64px; }
.vmx-err { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; font-size: .82rem; font-weight: 700; color: var(--nonveg); background: color-mix(in srgb, var(--nonveg) 10%, var(--surface)); }
.pack-foot { display: flex; align-items: center; gap: 14px; padding: 14px 18px 18px; border-top: 1px solid var(--line); background: var(--surface); flex-shrink: 0; }
.pack-foot small { display: block; color: var(--muted); font-size: .74rem; font-weight: 700; }
.pack-foot b { font-family: var(--f-display); font-size: 1.7rem; letter-spacing: -.04em; white-space: nowrap; }
.pack-foot .btn { flex: 1; height: 54px; border-radius: 16px; }
.pack-foot .btn:disabled { opacity: .45; cursor: not-allowed; }
.vmx-credit { font-size: .7rem; color: var(--muted); margin: 28px 0 0; }
.vmx-credit a { text-decoration: underline; }

/* dark: soften the pastel icon tints */
:root[data-theme="dark"] .vmx .vg-main i:not(.ph),
:root[data-theme="dark"] .vmx .cr i:not(.ph) { background: color-mix(in srgb, var(--tint) 22%, var(--surface-2)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .vmx .vg-main i:not(.ph),
  :root:not([data-theme="light"]) .vmx .cr i:not(.ph) { background: color-mix(in srgb, var(--tint) 22%, var(--surface-2)); }
}

@media (max-width: 1100px) {
  .mix-grid { grid-template-columns: 1fr; }
  .pack { position: static; max-height: none; }
}
@media (max-width: 640px) {
  .vmx { padding-top: 14px; }
  .dishes { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dish { border-radius: 18px; }
  .dish .dt { left: 12px; right: 12px; bottom: 10px; }
  .dish b { font-size: 1.05rem; }
  .dish small { display: none; }
  .dish .dn { font-size: .62rem; padding: 3px 7px; letter-spacing: .03em; }
  .dish .tick { top: 8px; right: 8px; width: 26px; height: 26px; }
  .vegs { grid-template-columns: 1fr; }
  .cut-pills { grid-template-columns: 1fr 1fr; }
  .pack { border-radius: 22px; }
}
/* phones: sticky bar that jumps to the pack (the pack sits below the vegetable list) */
.vmx-packbar { display: none; }
@media (max-width: 1100px) {
  .vmx-packbar { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 34; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; border-radius: 16px; padding: 12px 16px; background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow-lg); text-align: left; transition: transform .45s var(--spring), opacity .3s; }
  .vmx-packbar span { display: grid; }
  .vmx-packbar small { font-size: .74rem; opacity: .85; font-weight: 600; }
  .vmx-packbar > b { font-family: var(--f-display); font-size: 1.25rem; letter-spacing: -.03em; }
  .vmx-packbar.away { transform: translateY(160%); opacity: 0; pointer-events: none; }
}
@media (min-width: 768px) and (max-width: 1100px) { .vmx-packbar { bottom: 16px; } }
@media (prefers-reduced-motion: reduce) {
  .dish, .dish img, .vg, .vg-main i, .vg .plus { transition: none; }
  .comp-list .cr, .gstep { animation: none; }
}
