/* higgy – vlastné formulárové prvky (js/forms.js) + zjednotenie natívnych detailov polí */

/* ---------- Spoločné: žiadny natívny vzhľad prehliadača ---------- */
.hg input:not([type="checkbox"]):not([type="radio"]), .hg textarea, .hg select, .s-ov input, .hs-btn { -webkit-appearance: none; appearance: none; }
.hg input, .hg textarea, .hg select, .hg button, .s-ov input, .s-ov button, .hs-panel { -webkit-tap-highlight-color: transparent; }
.hg, .s-ov { accent-color: var(--ink); caret-color: var(--orange); }
.hg ::selection, .s-ov ::selection, .hs-panel ::selection { background: rgba(247, 137, 47, .28); color: inherit; }
.co-in::placeholder, .co-code::placeholder { color: #8A8590; opacity: 1; }
.hg input::-webkit-inner-spin-button, .hg input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.hg input[type="number"] { -moz-appearance: textfield; }
.hg input::-webkit-contacts-auto-fill-button, .hg input::-webkit-credentials-auto-fill-button { visibility: hidden; pointer-events: none; position: absolute; right: 0; }
.hg input::-ms-clear, .hg input::-ms-reveal { display: none; }

/* Automatické vypĺňanie: bez modrého / žltého pozadia prehliadača (necháme farby poľa) */
.hg input:-webkit-autofill, .hg input:-webkit-autofill:hover, .hg input:-webkit-autofill:focus,
.hg textarea:-webkit-autofill, .hg select:-webkit-autofill {
  -webkit-text-fill-color: var(--ink); caret-color: var(--orange);
  transition: background-color 600000s 0s, color 600000s 0s;
}
.hg input:autofill { background-image: none; }
.hg-news input:-webkit-autofill, .hg-news input:-webkit-autofill:hover, .hg-news input:-webkit-autofill:focus { -webkit-text-fill-color: var(--cream); }

/* ---------- Select ---------- */
.hs { position: relative; display: block; min-width: 0; }
.hs-native { display: none !important; }
.hs-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; text-align: left; cursor: pointer;
  /* vzhľad (výška, pozadie, okraj, písmo) preberá z tried pôvodného selectu, napr. .co-in */
}
.hs-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-chev { flex: none; margin-right: -2px; color: var(--ink); transition: transform .25s var(--ease); }
.hs-btn.is-open .hs-chev, .is-open > .sort-chev { transform: rotate(180deg); }
.hs-btn:disabled { opacity: .55; cursor: not-allowed; }
.hs-btn.co-in:hover { box-shadow: inset 0 0 0 1.5px rgba(29, 27, 38, .4); }
.hs-btn.co-in:focus, .hs-btn.co-in.is-open { box-shadow: inset 0 0 0 2px var(--ink); }
.hs-btn.co-in[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--red); }
.hs-btn.co-in:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* priehľadné tlačidlo cez vlastný obal (.sort) */
.hs-hit { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
.hs-hit:focus-visible { outline: none; }
.sort.is-open { box-shadow: inset 0 0 0 1.5px var(--ink); }

/* zoznam – vkladá sa do <body>, pozícia fixed (nevyreže ho overflow lišty filtrov) */
.hs-panel {
  position: fixed; z-index: 1000; box-sizing: border-box; max-width: calc(100vw - 32px); padding: 6px; overflow-y: auto; overscroll-behavior: contain;
  border-radius: 18px; background: #FFFFFF; color: var(--ink); box-shadow: 0 0 0 1px rgba(29, 27, 38, .08), 0 18px 48px -12px rgba(29, 27, 38, .28), 0 4px 12px -4px rgba(29, 27, 38, .12);
  font: 500 16px/1.35 'Figtree', system-ui, sans-serif; outline: none; scrollbar-width: thin; scrollbar-color: rgba(29, 27, 38, .25) transparent;
  transform-origin: top center; animation: hsIn .18s var(--ease);
}
.hs-panel.is-up { transform-origin: bottom center; }
.hs-panel[hidden] { display: none; }
.hs-panel::-webkit-scrollbar { width: 10px; }
.hs-panel::-webkit-scrollbar-thumb { border: 3px solid #FFFFFF; border-radius: 999px; background: rgba(29, 27, 38, .25); }
@keyframes hsIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.hs-panel.is-up { animation-name: hsInUp; }
@keyframes hsInUp { from { opacity: 0; transform: translateY(4px) scale(.98); } }

.hs-opt { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px 0 14px; border-radius: 12px; cursor: pointer; white-space: nowrap; user-select: none; -webkit-user-select: none; }
.hs-opt span { flex: 1; min-width: 0; }
.hs-opt.is-active { background: #EFEAE2; }
.hs-opt[aria-selected="true"] { font-weight: 700; }
.hs-check { flex: none; color: var(--orange); opacity: 0; }
.hs-opt[aria-selected="true"] .hs-check { opacity: 1; }
.hs-opt[aria-disabled="true"] { color: var(--muted); opacity: .55; cursor: default; }
.hs-panel:focus-visible .hs-opt.is-active { box-shadow: inset 0 0 0 2px var(--ink); }

/* ---------- Textarea: rastie s textom, bez natívneho úchytu ---------- */
.hg textarea.hs-grow { resize: none; overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .hs-panel { animation: none; }
  .hs-chev, .sort-chev { transition: none; }
}

/* ---------- Newsletter v pätičke: vlastná chyba namiesto bubliny prehliadača ---------- */
.hg-news label { position: relative; }
.hg-news-err { position: absolute; top: calc(100% + 6px); left: 18px; font-size: 14px; font-weight: 500; line-height: 1.3; color: #FFA89C; }
.hg-news:has(.hg-news-err:not(:empty)) { margin-bottom: 26px; }
.hg-news-err:empty { display: none; }
.hg-news input[aria-invalid="true"] { border-color: #FFA89C; }
