/* ============================================
   MugShop — Base / Reset
   Global typography, resets, utilities
   ============================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Remove default list styles */
ul, ol {
  list-style: none;
}

/* Reset form elements */
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

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

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Remove default fieldset styles */
fieldset {
  border: none;
}

/* Reset search input styling */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
}

/* Remove number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* ── RTL Support ────────────────────────────── */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] body {
  direction: rtl;
  text-align: right;
}

/* ── Selection ──────────────────────────────── */
::selection {
  background-color: var(--color-gold);
  color: var(--color-bg);
}

::-moz-selection {
  background-color: var(--color-gold);
  color: var(--color-bg);
}

/* ── Custom Scrollbar ───────────────────────── */
::-webkit-scrollbar {
  width: var(--scrollbar-width);
  height: var(--scrollbar-width);
}

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-dark);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

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

h1 {
  font-size: var(--font-size-5xl);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tighter);
}

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

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

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

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

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

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

strong, b {
  font-weight: var(--weight-bold);
}

small {
  font-size: var(--font-size-sm);
}

/* ── Links ──────────────────────────────────── */
a:not([class]) {
  color: var(--color-gold);
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-default);
}

a:not([class]):hover {
  color: var(--color-gold-light);
}

/* ── Images ─────────────────────────────────── */
img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

img[loading="lazy"] {
  opacity: 1;
  transition: opacity var(--duration-slow) var(--ease-default);
}

img[loading="lazy"][src=""] {
  opacity: 0;
}

/* ── Container ──────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* ── Section ────────────────────────────────── */
.section {
  padding-block: var(--space-20);
}

.section--sm {
  padding-block: var(--space-12);
}

.section--lg {
  padding-block: var(--space-32);
}

/* ── Accessibility: 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;
}

.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

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

/* ── Divider ────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin-block: var(--space-6);
}

/* ── Code ───────────────────────────────────── */
code, kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.15em 0.4em;
  background: var(--color-bg-3);
  border-radius: var(--radius-sm);
  color: var(--color-gold-light);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  padding: var(--space-4);
  background: var(--color-bg-2);
  border-radius: var(--radius-md);
  overflow-x: auto;
  line-height: var(--leading-relaxed);
}

/* ── Blockquote ─────────────────────────────── */
blockquote {
  padding-inline-start: var(--space-6);
  border-inline-start: 3px solid var(--color-gold);
  font-style: italic;
  color: var(--color-gray-light);
}

/* ── Address ────────────────────────────────── */
address {
  font-style: normal;
}
