/* ============================================
   FASHION STORE — Base Styles
   Reset, Typography, Global Defaults
   ============================================ */

/* ── Modern Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

@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;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  position: relative;
}

main {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body.cart-open {
  overflow: hidden;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-regular);
  line-height: var(--leading-tight);
  color: var(--color-text-heading);
  letter-spacing: var(--tracking-tight);
}

h1 {
  font-size: var(--text-5xl);
  line-height: 1.1;
}

h2 {
  font-size: var(--text-4xl);
}

h3 {
  font-size: var(--text-3xl);
}

h4 {
  font-size: var(--text-2xl);
}

h5 {
  font-size: var(--text-xl);
}

h6 {
  font-size: var(--text-lg);
}

p {
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--color-text-primary);
}

/* ── Images ── */
img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

img {
  font-style: italic; /* alt text styling */
}

/* ── Lists ── */
ul, ol {
  list-style: none;
}

/* ── Buttons ── */
button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  outline: none;
}

button:focus-visible {
  outline: 2px solid var(--color-text-primary);
  outline-offset: 2px;
}

/* ── Form Elements ── */
input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: 1px solid var(--color-border-medium);
  border-radius: var(--radius-md);
  background: var(--color-bg-surface);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-out);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--color-text-primary);
}

/* ── Price Typography ── */
.price,
.product-price,
[data-price] {
  font-variant-numeric: tabular-nums;
}

/* ── Utility: Screen Reader Only ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ── Selection ── */
::selection {
  background: rgba(31, 27, 24, 0.12);
  color: var(--color-text-heading);
}

/* ── Scrollbar (Webkit) ── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-medium);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* ── Skip Link for Keyboard Accessibility ── */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--color-text-primary);
  color: var(--color-text-inverse);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  z-index: 1000;
  transition: top var(--duration-fast) var(--ease-out);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-4);
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* ── Focus Visible Ring (WCAG 2.1 AA) ── */
:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}
