/* Minimal modern reset */
*, *::before, *::after {
  box-sizing: border-box;
}

/* overflow-x: hidden on both is a hard stop on the whole page ever
   scrolling sideways — any one element a little too wide for a narrow
   phone screen (a wide table, a long unbreakable string) gets clipped
   instead of dragging the entire page into a horizontal scroll. Elements
   that intentionally scroll sideways (e.g. .compare-table-wrap) still do,
   inside their own contained overflow-x: auto — this only guards the page
   as a whole. */
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Mobile-only 10px inset on the whole page — confirmed by direct test to
   fix real-device "content touches the edge" reports that .container's
   own padding wasn't reliably covering. Desktop/tablet already look right
   off .container's padding alone, so this only applies on phones.
   Full-bleed bands (header/footer chrome, hero banners) opt back OUT to
   100% width via .full-bleed-mobile below — they should still touch the
   edge; only the padded content living inside .container should not. */
@media (max-width: 640px) {
  body {
    padding: 0 10px;
  }

  .full-bleed-mobile {
    margin-left: -10px;
    margin-right: -10px;
  }
}

img, picture, svg {
  display: block;
  max-width: 100%;
}

ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

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

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

h1, h2, h3, h4, h5, h6, p, figure {
  margin: 0;
}

/* Off-screen until focused (keyboard Tab from the very top of the page),
   then jumps into view above everything else — standard "skip to content"
   pattern so keyboard/screen-reader users aren't forced through the full
   nav (and, on the storefront, the "Shop Rugs" mega-menu) on every page. */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 200;
  background: var(--color-forest);
  color: var(--color-ivory);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.skip-link:focus {
  top: var(--space-4);
}

/* Brand-themed scrollbar (Firefox + WebKit/Chromium/Edge). */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-forest) var(--color-sand);
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--color-sand);
}

::-webkit-scrollbar-thumb {
  background-color: var(--color-forest);
  border-radius: var(--radius-lg);
  border: 3px solid var(--color-sand);
}

::-webkit-scrollbar-thumb:hover {
  background-color: #1E332B;
}
