/* ============================================================
   Riddell SpeedFlex Helmets — Base Styles & Reset
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--clr-text);
  background-color: var(--clr-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* ── Typography ────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--clr-text);
}

h1 { font-size: clamp(var(--text-4xl), 5vw, var(--text-7xl)); }
h2 { font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl)); }
h3 { font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl)); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  margin-bottom: var(--space-4);
  color: var(--clr-text-secondary);
}

p:last-child { margin-bottom: 0; }

a {
  color: var(--clr-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover { color: var(--clr-accent-hover); }

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

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: var(--font-body);
  border: none;
  background: none;
}

input, textarea, select {
  font-family: var(--font-body);
  font-size: var(--text-base);
}

/* ── Focus States (Accessibility) ───────────────────── */
:focus-visible {
  outline: 2px solid var(--clr-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Selection ─────────────────────────────────────── */
::selection {
  background-color: var(--clr-accent);
  color: var(--clr-white);
}

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--clr-surface); }
::-webkit-scrollbar-thumb { background: var(--clr-surface-2); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--clr-text-muted); }

/* ── Utility Classes ─────────────────────────────────────── */
.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;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

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

.section {
  padding: var(--space-20) 0;
}

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

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

/* ── Page Layout ─────────────────────────────────────── */
.page-content {
  padding-top: var(--header-height);
  min-height: 100vh;
}

/* ── Text Utilities ──────────────────────────────────── */
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }
.text-accent  { color: var(--clr-accent); }
.text-muted   { color: var(--clr-text-muted); }
.text-upper   { text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--text-sm); font-weight: 600; }
.font-heading { font-family: var(--font-heading); }

/* ── Display Utilities ────────────────────────────────── */
.d-flex       { display: flex; }
.d-grid       { display: grid; }
.d-none       { display: none; }
.d-block      { display: block; }

.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.justify-between{ justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2  { gap: var(--space-2); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }
.flex-1 { flex: 1; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }

@media (min-width: 1025px) {
  .d-md-none { display: none !important; }
}

/* ── Spacing Utilities ────────────────────────────────── */
.mt-4  { margin-top: var(--space-4); }
.mb-4  { margin-bottom: var(--space-4); }
.mt-8  { margin-top: var(--space-8); }
.mb-8  { margin-bottom: var(--space-8); }

/* ── Badge ────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge--accent  { background: var(--clr-accent); color: var(--clr-white); }
.badge--success { background: var(--clr-success-bg); color: var(--clr-success); }
.badge--warning { background: var(--clr-warning-bg); color: var(--clr-warning); }
.badge--error   { background: var(--clr-error-bg); color: var(--clr-error); }
.badge--muted   { background: var(--clr-surface); color: var(--clr-text-secondary); }
.badge--dark    { background: var(--clr-primary); color: var(--clr-white); }

/* ── Loading Skeleton ─────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--clr-surface) 25%, var(--clr-surface-2) 50%, var(--clr-surface) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Toast Notification ───────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--clr-primary-light);
  color: var(--clr-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2xl);
  font-size: var(--text-sm);
  font-weight: 500;
  max-width: 360px;
  pointer-events: auto;
  animation: toast-in var(--transition-spring) forwards;
  border-left: 3px solid transparent;
}

.toast--success { border-left-color: var(--clr-success); }
.toast--error   { border-left-color: var(--clr-error); }
.toast--warning { border-left-color: var(--clr-warning); }
.toast--info    { border-left-color: var(--clr-info); }

.toast.hiding {
  animation: toast-out var(--transition-base) forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(10px) scale(0.95); }
}

/* ── Modal ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fade-in var(--transition-fast) ease;
}

.modal {
  background: var(--clr-white);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-2xl);
  animation: modal-in var(--transition-spring) forwards;
}

.modal__title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.modal__actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
  justify-content: flex-end;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Empty State ─────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-24) var(--space-8);
  gap: var(--space-4);
}

.empty-state__icon {
  font-size: 3rem;
  opacity: 0.3;
}

.empty-state__title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--clr-text);
}

.empty-state__text {
  color: var(--clr-text-muted);
  max-width: 400px;
}

/* ── Error State ─────────────────────────────────────── */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16) var(--space-8);
  gap: var(--space-4);
}

/* ── Form Elements ─────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--clr-text);
}

.form-label span.required {
  color: var(--clr-error);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  color: var(--clr-text);
  background: var(--clr-white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--clr-accent);
  box-shadow: 0 0 0 3px var(--clr-accent-light);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--clr-error);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--clr-error);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: var(--space-10);
}

/* ── Divider ─────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--clr-border);
  margin: var(--space-6) 0;
}

/* ── Price ─────────────────────────────────────────────── */
.price {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--clr-text);
}

.price--current { font-size: var(--text-2xl); }
.price--old {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  text-decoration: line-through;
  font-weight: 400;
}
.price--sale { color: var(--clr-error); }

/* ── Breadcrumb ─────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--clr-text-muted);
  transition: color var(--transition-fast);
}

.breadcrumb a:hover { color: var(--clr-text); }
.breadcrumb__sep { color: var(--clr-border-dark); }
.breadcrumb__current { color: var(--clr-text); font-weight: 500; }

/* ── Page Header ─────────────────────────────────────────── */
.page-header {
  background: var(--clr-surface);
  padding: var(--space-12) 0 var(--space-10);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--clr-border);
}

.page-header::before {
  display: none;
}

.page-header__breadcrumb { margin-bottom: var(--space-4); }
.page-header__breadcrumb .breadcrumb,
.page-header__breadcrumb .breadcrumb a { color: var(--clr-text-secondary); }
.page-header__breadcrumb .breadcrumb a:hover { color: var(--clr-text); }
.page-header__breadcrumb .breadcrumb__current { color: var(--clr-text); }

.page-header__title {
  color: var(--clr-text);
  margin-bottom: var(--space-2);
}

.page-header__subtitle {
  color: var(--clr-text-secondary);
  font-size: var(--text-lg);
  margin-bottom: 0;
}

