/* ============================================
   GLOBAL RULES & RESET
   ============================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #ffffff;
  --color-footer-bg: #f8f7f4;
  --color-text: #1a1a1a;
  --color-text-light: #666;
  --color-border: #d4d2cc;
  --color-accent: #2a2a2a;
  --font-serif: 'Crimson Text', 'Georgia', serif;
  --font-sans: 'Inter', -apple-system, sans-serif;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 6rem;
}

body {
  font-family: var(--font-serif);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

.site-header {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  text-align: center;
  position: relative;
}

.brand {
  font-size: 1.125rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 400;
  font-family: var(--font-sans);
  margin-bottom: var(--spacing-sm);
}

.brand a {
  transition: opacity 0.3s ease;
}

.brand a:hover {
  opacity: 0.6;
}

.nav {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  justify-content: center;
}

.nav a {
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  font-family: var(--font-sans);
  opacity: 0.7;
  transition: opacity 0.3s ease;
  position: relative;
}

.nav a:hover,
.nav a.active {
  opacity: 1;
}

.nav a.active::after {
  content: '';
  position: absolute;
  bottom: -0.25rem;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-text);
}

/* Header Icons */
.header-icons {
  position: absolute;
  right: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.header-icons a {
  color: var(--color-text);
  opacity: 0.7;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  position: relative;
}

.header-icons a:hover {
  opacity: 1;
}

.header-icons svg {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cart-icon {
  position: relative;
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--color-accent);
  color: white;
  font-size: 0.625rem;
  font-family: var(--font-sans);
  padding: 2px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  display: none;
}

.cart-count.has-items {
  display: block;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--spacing-lg) var(--spacing-md);
  margin-top: var(--spacing-xl);
  background: var(--color-footer-bg);
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-lg);
}

.footer-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.footer-section a {
  font-size: 0.875rem;
  font-family: var(--font-sans);
  opacity: 0.7;
  transition: opacity 0.3s ease;
  letter-spacing: 0.03em;
}

.footer-section a:hover {
  opacity: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  :root {
    --spacing-md: 1.5rem;
    --spacing-lg: 2.5rem;
    --spacing-xl: 4rem;
  }

  .site-header {
    padding: 1rem;
  }

  .header-icons {
    right: 1rem;
    gap: 1rem;
  }

  .header-icons svg {
    width: 18px;
    height: 18px;
  }
}
