:root { --font-heading: "Alfa Slab One", system-ui, serif; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #f5ead8; color: #201e1d; font-family: "Figtree", system-ui, sans-serif; font-size: 17px; line-height: 1.6; }
a { color: #8c491a; text-decoration: none; }
a:hover { color: #402310; }
h1, h2, h3, h4 { font-family: "Alfa Slab One", system-ui, serif; font-weight: 400; margin: 0; line-height: 1.04; letter-spacing: -0.015em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
input, textarea { font-family: "Figtree", system-ui, sans-serif; font-size: 16px; }

/* Defensive: any class below that sets its own "display" (e.g. .cart-toast-wrap)
   would otherwise beat the browser's [hidden] rule on specificity ties. */
[hidden] { display: none !important; }

.grain { overflow-x: clip; }
.grain::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 9999; opacity: 0.4; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.28'/%3E%3C/svg%3E");
}

/* Static stand-in for a not-yet-uploaded photo. Matches the site's own
   documented empty-photo-slot look (design.md §5) rather than a broken image. */
.photo-slot {
  width: 100%; height: 100%; box-sizing: border-box; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center;
  color: inherit; font-size: 13px; font-weight: 600; line-height: 1.3;
  border: 1.5px dashed color-mix(in srgb, currentColor 55%, transparent);
  background: color-mix(in srgb, currentColor 6%, transparent);
}
.photo-slot svg { opacity: .55; }
.photo-slot span { opacity: .75; max-width: 90%; }

/* "Added to cart" confirmation toast (index.html, sklep.html) */
.cart-toast-wrap { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9998; display: flex; justify-content: center; padding: 0 20px 26px; pointer-events: none; }
.cart-toast { pointer-events: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 18px; max-width: 640px; background: #f0fae1; border: 2.5px solid #201e1d; border-radius: 255px 24px 225px 24px/24px 225px 24px 255px; padding: 18px 24px 18px 22px; box-shadow: 0 10px 0 rgba(32,30,29,0.16); }

/* ---- Mobile header / hamburger nav ---- */
header > div { position: relative; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 2.5px solid #201e1d;
  border-radius: 999px;
  background: #f5ead8;
  cursor: pointer;
  padding: 0;
  transition: background-color .3s ease;
}
.nav-toggle:hover { background: #e1eecc; }
.nav-toggle:focus-visible { outline: 2.5px solid #8c491a; outline-offset: 2px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

/* Keyboard focus visibility throughout the nav/cart controls — the design
   has no custom focus style, so give one rather than lose the browser default. */
header a:focus-visible, .nav-toggle:focus-visible { outline: 2.5px solid #8c491a; outline-offset: 2px; }

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

  header nav#site-nav {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 2px !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    padding: 10px 20px 22px !important;
    background: #f5ead8 !important;
    border-bottom: 2.5px solid #201e1d !important;
    box-shadow: 0 12px 22px rgba(46,43,37,0.14) !important;
    max-height: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: max-height .38s cubic-bezier(.22,.61,.36,1), opacity .28s ease, visibility 0s linear .38s !important;
  }
  header nav#site-nav[data-open="true"] {
    max-height: 360px !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transition: max-height .38s cubic-bezier(.22,.61,.36,1), opacity .28s ease, visibility 0s linear 0s !important;
  }
  header nav#site-nav a { padding: 14px 12px !important; border-radius: 12px !important; font-size: 17px !important; }

  header > div { gap: 12px !important; }
}

@media (max-width: 420px) {
  .cart-link .cart-word { display: none; }
  .cart-link { padding: 9px 14px !important; }
  header > div { padding-left: 16px !important; padding-right: 16px !important; }
}

/* Handwritten note in the skład section carries a fixed negative-px
   translate tuned for wide desktop columns; on narrow viewports it pushes
   the text off-screen. (The hero note next to it is positioned in % of its
   own container, same as its sibling images, so it already scales safely.) */
@media (max-width: 760px) {
  .sklad-note { transform: rotate(4deg) !important; }
}

/* Cart line (koszyk.html): the 3-column grid gets too tight for the
   name/price column on phones, wrapping "Paczka · 12 zł / szt." one
   word per line — stack the controls onto their own row instead. */
@media (max-width: 480px) {
  .cart-line { grid-template-columns: 60px 1fr !important; row-gap: 14px !important; }
  .cart-line > *:last-child { grid-column: 1 / -1 !important; justify-content: space-between !important; }
}
