/* ==========================================================================
   Base Styles
   ========================================================================== */

/* ==========================================================================
   Spacing Scale
   Used throughout components for consistent rhythm.
   ========================================================================== */
:root {
  /* Spacing scale */
  --space-xs:  0.4rem;   /*  4px */
  --space-sm:  0.8rem;   /*  8px */
  --space-md:  1.6rem;   /* 16px */
  --space-lg:  2.4rem;   /* 24px */
  --space-xl:  4rem;     /* 40px */
  --space-2xl: 6rem;     /* 60px */

  /* Border radius */
  --border-radius-sm: 4px;
  --border-radius-md: 8px;   /* same as --border-radius; use this going forward */
  --border-radius-lg: 12px;
  --border-radius-xl: 16px;

  /* Easing */
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  box-sizing: border-box;
  font-size: 62.5%;
  height: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  padding-top: 70px; /* Push all content below fixed header by default */
  font-size: 1.6rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

@media screen and (min-width: 750px) {
  body {
    padding-top: 80px; /* Larger padding on wider screens */
  }
}

/* Remove body padding only when page has a hero section as first child */
body:has(main > .page-section:first-child .hero),
body.template-index:has(.hero) {
  padding-top: 0;
}

main.content-for-layout {
  margin: 0;
  padding: 0;
  position: relative;
  min-height: 100vh;
}

/* Ensure hero starts at the very top */
main.content-for-layout > .section:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Ensure sections after hero are visible and scrollable */
main.content-for-layout > .section:not(:first-child) {
  position: relative;
  z-index: 10;
  background-color: var(--color-background);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading-family);
  font-style: var(--font-heading-style);
  font-weight: var(--font-heading-weight);
  line-height: 1.2;
  margin: 0 0 1em;
}

h1 { font-size: calc(var(--font-body-size) * var(--font-heading-scale) * 2); }
h2 { font-size: calc(var(--font-body-size) * var(--font-heading-scale) * 1.5); }
h3 { font-size: calc(var(--font-body-size) * var(--font-heading-scale) * 1.25); }
h4 { font-size: calc(var(--font-body-size) * var(--font-heading-scale)); }
h5 { font-size: var(--font-body-size); }
h6 { font-size: calc(var(--font-body-size) * 0.875); }

p {
  margin: 0 0 1em;
}

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

a:hover {
  opacity: 0.85;
}

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

/* Utility Classes */
.visually-hidden {
  position: absolute !important;
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  word-wrap: normal !important;
}

.skip-to-content-link {
  position: absolute;
  z-index: 9999;
  left: -9999px;
}

.skip-to-content-link:focus {
  left: 50%;
  transform: translateX(-50%);
  top: 1rem;
}

/* Layout */
.page-width {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

@media screen and (min-width: 750px) {
  .page-width {
    padding: 0 var(--space-2xl);
  }
}

.section {
  padding: calc(var(--spacing-sections) * 0.5) 0;
}

@media screen and (min-width: 750px) {
  .section {
    padding: var(--spacing-sections) 0;
  }
}

/* ==========================================================================
   Colour Hierarchy
   --color-primary   (#e3fc02): Neon yellow — CTAs, active states, highlights
   --color-pink      (#FF6B9D): Sale badges, hover glows, gradient fills
   --color-cyan      (#00D8D6): Sold-out badges, outline button hover, secondary accent
   --color-purple    (#9B59B6): Gradient partner to pink only — never used solo
   Never use raw #ffffff / #000000 for text; prefer var(--color-text) / var(--color-button-text).
   ========================================================================== */

/* ==========================================================================
   Button Variants — Usage Guide
   .button--primary        : Global primary CTA (uses neon yellow gradient). Use for
                             "Add to Cart", "Subscribe", and critical conversions.
   .button--graffiti       : Hero & product CTAs. Pink-to-purple gradient, streetwear feel.
                             Preferred over --primary for brand-facing CTAs on dark backgrounds.
   .button--graffiti-outline : Secondary CTA alongside a graffiti button (e.g. "Team Packages").
                               Cyan border, glass fill.
   .button--secondary      : Tertiary / ghost action on light or mixed contexts.
   Canonical primary CTA on dark backgrounds = .button--graffiti
   ========================================================================== */

/* Buttons */
.button {
  display: inline-block;
  padding: 1.2rem 3rem;
  font-size: 1.4rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  font-family: 'Inter', var(--font-body-family);
  line-height: 1.4;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
}

.button:hover::before {
  width: 300px;
  height: 300px;
}

.button--primary {
  background: linear-gradient(135deg, var(--color-button), var(--color-purple));
  color: var(--color-button-text);
  border-color: var(--color-button);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.button--primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3),
              0 0 20px rgba(255, 107, 157, 0.4);
}

.button--primary:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.button--secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-text);
  backdrop-filter: blur(4px);
}

.button--secondary:hover {
  background-color: var(--color-text);
  color: var(--color-background);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.button--secondary:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.button--full-width {
  width: 100%;
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 1.2rem 1.6rem;
  font-size: 1.4rem;
  font-family: inherit;
  line-height: 1.4;
  color: var(--color-text);
  background-color: var(--color-background);
  border: 1px solid rgba(var(--color-text), 0.3);
  border-radius: var(--border-radius);
  transition: border-color 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-button);
}

/* Rich Text Editor */
.rte {
  margin-bottom: 2rem;
}

.rte p {
  margin-bottom: 1.5rem;
}

.rte ul,
.rte ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

.rte li {
  margin-bottom: 0.5rem;
}

.rte a {
  text-decoration: underline;
}

.rte img {
  margin: 2rem 0;
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--space-md);
}

@media screen and (min-width: 750px) {
  .grid {
    gap: var(--space-lg);
  }
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  font-size: 1.2rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: var(--border-radius);
}

.badge--sale {
  background: linear-gradient(135deg, var(--color-pink), var(--color-purple));
  color: #ffffff;
  font-family: 'Permanent Marker', var(--font-heading-family);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.4);
}

.badge--sold-out {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text);
  border: 2px solid var(--color-cyan);
  font-family: 'Permanent Marker', var(--font-heading-family);
  font-size: 1.1rem;
  letter-spacing: 0.03em;
}

/* Placeholder SVG */
.placeholder-svg {
  width: 100%;
  height: 100%;
  background-color: rgba(var(--color-text), 0.05);
  fill: rgba(var(--color-text), 0.2);
}

/* Focus Styles */
*:focus-visible {
  outline: 2px solid var(--color-button);
  outline-offset: 2px;
}

/* Loading Spinner */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(var(--color-background), 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(var(--color-text), 0.1);
  border-top-color: var(--color-button);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
