/* ============================================================
   Grilometr - Primagas + PRAKUL
   Vanilla CSS, mobil-first, centrovaný sloupec max 430 px
   ============================================================ */

/* ---------- Fonty (self-hosted Montserrat, woff2) ---------- */
@font-face {
  font-family: "Montserrat"; font-style: normal; font-weight: 100; font-display: swap;
  src: url("../assets/fonts/Montserrat-Thin.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat"; font-style: normal; font-weight: 300; font-display: swap;
  src: url("../assets/fonts/Montserrat-Light.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/Montserrat-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../assets/fonts/Montserrat-Bold.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat"; font-style: normal; font-weight: 900; font-display: swap;
  src: url("../assets/fonts/Montserrat-Black.woff2") format("woff2");
}

/* ---------- Proměnné ---------- */
:root {
  --red:    #ed1c24;
  --orange: #f68b1f;
  --green:  #41ad49;
  --green-dark: #389a40;
  --green-light:  #5cc063;  /* lesk nahoře u hover gradientu */
  --green-darker: #2c8434;  /* okraj/spodek u hover gradientu */
  --ink:    #1d1d1b;
  --input-bg:     #ececec;
  --input-border: #b7b7b7;
  --rule:   #c9c9c9;
  --page-bg: #e9eaec;
  --col-max: 430px;
  --pad: 22px;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-weight: 400;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }

/* ---------- Aplikační sloupec ---------- */
.app {
  max-width: var(--col-max);
  margin-inline: auto;
  min-height: 100svh;
  background: #fff;
  box-shadow: 0 0 36px rgba(0,0,0,.12);
  position: relative;
  overflow: hidden;
}
@media (min-width: 460px) {
  body { padding-block: 24px; }
  .app { min-height: auto; border-radius: 14px; }
}

.view { padding: var(--pad) var(--pad) 26px; }
[hidden] { display: none !important; }

/* ============================================================
   KALKULAČKA
   ============================================================ */
.calc-title {
  margin: 6px 0 4px;
  color: var(--red);
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: .2px;
  line-height: 1.04;
  font-size: clamp(1.7rem, 8.5vw, 2.15rem);
}

/* ---- Hero: kuchař + velké "?" + výzva + podpis ---- */
.calc-hero {
  position: relative;
  margin: 2px 0 10px;
  aspect-ratio: 720 / 700;
}
.calc-hero__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain; object-position: center bottom;
}
.calc-hero__q {
  position: absolute;
  left: 39%; top: 6%;
  transform: translateX(-50%);
  color: var(--red);
  font-weight: 900;
  font-size: clamp(4.2rem, 23vw, 6rem);
  line-height: 1;
  text-shadow: 0 2px 6px rgba(255,255,255,.55);
  pointer-events: none;
}
.calc-hero__cta {
  position: absolute;
  right: 1%; top: 40%;
  width: 52%;
  margin: 0;
  text-align: center;
  font-weight: 700;
  font-size: clamp(1.05rem, 5.2vw, 1.35rem);
  line-height: 1.15;
  color: var(--ink);
}
.calc-hero__sign {
  position: absolute;
  right: 5%; top: 62%;
  width: 46%; height: auto;
}

/* ---- Formulář ---- */
.calc-form { margin-top: 2px; }

.field {
  display: grid;
  grid-template-columns: 1fr auto minmax(110px, 42%);
  align-items: center;
  column-gap: 10px;
  padding: 10px 0;
  border-bottom: 2px solid var(--red);
}
.field:first-of-type { border-top: 2px solid var(--red); }

.field__label {
  font-size: clamp(1rem, 4.6vw, 1.18rem);
  line-height: 1.1;
  font-weight: 700;
}
.field__name { color: var(--red); }
.field__unit { color: var(--ink); font-weight: 700; white-space: nowrap; }

.field__input {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  appearance: none;
}
.field__input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--green) 55%, transparent);
  outline-offset: 1px;
  border-color: var(--green);
}
.field__input.is-invalid {
  border-color: var(--red);
  background: #fdecec;
}
/* skrýt spinnery number inputu */
.field__input::-webkit-outer-spin-button,
.field__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field__input[type=number] { -moz-appearance: textfield; }

/* ---- Tooltip "?" ---- */
.tip {
  position: relative;
  width: 30px; height: 30px;
  flex: none;
  display: inline-grid; place-items: center;
  padding: 0;
  color: #fff;
  background: var(--red);
  border: none;
  border-radius: 5px;
  font-weight: 900;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}
.tip:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

.tip__bubble {
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 240px;
  padding: 9px 12px;
  background: var(--ink);
  color: #fff;
  font-size: .82rem;
  font-weight: 500;
  line-height: 1.35;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.28);
}
.tip__bubble::after {
  content: "";
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: var(--ink);
}
/* u krajních polí přitáhnout bublinu, aby nepřetekla */
.tip__bubble--clamp-left  { left: 0; transform: none; }
.tip__bubble--clamp-right { left: auto; right: 0; transform: none; }
.tip__bubble--clamp-left::after  { left: 22px; }
.tip__bubble--clamp-right::after { left: auto; right: 22px; }

/* ---- Chybová hláška ---- */
.form-error {
  margin: 14px 0 0;
  padding: 11px 14px;
  background: #fdecec;
  border: 1px solid var(--red);
  border-radius: 8px;
  color: var(--red);
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.3;
  text-align: center;
}

/* ---- Tlačítko SPOČÍTAT ---- */
.btn-spocitat {
  display: block;
  width: 100%;
  margin: 20px 0 4px;
  padding: 15px;
  background: var(--green);
  color: #fff;
  border: 1px solid var(--green-dark);
  border-radius: 12px;
  font-weight: 900;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
/* hover/tap dle předlohy: lesklé vystouplé tlačítko (světlejší nahoře -> tmavší dole) */
.btn-spocitat:hover,
.btn-spocitat:active {
  background: linear-gradient(180deg, var(--green-light) 0%, var(--green) 50%, var(--green-dark) 100%);
  border-color: var(--green-darker);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5),
              inset 0 -2px 4px rgba(0,0,0,.12),
              0 3px 7px rgba(0,0,0,.22);
}
.btn-spocitat:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.22);
}
.btn-spocitat:focus-visible { outline: 3px solid var(--green-dark); outline-offset: 3px; }

/* ---- Patička s logy ---- */
.brand-footer {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 2px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand-footer__prakul   { height: 50px; width: auto; }
.brand-footer__primagas { height: 56px; width: auto; }

/* ============================================================
   VÝSLEDKOVÉ SEKCE
   ============================================================ */
.view--result { padding-top: 0; }

.result-bar {
  margin: 0 calc(-1 * var(--pad)) 0;
  padding: 13px var(--pad) 15px;
  text-align: center;
}
/* kategorie = malý štítek nad časem */
.result-bar__cat {
  margin: 0;
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
  font-size: clamp(1rem, 4.4vw, 1.2rem);
  line-height: 1.05;
  opacity: .9;
}
/* přesný zbývající čas (dle vzorce) = hlavní údaj v liště */
.result-bar__time {
  margin: 2px 0 0;
  color: #fff;
  font-weight: 900;
  font-size: clamp(2.3rem, 12vw, 3.1rem);
  line-height: 1;
  letter-spacing: .3px;
}
/* „~" = přibližně (číslo je z odhadovaného vážení láhve) */
.result-bar__approx {
  font-size: .62em;
  margin-right: .1em;
  vertical-align: .1em;
  font-weight: 800;
  opacity: .88;
}
.result--red    .result-bar { background: var(--red); }
.result--orange .result-bar { background: var(--orange); }
.result--green  .result-bar { background: var(--green); }

/* ---- Hero s postavou ---- */
.result-hero {
  position: relative;
  margin: 14px 0 0;
}
.result-hero__img {
  width: 100%;
  margin-inline: auto;
}
/* vysoký výřez (kuchař 60-90) - oříznout na horní část */
.result--orange .result-hero__img {
  max-height: 360px;
  width: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 4px;
}
.result-hero__img--wide { max-width: 100%; }

.result-hero__sign {
  position: absolute;
  width: 40%;
  height: auto;
  filter: drop-shadow(0 1px 2px rgba(255,255,255,.6));
}
.result--red    .result-hero__sign { left: 0;   top: 52%; width: 32%; }
.result--orange .result-hero__sign { right: 4%; top: 42%; width: 38%; }
.result--green  .result-hero__sign { left: 6%;  top: 6%;  width: 34%; }

/* ---- Oddělovací linka v barvě varianty ---- */
.result-rule {
  height: 0;
  margin: 12px 0 16px;
  border: none;
  border-top: 3px solid currentColor;
}
.result--red    .result-rule { color: var(--red); }
.result--orange .result-rule { color: var(--red); }
.result--green  .result-rule { color: var(--green); }

/* ---- Výsledkový text ---- */
.result-text {
  margin: 0;
  text-align: center;
  font-weight: 700;
  font-size: clamp(1.5rem, 7vw, 1.9rem);
  line-height: 1.18;
  color: var(--ink);
}
.result-text .hl { color: var(--green); }

/* Odkaz na e-shop v oranžové variantě - předloha tu nemá pilulku, proto je
   prolinkované jen zvýrazněné slovo "zelenou". Beze změny vzhledu oproti
   kompozici: stejná zelená jako .hl, žádné podtržení. */
.bottle-link {
  color: var(--green);
  text-decoration: none;
  transition: color .15s;
}
.bottle-link:hover,
.bottle-link:active { color: var(--green-darker); }
.bottle-link:focus-visible { outline: 3px solid var(--green-dark); outline-offset: 3px; border-radius: 4px; }

/* CTA pilulka "zelenou láhev >" */
.bottle-cta {
  display: inline-block;
  margin-top: 4px;
  padding: 4px 14px;
  background: var(--green);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 900;
  white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .05s;
}
/* hover/tap dle předlohy: lesklá vystouplá pilulka s tmavým zeleným okrajem */
.bottle-cta:hover,
.bottle-cta:active {
  background: linear-gradient(180deg, var(--green-light) 0%, var(--green) 50%, var(--green-dark) 100%);
  box-shadow: inset 0 0 0 1.5px var(--green-darker),
              inset 0 1px 0 rgba(255,255,255,.5),
              0 2px 6px rgba(0,0,0,.22);
}
.bottle-cta:active { transform: translateY(1px); }
.bottle-cta:focus-visible { outline: 3px solid var(--green-dark); outline-offset: 2px; }

/* ---- Spočítat znovu ---- */
.btn-recalc {
  display: block;
  margin: 18px auto 0;
  padding: 9px 18px;
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--rule);
  border-radius: 999px;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-recalc:hover { background: #f3f3f3; border-color: #aaa; }
.btn-recalc:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

/* výsledek: patička bez horní linky navíc (už je rule) */
.view--result .brand-footer { margin-top: 22px; }

/* ---- Jemný přechod při přepnutí view ---- */
@media (prefers-reduced-motion: no-preference) {
  .view--result:not([hidden]) { animation: fade-in .22s ease both; }
}
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ============================================================
   PWA - plovoucí lišta „Instalovat aplikaci" (dole)
   Fixní dole, v šířce sloupce. JS ji odkryje jen když lze instalovat;
   jde zavřít křížkem (pak týden nic - localStorage). Viz app.js.
   ============================================================ */
.install-bar {
  /* akcent lišty - přepnutí zelená/červená jedním řádkem */
  --ib-accent: #6b6b6b;
  --ib-accent-dark: #3a3a3a;
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 50;
  width: 100%;
  max-width: var(--col-max);
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid #e6e6e6;   /* jemná neutrální linka místo výrazné barvy */
  box-shadow: 0 -6px 24px rgba(0,0,0,.16);
}
@media (min-width: 460px) {
  .install-bar {
    bottom: 18px;
    border: 1px solid var(--rule);
    border-radius: 14px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .install-bar:not([hidden]) { animation: bar-up .28s ease both; }
}
@keyframes bar-up {
  from { transform: translate(-50%, 105%); }
  to   { transform: translate(-50%, 0); }
}
/* když je lišta zobrazená, rezervovat dole místo, ať nepřekrývá obsah */
body.has-install-bar .app { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

/* Android/Chrome/Edge: outlinované tlačítko (decentní, ne plná výplň) */
.install-bar__action {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  background: #fff;
  color: var(--ib-accent-dark);
  border: 1.5px solid var(--ib-accent);
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.install-bar__action:hover,
.install-bar__action:active {
  background: var(--ib-accent);
  color: #fff;
  border-color: var(--ib-accent-dark);
  box-shadow: 0 2px 6px rgba(0,0,0,.16);
}
.install-bar__action:active { transform: translateY(1px); }
.install-bar__action:focus-visible { outline: 3px solid var(--ib-accent); outline-offset: 2px; }
.install-bar__ico { flex: none; }
.install-bar__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.install-bar__text strong { font-weight: 800; font-size: 1.02rem; color: inherit; }
.install-bar__text small { margin-top: 1px; font-weight: 500; font-size: .76rem; color: #6b6b6b; }
.install-bar__action:hover .install-bar__text small,
.install-bar__action:active .install-bar__text small { color: rgba(255,255,255,.92); }

/* iOS/Safari: textová nápověda (instalaci nelze vyvolat programově) */
.install-bar__ios {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 4px 8px;
  color: var(--ink);
  font-size: .84rem;
  font-weight: 500;
  line-height: 1.35;
}
.install-bar__ios strong { font-weight: 700; }
.install-bar__ico--share { flex: none; color: #007aff; }  /* iOS systémová modrá */

/* Křížek pro zavření */
.install-bar__close {
  flex: none;
  width: 40px;
  align-self: stretch;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  border: none;
  color: #8a8a8a;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.install-bar__close:hover { background: #f0f0f0; color: var(--ink); }
.install-bar__close:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
