/* ===================================
   Whisker Design System
   Inspired by clean, wellness-focused event pages
   =================================== */

/* CSS Variables */
:root {
  /* Colors */
  --primary: #bed39d;
  --primary-dark: #a8c188;
  --primary-light: #d4e5bc;
  --secondary: #7d9b6f;
  --background: #ffffff;
  --surface: #f8f9fa;
  --text: #2d3436;
  --text-light: #636e72;
  --text-muted: #95a5a6;
  --border: #e5e7e9;
  --error: #e74c3c;
  --success: #27ae60;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;

  /* Borders */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

  /* Layout */
  --max-width: 1200px;
  --header-height: 70px;
}

/* ===================================
   Reset & Base Styles
   =================================== */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--text);
  background-color: var(--background);
}

/* ===================================
   Typography
   =================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--space-md);
  color: var(--text);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }

p {
  margin-bottom: var(--space-md);
}

a {
  color: var(--primary-dark);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--secondary);
}

/* ===================================
   Layout
   =================================== */

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

.page-wrapper {
  min-height: 100vh;
  background-color: var(--surface);
  padding: var(--space-xl) 0;
}

/* ===================================
   Grid System
   =================================== */

.grid {
  display: grid;
  gap: var(--space-lg);
}

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

/* Desktop: 2 columns */
@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* Desktop: Event content + Sidebar */
@media (min-width: 1024px) {
  .grid-event {
    grid-template-columns: 2fr 1fr;
    gap: var(--space-2xl);
  }
}

/* ===================================
   Cards
   =================================== */

.card {
  background: var(--background);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-xl);
  border: 1px solid var(--border);
}

.card-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.card-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-light);
}

/* ===================================
   Event Header
   =================================== */

.event-banner {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto var(--space-xl);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}

.event-banner img {
  width: 100%;
  height: auto;
  display: block;
}

/* Fallback when no image - show placeholder */
.event-banner:empty {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-header {
  background: var(--background);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-xl);
}

.event-title {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-md);
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  color: var(--text-light);
  font-size: var(--font-size-sm);
}

.event-meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ===================================
   Forms
   =================================== */

.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.form-input,
.form-select {
  width: 100%;
  padding: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-family: var(--font-sans);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: var(--background);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(190, 211, 157, 0.1);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-error {
  color: var(--error);
  font-size: var(--font-size-sm);
  margin-top: var(--space-sm);
}

/* ===================================
   Buttons
   =================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md) var(--space-xl);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary:disabled {
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-full {
  width: 100%;
}

.btn-lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: var(--font-size-lg);
}

/* ===================================
   Quantity Selector
   =================================== */

.quantity-selector {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.quantity-label {
  font-size: var(--font-size-sm);
  color: var(--text-light);
  min-width: 100px;
}

.quantity-select {
  min-width: 120px;
}

/* ===================================
   Order Summary
   =================================== */

.order-summary {
  background: var(--background);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: var(--space-xl);
}

.order-summary-title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.order-line {
  display: flex;
  justify-content: space-between;
  padding: var(--space-md) 0;
  font-size: var(--font-size-sm);
}

.order-line-label {
  color: var(--text-light);
}

.order-line-value {
  font-weight: 500;
  color: var(--text);
}

.order-total {
  display: flex;
  justify-content: space-between;
  padding: var(--space-lg) 0;
  border-top: 2px solid var(--border);
  margin-top: var(--space-md);
  font-size: var(--font-size-lg);
  font-weight: 600;
}

/* ===================================
   Stripe Elements
   =================================== */

.stripe-element-container {
  padding: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.stripe-element-container:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(190, 211, 157, 0.1);
}

/* ===================================
   Success Message
   =================================== */

.success-container {
  max-width: 600px;
  margin: var(--space-3xl) auto;
  text-align: center;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-xl);
  font-size: var(--font-size-3xl);
  color: white;
}

.success-title {
  color: var(--success);
  margin-bottom: var(--space-md);
}

.success-message {
  color: var(--text-light);
  font-size: var(--font-size-lg);
}

/* ===================================
   Responsive Utilities
   =================================== */

.mobile-only {
  display: block;
}

.desktop-only {
  display: none;
}

@media (min-width: 768px) {
  .mobile-only {
    display: none;
  }

  .desktop-only {
    display: block;
  }
}

/* ===================================
   Loading States
   =================================== */

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn .spinner {
  margin-left: var(--space-sm);
}

/* ===================================
   Responsive Adjustments
   =================================== */

@media (max-width: 767px) {
  :root {
    --font-size-3xl: 1.5rem;
    --font-size-2xl: 1.25rem;
  }

  .card {
    padding: var(--space-lg);
  }

  .order-summary {
    position: static;
  }
}

@media (max-width: 480px) {
  .page-wrapper {
    padding: var(--space-md) 0;
  }

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

  .btn {
    padding: var(--space-md) var(--space-lg);
  }
}
