/* ============================================
   Base Styles — Reset, Typography, Utilities
   ============================================ */

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

.scroll-top {
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: 200;
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 50%;
  background-color: var(--color-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity var(--transition-default), transform var(--transition-default), background-color var(--transition-default);
}

.scroll-top::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 54%;
  width: 14px;
  height: 14px;
  border-top: 3px solid var(--color-black);
  border-left: 3px solid var(--color-black);
  transform: translate(-50%, -50%) rotate(45deg);
}

.scroll-top:hover {
  background-color: #ffd05a;
}

.scroll-top--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 640px) {
  .scroll-top {
    right: 18px;
    bottom: 18px;
    width: 48px;
    height: 48px;
  }
}

body {
  font-family: var(--font-family);
  font-weight: var(--font-weight-regular);
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-body);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

img[class*="about__image"],
img[class*="hero__"],
img[class*="catalog__card-image"] {
  max-width: none;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-default);
}

a:hover {
  color: var(--color-primary);
}

ul, ol {
  list-style: none;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-extra-bold);
  color: var(--color-text-heading);
  line-height: var(--line-height-snug);
}

h1 {
  font-size: var(--font-size-5xl);
  text-transform: uppercase;
}

h2 {
  font-size: var(--font-size-4xl);
  line-height: 40px;
}

h3 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
}

p {
  margin-bottom: 0;
}

/* --- Utility Classes --- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.text-white { color: var(--color-white); }
.text-light { color: var(--color-text-light); }
.text-muted { color: var(--color-text-muted); }
.text-primary { color: var(--color-primary); }
.text-center { text-align: center; }
