/* PredajDiviny – verejný HTML web (N08). Tokeny ako appka (lib/theme/app_theme.dart). */
:root {
  --brown: #5C4B44; --gold: #D9A224; --forest: #3E6B48;
  --bg: #FBF8F4; --surface: #FFFFFF; --text: #2A2320; --muted: #6E625C; --line: #E6DDD5;
  --link: #3E6B48; --notice-bg: #FFF4D6; --notice-text: #5C4300;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181D18; --surface: #222822; --text: #ECE7E2; --muted: #B3A9A2; --line: #384038;
    --link: #8FC79A; --notice-bg: #3A3220; --notice-text: #F3DFA6;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--link); }
a:focus-visible, .btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.top {
  background: var(--brown); color: #fff; display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px 24px; padding: 10px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 18px; }
.brand img { border-radius: 8px; background: #fff; }
.main ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; }
.main a { color: #fff; text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.main a:hover, .main a[aria-current] { border-bottom-color: var(--gold); }
main { max-width: 760px; margin: 0 auto; padding: 16px 16px 48px; }
h1 { font-size: 28px; line-height: 1.25; margin: 8px 0 12px; color: var(--text); }
h2 { font-size: 20px; margin: 28px 0 8px; }
.lead { font-size: 18px; color: var(--muted); }
.meta { color: var(--muted); font-size: 14px; }
.notice { background: var(--notice-bg); color: var(--notice-text); padding: 12px 14px; border-radius: 10px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 4px; }
.cards { list-style: none; padding: 0; display: grid; gap: 12px; }
.cards li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.cards li > a { font-weight: 600; font-size: 17px; }
.cards p { margin: 4px 0 0; }
.link.doc a::before { content: "📄 "; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 999px; background: var(--forest); color: #fff;
  text-decoration: none; font-weight: 600;
}
.btn.alt { background: transparent; color: var(--link); border: 1px solid var(--line); }
figure { margin: 16px 0; }
figure img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); }
.related { margin-top: 32px; padding-top: 8px; border-top: 1px solid var(--line); }
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; text-align: center; padding: 16px; }
@media (min-width: 900px) { h1 { font-size: 34px; } }

/* ---- ponuky (N08-P2) ---- */
.badge { display: inline-block; font-size: 13px; font-weight: 600; padding: 1px 10px; border-radius: 999px; vertical-align: 2px; }
.badge.ok { background: #E3F1E4; color: #1E5E22; }
.badge.warn { background: #FFF0D6; color: #8A4B00; }
.badge.off { background: #FBE3E3; color: #8E1C1C; }
@media (prefers-color-scheme: dark) {
  .badge.ok { background: #1F3A22; color: #A9DDAE; }
  .badge.warn { background: #3D2C10; color: #F5C77E; }
  .badge.off { background: #3E1F1F; color: #F2A8A8; }
}
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 16px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }
.pre { white-space: pre-line; }

/* ---- stránka s appkou vedľa obsahu (PD_WEB_EMBED_APP, embed.js) ---- */
.pd-embed { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.pd-embed .pd-shell { flex: 1; min-height: 0; display: flex; }
.pd-embed #pd-content { width: clamp(320px, 40vw, 440px); flex: none; overflow-y: auto; max-width: none; margin: 0; padding: 16px 16px 0; border-right: 1px solid var(--line); background: var(--bg); }
.pd-embed #pd-app { flex: 1; position: relative; min-width: 0; }
.pd-embed .foot { margin: 32px -16px 0; }
@media (max-width: 839px) {
  .pd-embed { height: auto; overflow: visible; display: block; }
  .pd-embed .pd-shell { display: flex; flex-direction: column; }
  /* Rovnaká výška mapy ako v appke na mobile (32 %, 200–320 px). */
  .pd-embed #pd-app { order: -1; height: 32vh; min-height: 200px; max-height: 320px; flex: none; position: sticky; top: 0; z-index: 1; }
  .pd-embed #pd-content { width: auto; border-right: 0; overflow: visible; }
}
/* Súkromné okno appky (účet, filtre, prihlásenie): appka na celú plochu. */
.pd-embed.pd-flutter-full .top, .pd-embed.pd-flutter-full #pd-content { display: none; }
.pd-embed.pd-flutter-full #pd-app { position: fixed; inset: 0; height: auto; min-height: 0; max-height: none; z-index: 2; }

/* Výber z viacerých bodov na jednom mieste mapy (embed.js choices). */
.choices { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px 8px; margin: 8px 0 16px; }
.choices h2 { margin-top: 12px; }
.choices .close { position: absolute; top: 6px; right: 8px; border: 0; background: none; color: var(--muted); font-size: 24px; cursor: pointer; }

/* ---- predajcovia, okresy, recepty (N08-P3) ---- */
.toc { font-size: 14px; line-height: 1.9; }
.contacts { padding-left: 18px; }
.rich p { white-space: pre-line; }
.rich h2 { margin-top: 24px; }
.recipes li { overflow: hidden; }
.recipes .thumb { float: right; margin: 0 0 6px 12px; border-radius: 8px; object-fit: cover; }
figure.video a { position: relative; display: inline-block; }
figure.video span { position: absolute; left: 12px; bottom: 12px; background: rgba(0,0,0,.7); color: #fff; padding: 4px 10px; border-radius: 999px; font-weight: 600; }

/* Prihlásenie v hlavičke – prepne stránku na čistú appku (embed.js, appMode). */
.top .login { margin-left: auto; color: #fff; text-decoration: none; font-weight: 600; padding: 6px 14px; border: 1px solid rgba(255,255,255,.6); border-radius: 999px; }
.top .login:hover { background: rgba(255,255,255,.12); }

/* Menu: na širokom displeji všetky položky, na mobile Ponuky, Predajcovia,
   Prihlásiť a ☰ s ostatnými – jeden riadok. */
.top .login .short, .top .more { display: none; }
.top .more { position: relative; }
.top .more summary { list-style: none; cursor: pointer; color: #fff; font-size: 24px; line-height: 1; padding: 4px 8px; border-radius: 8px; }
.top .more summary::-webkit-details-marker { display: none; }
.top .more[open] summary { background: rgba(255,255,255,.15); }
.top .more ul { position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; list-style: none; margin: 0; padding: 6px 0; min-width: 180px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.top .more a { display: block; padding: 10px 16px; color: var(--text); text-decoration: none; }
.top .more a[aria-current] { color: var(--link); font-weight: 600; }
@media (max-width: 839px) {
  .top { flex-wrap: nowrap; gap: 12px; padding: 8px 12px; }
  .brand span { display: none; }
  .main li.extra { display: none; }
  .main ul { flex-wrap: nowrap; gap: 14px; }
  .top .login { margin-left: auto; padding: 5px 12px; white-space: nowrap; }
  .top .login .long { display: none; }
  .top .login .short { display: inline; }
  .top .more { display: block; }
}
/* Mapa na celú obrazovku (ikona v mape, PublicEmbed.setMapFullscreen). */
.pd-embed.pd-map-full #pd-app { position: fixed; inset: 0; height: auto; min-height: 0; max-height: none; z-index: 5; }
/* Flutter na dotykových zariadeniach vloží do <body> neviditeľné tlačidlo
   „Enable accessibility“ cez celú stránku – zachytilo by ťuknutia na HTML
   hlavičku a odkazy. S HTML panelom je obsah prístupný priamo v DOM, preto
   ho tu vypneme; v čistom Flutter režime ostáva. */
body.pd-embed:not(.pd-flutter-full) > flt-semantics-placeholder { pointer-events: none; }

button.btn { font: inherit; cursor: pointer; border: 1px solid var(--line); }
.share-url { display: block; width: 100%; margin-top: 8px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
