/* WIZZ mobile application foundation. Only the public home consumes these components. */
:root {
  --app-brand: #c2410c;
  --app-brand-pressed: #9a3412;
  --app-white: #ffffff;
  --app-canvas: #f7f7f7;
  --app-surface: #ffffff;
  --app-surface-muted: #f4f4f5;
  --app-text: #18181b;
  --app-text-muted: #606068;
  --app-border: #e4e4e7;
  --app-success: #16803d;
  --app-error: #b42318;
  --app-focus: #c2410c;
  --app-shadow: 0 2px 10px rgb(24 24 27 / 5%);
  --app-r-10: 10px;
  --app-r-14: 14px;
  --app-r-20: 20px;
  --app-s-4: 4px;
  --app-s-8: 8px;
  --app-s-12: 12px;
  --app-s-16: 16px;
  --app-s-24: 24px;
  --app-fs-xs: 12px;
  --app-fs-sm: 14px;
  --app-fs-md: 16px;
  --app-fs-lg: 20px;
  --app-fs-xl: 24px;
  --app-z-sticky: 30;
  --app-z-nav: 60;
  --app-z-sheet: 100;
  --app-z-modal: 150;
  --app-ease: cubic-bezier(.2,.7,.2,1);
  --app-fast: 120ms;
  --app-medium: 180ms;
  --app-font: 'Cairo', system-ui, Tahoma, sans-serif;
}

/* A future explicit theme switch can set data-wizz-theme="dark" on body.
   Device dark mode alone does not override the public home appearance. */
body[data-page="/"][data-wizz-theme="dark"] {
  --app-canvas: #141414;
  --app-surface: #202020;
  --app-surface-muted: #2a2a2a;
  --app-text: #f6f6f6;
  --app-text-muted: #b5b5ba;
  --app-border: #38383d;
  --app-shadow: 0 2px 10px rgb(0 0 0 / 12%);
  color-scheme: dark;
}

/* Route-scoped bridge: preserve the existing markup while older layers are retired. */
body[data-page="/"] {
  color-scheme: light;
  background: var(--app-canvas);
  color: var(--app-text);
  font-family: var(--app-font) !important;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-x: none;
  --wd-bg: var(--app-canvas);
  --wd-ink: var(--app-text);
  --wd-muted: var(--app-text-muted);
  --wd-accent: var(--app-brand);
  --w16-orange: var(--app-brand);
  --w19-brand: var(--app-brand);
  --w19-ink: var(--app-text);
  --w19-muted: var(--app-text-muted);
  --w19-canvas: var(--app-canvas);
  --w18-orange: var(--app-brand);
  --w18-ink: var(--app-text);
  --w18-bg: var(--app-canvas);
}
body[data-page="/"] :is(.wd-header, .wd-main, .wd-bottom, #wh27-bottom-nav),
body[data-page="/"] :is(button, input, textarea, select) {
  font-family: var(--app-font) !important;
}
body[data-page="/"] :is(button, a, input, select, textarea, summary) {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
body[data-page="/"] :is(button, a) {
  transition: opacity var(--app-fast) var(--app-ease), transform var(--app-fast) var(--app-ease);
}
body[data-page="/"] :is(button, a):active {
  opacity: .88;
}
body[data-page="/"] :is(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--app-focus);
  outline-offset: 3px;
}
body[data-page="/"] :is(button, a)[disabled] {
  opacity: .5;
  pointer-events: none;
}
body[data-page="/"] .wd-main {
  min-width: 0;
  max-width: 1100px;
  margin-inline: auto;
}
body[data-page="/"] :is(.wd-market-title, .wd-smart-heading, .wd-discover-heading) h2,
body[data-page="/"] .wd-fast-heading {
  color: var(--app-text);
  font-size: var(--app-fs-lg);
  font-weight: 700;
  line-height: 1.5;
}
body[data-page="/"] .wd-feature-cover picture,
body[data-page="/"] .wd-feature-cover img {
  display: block;
  width: 100%;
  height: 100%;
}
body[data-page="/"] .wd-feature-cover img {
  object-fit: cover;
}
body[data-page="/"] :is(.wd-feature-card, .wd-business-card, .wd-item-card) {
  min-width: 0;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-14);
  box-shadow: none;
}
body[data-page="/"] :is(.wd-feature-title, .wd-feature-info, .wd-item-body) {
  min-width: 0;
  overflow-wrap: anywhere;
}
body[data-page="/"] :is(.wd-more, .wd-primary, .wd-add) {
  border-radius: var(--app-r-10);
}
body[data-page="/"] .wd-filter-chip.is-active {
  color: var(--app-brand);
  border-color: var(--app-brand);
  background: var(--app-surface);
}
body[data-page="/"] :is(.wd-market-title, .wd-smart-heading) a {
  color: var(--app-brand);
}
body[data-page="/"] .wd-empty {
  color: var(--app-text-muted);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-14);
}

/* Shared markup contracts for the next home batches and future product rails. */
body[data-page="/"] .wizz-app-rail {
  min-width: 0;
  margin-block: var(--app-s-24);
}
body[data-page="/"] .wizz-app-rail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--app-s-12);
  margin-bottom: var(--app-s-12);
}
body[data-page="/"] .wizz-app-rail__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(148px, 42%);
  gap: var(--app-s-12);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--app-s-16);
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
}
body[data-page="/"] .wizz-app-rail__track::-webkit-scrollbar {
  display: none;
}
body[data-page="/"] .wizz-app-rail__track > * {
  scroll-snap-align: start;
}
body[data-page="/"] .wizz-app-skeleton {
  background: var(--app-surface-muted);
  border-radius: var(--app-r-10);
  animation: wizz-app-pulse 1.3s ease-in-out infinite alternate;
}
@keyframes wizz-app-pulse {
  from { opacity: .55; }
  to { opacity: 1; }
}
body[data-page="/"] .wizz-app-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  border-radius: var(--app-r-10);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  color: var(--app-text);
  font: 600 var(--app-fs-sm)/1.5 var(--app-font);
}
body[data-page="/"] .wizz-app-action--primary {
  background: var(--app-brand);
  border-color: var(--app-brand);
  color: var(--app-white);
}
@media (hover: hover) and (pointer: fine) {
  body[data-page="/"] .wizz-app-action--primary:hover {
    background: var(--app-brand-pressed);
  }
}
@media (max-width: 480px) {
  body[data-page="/"] .wd-main {
    padding-inline: max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-left));
  }
}
@media (prefers-reduced-motion: reduce) {
  body[data-page="/"] *,
  body[data-page="/"] *::before,
  body[data-page="/"] *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
