/* Recipe cost calculator page: calculator grid, results card, app band, video facade. */

.intro { padding-top: 28px; padding-bottom: 18px; }
.lead { font-size: clamp(1rem, 1.3vw, 1.12rem); color: #2c2c45; max-width: 70ch; margin-top: 12px; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }

.calc-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; padding-bottom: 24px; }
.calc, .results { background: var(--card); border: 2px solid #000; border-radius: var(--radius); box-shadow: var(--shadow); }
.calc { padding: 20px; }

.field { display: flex; flex-direction: column; gap: 4px; font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.field input, .field select, .line input, .line select {
  font: inherit; font-size: 0.95rem; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 10px; background: #fff; width: 100%; min-width: 0;
}
.field input:focus, .line input:focus, .line select:focus, .field select:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px rgba(1,3,79,0.12); }
.calc-head { display: grid; grid-template-columns: 1fr 110px 130px; gap: 12px; margin-bottom: 16px; }

/* ingredient lines: name | pack size+unit | pack price | used+unit | yield | cost | remove */
.line { display: grid; grid-template-columns: minmax(120px, 1.4fr) minmax(130px, 1.1fr) 92px minmax(130px, 1.1fr) 70px 78px 30px; gap: 8px; align-items: center; padding: 6px 0; }
.line-head { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); border-bottom: 1.5px solid var(--line); padding-bottom: 8px; }
.line .pair { display: grid; grid-template-columns: 1fr 74px; gap: 4px; }
.line .pair select { padding-left: 6px; padding-right: 2px; }
.line .cost { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--navy); }
.line .cost.err { color: var(--error); font-size: 0.72rem; font-weight: 700; line-height: 1.2; }
.line .rm { width: 30px; height: 30px; border-radius: 50%; color: var(--muted); font-size: 1.1rem; line-height: 1; }
.line .rm:hover { background: #f3eee4; color: var(--error); }
.line input[aria-invalid="true"] { border-color: var(--error); }
.line .mlabel { display: none; }
.r { text-align: right; }
.line-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }

.extras { margin-top: 14px; border-top: 1.5px solid var(--line); padding-top: 12px; }
.extras summary { cursor: pointer; font-weight: 700; color: var(--navy); font-size: 0.92rem; }
.extras-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.pricing { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; border-top: 1.5px solid var(--line); padding-top: 14px; }

/* results */
.results { padding: 20px; position: sticky; top: 84px; background: var(--navy); color: #fff; }
.results h3 { color: #fff; font-size: 1.4rem; text-transform: uppercase; margin-bottom: 10px; }
.results dl > div[hidden] { display: none; }
.results dl > div { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,0.14); }
.results dt { font-size: 0.86rem; color: rgba(255,255,255,0.78); }
.results dd { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 1.05rem; text-align: right; }
.results .big dd { font-family: var(--font-head); font-size: 1.9rem; font-weight: 600; color: var(--yellow); }
.results .warn { margin-top: 10px; font-size: 0.8rem; color: #ffd2c2; }
.res-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.results .btn-small { background: var(--orange); border-color: var(--orange); }
.results .btn-small.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.5); }

/* app band */
.app-band { background: #fff; border-top: 2px solid #000; border-bottom: 2px solid #000; margin-top: 32px; padding: 48px 0; }
.app-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 36px; align-items: center; }
.app-band h2 { margin-bottom: 12px; }
.app-band p { color: #2c2c45; }
.ticks { list-style: none; margin: 14px 0 20px; }
.ticks li { padding-left: 26px; position: relative; margin: 6px 0; font-weight: 600; font-size: 0.95rem; }
.ticks li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 900; }
.app-cta { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.qr { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.72rem; color: var(--muted); font-weight: 700; }
.qr-svg { width: 112px; height: 112px; border: 2px solid #000; border-radius: 10px; }
.sheet { border: 2px solid #000; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #fff; }
.sheet figcaption { font-size: 0.82rem; color: var(--muted); padding: 10px 14px; border-top: 1px solid var(--line); }

/* video facade (same pattern as the business plan page) */
.video { margin: 32px 0 8px; aspect-ratio: 16 / 9; border: 2px solid #000; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--navy); }
.video iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-facade { position: relative; width: 100%; height: 100%; display: block; }
.vf-poster { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(1,3,79,0.25), rgba(1,3,79,0.9)), url('../images/calculators_recipe-cost-calculator-carne-asada-google-sheet.webp') center / cover no-repeat; display: flex; align-items: flex-end; padding: 24px; }
.vf-title { font-family: var(--font-head); color: #fff; font-size: clamp(1.3rem, 3vw, 2.3rem); text-transform: uppercase; line-height: 1; text-align: left; }
.vf-play { position: absolute; left: 50%; top: 50%; width: 84px; transform: translate(-50%, -50%); transition: transform .2s; }
.video-facade:hover .vf-play { transform: translate(-50%, -50%) scale(1.1); }

/* phones/tablets: sticky summary while the ingredient list is on screen and the results card is not */
.mini { display: none; }
@media (max-width: 1080px) {
  .calc-wrap { grid-template-columns: 1fr; }
  .results { position: static; }
  .mini:not([hidden]) { display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40; gap: 14px; align-items: center; justify-content: space-between;
    background: var(--navy); color: #fff; text-decoration: none; border: 2px solid #000; border-radius: 14px; box-shadow: 4px 4px 0 #000; padding: 10px 14px; font-size: 0.82rem; }
  .mini b { color: var(--yellow); font-size: 1rem; font-variant-numeric: tabular-nums; margin-left: 4px; }
  .mini-go { font-weight: 700; color: rgba(255,255,255,0.8); white-space: nowrap; }
}
@media (max-width: 880px) {
  .app-grid { grid-template-columns: 1fr; }
}
/* phones: each ingredient becomes a small labelled card */
@media (max-width: 720px) {
  .intro { padding-top: 18px; padding-bottom: 14px; }
  .intro-actions .btn-orange { display: none; }
  .intro-actions .btn-line { padding: 10px 18px; font-size: 0.88rem; }
  .calc { padding: 14px; }
  .calc-head { grid-template-columns: 1fr 1fr; }
  .calc-head .grow { grid-column: 1 / -1; }
  .line-head { display: none; }
  .line { grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 12px; margin-bottom: 10px; border: 1.5px solid var(--line); border-radius: 12px; position: relative; }
  .line .c-name { grid-column: 1 / -1; padding-right: 34px; }
  .line .mlabel { display: block; font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 3px; }
  .line .cost { grid-column: 2; align-self: end; font-size: 1.1rem; }
  .line .rm { position: absolute; top: 8px; right: 8px; }
  .extras-grid { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .qr { display: none; }
}
@media (hover: none) and (pointer: coarse) { .qr { display: none; } }
