/* ============================================================
   JAFS Larvik – WorldClass v9
   Production polish: accessibility, clarity, rendering speed.
   Presentation only. No payment, order, SMS or webhook logic.
   ============================================================ */

:root {
  --wc9-focus: #ed4e1f;
  --wc9-ink: #17120e;
  --wc9-paper: #fffaf1;
  --wc9-muted: #706861;
  --wc9-line: rgba(42, 29, 20, .12);
  --wc9-shadow: 0 18px 46px rgba(45, 29, 18, .11);
}

html {
  scroll-padding-top: 104px;
  font-synthesis: none;
}

[id] { scroll-margin-top: 112px; }

/* One consistent, visible keyboard focus system. */
.worldclass-v9 :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--wc9-focus) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 6px rgba(237, 78, 31, .15) !important;
}

.worldclass-v9 .main-nav .nav-link[aria-current="page"] {
  color: var(--orange, #ed4e1f);
  font-weight: 900;
}

.worldclass-v9 .main-nav .nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

/* Keep primary actions comfortably tappable. */
.worldclass-v9 :where(.btn, .add-btn, .nav-toggle, .qty-btn, .filter-btn, .size-pill) {
  touch-action: manipulation;
}

.worldclass-v9 .btn:not(.btn-sm),
.worldclass-v9 .nav-toggle {
  min-height: 48px;
}

.worldclass-v9 input,
.worldclass-v9 select,
.worldclass-v9 textarea {
  accent-color: var(--orange, #ed4e1f);
}

.worldclass-v9 input:not([type="checkbox"]):not([type="radio"]),
.worldclass-v9 select {
  min-height: 48px;
}

.worldclass-v9 [aria-invalid="true"] {
  border-color: #b42318 !important;
  box-shadow: 0 0 0 4px rgba(180, 35, 24, .10) !important;
}

.worldclass-v9 .form-error[role="alert"] {
  color: #9f2018;
  font-weight: 750;
}

/* A closed mobile navigation must not leave the page scroll-locked. */
body.wc9-nav-open {
  overflow: hidden;
  overscroll-behavior: contain;
}

/* The compact quick-order row is the only category entry on the homepage. */
.page-index .quick-order-nav {
  border-bottom: 1px solid rgba(42, 29, 20, .08);
}

.page-index .quick-order-card {
  min-height: 92px;
}

/* Dedicated business route on Contact replaces the old competing order form. */
.wc9-contact-business-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(1.25rem, 4vw, 3rem);
  padding: clamp(1.4rem, 4vw, 2.4rem);
  border: 1px solid rgba(237, 78, 31, .20);
  border-radius: 28px;
  background:
    radial-gradient(circle at 92% 15%, rgba(255, 211, 76, .26), transparent 33%),
    linear-gradient(145deg, #fffdfa, #fff5e6);
  box-shadow: var(--wc9-shadow);
}

.wc9-contact-business-card h2 {
  margin: .25rem 0 .6rem;
  color: var(--wc9-ink);
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  line-height: 1.02;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.wc9-contact-business-card p:last-child {
  max-width: 60ch;
  margin: 0;
  color: var(--wc9-muted);
  line-height: 1.65;
}

.wc9-contact-business-card .btn {
  white-space: nowrap;
}

/* Native FAQ controls get a calmer, clearer hit area. */
.worldclass-v9 details > summary {
  min-height: 48px;
  cursor: pointer;
}

.worldclass-v9 details > summary::marker {
  color: var(--orange, #ed4e1f);
}

/* Do not show an empty floating cart before the customer has chosen anything. */
.worldclass-v9 #cartFloat.wc9-cart-empty {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(.96);
}

.worldclass-v9 #cartFloat:not(.wc9-cart-empty) {
  visibility: visible;
  opacity: 1;
}

/* Reserve media geometry and reduce layout shifts. */
.page-menu.worldclass-v9 .menu-item-img,
.page-menu.worldclass-v9 .menu-item-tom {
  aspect-ratio: 23 / 16;
}

.page-menu.worldclass-v9 .menu-item-img[src*="/v9-"] {
  filter: none !important;
  padding: 0 !important;
  object-fit: cover !important;
}

/* More readable text measure throughout editorial pages. */
.worldclass-v9 :where(.section-lead, .about-text, .privacy-content p, .v8-biz-lead) {
  text-wrap: pretty;
}

@media (max-width: 760px) {
  html { scroll-padding-top: 82px; }
  [id] { scroll-margin-top: 92px; }

  .wc9-contact-business-card {
    grid-template-columns: 1fr;
    border-radius: 22px;
  }

  .wc9-contact-business-card .btn {
    width: 100%;
  }

  .worldclass-v9 .main-nav.is-open {
    max-height: calc(100dvh - 82px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}

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

/* Checkout: one clear final step and truthful payment guidance. */
.wc9-checkout-head {
  margin: 0 0 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--wc9-line);
}

.wc9-checkout-head > span {
  display: inline-block;
  margin-bottom: .35rem;
  color: var(--orange, #ed4e1f);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .1em;
}

.wc9-checkout-head h2 {
  margin: 0;
  color: var(--wc9-ink);
  font-size: clamp(1.35rem, 5vw, 1.8rem);
  line-height: 1.06;
  letter-spacing: -.035em;
}

.wc9-checkout-head p {
  margin: .45rem 0 0;
  color: var(--wc9-muted);
  font-size: .84rem;
  line-height: 1.5;
}

.worldclass-v9 .delivery-opt[aria-pressed="true"] {
  box-shadow: 0 0 0 3px rgba(237, 78, 31, .12);
}

/* Use the supplied official JAFS mark consistently in header and footer. */
.worldclass-v9 .logo-mark,
.worldclass-v9.premium-site .logo-mark,
.worldclass-v9.premium-site .logo-footer .logo-mark {
  overflow: hidden;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

.worldclass-v9 .logo-mark img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
}
