/* components.bundle.css - Generated bundle */

/* === src/css/modern-product-cards.css === */
/* Modern Product Cards - 2025 Design Trends Implementation */

/* Base Card Styles */
.modern-product-card,
.product-card.modern-enhanced {
  position: relative;
  background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  /* limit transitions to transform and opacity only (avoid triggering layout/paint) */
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  /* backdrop-filter is expensive on many devices; only enable it via a utility class or on capable devices */
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  contain: layout;
  transform: translateZ(0);
  transform-origin: center;
  box-sizing: border-box;
}

.modern-product-card:hover,
.product-card.modern-enhanced:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.08),
    0 10px 10px -5px rgba(0, 0, 0, 0.03);
  border-color: rgba(79, 70, 229, 0.22);
  /* hint to compositor only when hovered */
  will-change: transform, box-shadow;
}

/* Make only interactive controls show pointer -- avoid entire card being perceived as a button */
.btn-action,
.product-card .buy-now-btn,
.modern-product-card .buy-now-btn,
.product-payment-close,
.buy-now-btn a,
.wewonttip-support-copy,
.download-btn {
  cursor: pointer;
}

/* Dark Mode Styles */
.dark .modern-product-card,
.dark .product-card.modern-enhanced {
  /* Use deep, true black in dark mode for product cards to match design */
  background: #000;
  border-color: rgba(255, 255, 255, 0.06);
  color: #f9fafb;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.6),
    0 2px 4px -1px rgba(0, 0, 0, 0.5);
}



.modern-product-card::after,
.product-card.modern-enhanced::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  /* Limit transition to transform and opacity to avoid layout/paint on unrelated properties */
  transition:
    transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  opacity: 0;
}

.modern-product-card:hover::after,
.product-card.modern-enhanced:hover::after {
  width: 300px;
  height: 300px;
  opacity: 1;
}

.modern-product-card.loading,
.product-card.modern-enhanced.loading {
  overflow: hidden;
}

/* Card Overlay */
.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.06));
  opacity: 0;
  transform: translateY(8%);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
  pointer-events: none;
  border-radius: inherit;
}

.modern-product-card.hovered .card-overlay {
  opacity: 1;
  transform: translateY(0);
}

/* Card Shimmer Effect */
.card-shimmer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: shimmer 1.5s infinite;
  border-radius: inherit;
  /* reduce paint cost by using opacity animation only where possible */
  will-change: transform;
}

.modern-product-card.loaded .card-shimmer {
  display: none;
}

/* Product Image */
.modern-product-card .product-image,
.product-card.modern-enhanced .product-image {
  position: relative;
  height: 160px;
  margin-bottom: 16px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.modern-product-card .product-image img,
.product-card.modern-enhanced .product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: inherit;
}

.modern-product-card:hover .product-image img,
.product-card.modern-enhanced:hover .product-image img {
  transform: scale(1.05) rotate(1deg);
}

.modern-product-card .card-image,
.product-card.modern-enhanced .card-image {
  will-change: transform, opacity;
  backface-visibility: hidden;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.1);
}

/* Per-component focus/hover styles using canonical brand variables */
.product-image[data-focus-halo],
.product-title[data-focus-halo],
.product-description[data-focus-halo],
.buy-now-btn[data-focus-halo] {
  transition: box-shadow 160ms ease, transform 160ms ease, outline-color 160ms ease;
}

/* Always use the brand focus color/ring so visuals are consistent across components */
.product-image[data-focus-halo]:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px var(--brand-focus-color) !important;
}

.product-title[data-focus-halo]:focus-visible {
  outline: none;
  /* underline dotted with brand color for clear keyboard affordance */
  text-decoration: underline dotted var(--brand-focus-color) !important;
  text-decoration-thickness: 2px;
}

.product-description[data-focus-halo]:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--brand-focus-color) !important;
}

.buy-now-btn[data-focus-halo]:focus-visible,
.buy-now-btn[data-focus-halo]:hover {
  outline: none;
  box-shadow: var(--brand-focus-ring), 0 6px 16px rgba(0,0,0,0.08) !important;
  transform: translateY(-2px);
}

.product-image[data-focus-halo]:hover {
  transform: translateY(-4px) scale(1.02);
}

/* Product Content */
.modern-product-card .product-content,
.product-card.modern-enhanced .product-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  /* Defensive: allow shrinking in flex containers (fixes Safari's intrinsic min-width behavior) */
  min-width: 0;
  box-sizing: border-box;
  gap: 8px;
}

/* Retired product visual state */
.product-card.retired {
  opacity: 0.45;
  filter: grayscale(80%);
}

/* Ensure images remain visible but subdued */
.product-card.retired .product-image img {
  transform: none !important;
  opacity: 0.7;
}

/* Replace interactive buy button with a visible retired badge */
.retired-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 2px solid rgba(0,0,0,0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(250,250,250,0.95));
  color: #6b7280;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 6px;
}

html[data-theme="dark"] .retired-badge {
  background: linear-gradient(180deg, rgba(0,0,0,0.6), rgba(10,10,10,0.8));
  color: #9ca3af;
  border-color: rgba(255,255,255,0.04);
}

/* Keep layout consistent: ensure buy-now-btn space reserved */
.product-card .buy-now-btn,
.product-card .retired-badge {
  margin-top: auto;
}

/* Ensure JS-inserted wrapper participates as a flex child */
.card-perspective {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  -webkit-flex: 1 1 auto;
  -ms-flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  width: 100%;
}

.modern-product-card .product-title,
.product-card.modern-enhanced .product-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.modern-product-card .product-description,
.product-card.modern-enhanced .product-description {
  font-size: 0.875rem;
  /* inherit color from the card so descriptions are pure black (light) or pure white (dark) */
  color: inherit;
  margin: 0 0 12px;
  line-height: 1.4;
}

.modern-product-card .product-price,
.product-card.modern-enhanced .product-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-color);
  margin: auto 0 16px;
}

/* Reinforce buy button layout and accessibility across bundled CSS */
.product-card .buy-now-btn,
.modern-product-card .buy-now-btn {
  justify-content: center; /* ensure centered even if utility classes interfere */
  gap: 0.5rem;
  text-decoration: none;
}

.product-card .buy-now-btn span,
.modern-product-card .buy-now-btn span {
  text-decoration: none;
}

/* Price appearance and separator fallback when JS/templating omits it */
.product-card .buy-now-btn > .text-2xl::before,
.modern-product-card .buy-now-btn > .text-2xl::before {
  /* Disabled: separator is provided centrally by unified-cta-buttons.css
     Keep the selector present for specificity parity, but do not generate content. */
  content: none;
  margin-right: 0;
  font-weight: 900;
  color: inherit;
}

/* Remove underline on focus but keep clear focus ring for keyboard users */
.buy-now-btn:focus {
  /* avoid stacking: defer visible focus to :focus-visible and brand ring */
  outline: none !important;
  box-shadow: none !important;
}

.product-card.modern-enhanced.loading .card-shimmer {
  display: block;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* Buttons */
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  min-height: 44px;
}

.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.4);
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.btn-action:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
}

/* Button focus states */
.btn-action:focus:not(:focus-visible) {
  outline: none !important;
  box-shadow: none !important;
}

.btn-action:focus-visible {
  outline: none !important;
  box-shadow: var(--brand-focus-ring) !important;
}

/* Dark Mode Button Styles */
.dark .btn-action {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.4);
}

.dark .btn-action:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  box-shadow: 0 8px 16px rgba(99, 102, 241, 0.5);
}

.btn-action::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-action:hover::before {
  left: 100%;
}

/* Dark Mode Styles */
.dark .modern-product-card,
.dark .product-card.modern-enhanced {
  background: #000; /* deep black */
  border-color: rgba(255, 255, 255, 0.06);
  color: #f9fafb;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.6),
    0 2px 4px -1px rgba(0, 0, 0, 0.5);
}

.dark .modern-product-card .product-title,
.dark .product-card.modern-enhanced .product-title {
  color: #f9fafb;
}

.dark .modern-product-card .product-description,
.dark .product-card.modern-enhanced .product-description {
  /* Keep inheriting the card's color in dark mode */
  color: inherit;
} /* Improved Accessibility Styles */
@media (prefers-reduced-motion: reduce) {
  .modern-product-card,
  .product-card.modern-enhanced,
  .btn-action,
  .card-overlay,
  .modern-product-card .product-image img,
  .product-card.modern-enhanced .product-image img {
    transition: none;
    animation: none;
    transform: none !important;
  }

  .modern-product-card::after,
  .product-card.modern-enhanced::after {
    display: none;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  .modern-product-card:hover,
  .product-card.modern-enhanced:hover {
    transform: none;
    box-shadow:
      0 4px 6px -1px rgba(0, 0, 0, 0.1),
      0 2px 4px -1px rgba(0, 0, 0, 0.06);
  }

  .modern-product-card:hover .product-image img,
  .product-card.modern-enhanced:hover .product-image img {
    transform: none;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: more) {
  .modern-product-card,
  .product-card.modern-enhanced {
    border-width: 2px;
    border-color: #000;
  }

  .btn-action {
    border: 2px solid #000;
  }
}

/* Print Styles */
@media print {
  .modern-product-card,
  .product-card.modern-enhanced {
    background: white !important;
    box-shadow: none !important;
    border: 1px solid #000 !important;
    break-inside: avoid;
  }

  .btn-action {
    background: #000 !important;
    color: white !important;
    box-shadow: none !important;
  }
}

/* Responsive Design */
@media (max-width: 640px) {
  .modern-product-card,
  .product-card.modern-enhanced {
    padding: 16px;
    min-height: 280px;
  }

  .modern-product-card .product-image,
  .product-card.modern-enhanced .product-image {
    height: 140px;
    margin-bottom: 12px;
  }

  .modern-product-card .product-title,
  .product-card.modern-enhanced .product-title {
    font-size: 1rem;
  }

  .btn-action {
    padding: 10px 20px;
    font-size: 0.8125rem;
    min-height: 40px;
  }
}

/* Layout: stack on small screens, side-by-side on larger screens */
@media (max-width: 720px) {
  /* Collapse image above content for narrow viewports */
  .product-card,
  .modern-product-card,
  .product-card.modern-enhanced {
    flex-direction: column !important;
    align-items: stretch;
  }

  .product-card .product-image,
  .modern-product-card .product-image,
  .product-card.modern-enhanced .product-image {
    width: 100% !important;
    height: auto !important;
    margin-bottom: 12px !important;
    border-right: none !important;
    border-bottom-width: 4px !important;
  }

  .product-card .product-content,
  .modern-product-card .product-content,
  .product-card.modern-enhanced .product-content {
    width: 100% !important;
    padding: 12px !important;
  }
}

@media (min-width: 721px) {
  /* Desktop: allow side-by-side layout for richer use of horizontal space */
  .product-card,
  .modern-product-card,
  .product-card.modern-enhanced {
    flex-direction: row !important;
    gap: 20px;
    align-items: stretch;
  }

  .product-card .product-image,
  .modern-product-card .product-image,
  .product-card.modern-enhanced .product-image {
    width: 40%;
    min-width: 220px;
    height: auto;
    margin: 0;
    border-bottom-width: 0;
    border-right: 4px solid currentColor;
    box-sizing: border-box;
  }

  .product-card .product-content,
  .modern-product-card .product-content,
  .product-card.modern-enhanced .product-content {
    width: 60%;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
  }

  /* Ensure title and price don't get vertically centered awkwardly */
  .product-card .product-price,
  .modern-product-card .product-price,
  .product-card.modern-enhanced .product-price {
    margin-top: auto;
  }
}

/* Stronger cross-breakpoint rules for predictable behavior */
/* Ensure dark-mode cards are deep black with higher specificity to avoid gradient overrides */
.dark .product-card,
.dark .modern-product-card,
.dark .product-card.modern-enhanced {
  background: #000 !important;
  color: #f8fafc;
}

/* Detailed breakpoint grid for product cards
   - mobile (<=480): single-column stacked, compact spacing
   - small tablet (481-720): stacked but more padding
   - medium (721-1024): side-by-side with 40/60 split
   - large (>=1025): side-by-side with generous spacing and min-heights
*/

/* Mobile: <=480px */
@media (max-width: 480px) {
  .product-card,
  .modern-product-card,
  .product-card.modern-enhanced {
    flex-direction: column !important;
    gap: 8px;
    padding: 12px !important;
  }

  .product-card .product-image,
  .modern-product-card .product-image,
  .product-card.modern-enhanced .product-image {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1/1;
    margin-bottom: 10px !important;
    border-radius: 10px;
  }

  .product-card .product-content,
  .modern-product-card .product-content,
  .product-card.modern-enhanced .product-content {
    padding: 8px !important;
  }
}

/* Small tablets: 481px - 720px */
@media (min-width: 481px) and (max-width: 720px) {
  .product-card,
  .modern-product-card,
  .product-card.modern-enhanced {
    flex-direction: column !important;
    gap: 12px;
    padding: 14px !important;
  }

  .product-card .product-image,
  .modern-product-card .product-image,
  .product-card.modern-enhanced .product-image {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 4/3;
    margin-bottom: 12px !important;
  }

  .product-card .product-content,
  .modern-product-card .product-content,
  .product-card.modern-enhanced .product-content {
    padding: 12px 14px !important;
  }
}

/* Medium: 721px - 1024px (side-by-side) */
@media (min-width: 721px) and (max-width: 1024px) {
  .product-card,
  .modern-product-card,
  .product-card.modern-enhanced {
    flex-direction: row !important;
    gap: 18px;
    align-items: stretch;
  }

  .product-card .product-image,
  .modern-product-card .product-image,
  .product-card.modern-enhanced .product-image {
    flex: 0 0 42%;
    max-width: 46%;
    aspect-ratio: 4/3;
    height: auto;
    margin: 0;
    border-bottom-width: 0;
    border-right: 4px solid currentColor;
    box-sizing: border-box;
  }

  .product-card .product-content,
  .modern-product-card .product-content,
  .product-card.modern-enhanced .product-content {
    flex: 1 1 58%;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
  }
}

/* Large: >=1025px */
@media (min-width: 1025px) {
  .product-card,
  .modern-product-card,
  .product-card.modern-enhanced {
    flex-direction: row !important;
    gap: 24px;
    align-items: stretch;
    padding: 20px;
  }

  .product-card .product-image,
  .modern-product-card .product-image,
  .product-card.modern-enhanced .product-image {
    flex: 0 0 40%;
    max-width: 45%;
    aspect-ratio: 4/3;
    height: auto;
    margin: 0;
    border-bottom-width: 0;
    border-right: 4px solid currentColor;
    box-sizing: border-box;
  }

  .product-card .product-content,
  .modern-product-card .product-content,
  .product-card.modern-enhanced .product-content {
    flex: 1 1 60%;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
  }

  /* Gentle min-height so cards align nicely in grids without forcing huge whitespace on small screens */
  .product-card,
  .modern-product-card,
  .product-card.modern-enhanced {
    min-height: 380px;
  }
}

@media (max-width: 480px) {
  .modern-product-card,
  .product-card.modern-enhanced {
    padding: 12px;
    min-height: 260px;
  }

  .modern-product-card .product-image,
  .product-card.modern-enhanced .product-image {
    height: 120px;
    margin-bottom: 10px;
  }

  .btn-action {
    padding: 8px 16px;
    font-size: 0.75rem;
    min-height: 36px;
  }
}

/* Grid Layout Support */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  padding: 24px 0;
}

@media (max-width: 640px) {
  .products-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px 0;
  }
}

/* Filter Animation */
.filter-section {
  margin-bottom: 32px;
}

.filter-section select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  color: #374151;
  font-size: 0.875rem;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.filter-section select:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.dark .filter-section select {
  background: #374151;
  border-color: #4b5563;
  color: #f9fafb;
}

.dark .filter-section select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}


/* === src/css/ui-polish-styles.css === */
/**
 * Advanced UI Polish Styles
 * Comprehensive styling for animations, interactions, and accessibility
 */

/* Prevent accidental horizontal scrolling at 100% zoom across the site.
   This is intentionally conservative and scoped to screen media only so
   print/layout are unaffected. If a component truly requires horizontal
   overflow (rare), it should opt into it explicitly. */
@media screen {
  html, body {
    overflow-x: hidden;
  }
}

/* Section modal scroller: dedicated element that handles touch scrolling on mobile */
.section-modal-scroller {
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

/* Allow children inside flex containers to shrink properly on small viewports
   Prevents overflow clipping when descendant elements (like iframes) need to
   be scrolled; setting min-height:0 on scroller and its direct children fixes
   common flexbox overflow issues on mobile. */
.section-modal-scroller,
.section-modal-scroller * {
  min-height: 0 !important;
}

.section-modal {
  -webkit-tap-highlight-color: transparent;
}


/* CSS Custom Properties for Theming */
:root {
  /* Animation System */
  --animation-duration-fast: 0.15s;
  --animation-duration-normal: 0.3s;
  --animation-duration-slow: 0.5s;
  --animation-easing-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --animation-easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --animation-easing-sharp: cubic-bezier(0.4, 0, 0.6, 1);

  /* Color System */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --space-12: 3rem;
  /* Disable animations/transitions for navigation links */
  transition: none !important;
  animation: none !important;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  /* Only underline on hover; avoid color changes */
  color: var(--gray-700);
  /* Shadow System */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Focus Ring */
  --focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.1);
  /* Brand red for focus outlines (red-700) */
  --brand-focus-color: rgb(185 28 28 / var(--tw-text-opacity, 1));
  --brand-focus-ring: 0 0 0 1px var(--brand-focus-color);
  --focus-ring-offset: 2px;
}

/* Global focus-visible styling: make accessible focus rings red across the site */
/* Don't remove focus for all users — only suppress focus visuals when the
   element is focused via pointer (not keyboard). Use :focus:not(:focus-visible)
   so keyboard users still see a clear focus ring. */
:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  /* Canonical keyboard focus visual: brand ring */
  box-shadow: var(--brand-focus-ring) !important;
  outline: none !important;
  outline-offset: 1px;
}

/* Enforce brand color on outline/box-shadow for elements that rely on outline instead */
:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none !important;
  box-shadow: var(--brand-focus-ring) !important;
}

/*
  Normalization: ensure there is only a single focus ring (the brand red) visible.
  Some components add outlines or additional box-shadows which stack visually.
  The strategy below is to remove non-brand outlines/box-shadows on focus and
  prefer the single authoritative brand ring. We keep this narrowly targeted
  at interactive elements and components to avoid surprising unrelated styles.
*/
/* Remove any other outline styles on focus so they don't stack with our ring */
a:focus, button:focus, input:focus, textarea:focus, select:focus, .btn-action:focus, .modern-product-card:focus, .product-card:focus {
  /* Remove non-visible focus outlines; only :focus-visible should show ring */
  outline: none !important;
  -webkit-outline: none !important;
  box-shadow: none !important;
}

/* Remove non-brand box-shadows on focus to prevent double-rings. Components should
   use :focus-visible with brand variables instead of applying their own shadows. */
a:focus, button:focus, input:focus, textarea:focus, select:focus, .btn-action:focus, .modern-product-card:focus, .product-card:focus {
  box-shadow: none !important;
}

/* Ensure only the :focus-visible variants show the brand ring */
:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, .btn-action:focus-visible, .modern-product-card:focus-visible, .product-card:focus-visible {
  box-shadow: var(--brand-focus-ring) !important;
  outline: none !important;
}

/* Stronger global overrides to ensure other component styles can't easily override
   the brand focus color. Keep specificity moderate to be friendly to component-level
   focus styles that intentionally differ; these rules target common interactive
   elements and card containers. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.product-card:focus-visible,
.modern-product-card:focus-visible,
.card:focus-visible,
.btn-action:focus-visible {
  box-shadow: var(--brand-focus-ring) !important;
  outline: none !important;
}

/* Pledge form specific focus overrides: use brand red for CTA and form controls */
#pledgeButtonModal:focus-visible,
#pledgeButton:focus-visible,
.pledge-form #pledgeButtonModal:focus-visible,
.pledge-form #pledgeButton:focus-visible {
  box-shadow: var(--brand-focus-ring) !important;
  outline: none !important;
}

/* Inputs inside pledge form should use the brand focus ring when keyboard-focused */
.pledge-form input:focus-visible,
.pledge-form textarea:focus-visible,
.pledge-form select:focus-visible {
  box-shadow: var(--brand-focus-ring) !important;
  outline: none !important;
}

/* Role selection visuals: when the hidden radio receives keyboard focus, show brand ring on the visual gem */
.role-label input:focus + .visual,
.role-label input:focus-visible + .visual {
  box-shadow: var(--brand-focus-ring) !important;
  outline: none !important;
}

/* Social share / share-section buttons: ensure keyboard focus uses brand ring */
.button-as-link:focus-visible,
.share-button:focus-visible,
#shareX:focus-visible,
#shareReddit:focus-visible,
#shareFacebook:focus-visible,
#webShare:focus-visible {
  box-shadow: var(--brand-focus-ring) !important;
  outline: none !important;
}

/* Ensure pledge form elements are tabbable in order (some components previously removed outlines) */
.pledge-form [tabindex] { /* keep visible focus even if components attempted to hide it */
  outline: none !important;
}

/* Anchor styling: keep underlines scoped to anchors only and avoid applying underlines globally
   through :root or other broad selectors. This is the canonical source for anchor styling used
   across component bundles. */
a, a:visited {
  color: var(--primary-700);
  text-decoration: underline;
}

/* Base Animation Classes */
.animate-fade-in {
  animation: fadeIn var(--animation-duration-normal) var(--animation-easing-ease) forwards;
}

.animate-fade-in-up {
  animation: fadeInUp var(--animation-duration-normal) var(--animation-easing-ease) forwards;
}

.animate-slide-in-left {
  animation: slideInLeft var(--animation-duration-normal) var(--animation-easing-ease) forwards;
}

.animate-slide-in-right {
  animation: slideInRight var(--animation-duration-normal) var(--animation-easing-ease) forwards;
}

.animate-bounce-in {
  animation: bounceIn var(--animation-duration-slow) var(--animation-easing-bounce) forwards;
}

.animate-pulse {
  animation: pulse 2s var(--animation-easing-ease) infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Enhanced Keyframe Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }

  20% {
    transform: scale3d(1.1, 1.1, 1.1);
  }

  40% {
    transform: scale3d(0.9, 0.9, 0.9);
  }

  60% {
    opacity: 1;
    transform: scale3d(1.03, 1.03, 1.03);
  }

  80% {
    transform: scale3d(0.97, 0.97, 0.97);
  }

  100% {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }

  100% {
    transform: scale(4);
    opacity: 0;
  }
}

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

  100% {
    background-position: calc(200px + 100%) 0;
  }
}

/* Enhanced Button Styles */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  cursor: pointer;
  transition:
    transform var(--animation-duration-fast) var(--animation-easing-ease),
    opacity var(--animation-duration-fast) var(--animation-easing-ease);
  overflow: hidden;
  text-decoration: none;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}

.btn:focus-visible {
  box-shadow: var(--brand-focus-ring) !important;
  outline: none !important;
  outline-offset: var(--focus-ring-offset);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Button Variants */
.btn-primary {
  background-color: var(--primary-600);
  color: white;
  border-color: var(--primary-600);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-700);
  border-color: var(--primary-700);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background-color: var(--gray-100);
  color: var(--gray-900);
  border-color: var(--gray-300);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--gray-200);
  border-color: var(--gray-300);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary-600);
  border-color: var(--primary-300);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--primary-50);
  color: var(--primary-700);
  border-color: var(--primary-400);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: 0.75rem;
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: 1rem;
}

/* Enhanced Card Styles */
.card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition:
    transform var(--animation-duration-normal) var(--animation-easing-ease),
    opacity var(--animation-duration-normal) var(--animation-easing-ease);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gray-300);
  /* Promote to compositor only during interactive state */
  will-change: transform;
}

.card-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--gray-200);
}

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

.card-footer {
  padding: var(--space-4) var(--space-6);
  background-color: var(--gray-50);
  border-top: 1px solid var(--gray-200);
}

/* Enhanced Form Styles */
.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

.form-input {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--gray-900);
  background-color: white;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  transition:
    transform var(--animation-duration-fast) var(--animation-easing-ease),
    opacity var(--animation-duration-fast) var(--animation-easing-ease);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: var(--focus-ring);
}

.form-input.error {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-input.success {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Floating Label Enhancement */
.floating-label {
  position: relative;
  margin-bottom: var(--space-6);
}

.floating-label .form-input {
  padding-top: 1.625rem;
  padding-bottom: 0.625rem;
}

.floating-label .form-label {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  padding: var(--space-4);
  margin: 0;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  pointer-events: none;
  transform-origin: 0 0;
  transition:
    transform var(--animation-duration-fast) var(--animation-easing-ease),
    opacity var(--animation-duration-fast) var(--animation-easing-ease);
  color: var(--gray-500);
}

.floating-label .form-input:focus ~ .form-label,
.floating-label .form-input:not(:placeholder-shown) ~ .form-label,
.floating-label .form-label.floating {
  transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
  color: var(--primary-600);
  background: white;
  padding: 0 var(--space-1);
}

/* Enhanced Loading States */
.loading-skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.25rem;
}

.loading-spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--gray-200);
  border-top: 2px solid var(--primary-600);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-dots {
  display: inline-flex;
  gap: var(--space-1);
}

.loading-dots span {
  width: 0.375rem;
  height: 0.375rem;
  background-color: var(--primary-600);
  border-radius: 50%;
  animation: loading-dots 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes loading-dots {
  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0.5;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Enhanced Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition:
    transform var(--animation-duration-normal) var(--animation-easing-ease),
    opacity var(--animation-duration-normal) var(--animation-easing-ease);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-xl);
  max-width: 32rem;
  width: 90%;
  max-height: 90%;
  overflow: auto;
  transform: scale(0.95) translateY(1rem);
  transition:
    transform var(--animation-duration-normal) var(--animation-easing-ease),
    opacity var(--animation-duration-normal) var(--animation-easing-ease);
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-400);
  transition: color var(--animation-duration-fast) var(--animation-easing-ease);
  padding: var(--space-1);
  margin: calc(-1 * var(--space-1));
}

.modal-close:hover {
  color: var(--gray-600);
}

.modal-body {
  padding: var(--space-6);
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  background-color: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* Enhanced Navigation */
.nav {
  display: flex;
  gap: var(--space-1);
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  color: var(--gray-700);
  text-decoration: none;
  border-radius: 0.5rem;
  transition:
    color var(--animation-duration-fast) var(--animation-easing-ease),
    background-color var(--animation-duration-fast) var(--animation-easing-ease),
    border-color var(--animation-duration-fast) var(--animation-easing-ease),
    box-shadow var(--animation-duration-fast) var(--animation-easing-ease);
  font-weight: 500;
}

.nav-link:hover {
  color: var(--primary-600);
}

.nav-link.active {
  background-color: var(--primary-100);
  color: var(--primary-700);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: var(--space-4);
  right: var(--space-4);
  height: 2px;
  background-color: var(--primary-600);
  border-radius: 1px;
}

/* Enhanced Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table th {
  background-color: var(--gray-50);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: 600;
  color: var(--gray-900);
  border-bottom: 1px solid var(--gray-200);
}

.table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--gray-100);
  transition: background-color var(--animation-duration-fast) var(--animation-easing-ease);
}

.table tr:hover td {
  background-color: var(--gray-50);
}

/* Enhanced Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-primary {
  background-color: var(--primary-100);
  color: var(--primary-700);
}

.badge-success {
  background-color: #dcfce7;
  color: #166534;
}

.badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-error {
  background-color: #fee2e2;
  color: var(--brand-color);
}

/* Accessibility Enhancements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.focus-visible {
  outline: 2px solid var(--primary-600);
  outline-offset: 2px;
}

/* Skip Navigation */
.skip-nav {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--gray-900);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 0.25rem;
  z-index: 1000;
  transition: top var(--animation-duration-fast) var(--animation-easing-ease);
}

.skip-nav:focus {
  top: 6px;
}

/* Touch Device Optimizations */
.touch-device .btn {
  min-height: 44px;
  min-width: 44px;
}

.touch-device .nav-link {
  min-height: 44px;
}

.touch-active {
  background-color: rgba(0, 0, 0, 0.1) !important;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .card {
    border: 2px solid;
  }

  .btn {
    border: 2px solid;
  }

  .form-input {
    border: 2px solid;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .loading-spinner {
    animation: none;
    border-top-color: transparent;
    border-right-color: var(--primary-600);
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --gray-50: #1f2937;
    --gray-100: #374151;
    --gray-200: #4b5563;
    --gray-300: #6b7280;
    --gray-500: #9ca3af;
    --gray-700: #d1d5db;
    --gray-900: #f9fafb;
  }

  .card {
    background: #1f2937;
    border-color: #374151;
  }

  .form-input {
    background: #374151;
    color: #f9fafb;
    border-color: #4b5563;
  }

  .modal-content {
    background: #1f2937;
  }
}

/* Custom Dark Mode Classes */
.dark {
  color-scheme: dark;
}

.dark .card {
  background: #1f2937;
  border-color: #374151;
}

.dark .form-input {
  background: #374151;
  color: #f9fafb;
  border-color: #4b5563;
}

.dark .modal-content {
  background: #1f2937;
}

.dark .table th {
  background-color: #374151;
  color: #f9fafb;
}

.dark .table td {
  border-color: #4b5563;
}

.dark .table tr:hover td {
  background-color: #374151;
}

/* Print Styles */
@media print {
  .btn,
  .modal-overlay,
  .loading-spinner,
  .skip-nav {
    display: none !important;
  }

  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #000;
  }

  * {
    background: transparent !important;
    color: #000 !important;
  }
}

/* Payment tile specific tweaks to avoid PayPal logo clipping and allow hosted SDK to render */
.payment-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible; /* allow hosted SDK to expand */
}

.payment-tile--paypal img,
.payment-tile--paypal svg {
  max-width: 100%;
  height: auto;
  display: block;
}

.paypal-mount, #paypal-tile, #paypal-tile-widget {
  min-height: 44px;
  min-width: 88px;
  box-sizing: border-box;
}

/* ============================================
   Pledge Modal Styles
   ============================================ */

/* Backdrop */
.section-modal-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: var(--z-modal-backdrop, 1040);
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms var(--animation-easing-ease, ease),
              visibility 300ms var(--animation-easing-ease, ease);
  /* Make backdrop fill the visual viewport by default; JS will adjust if visualViewport is available */
  height: 100vh;
}

.section-modal-backdrop:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

/* Modal Container */
.section-modal {
  /* As a flex item of the backdrop, keep modal relative (no fixed translate centering)
     so centering is handled by the backdrop's flexbox. Maintain responsive sizing
     and mobile-friendly scroll behavior. */
  position: relative;
  box-sizing: border-box;
  /* Baseline (widely supported): percentage width with a readable max-width cap */
  width: 90%;
  max-width: 90ch; /* readable line length fallback for older browsers */
  /* Progressive enhancement for modern browsers that support min() */
  @supports (width: min(1vw, 1rem)) {
    width: min(96vw, 90ch);
  }
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: transparent; /* keep container transparent; content carries the visible surface */
  border-radius: 0.75rem;
  box-shadow: var(--shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04));
  z-index: calc(var(--z-modal-backdrop, 1040) + 1);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95);
  transition: opacity 300ms var(--animation-easing-ease, ease),
              transform 300ms var(--animation-easing-ease, ease),
              visibility 300ms var(--animation-easing-ease, ease);
}


.section-modal:not(.hidden) {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

/* QA helper: force more visible scrollbars for testing. Use only in debugging.
   This forces a solid track and higher-contrast thumb and disables overlay behavior
   by increasing size and contrast. Remove or don't use in production markup. */

/* Modal Content */
.section-modal-content {
  position: relative;
  padding: var(--space-8, 2rem);
  /* Ensure comfortable horizontal padding so large headings never touch or clip the edges */
  /* Use a responsive padding that grows slightly on large screens and respects safe-area insets */
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
  /* Additional min horizontal padding to prevent clipping of oversized header at all viewport sizes */
  --pledge-horizontal-padding: clamp(1rem, 4vw, 3rem);
  padding-left: calc(max(1.25rem, env(safe-area-inset-left)) + var(--pledge-horizontal-padding));
  padding-right: calc(max(1.25rem, env(safe-area-inset-right)) + var(--pledge-horizontal-padding));
}

/* Visual surface for the modal: visible background and rounded corners live here */
.section-modal-content {
  background: white;
  border-radius: 0.5rem;
}

/* Dark mode surface */
.dark .section-modal-content,
body.dark .section-modal-content,
html.dark .section-modal-content,
html[data-theme="dark"] .section-modal-content {
  background: #000000;
}

.section-modal-inner {
  max-width: 100%;
}

/* Safety: prevent large children from causing horizontal overflow inside the modal */
.section-modal-content img,
.section-modal-content video,
.section-modal-content svg,
.section-modal-content table,
.section-modal-content pre,
.section-modal-content code {
  max-width: 100%;
  height: auto;
}

.section-modal-content,
.section-modal-content * {
  -webkit-overflow-scrolling: touch;
}

/* Make modal content scrollable and contain overscroll to avoid page chaining */
.section-modal-content {
  max-height: 90vh; /* ensure there's room for the modal and allow internal scrolling */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* iOS momentum scrolling */
  overscroll-behavior: contain; /* prevent scroll chaining to the underlying page */
  touch-action: auto; /* allow touch gestures inside the modal */
}

/* Allow long, unbroken strings in body text and table cells to wrap safely, but
   don't apply this to headings or probable brand elements which should remain
   unbroken. */
.section-modal-content p,
.section-modal-content li,
.section-modal-content td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Preserve brand and heading integrity: don't break sequences like PAWSRADAR */
.section-modal-content h1,
.section-modal-content h2,
.section-modal-content h3,
.section-modal-content .brand-name {
  overflow-wrap: normal;
  word-break: keep-all;
}

/* Close button styling intentionally removed: the pledge modal uses the
   external toggle control to open/close; close button markup and JS were
   removed to avoid collisions with the control gutter. */

/* Mobile Responsive */
@media (max-width: 640px) {
  .section-modal {
    width: 95%;
    max-height: 95vh;
    border-radius: 0.5rem;
  }
  
  .section-modal-content {
    padding: var(--space-6, 1.5rem);
  }
  
}

.dark .section-modal,
body.dark .section-modal,
html.dark .section-modal,
html[data-theme="dark"] .section-modal {
  background: #000000;
  color: #f9fafb;
}

/* Ensure the modal content itself is dark and interactive in dark mode */
.dark .section-modal-content,
body.dark .section-modal-content,
html.dark .section-modal-content,
html[data-theme="dark"] .section-modal-content {
  background: transparent; /* content uses inner backgrounds; keep transparent to avoid double framing */
  color: #f9fafb;
}

/* Force pointer events inside the modal so links remain clickable even if other
   UI rules try to delegate pointer-events globally. */
.section-modal,
.section-modal * {
  pointer-events: auto !important;
}

/* Prevent body scroll when modal is open */
body.section-modal-open {
  overflow: hidden;
}

/* Remove blue outline in all themes - use default box-shadow only */
.section-modal:focus-within {
  outline: none;
}

/* ============================================
   Donation Product Card Styles
   ============================================ */

/* Ensure donation card matches product card heights */
.donation-product-card {
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

/* Donation image area - matches product image aspect ratio */
.donation-product-card .donation-image {
  flex-shrink: 0;
}

/* Product content area for donation card */
.donation-product-card .product-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Donation UI container pushes to bottom like buy button */
.donation-product-card .donation-ui-container {
  margin-top: auto;
}

/* Ensure proper spacing in grid */
@media (min-width: 768px) {
  .donation-product-card {
    min-height: 400px; /* Match taller cards on larger screens */
  }
}

@media (min-width: 1024px) {
  .donation-product-card {
    min-height: 480px; /* Match tallest cards on desktop */
  }
}

/* Multi-color picker compact styles */
.color-multi { display:flex; align-items:center; gap:0.5rem; }
.color-multi-list { display:flex; gap:0.5rem; align-items:center; }
.color-multi-input { width:36px; height:36px; padding:0; border-radius:6px; }
.color-add-btn { width:36px; height:36px; display:inline-flex; align-items:center; justify-content:center; font-weight:600; border-radius:8px; border:1px solid rgba(185,28,28,0.15); background:transparent; color: rgb(185 28 28); cursor:pointer; transition: background-color 0.12s ease, transform 0.08s ease; }
.color-add-btn:hover:not(:disabled) { background: rgba(185,28,28,0.06); transform: translateY(-1px); }
.color-add-btn:active:not(:disabled) { transform: translateY(0); }
.color-add-btn:disabled { opacity:0.5; cursor:not-allowed; }

/* Hidden state applied when max items reached */
.color-add-btn.is-hidden { display:none !important; }



/* === src/css/mobile-optimization.css === */
/**
 * Mobile Responsiveness Optimization
 * Perfect mobile layout for map, forms, navigation, and all components
 */

/* ==========================================================================
   MOBILE-FIRST RESPONSIVE DESIGN
   ========================================================================== */

/* Base mobile styles (320px and up) */
@media (max-width: 480px) {
  /* Container adjustments */
  .container {
    padding: 0 var(--space-3);
    max-width: 100%;
  }

  /* Typography scaling */
  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);
  }

  /* Button adjustments */
  .btn {
    width: 100%;
    justify-content: center;
    padding: var(--space-4) var(--space-3);
    font-size: var(--font-size-base);
  }

  /* Form improvements */
  .form-input,
  .form-textarea,
  .form-select {
    font-size: var(--font-size-base);
    padding: var(--space-4);
  }

  /* Card adjustments */
  .card {
    padding: var(--space-4);
    margin-bottom: var(--space-4);
  }

  /* Grid system mobile-first */
  .grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  /* Spacing adjustments */
  .p-8 {
    padding: var(--space-4);
  }
  .p-6 {
    padding: var(--space-4);
  }
  .m-8 {
    margin: var(--space-4);
  }
  .m-6 {
    margin: var(--space-4);
  }

  /* Navigation improvements */
  nav {
    flex-direction: column;
    gap: var(--space-3);
  }

  nav a {
    width: 100%;
    text-align: center;
    padding: var(--space-3) var(--space-4);
  }
}

/* ==========================================================================
   MAP MOBILE OPTIMIZATION
   ========================================================================== */

@media (max-width: 768px) {
  /* Map container mobile adjustments */
  .map-container {
    height: 50vh;
    min-height: 400px;
    margin: var(--space-4) 0;
    border-radius: var(--radius-md);
  }

  /* Map statistics overlay mobile */
  .map-stats {
    top: var(--space-2);
    left: var(--space-2);
    right: var(--space-2);
  }

  .stat-card {
    padding: var(--space-3) var(--space-4);
    min-width: auto;
    width: 100%;
    font-size: var(--font-size-sm);
  }

  .stat-value {
    font-size: var(--font-size-xl);
  }

  .stat-label {
    font-size: var(--font-size-xs);
  }

  /* Map legend mobile */
  .map-legend {
    bottom: var(--space-2);
    left: var(--space-2);
    right: var(--space-2);
    padding: var(--space-3);
    font-size: var(--font-size-xs);
  }

  .legend-items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }

  /* Statistics panels mobile */
  .stats-panels {
    bottom: var(--space-2);
    right: var(--space-2);
    left: auto;
    max-width: 120px;
  }

  .stat-panel {
    padding: var(--space-2) var(--space-3);
    min-width: auto;
    font-size: var(--font-size-xs);
  }

  .stat-panel .stat-value {
    font-size: var(--font-size-lg);
  }

  .stat-panel .stat-label {
    font-size: var(--font-size-xs);
  }

  /* Map actions mobile */
  .map-actions {
    top: var(--space-2);
    right: var(--space-2);
    left: auto;
  }

  .action-btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
    min-width: 100px;
  }

  /* Map popup visuals are handled by MapLibre vendor CSS and the project's map bundle. */
}

/* ==========================================================================
   FORM MOBILE OPTIMIZATION
   ========================================================================== */

@media (max-width: 768px) {
  /* Form container */
  .form-container {
    padding: var(--space-4);
    margin: var(--space-4) 0;
  }

  /* Form groups */
  .form-group {
    margin-bottom: var(--space-4);
  }

  /* Form labels */
  .form-label {
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-2);
    font-weight: var(--font-weight-semibold);
  }

  /* Form inputs */
  .form-input,
  .form-textarea,
  .form-select {
    padding: var(--space-4);
    font-size: var(--font-size-base);
    border-radius: var(--radius-md);
    line-height: var(--line-height-normal);
  }

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

  /* Form buttons */
  .form-submit {
    width: 100%;
    padding: var(--space-4) var(--space-6);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-top: var(--space-4);
  }

  /* Form validation messages */
  .form-error,
  .form-help {
    font-size: var(--font-size-sm);
    margin-top: var(--space-2);
    line-height: var(--line-height-normal);
  }

  /* Form success state */
  .form-success {
    padding: var(--space-4);
    border-radius: var(--radius-md);
    margin: var(--space-4) 0;
    text-align: center;
  }
}

/* ==========================================================================
   NAVIGATION MOBILE OPTIMIZATION
   ========================================================================== */

@media (max-width: 768px) {
  /* Header mobile */
  header {
    padding: var(--space-6) var(--space-4);
    min-height: 90vh;
  }

  /* Main title mobile */
  header h1 {
    font-size: clamp(2.5rem, 12vw, 5rem);
    margin-bottom: var(--space-6);
    line-height: 0.9;
  }

  /* Navigation mobile */
  header nav {
    flex-direction: column;
    gap: var(--space-4);
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }

  header nav a {
    width: 100%;
    padding: var(--space-4) var(--space-6);
    font-size: var(--font-size-lg);
    text-align: center;
    border-radius: var(--radius-lg);
    /* Remove light-pink background on mobile while keeping spacing —
       we preserve an accessible focus outline instead of filling the
       entire link with a background color. */
    background: transparent;
    transition:
      transform var(--transition-fast),
      opacity var(--transition-fast);
  }

  header nav a:hover,
  header nav a:focus {
    /* Don't fill the link on hover/focus to avoid large colored boxes.
       Use a visible outline + subtle shadow for pointer and keyboard
       users to indicate interaction without changing background. */
    background: transparent;
    color: var(--accent-color);
    transform: none;
    box-shadow: var(--shadow-lg);
    outline: 3px solid rgba(0,0,0,0);
    outline-offset: 3px;
  }
}

/* ==========================================================================
   CONTENT SECTIONS MOBILE OPTIMIZATION
   ========================================================================== */

@media (max-width: 768px) {
  /* Section spacing */
  section {
    padding: 0;
  }

  /* Section headings */
  section h2 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-6);
    text-align: center;
  }

  section h3 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-4);
  }

  /* Section content */
  section p {
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
    margin-bottom: var(--space-4);
  }

  /* Lists */
  section ul,
  section ol {
    padding-left: var(--space-6);
    margin-bottom: var(--space-4);
  }

  section li {
    margin-bottom: var(--space-2);
    line-height: var(--line-height-relaxed);
  }
}

/* ==========================================================================
   PRODUCT CARDS MOBILE OPTIMIZATION
   ========================================================================== */

@media (max-width: 768px) {
  /* Product grid */
  .products-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    padding: var(--space-4);
  }

  /* Product card */
  .product-card {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    text-align: center;
  }

  /* Product image */
  .product-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 0 auto var(--space-4);
    border-radius: var(--radius-md);
  }

  /* Product title */
  .product-title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-3);
  }

  /* Product description */
  .product-description {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
    margin-bottom: var(--space-4);
  }

  /* Product price */
  .product-price {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--accent-color);
    margin-bottom: var(--space-4);
  }

  /* Product button */
  .product-button {
    width: 100%;
    padding: var(--space-4) var(--space-6);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
  }
}

/* ==========================================================================
   FOOTER MOBILE OPTIMIZATION
   ========================================================================== */

@media (max-width: 768px) {
  footer {
    padding: var(--space-8) var(--space-4);
    text-align: center;
  }

  footer .footer-content {
    flex-direction: column;
    gap: var(--space-6);
  }

  footer .footer-section {
    width: 100%;
    text-align: center;
  }

  footer .footer-title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-3);
  }

  footer .footer-links {
    flex-direction: column;
    gap: var(--space-3);
  }

  footer .footer-link {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-base);
  }
}

/* ==========================================================================
   TOUCH AND GESTURE OPTIMIZATION
   ========================================================================== */

/* Touch-friendly targets */
@media (pointer: coarse) {
  /* Minimum touch target size (44x44px) */
  a,
  button,
  input[type='submit'],
  input[type='button'],
  .btn,
  .form-input,
  .form-select,
  .form-textarea {
    min-height: 44px;
    min-width: 44px;
  }

  /* Button padding for touch */
  .btn {
    padding: var(--space-3) var(--space-6);
  }

  /* Form input padding for touch */
  .form-input,
  .form-textarea,
  .form-select {
    padding: var(--space-4);
  }

  /* Navigation link padding for touch */
  nav a {
    padding: var(--space-3) var(--space-4);
  }
}

/* ==========================================================================
   SCROLL OPTIMIZATION
   ========================================================================== */

/* Smooth scrolling enhancements */
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-16);
}

/* iOS momentum scrolling */
body {
  -webkit-overflow-scrolling: touch;
}

/* Scroll snap for sections */
@media (max-width: 768px) {
  main {
    scroll-snap-type: y proximity;
  }

  section {
    scroll-snap-align: start;
  }
}

/* ==========================================================================
   ORIENTATION CHANGE HANDLING
   ========================================================================== */

/* Landscape mobile adjustments */
@media (max-width: 768px) and (orientation: landscape) {
  header {
    min-height: auto;
    padding: var(--space-4);
  }

  header h1 {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--space-4);
  }

  header nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-3);
  }

  header nav a {
    width: auto;
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-base);
  }

  .map-container {
    height: 70vh;
    min-height: 300px;
  }
}

/* ==========================================================================
   ACCESSIBILITY ENHANCEMENTS
   ========================================================================== */

/* Focus indicators */
@media (max-width: 768px) {
  /* Avoid forcing outlines for all elements on mobile; prefer :focus-visible with brand ring */
  *:focus {
    outline: none !important;
    box-shadow: none !important;
  }

  *:focus-visible {
    outline: none !important;
    box-shadow: var(--brand-focus-ring) !important;
    outline-offset: 2px;
  }

  /* Skip links */
  .sr-only:focus {
    position: absolute !important;
    top: var(--space-4) !important;
    left: var(--space-4) !important;
    right: var(--space-4) !important;
    width: auto !important;
    height: auto !important;
    padding: var(--space-4) !important;
    font-size: var(--font-size-lg) !important;
    z-index: var(--z-toast) !important;
  }
}

/* ==========================================================================
   PERFORMANCE OPTIMIZATIONS
   ========================================================================== */

/* Reduce motion for mobile if preferred */
@media (prefers-reduced-motion: reduce) and (max-width: 768px) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .map-container {
    transform: none !important;
  }
}

/* Battery optimization */
@media (prefers-reduced-transparency) and (max-width: 768px) {
  .map-stats,
  .map-legend,
  .stats-panels {
    backdrop-filter: none;
    background: var(--surface-bg);
  }
}

/* ==========================================================================
   VERY SMALL SCREENS (320px and below)
   ========================================================================== */

@media (max-width: 320px) {
  .container {
    padding: 0 var(--space-2);
  }

  header h1 {
    font-size: clamp(2rem, 10vw, 4rem);
  }

  .btn {
    padding: var(--space-3);
    font-size: var(--font-size-sm);
  }

  .map-container {
    height: 40vh;
    min-height: 300px;
  }

  .stat-card,
  .stat-panel {
    padding: var(--space-2);
    font-size: var(--font-size-xs);
  }

  .action-btn {
    padding: var(--space-2);
    font-size: var(--font-size-xs);
  }
}

