@font-face {
  font-family: 'Nok Regular';
  src: url('../fonts/nok.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('../fonts/PlusJakartaSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('../fonts/PlusJakartaSans-Medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('../fonts/PlusJakartaSans-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('../fonts/PlusJakartaSans-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
img, video { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font: inherit; }
a { color: inherit; text-decoration: none; }

/* Base */
html { -webkit-text-size-adjust: 100%; }

html.modal-open,
body.modal-open {
  overflow: hidden;
  overscroll-behavior: contain;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-primary);
  background: var(--color-background);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Focus ring -- never use outline: none */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-button-sm);
}

/* Exception: FocusOnNavigate moves focus to the non-interactive page h1 for
   screen reader announcements; a visible ring there is noise. */
h1:focus {
  outline: none;
}

/* Keep viewport-fixed menus and modals anchored to the viewport, including
   while the page enters. A transform here makes main their containing block.
   Only fill backwards so the animation also releases its stacking context. */
@keyframes page-enter {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.page-enter {
  animation: page-enter var(--transition-normal) ease backwards;
}

/* Opacity-only fade for swapping a content-shaped skeleton to real content.
   Because the skeletons match the real layout dimensions, no positional shift
   occurs; this only softens the visual swap. The global prefers-reduced-motion
   block below neutralizes it for users who opt out. */
@keyframes content-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.content-fade-in {
  /* Lists can contain dialogs; release the opacity stacking context once the
     fade ends so those dialogs can cover the app chrome. */
  animation: content-fade-in var(--transition-normal) ease backwards;
}

/* Heading utilities — shared typographic scale for page and section titles.
   Compose with a page-specific BEM class for layout (margin, max-width, etc.):
   e.g. <h1 class="contact-page__title heading-page"> */
.heading-page {
  font-family: var(--font-brand);
  font-size: var(--text-5xl);
  font-weight: var(--weight-regular);
  color: var(--color-text-primary);
  letter-spacing: var(--font-brand-letter-spacing);
  margin: 0;
}

.heading-section {
  font-family: var(--font-body);
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  color: var(--color-text-primary);
  margin: 0;
}

/* Chip utility — global so raw <button class="chip"> works outside the Chip component */
.chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-chip);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  cursor: default;
  background: var(--color-surface);
  color: var(--color-text-muted);
  box-shadow: inset 0 0 0 1px var(--color-border);
}
button.chip,
a.chip,
.chip--interactive {
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
button.chip:hover,
a.chip:hover,
.chip--interactive:hover {
  background: var(--color-surface-accent);
}
.chip--active {
  background: var(--color-primary);
  color: white;
  box-shadow: none;
}
button.chip--active:hover,
a.chip--active:hover,
.chip--interactive.chip--active:hover {
  background: var(--color-primary-dark);
}

/* Search suggestion row content — global so ItemTemplate markup from any host works */
.search-bar__option-content {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  min-width: 0;
}

.search-bar__option-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  margin-top: 0.15rem;
  color: var(--color-primary);
  flex: 0 0 auto;
  font-size: 1rem;
}

.search-bar__option-text {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.search-bar__option-text span {
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.search-bar__option-text small {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

/* Button utility — global so <a class="btn"> works outside the Button component */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-button);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-extrabold);
  cursor: pointer;
  transition: background var(--transition-fast), opacity var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--full-width { width: 100%; }
.btn--primary { background: var(--color-primary); color: white; }
.btn--primary:hover:not(:disabled) { background: var(--color-primary-dark); }
.btn--secondary {
  background: var(--color-surface);
  color: var(--color-primary-dark);
  box-shadow: inset 0 0 0 1px var(--color-border);
}
.btn--secondary:hover:not(:disabled) { background: var(--color-surface-accent); }
.btn--ghost { background: transparent; color: var(--color-primary); }
.btn--ghost:hover:not(:disabled) { background: var(--color-primary-soft); }
.btn__icon { display: inline-flex; align-items: center; font-size: 1.125rem; }

/* Icons RenderFragments — global because scoped CSS does not attach to static fragments. */
.icon {
  display: block;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

/* Skeleton shimmer — uses composited translateX on a ::after pseudo-element */
@keyframes shimmer {
  to { transform: translateX(100%); }
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--color-surface-accent);
  border-radius: var(--radius-button-sm);
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgb(255 255 255 / 0.35) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s infinite;
}

/* Spin animation for Spinner component */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Custom scrollbar (also in scrollbar.css — kept here so it always ships with base.css) */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb, #c9a99a) var(--scrollbar-track, #fff1ed);
}

@supports not (scrollbar-color: auto) {
  *::-webkit-scrollbar {
    width: var(--scrollbar-size, 8px);
    height: var(--scrollbar-size, 8px);
  }

  *::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
  }

  *::-webkit-scrollbar-track {
    background: var(--scrollbar-track, #fff1ed);
  }

  *::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb, #c9a99a);
    border-radius: var(--scrollbar-radius, 9999px);
  }

  *::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover, #f4846e);
  }

  *::-webkit-scrollbar-thumb:active {
    background-color: var(--scrollbar-thumb-active, #d95f4c);
  }

  *::-webkit-scrollbar-corner {
    background: transparent;
  }

  .scroll-inset::-webkit-scrollbar-thumb {
    border: var(--scrollbar-inset, 0.5rem) solid transparent;
    background-clip: padding-box;
  }
}

.scroll-inset {
  scrollbar-gutter: stable;
  padding-inline-end: var(--space-1, 0.25rem);
}

/*
 * Use with rounded containers:
 *   .scroll-clip { border-radius; overflow: hidden; }
 *   .scroll-clip > .scroll-inset { overflow: auto; }
 * Scrollbars cannot be radius-aware via scrollbar-color alone;
 * the outer clip is what keeps them inside rounded corners (esp. mobile).
 */
.scroll-clip {
  overflow: hidden;
}
.offer-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

@media (min-width: 640px) {
  .offer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    grid-auto-flow: row dense;
    gap: var(--space-4);
  }
}

@media (min-width: 1024px) {
  .offer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
