/* ==========================================================================
   koupite.cz – hlavní styly
   Struktura: 1) písmo  2) proměnné  3) základ  4) layout  5) komponenty
   ========================================================================== */

/* 1) Písmo – Inter hostovaný lokálně (bez Google Fonts kvůli GDPR).
   Stáhněte InterVariable.woff2 z https://rsms.me/inter/ do assets/fonts/.
   Bez souboru se použije systémové písmo. */
@font-face {
  font-family: "Inter";
  src: local("Inter"), url("../fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* 2) Design tokeny */
:root {
  --c-brand: #4D7C0F;
  --c-brand-dark: #3F6212;
  --c-ink: #1A2E05;
  --c-text: #334155;
  --c-muted: #475569;
  --c-subtle: #64748B;
  --c-line: #E2E8F0;
  --c-line-strong: #CBD5E1;
  --c-bg: #FFFFFF;
  --c-bg-soft: #F8FAFC;
  --c-bg-brand: #F4F8EC;
  --c-bg-hover: #EEF4E2;
  --c-red: #B91C1C;
  --c-red-ink: #7F1D1D;
  --c-red-soft: #FEF2F2;
  --c-red-line: #FECACA;
  --c-accent-lime: #A3E635;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --radius-s: 10px;
  --radius-m: 14px;
  --radius-l: 20px;
  --radius-xl: 28px;

  --shadow-pop: 0 24px 60px rgb(26 46 5 / .16);
  --shadow-hover: 0 8px 24px rgb(26 46 5 / .08);
  --ring: 0 0 0 4px rgb(77 124 15 / .35);

  --container: 1200px;
  --gutter: clamp(16px, 4vw, 24px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* 3) Základ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }

a { color: var(--c-ink); }
a:hover { color: var(--c-brand); }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-s); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--c-ink);
  color: #fff;
  border-radius: var(--radius-s);
  font-weight: 600;
}
.skip-link:focus { top: 16px; color: #fff; }

/* 4) Layout */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: 1048px; }

main { flex: 1 0 auto; }

/* 5) Komponenty
   ------------------------------------------------------------------------ */

/* Tlačítka */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn--primary { background: var(--c-brand); color: #fff; border: 0; }
.btn--primary:hover { background: var(--c-brand-dark); color: #fff; }
.btn--outline { min-height: 36px; padding: 0 14px; gap: 6px; border: 1.5px solid var(--c-brand); border-radius: 10px; color: var(--c-ink); background: transparent; font-size: 14px; }
.btn--outline .icon { width: 16px; height: 16px; }
.btn--outline:hover { background: var(--c-bg-brand); color: var(--c-ink); }

.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge--red { background: var(--c-red); color: #fff; }

/* Hlavička */
.site-header {
  position: relative;
  z-index: 30;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.site-header__logo { display: flex; flex: none; }
.site-header__logo img { height: 36px; width: auto; }

.main-nav {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: space-between;
  gap: 16px;
}
.main-nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline: auto;
}
.main-nav__link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-s);
  font-weight: 500;
  text-decoration: none;
  color: var(--c-ink);
}
.main-nav__link:hover { background: var(--c-bg-hover); color: var(--c-ink); }
.main-nav__link[aria-current="page"] { background: var(--c-bg-brand); }
.main-nav__link--season { color: var(--c-red); font-weight: 600; }
.main-nav__link--season:hover { color: var(--c-red); background: var(--c-red-soft); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--c-line-strong);
  border-radius: 12px;
  background: var(--c-bg);
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }

  /* Bez JS zůstává menu vidět; s JS se sbalí. */
  .js .main-nav {
    position: absolute;
    inset: 100% 0 auto;
    flex-direction: column;
    align-items: stretch;
    padding: 12px var(--gutter) 20px;
    background: var(--c-bg);
    border-bottom: 1px solid var(--c-line);
    box-shadow: 0 16px 32px rgb(26 46 5 / .08);
  }
  .js .main-nav:not(.is-open) { display: none; }
  .main-nav__list { flex-direction: column; align-items: stretch; margin: 0; }
  .main-nav__link { min-height: 48px; font-size: 17px; }
  .main-nav__login { align-self: flex-start; }

  html:not(.js) .site-header__inner { flex-wrap: wrap; }
  html:not(.js) .nav-toggle { display: none; }
}

/* Hero */
.hero {
  background: var(--c-bg-brand);
  padding: clamp(28px, 4vw, 44px) 0 clamp(32px, 4.5vw, 48px);
}
.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}
.hero__title {
  font-size: clamp(36px, 5.2vw, 60px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -.03em;
}

/* Vyhledávání */
.search {
  position: relative;
  z-index: 20;
  width: 100%;
  text-align: left;
}
.search__field { position: relative; }
.search__icon {
  position: absolute;
  left: 24px;
  top: 50%;
  width: 28px;
  height: 28px;
  transform: translateY(-50%);
  color: var(--c-brand);
  stroke-width: 2.4;
  pointer-events: none;
}
.search__input {
  width: 100%;
  height: 80px;
  padding: 0 160px 0 66px;
  font-size: 22px;
  font-weight: 500;
  color: var(--c-ink);
  background: var(--c-bg);
  border: 3px solid var(--c-ink);
  border-radius: 24px;
  outline: none;
  appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.search__input::placeholder { color: var(--c-subtle); opacity: 1; }
.search__input:focus { border-color: var(--c-brand); box-shadow: 0 0 0 6px rgb(77 124 15 / .18); border-radius: 24px; }
.search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search.is-open .search__input { border-color: var(--c-brand); }

.search__submit {
  position: absolute;
  top: 10px; right: 10px; bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 28px;
  border: 0;
  border-radius: 16px;
  background: var(--c-brand);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .15s;
}
.search__submit:hover { background: var(--c-brand-dark); }
.search__submit .icon { display: none; width: 26px; height: 26px; stroke-width: 2.4; }

@media (max-width: 640px) {
  .search__input { height: 64px; padding: 0 72px 0 50px; font-size: 18px; border-radius: 20px; }
  .search__input:focus { border-radius: 20px; }
  .search__icon { left: 16px; width: 24px; height: 24px; }
  .search__submit { top: 8px; right: 8px; bottom: 8px; padding: 0 14px; border-radius: 13px; }
  .search__submit .icon { display: block; }
  .search__submit-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* Našeptávač */
.suggest {
  position: absolute;
  top: calc(100% + 12px);
  left: 0; right: 0;
  overflow: hidden;
  background: var(--c-bg);
  border: 1px solid var(--c-line-strong);
  border-radius: 24px;
  box-shadow: var(--shadow-pop);
  animation: suggest-in .16s var(--ease);
}
.suggest[hidden] { display: none; }
@keyframes suggest-in { from { opacity: 0; transform: translateY(-6px); } }

.suggest__list { display: flex; flex-wrap: wrap; max-height: min(70vh, 640px); overflow-y: auto; }
.suggest__list[hidden] { display: none; }
.suggest__group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 20px 12px;
}
.suggest__group--categories { flex: 1 1 260px; border-right: 1px solid var(--c-line); }
.suggest__group--products { flex: 999 1 420px; }
/* Jen kategorie, žádné produkty → bez dělicí čáry. */
.suggest__group--categories:has(+ .suggest__all) { border-right: 0; }

.suggest__label {
  padding: 0 12px 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--c-subtle);
}

.suggest__option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: var(--radius-m);
  font-size: 18px;
  color: var(--c-text);
  cursor: pointer;
}
.suggest__option.is-active,
.suggest__option:hover { background: var(--c-bg-brand); }
.suggest__option mark { background: none; color: var(--c-ink); font-weight: 700; }
.suggest__option > .icon { color: var(--c-brand); }

.suggest__thumb {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: 12px;
  background: #F1F5F9;
  color: #94A3B8;
  overflow: hidden;
}
.suggest__thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.suggest__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.suggest__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest__meta { font-size: 14px; color: var(--c-subtle); }
.suggest__price { flex: none; font-weight: 700; color: var(--c-ink); white-space: nowrap; }

.suggest__all {
  flex: 1 1 100%;
  justify-content: space-between;
  border-top: 1px solid var(--c-line);
  min-height: 56px;
  padding: 0 24px;
  border-radius: 0;
  background: var(--c-bg-soft);
  font-size: 16px;
  font-weight: 600;
  color: var(--c-brand);
}
.suggest__all.is-active, .suggest__all:hover { background: var(--c-bg-hover); }

.suggest__empty { padding: 28px; font-size: 18px; color: var(--c-muted); }
.suggest__empty[hidden] { display: none; }

@media (max-width: 720px) {
  .suggest__group--categories { border-right: 0; border-bottom: 1px solid var(--c-line); }
  .suggest__option { font-size: 16px; gap: 10px; }
  .suggest__name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .suggest__price { font-size: 15px; }
  .suggest__meta { font-size: 13px; }
  .suggest__thumb { width: 44px; height: 44px; }
}

/* Trendy */
.trending {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
.trending__label { font-size: 15px; color: var(--c-muted); }
.trending__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--c-line-strong);
  border-radius: 999px;
  background: var(--c-bg);
  font-size: 15px;
  color: var(--c-text);
  text-decoration: none;
  transition: border-color .15s, color .15s;
}
.chip:hover { border-color: var(--c-brand); color: var(--c-ink); }

/* Sezónní sekce */
.season { padding: clamp(48px, 7vw, 72px) 0; }
.season > .container { display: flex; flex-direction: column; gap: 32px; }

.season__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.season__heading { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.season__title {
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -.02em;
}

.countdown {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: var(--c-red-soft);
  border: 1px solid var(--c-red-line);
  border-radius: 16px;
}
.countdown[hidden] { display: none; }
.countdown__num { font-size: 40px; font-weight: 800; line-height: 1; color: var(--c-red); font-variant-numeric: tabular-nums; }
.countdown__text { font-size: 15px; line-height: 1.35; color: var(--c-red-ink); }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 20px;
}
.tile {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-l);
  text-decoration: none;
  transition: border-color .15s, box-shadow .2s var(--ease), transform .2s var(--ease);
}
.tile:hover { border-color: var(--c-brand); box-shadow: var(--shadow-hover); transform: translateY(-2px); color: inherit; }
.tile__icon {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: var(--radius-m);
  background: var(--c-bg-brand);
  color: var(--c-brand);
}
.tile__icon .icon { width: 26px; height: 26px; }
.tile__icon--red { background: var(--c-red-soft); color: var(--c-red); }
.tile__title { font-size: 20px; font-weight: 700; color: var(--c-ink); }
.tile__text { color: var(--c-muted); }
.tile__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  font-size: 15px;
  font-weight: 600;
  color: var(--c-brand);
}
.tile__more .icon { width: 18px; height: 18px; transition: transform .2s var(--ease); }
.tile:hover .tile__more .icon { transform: translateX(3px); }

.promo { display: flex; flex-wrap: wrap; gap: 20px; }
.promo__card {
  flex: 1 1 420px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 32px;
  border-radius: 24px;
}
.promo__card--dark {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  background: var(--c-ink);
  color: #fff;
}
.promo__card--dark .promo__text { color: #D9E5C6; }
.promo__card--light { background: var(--c-bg-brand); }
.promo__card--light .btn { margin-top: 8px; }
.promo__body { flex: 1 1 240px; display: flex; flex-direction: column; gap: 12px; }
.promo__title { font-size: 26px; font-weight: 800; line-height: 1.2; }
.promo__text { color: var(--c-muted); line-height: 1.55; }
.promo__chart { width: 220px; height: 110px; fill: none; }
.promo__grid { stroke: #3B5A16; stroke-dasharray: 4 6; }
.promo__line { stroke: var(--c-accent-lime); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.promo__dot { fill: var(--c-accent-lime); }

/* Patička */
.site-footer { background: var(--c-bg-soft); border-top: 1px solid var(--c-line); }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 32px;
}
.site-footer__brand { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--c-muted); }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 15px; }
.site-footer__links a { display: inline-block; padding: 8px 0; }

/* Omezený pohyb */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Tisk */
@media print {
  .site-header, .search, .trending, .promo, .site-footer { display: none; }
}
