/* ================================================
   HERITAGE KNITTINGS - Base Layout (Scandi-Luxury)
   ================================================ */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  background-color: var(--bg-body);
  transition: background-color 0.5s ease, color 0.5s ease;
  overflow-x: hidden;
}

/* Texture Overlay (Optional, handled via opacity var) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url('../assets/noise.svg');
  opacity: var(--texture-opacity, 0.03);
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: multiply;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5em;
  color: var(--text-heading);
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  text-align: center;
  margin-bottom: 1rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-family: var(--font-accent, serif);
  font-style: italic;
  text-align: center;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 4rem;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 16px 32px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.btn--primary {
  background-color: var(--btn-bg);
  color: var(--btn-text);
}

.btn--primary:hover {
  background-color: var(--btn-hover-bg);
  color: var(--btn-hover-text);
}

.btn--outline {
  border-color: var(--btn-bg);
  color: var(--btn-bg);
}

.btn--outline:hover {
  background-color: var(--btn-bg);
  color: var(--btn-text);
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  transition: background 0.5s ease;
}

.header__top {
  background-color: var(--accent-dark);
  color: var(--white);
  text-align: center;
  padding: 8px;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.header__main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header__nav {
  display: flex;
  gap: 30px;
}

.nav__link {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}

.nav__link:hover {
  color: var(--accent);
}

.header__logo {
  flex-grow: 1;
  text-align: center;
}

.header__logo img {
  height: 80px;
  /* Increased from 40px */
  width: auto;
  margin: 0 auto;
  transition: height 0.3s ease;
}

.header.scrolled .header__logo img {
  height: 60px;
  /* Slight shrink on scroll */
}

.header__icons {
  display: flex;
  gap: 20px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  color: var(--white);
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-color: var(--hero-overlay);
  /* Fallback */
  z-index: -1;
}

.hero__content {
  max-width: 800px;
  padding: 20px;
  z-index: 1;
}

.hero__title {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
  color: var(--white);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero__subtitle {
  font-size: 1.2rem;
  margin-bottom: 40px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.9);
}

/* ---------- Collection Grid ---------- */
.collection {
  padding: 100px 40px;
  max-width: 1600px;
  margin: 0 auto;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}

.product-card {
  position: relative;
  cursor: pointer;
}

.product__image-wrap {
  aspect-ratio: 3/4;
  background-color: var(--card-bg);
  margin-bottom: 20px;
  overflow: hidden;
  position: relative;
}

.product__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.product-card:hover .product__image {
  transform: scale(1.08);
}

.product__info {
  text-align: center;
}

.product__title {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text);
}

.product__price {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---------- Brand Story ---------- */
.story {
  padding: 120px 40px;
  background-color: var(--section-bg);
  text-align: center;
}

.story__container {
  max-width: 800px;
  margin: 0 auto;
}

.story__text {
  font-size: 1.1rem;
  line-height: 2;
  margin-bottom: 30px;
}

/* ---------- Footer ---------- */
.footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding: 80px 40px;
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.footer__col h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  margin-bottom: 20px;
  color: var(--accent);
}

.footer__links a {
  display: block;
  margin-bottom: 10px;
  opacity: 0.7;
}

.footer__links a:hover {
  opacity: 1;
  color: var(--accent);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .header__main {
    flex-direction: column;
    gap: 20px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero__title {
    font-size: 2.5rem;
  }
}

/* ---------- Theme Switcher UI ---------- */
.theme-switcher {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: white;
  padding: 15px;
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  display: flex;
  gap: 10px;
  z-index: 9999;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.theme-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s;
}

.theme-btn:hover {
  transform: scale(1.2);
}

.theme-btn.active {
  border-color: #000;
  transform: scale(1.1);
}