/* Coffee Time — landing
   Paleta wzięta z logo (czerń/biel) + zieleń jako sygnał "zdrowo". */

:root {
  --ink: #17150f;
  --ink-soft: #45403a;
  --muted: #78716a;
  --cream: #faf7f2;
  --cream-deep: #f2ece2;
  --line: #e3dcd0;
  --white: #ffffff;
  --green: #35714f;
  --green-dark: #275a3e;
  --green-soft: #e8f1ea;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 1px 2px rgba(23, 21, 15, .05), 0 12px 32px rgba(23, 21, 15, .07);
  --shadow-lg: 0 24px 60px rgba(23, 21, 15, .14);
  --wrap: 1180px;
  --font: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

h1, h2, h3 { line-height: 1.12; letter-spacing: -.02em; margin: 0 0 .4em; font-weight: 700; }
h1 { font-size: clamp(2.4rem, 5.6vw, 4.1rem); font-weight: 800; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--white); padding: .75rem 1.25rem;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .95rem 1.75rem; border-radius: 999px; border: 2px solid transparent;
  font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--ink); color: var(--white); }
.btn-primary:hover { background: var(--green); }
.btn-ghost { border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--white); }
.btn-sm { padding: .65rem 1.35rem; font-size: .95rem; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 247, 242, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; padding: .7rem 0; }
.brand img { height: 46px; width: auto; }
.nav { display: flex; gap: 1.75rem; margin-left: auto; }
.nav a { text-decoration: none; font-weight: 500; color: var(--ink-soft); }
.nav a:hover { color: var(--green); }

.nav-toggle {
  display: none; margin-left: auto; background: none; border: 0; cursor: pointer;
  width: 44px; height: 44px; padding: 10px; gap: 5px; flex-direction: column; justify-content: center;
}
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }

.mobile-nav { display: none; flex-direction: column; padding: .5rem 1.25rem 1.25rem; border-bottom: 1px solid var(--line); }
.mobile-nav a { padding: .7rem 0; text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--line); }

/* ---------- Hero ---------- */

.hero { padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }

.eyebrow {
  text-transform: uppercase; letter-spacing: .16em; font-size: .78rem;
  font-weight: 600; color: var(--green); margin-bottom: 1rem;
}
.accent { color: var(--green); }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 46ch; }

.hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; margin: 1.9rem 0 1.6rem; }

.hero-badges { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.hero-badges li {
  background: var(--green-soft); color: var(--green-dark);
  padding: .4rem .9rem; border-radius: 999px; font-size: .87rem; font-weight: 600;
}

.hero-figure { margin: 0; display: flex; justify-content: center; }
/* Zdjęcie jest pionowe — bez limitu wysokości rozpychałoby pierwszy ekran. */
.hero-figure img {
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  max-height: min(70vh, 620px); width: auto;
}

/* ---------- Claim strip ---------- */

.strip { background: var(--ink); color: var(--white); }
.strip-inner { padding: 1.4rem 0; text-align: center; }
.strip-claim {
  margin: 0; font-size: clamp(1.1rem, 2.3vw, 1.6rem); font-weight: 600;
  letter-spacing: .01em;
}

/* ---------- Sections ---------- */

.section { padding: clamp(3.5rem, 7vw, 6rem) 0; scroll-margin-top: 84px; }
.section-soft { background: var(--cream-deep); }
.section-dark { background: var(--ink); color: var(--cream); }

.section-head { max-width: 58ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head p { color: var(--muted); font-size: 1.08rem; margin: 0; }
.section-head-light p { color: rgba(250, 247, 242, .7); }

.cards-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }

.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 2rem;
}
.card p { margin: 0; color: var(--ink-soft); }
.card-dark {
  background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .14); color: var(--cream);
}
.card-dark p { color: rgba(250, 247, 242, .72); }

.value-card { position: relative; }
.value-num {
  display: block; font-size: .8rem; font-weight: 700; letter-spacing: .18em;
  color: var(--green); margin-bottom: .9rem;
}

/* ---------- Filters ---------- */

.filters {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  justify-content: space-between; margin-bottom: 2rem;
}
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  border: 1px solid var(--line); background: var(--white); color: var(--ink-soft);
  padding: .5rem 1.05rem; border-radius: 999px; font: inherit; font-size: .92rem;
  font-weight: 500; cursor: pointer; transition: all .15s ease;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }

.search input {
  font: inherit; padding: .65rem 1.1rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--white); min-width: 240px;
}

/* ---------- Product grid ---------- */

.product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 1.25rem;
}

.product {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.product:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

/* Kafelek ze zdjęciem.
   Zdjęcie pozycjonujemy absolutnie, bo procentowe max-height nie rozwiązuje się
   względem wysokości wyznaczonej przez aspect-ratio — wysokie zdjęcia wychodziły
   wtedy w naturalnym rozmiarze i były obcinane przez overflow. */
.product-media {
  /* Białe tło, bo zdjęcia produktów są na białym — kremowe zostawiało widoczny szew. */
  position: relative; aspect-ratio: 1; background: var(--white); overflow: hidden;
}
.product-media img {
  position: absolute; inset: 1rem;
  width: calc(100% - 2rem); height: calc(100% - 2rem);
  object-fit: contain;
}

.product-media.is-empty { background: var(--cream-deep); }
/* Selektor musi być mocniejszy niż `.product-media img` powyżej,
   inaczej `width: auto` rozdmuchuje znak wodny do pełnego kafelka. */
.product-media img.placeholder-mark {
  inset: auto; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 68px; height: auto; opacity: .22;
}

.product-body { padding: .95rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.product-cat {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); font-weight: 600;
}
/* Nazwy z cennika bywają bardzo długie — przycinamy do trzech linii,
   pełna nazwa zostaje w title. */
.product-name {
  font-size: .98rem; font-weight: 600; line-height: 1.35; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  line-clamp: 3; overflow: hidden;
}
.product-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: auto; padding-top: .5rem; }
.tag {
  font-size: .72rem; font-weight: 600; padding: .25rem .6rem; border-radius: 999px;
  background: var(--green-soft); color: var(--green-dark);
}

.empty { text-align: center; color: var(--muted); padding: 3rem 0; }

/* ---------- Machines ---------- */

.machine-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
/* Zdjęcia są pionowe 4:5 i wykadrowane pod kafelek — bez dopełnień. */
.machine-card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.machine-body { padding: 1.5rem 1.75rem 1.9rem; }

/* ---------- Contact ---------- */

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .6rem; }
.contact-list a { color: var(--green-dark); }

.contact-form {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: clamp(1.5rem, 3vw, 2.25rem);
}
.field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.field label { font-size: .9rem; font-weight: 600; }
.field input, .field textarea {
  font: inherit; padding: .7rem .9rem; border: 1px solid var(--line);
  border-radius: 12px; background: var(--cream); resize: vertical;
}
.field input:focus, .field textarea:focus { background: var(--white); }
.form-note { margin: 1rem 0 0; font-size: .92rem; color: var(--green-dark); min-height: 1.4em; }
.form-note.is-error { color: #a3402c; }

/* ---------- Footer ---------- */

.site-footer { background: var(--ink); color: rgba(250, 247, 242, .75); padding: 3rem 0; }
.footer-inner { display: grid; justify-items: center; text-align: center; gap: .6rem; }
.footer-mark { width: 72px; height: auto; filter: invert(1); opacity: .9; }
.footer-claim { font-size: 1.15rem; font-weight: 600; color: var(--cream); margin: 0; }
.footer-meta { font-size: .88rem; margin: 0; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-figure { order: -1; }
  .nav, .header-cta { display: none; }
  .nav-toggle { display: flex; }
  .mobile-nav[data-open="true"] { display: flex; }
}

@media (max-width: 560px) {
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem; }
  .filters { flex-direction: column; align-items: stretch; }
  .search input { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover, .product:hover { transform: none; }
}

/* ---------- Modal produktu ---------- */

.product {
  /* karta jest <button>, więc zerujemy domyślny wygląd przycisku */
  font: inherit; color: inherit; text-align: left; cursor: pointer; padding: 0;
  appearance: none;
}

.modal {
  border: 0; padding: 0; background: transparent;
  max-width: min(920px, calc(100vw - 2rem)); width: 100%;
  max-height: calc(100vh - 2rem);
}
.modal::backdrop { background: rgba(23, 21, 15, .55); backdrop-filter: blur(3px); }

.modal-inner {
  position: relative; display: grid; grid-template-columns: 1fr 1.1fr;
  background: var(--white); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); max-height: calc(100vh - 2rem);
}

.modal-close {
  position: absolute; top: .75rem; right: .9rem; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--white); color: var(--ink); font-size: 1.5rem; line-height: 1;
  cursor: pointer;
}
.modal-close:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }

.modal-media {
  background: var(--white); padding: 1.75rem; display: flex; flex-direction: column;
  gap: 1rem; align-items: center; justify-content: center;
}
.modal-media > img { max-height: 340px; width: auto; object-fit: contain; }
.modal-media.is-empty > img { width: 96px; opacity: .22; }

.modal-thumbs { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.modal-thumbs button {
  width: 56px; height: 56px; padding: .25rem; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: var(--white);
}
.modal-thumbs button[aria-current="true"] { border-color: var(--ink); }
.modal-thumbs img { width: 100%; height: 100%; object-fit: contain; }

.modal-body { padding: 2rem 2.25rem 2.25rem; overflow-y: auto; }
.modal-cat {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); font-weight: 600; margin: 0 0 .4rem;
}
.modal-title { font-size: 1.55rem; margin: 0 0 1rem; }
.modal-desc { color: var(--ink-soft); margin: 1rem 0 0; }
.modal-desc:empty { display: none; }

.modal-meta { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 1.25rem 0 0; }
.modal-meta dt { font-size: .85rem; color: var(--muted); }
.modal-meta dd { margin: 0; font-size: .9rem; font-weight: 500; }
.modal-cta { margin-top: 1.75rem; }

@media (max-width: 720px) {
  .modal-inner { grid-template-columns: 1fr; }
  .modal-media { padding: 2.5rem 1.25rem 1.25rem; }
  .modal-media > img { max-height: 220px; }
  .modal-body { padding: 1.5rem 1.35rem 1.75rem; }
}

.field-hint { font-size: .85rem; color: var(--muted); margin: -.5rem 0 1rem; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] {
  border-color: #a3402c; background: #fdf3f1;
}
