/* ==========================================================
   Hoki Shop – alap: fontok, tokenek, reset, tipográfia, gombok, űrlapok
   ========================================================== */

/* --- Saját fontok (assets/fonts, SIL OFL) ----------------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/inter-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/inter-var-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/anton-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/anton-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Metrikailag igazított tartalék, hogy a betöltés alatt ne ugorjon az elrendezés. */
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial');
  size-adjust: 107.12%;
  ascent-override: 90.49%;
  descent-override: 22.56%;
  line-gap-override: 0%;
}

/* --- Tokenek ---------------------------------------------- */
:root {
  /* Márka */
  --brand-black: #0D0D0D;
  --brand-black-soft: #1A1A1A;
  --brand-white: #FFFFFF;
  --accent: #D62828;
  --accent-hover: #B91F1F;
  --accent-light: #FBEAEA;

  /* Szöveg és felületek */
  --ink: #0D0D0D;
  --ink-2: #5B6470;
  --ink-3: #8A9198;
  --surface: #FFFFFF;
  --surface-2: #F5F7F8;
  --surface-3: #EDF0F2;
  --line: #E4E7E9;
  --line-strong: #0D0D0D;
  --success: #1B873F;
  --success-light: #E8F4EC;
  --warning: #B45309;
  --warning-light: #FEF3E2;

  /* Régi nevek (a legacy.css és a GLS bővítmény használja) */
  --text-main: var(--ink);
  --text-muted: var(--ink-2);
  --text-light: var(--ink-3);
  --bg-main: var(--surface);
  --bg-subtle: var(--surface-2);
  --bg-card: var(--surface);
  --bg-header: rgba(255, 255, 255, 0.97);
  --bg-footer: var(--brand-black);
  --border-color: var(--line);
  --border-focus: var(--ink);

  /* Árnyék */
  --shadow-sm: 0 1px 2px rgba(13, 13, 13, 0.04), 0 2px 8px rgba(13, 13, 13, 0.05);
  --shadow-md: 0 4px 16px rgba(13, 13, 13, 0.08);
  --shadow-lg: 0 16px 40px rgba(13, 13, 13, 0.14);
  --shadow-up: 0 -8px 24px rgba(13, 13, 13, 0.08);

  /* Lekerekítés */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* Térköz */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 56px;
  --space-10: 72px;

  /* Betű */
  --font-display: 'Anton', Impact, 'Arial Narrow', sans-serif;
  --font-ui: 'Inter', 'Inter Fallback', system-ui, -apple-system, sans-serif;
  --font-body: var(--font-ui);
  --font-title: var(--font-ui);
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  --fs-xl: clamp(1.375rem, 1.1rem + 1.2vw, 1.75rem);
  --fs-2xl: clamp(1.75rem, 1.3rem + 2vw, 2.5rem);
  --fs-display: clamp(2.25rem, 1.5rem + 4vw, 4rem);

  /* Elrendezés */
  --container: 1280px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 76px;
  --tabbar-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tap: 44px;

  /* Mozgás */
  --dur-fast: 150ms;
  --dur: 240ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: all var(--dur) var(--ease-out);
}

@media (min-width: 1024px) {
  :root {
    --header-h: 88px;
  }
}

/* Mobilon (≤600px) a WP admin sáv nem fix, elgördül: a ragadós elemek a tetejére tapadnak */
@media (max-width: 600px) {
  html {
    --wp-admin--admin-bar--height: 0px !important;
  }
}

/* --- Reset ------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

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

body {
  min-width: 320px;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--surface-2);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

/* iOS ne nagyítson a mezőkre */
input,
select,
textarea {
  font-size: max(16px, 1rem);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-ui);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.display,
.hoki-display {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1;
}

p,
ul,
ol {
  margin: 0;
}

/* --- Hozzáférhetőség -------------------------------------- */
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus,
.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100001;
  width: auto;
  height: auto;
  padding: 12px 16px;
  clip: auto;
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-weight: 600;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  border-radius: 4px;
}

.on-dark :focus-visible,
.on-dark:focus-visible {
  outline-color: var(--surface);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Konténer --------------------------------------------- */
.hoki-container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* --- Gombok ----------------------------------------------- */
.btn,
.hoki-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 var(--space-6);
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  background: var(--ink);
  color: var(--surface);
  font-size: var(--fs-base);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}

.btn:hover,
.hoki-btn:hover {
  background: var(--accent);
  color: var(--surface);
}

.btn:active,
.hoki-btn:active {
  transform: translateY(1px);
}

.btn--primary,
.hoki-btn--primary {
  background: var(--accent);
}

.btn--primary:hover,
.hoki-btn--primary:hover {
  background: var(--accent-hover);
}

.btn--outline,
.hoki-btn--outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--ink);
}

.btn--outline:hover,
.hoki-btn--outline:hover {
  background: var(--ink);
  color: var(--surface);
}

.btn--ghost,
.hoki-btn--ghost {
  background: var(--surface-2);
  color: var(--ink);
}

.btn--ghost:hover,
.hoki-btn--ghost:hover {
  background: var(--surface-3);
  color: var(--ink);
}

.btn--sm,
.hoki-btn--sm {
  min-height: 40px;
  padding-inline: var(--space-4);
  font-size: var(--fs-sm);
}

.btn--lg,
.hoki-btn--lg {
  min-height: 54px;
  font-size: var(--fs-md);
}

.btn--block,
.hoki-btn--block {
  display: flex;
  width: 100%;
}

.btn:disabled,
.btn[aria-disabled='true'],
.hoki-btn:disabled,
.hoki-btn[aria-disabled='true'] {
  background: var(--line);
  color: var(--ink-3);
  border-color: transparent;
  cursor: not-allowed;
  transform: none;
}

.btn[aria-busy='true'],
.hoki-btn[aria-busy='true'] {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn[aria-busy='true']::after,
.hoki-btn[aria-busy='true']::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: hoki-spin 0.7s linear infinite;
}

@keyframes hoki-spin {
  to {
    transform: rotate(360deg);
  }
}

/* WooCommerce gombok ugyanezt az alapot kapják */
.woocommerce .button,
.woocommerce button.button,
.woocommerce a.button,
.woocommerce input.button,
.wc-block-components-button,
.wp-element-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 var(--space-6);
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  background: var(--ink);
  color: var(--surface);
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-fast), color var(--dur-fast);
}

.woocommerce .button:hover,
.woocommerce button.button:hover,
.woocommerce a.button:hover,
.wc-block-components-button:hover,
.wp-element-button:hover {
  background: var(--accent);
  color: var(--surface);
}

.woocommerce .button.alt,
.woocommerce button.button.alt,
.woocommerce a.button.alt,
.single_add_to_cart_button,
.wc-block-components-checkout-place-order-button {
  background: var(--accent);
}

.woocommerce .button.alt:hover,
.single_add_to_cart_button:hover,
.wc-block-components-checkout-place-order-button:hover {
  background: var(--accent-hover);
}

.woocommerce .button.disabled,
.woocommerce .button:disabled,
.single_add_to_cart_button.disabled {
  background: var(--line) !important;
  color: var(--ink-3) !important;
  cursor: not-allowed;
  opacity: 1;
}

/* --- Chipek ----------------------------------------------- */
.chip,
.hoki-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}

.chip:hover,
.hoki-chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.chip.is-active,
.chip[aria-current],
.hoki-chip.is-active,
.hoki-chip[aria-current] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}

.chip--accent,
.hoki-chip--accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--surface);
}

/* --- Jelvények -------------------------------------------- */
.badge,
.hoki-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-xs);
  background: var(--accent);
  color: var(--surface);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.badge--dark,
.hoki-badge--dark {
  background: var(--ink);
}

.badge--soft,
.hoki-badge--soft {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
}

.badge--success,
.hoki-badge--success {
  background: var(--success-light);
  color: var(--success);
}

.hoki-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--surface);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1;
}

/* --- Űrlapmezők ------------------------------------------- */
.hoki-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hoki-field > label,
.hoki-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
}

.hoki-input,
.hoki-field input:not([type='checkbox']):not([type='radio']),
.hoki-field select,
.hoki-field textarea,
.woocommerce .input-text,
.woocommerce select,
.woocommerce textarea {
  width: 100%;
  min-height: 50px;
  padding: 0 var(--space-4);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.3;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.woocommerce textarea,
.hoki-field textarea {
  min-height: 120px;
  padding-block: var(--space-3);
  resize: vertical;
}

.hoki-input:focus,
.hoki-field input:focus,
.hoki-field select:focus,
.hoki-field textarea:focus,
.woocommerce .input-text:focus,
.woocommerce select:focus,
.woocommerce textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(13, 13, 13, 0.12);
}

.hoki-field.has-error input,
.hoki-input[aria-invalid='true'] {
  border-color: var(--accent);
}

.hoki-field__hint {
  font-size: var(--fs-xs);
  color: var(--ink-2);
}

.hoki-field__error {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--accent);
}

select,
.woocommerce select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230D0D0D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
}

input[type='checkbox'],
input[type='radio'] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  flex: none;
}

/* --- Segédosztályok --------------------------------------- */
.hoki-eyebrow {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.hoki-team {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.hoki-muted {
  color: var(--ink-2);
}

.hoki-price,
.price,
.woocommerce-Price-amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hoki-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.hoki-scroll-row {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.hoki-scroll-row::-webkit-scrollbar {
  display: none;
}

.hoki-scroll-row > * {
  flex: none;
  scroll-snap-align: start;
}

.hoki-skeleton {
  background: linear-gradient(90deg, var(--line) 25%, var(--surface-2) 50%, var(--line) 75%);
  background-size: 200% 100%;
  animation: hoki-shimmer 1.2s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes hoki-shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@media (max-width: 1023px) {
  .hoki-hide-mobile {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  .hoki-hide-desktop {
    display: none !important;
  }
}

/* --- Oldalváltás-animáció (progresszív) ------------------ */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 180ms;
  }

  /* A váz (fejléc, fülsáv) nem mozdul */
  .hoki-header {
    view-transition-name: hoki-header;
  }

  .hoki-tabbar {
    view-transition-name: hoki-tabbar;
  }

  ::view-transition-group(hoki-header),
  ::view-transition-group(hoki-tabbar) {
    animation-duration: 0s;
  }

  /* A kattintott kártyakép a termékoldal első képévé alakul */
  .hoki-product__gallery .woocommerce-product-gallery__image:first-child img {
    view-transition-name: hoki-pimg;
  }

  ::view-transition-old(hoki-pimg),
  ::view-transition-new(hoki-pimg) {
    animation-duration: 260ms;
    object-fit: cover;
    mix-blend-mode: normal;
  }
}
