/* =============================================================================
   MILIVAULT DESIGN SYSTEM - TYPOGRAPHY & VISUAL IMPROVEMENTS
   ============================================================================= */

/* ===== TYPOGRAPHY SYSTEM ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Typography Scale */
  --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;
  --font-size-3xl: 30px;
  
  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Line Heights */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  
  /* Design System Spacing Scale: 8 / 16 / 24 / 32px */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 40px;  /* Extended for flexibility */
  --space-2xl: 48px;
  --space-3xl: 64px;
  
  /* Design System Tokens */
  --radius-card: 8px;
  --radius-pill: 16px;
  --shadow-small: 0 1px 2px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
  --text-base: 16px;
  --text-title: 20px;
  --text-title-large: 22px;
  --text-meta: 13px;
  --text-meta-large: 14px;
  
  /* Professional Military Palette - Inspired by Cyclist Logo */
  --color-background: #fafaf7;
  --color-surface: #ffffff;
  --color-surface-soft: #f5f5f0;
  --color-surface-elevated: #fcfcfa;
  --color-border-light: #e8e6d8;
  --color-border: #d4d2aa;
  --color-border-strong: #a8a682;

  /* Text Colors - Match Milivault logo text color */
  --color-text-primary: #2F3A3D;
  --color-text-secondary: #3f4f52;
  --color-text-tertiary: #556366;
  --color-text-muted: #6b7779;

  /* Military-Inspired Accent Colors */
  --color-accent-primary: #4a5d23;
  --color-accent-primary-hover: #3d4f1c;
  --color-accent-primary-light: #e8eadf;
  --color-accent-secondary: #5a5a5a;
  --color-accent-secondary-hover: #454545;
  --color-accent-tertiary: #b8860b;
  --color-accent-tertiary-hover: #9a7209;  /* Interactive States */
  --color-hover: #f1f5f9;
  --color-hover-strong: #e2e8f0;
  --color-active: #cbd5e1;
  
  /* Status Colors - Deeper Brand Tones */
  --color-available: #5d7c32;
  --color-available-bg: #f0f2e8;
  --color-available-border: #d0dbb8;
  --color-sold: #9b6b6b;
  --color-sold-bg: #f5f0f0;
  --color-sold-border: #e0d0d0;
  --color-warning: #b8860b;
  --color-warning-light: #f8f3e8;
  --color-warning-border: #f0e6d2;
  
  /* 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), 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);
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: all 0.15s ease;
  --transition-normal: all 0.2s ease;
  --transition-slow: all 0.3s ease;
}

/* ===== BASE TYPOGRAPHY ===== */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== HEADING HIERARCHY ===== */
h1 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  margin: 0 0 var(--space-lg) 0;
  color: var(--color-text-primary);
}

h2 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  margin: 0 0 var(--space-md) 0;
  color: var(--color-text-primary);
}

h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  margin: 0 0 var(--space-md) 0;
  color: var(--color-text-primary);
}

h4 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal);
  margin: 0 0 var(--space-sm) 0;
  color: var(--color-text-secondary);
}

p {
  margin: 0 0 var(--space-md) 0;
  color: var(--color-text-primary);
}

/* ===== CLUSTER IMPROVEMENTS ===== */
.cluster-container {
  margin: var(--space-3xl) 0;
}

.cluster-container:first-child {
  margin-top: 0; /* Remove space above first cluster */
}

.cluster-header {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-light);
  border-left: 4px solid var(--color-accent-primary);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin: 0 0 var(--space-xl) 0;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.cluster-header:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.cluster-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cluster-site-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.cluster-site-name {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin: 0;
  color: var(--color-text-primary);
}

.cluster-date-range {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: var(--space-xs) 0 0 0;
}

.cluster-item-count {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-tertiary);
  background: var(--color-surface);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-light);
}

.cluster-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-light);
}

/* ===== PRODUCT CARD STANDARDIZATION ===== */
.product-tile {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.product-tile:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--color-accent-primary-light);
  background: var(--color-surface-elevated);
}

.product-tile:hover .product-tile-image {
  transform: scale(1.02);
}

.product-tile:hover .product-tile-title {
  color: var(--color-accent-primary);
}

.product-tile-image {
  width: 100%;
  height: 180px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: var(--space-md);
  transition: var(--transition-normal);
  background: var(--color-surface-soft);
  position: relative;
  
  /* Ensure consistent 4:3 aspect ratio */
  aspect-ratio: 4/3;
}

.product-tile-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(0,0,0,0.05) 100%);
  pointer-events: none;
  z-index: 1;
}

.product-tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: var(--transition-normal);
  display: block;
}

/* Enhanced image states */
.product-tile:hover .product-tile-image::before {
  background: linear-gradient(135deg, transparent 0%, rgba(0,0,0,0.02) 100%);
}

.product-tile-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-tile-title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-tight);
  margin: 0 0 var(--space-sm) 0;
  color: var(--color-text-primary);
  
  /* Limit to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-tile-price {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-accent-primary);
  margin: 0 0 var(--space-xs) 0;
  font-feature-settings: 'tnum'; /* Tabular numbers for better alignment */
}

.product-tile-price--na {
  color: var(--color-text-tertiary);
  font-weight: var(--font-weight-medium);
  font-style: italic;
}

.product-tile-meta {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-top: auto;
}

.product-tile-badge {
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  margin-top: var(--space-sm);
}

.product-tile-badge--available {
  background: var(--color-success-light);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

.product-tile-badge--sold {
  background: var(--color-error-light);
  color: var(--color-error);
  border: 1px solid var(--color-error-border);
}

/* ===== CONSISTENT BADGE SYSTEM ===== */
.badge {
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  transition: var(--transition-fast);
}

.badge--success {
  background: var(--color-success-light);
  color: var(--color-success);
  border-color: var(--color-success-border);
}

.badge--error {
  background: var(--color-error-light);
  color: var(--color-error);
  border-color: var(--color-error-border);
}

.badge--warning {
  background: var(--color-warning-light);
  color: var(--color-warning);
  border-color: var(--color-warning-border);
}

.badge--neutral {
  background: var(--color-hover);
  color: var(--color-text-secondary);
  border-color: var(--color-border-light);
}

/* ===== ENHANCED FORM CONTROLS ===== */
input[type="text"],
input[type="search"],
select,
textarea {
  font-family: var(--font-family-primary);
  transition: var(--transition-fast);
}

input[type="text"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 3px var(--color-accent-primary-light);
}

input[type="text"]:hover,
select:hover {
  border-color: var(--color-border-strong);
}

/* ===== ENHANCED BUTTONS ===== */
button,
.btn {
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-height: 44px; /* Accessibility: minimum touch target */
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--font-size-base);
  line-height: var(--line-height-tight);
  position: relative;
  overflow: hidden;
}

button:hover,
.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

button:active,
.btn:active {
  transform: translateY(0);
}

button:disabled,
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Primary Button */
.btn-primary {
  background: var(--color-accent-primary);
  color: white;
  border-color: var(--color-accent-primary);
}

.btn-primary:hover {
  background: var(--color-accent-primary-hover);
  border-color: var(--color-accent-primary-hover);
}

.btn-primary:focus {
  box-shadow: 0 0 0 4px var(--color-accent-primary-light);
}

/* Secondary Button */
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-hover);
  border-color: var(--color-border-strong);
  color: var(--color-text-primary);
}

/* Success Button */
.btn-success {
  background: var(--color-success);
  color: white;
  border-color: var(--color-success);
}

.btn-success:hover {
  background: var(--color-success-hover, #15803d);
  border-color: var(--color-success-hover, #15803d);
}

/* Danger Button */
.btn-danger {
  background: var(--color-error);
  color: white;
  border-color: var(--color-error);
}

.btn-danger:hover {
  background: var(--color-error-hover, #b91c1c);
  border-color: var(--color-error-hover, #b91c1c);
}

/* Button Sizes */
.btn-sm {
  min-height: 36px;
  padding: var(--space-xs) var(--space-md);
  font-size: var(--font-size-sm);
}

.btn-lg {
  min-height: 52px;
  padding: var(--space-md) var(--space-xl);
  font-size: var(--font-size-lg);
}

/* Button with icon */
.btn-with-icon {
  gap: var(--space-sm);
}

.btn-icon-only {
  min-width: 44px;
  padding: var(--space-sm);
}

/* Loading state */
.btn-loading {
  color: transparent;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Save button specific styles */
.save-btn {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  z-index: 2;
  min-height: 32px;
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-xs);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border: 1px solid var(--color-border-light);
  color: var(--color-text-secondary);
  transition: var(--transition-fast);
}

.save-btn:hover {
  background: var(--color-surface);
  color: var(--color-accent-primary);
  transform: scale(1.05);
}

.btn-saved {
  background: var(--color-success-light);
  color: var(--color-success);
  border-color: var(--color-success-border);
}

.btn-unsaved:hover {
  background: var(--color-accent-primary-light);
  color: var(--color-accent-primary);
  border-color: var(--color-accent-primary);
}

/* ===== ENHANCED HEADER & FOOTER ===== */

/* Enhanced Header Styling */
header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-sm);
  position: relative;
}

header::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--color-border-light) 20%, var(--color-border-light) 80%, transparent 100%);
}

.beta-notice {
  background: linear-gradient(135deg, var(--color-warning-light) 0%, rgba(251, 191, 36, 0.1) 100%);
  color: var(--color-warning);
  text-align: center;
  padding: var(--space-xs) var(--space-md);
  font-size: var(--font-size-sm);
  border-bottom: 1px solid rgba(251, 191, 36, 0.2);
  font-weight: var(--font-weight-medium);
  position: relative;
}

.beta-notice::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23f59e0b' fill-opacity='0.03'%3E%3Cpath d='M0 0h40v40H0z'/%3E%3Cpath d='M20 0L0 20v20l20-20 20 20V20z'/%3E%3C/g%3E%3C/svg%3E") repeat;
  pointer-events: none;
  opacity: 0.5;
}

/* Enhanced Footer Styling */
footer {
  background: linear-gradient(135deg, var(--color-surface-soft) 0%, var(--color-surface-elevated) 100%);
  border-top: 1px solid var(--color-border-light);
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  margin-top: auto;
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--color-border-light) 20%, var(--color-border-light) 80%, transparent 100%);
}

footer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23a8a29e' fill-opacity='0.02'%3E%3Cpath d='M30 30h30v30H30z'/%3E%3Cpath d='M30 0h30v30H30z'/%3E%3Cpath d='M0 30h30v30H0z'/%3E%3Cpath d='M0 0h30v30H0z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
  pointer-events: none;
  opacity: 0.3;
}

/* ===== SUBTLE TEXTURES & PATTERNS ===== */

/* Main content area texture */
main {
  position: relative;
}

main::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23f7f5f1' fill-opacity='0.03'%3E%3Cpath d='M0 0h100v100H0z'/%3E%3Cpath d='M50 0v100M0 50h100'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

.main-inner {
  position: relative;
  z-index: 1;
}

/* Cluster background enhancement */
.cluster-header::before {
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
}

/* Enhanced product card texture */
.product-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23f8f6f2' fill-opacity='0.02'%3E%3Cpath d='M20 20c0 11.046-8.954 20-20 20s-20-8.954-20-20 8.954-20 20-20 20 8.954 20 20z'/%3E%3C/g%3E%3C/svg%3E") repeat;
  pointer-events: none;
  border-radius: var(--radius-md);
  z-index: 0;
}

.product-tile-content {
  position: relative;
  z-index: 1;
}

/* ===== CURRENCY CONVERTER ===== */

.currency-bar {
  background: linear-gradient(135deg, var(--color-surface-soft) 0%, var(--color-surface) 100%);
  border-bottom: 1px solid var(--color-border-subtle);
  padding: var(--space-xs) 0;
}

.currency-converter {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
}

.currency-label {
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  margin: 0;
}

.currency-select {
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
}

.currency-select:hover {
  border-color: var(--accent-color);
  box-shadow: 0 2px 4px var(--shadow-color);
}

.currency-select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--color-accent-alpha);
}

.currency-status {
  color: var(--color-text-tertiary);
  font-size: var(--font-size-xs);
  font-style: italic;
  margin-left: auto;
}

.currency-status.success {
  color: var(--color-success);
}

.currency-status.error {
  color: var(--color-error);
}

/* Price conversion styling */
.price-converted {
  font-size: var(--text-meta);
  color: var(--color-text-secondary);
  margin: 0;
  font-style: normal;
  opacity: 0.75;
  display: block;
}

.price-converted::before {
  content: "≈ ";
  opacity: 0.7;
}

.product-card-wrapper {
  height: 100%;
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #e6e2d7;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: var(--color-text-primary);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  position: relative;
}

.product-card:hover,
.product-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  border-color: rgba(90, 102, 70, 0.4);
  outline: none;
}

.product-card:focus-visible {
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16);
}

.product-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, #f5f1e8 0%, #e8dfc4 100%);
}

.product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
  display: block;
}

.product-card:hover .product-card__image {
  transform: scale(1.02);
}

.product-card__placeholder {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: #a89968;
  background: linear-gradient(135deg, #f5f1e8 0%, #e8dfc4 100%);
  font-size: 12px;
}

.product-card__badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: var(--text-meta);
  font-weight: var(--font-weight-medium);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  border: 1px solid transparent;
  pointer-events: none;
}

.product-card__badge--available {
  background: rgba(116, 128, 86, 0.18);
  border-color: rgba(116, 128, 86, 0.35);
  color: #5f663d;
}

.product-card__badge--sold {
  background: rgba(148, 82, 74, 0.16);
  border-color: rgba(148, 82, 74, 0.32);
  color: #8a4b42;
}

.product-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.product-card__title {
  margin: 0;
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card__pricing {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-card__price {
  font-size: var(--text-title);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
}

.product-card__price--missing {
  color: var(--color-text-secondary);
}

/* Responsive currency bar */
@media (max-width: 768px) {
  .currency-converter {
    padding: 0 var(--space-md);
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
  
  .currency-status {
    margin-left: 0;
    margin-top: var(--space-xs);
    width: 100%;
  }
}

@media (max-width: 480px) {
  .currency-bar {
    padding: var(--space-xs);
  }
  
  .currency-converter {
    flex-direction: column;
    gap: var(--space-xs);
  }
  
  .currency-select {
    width: 100%;
    max-width: 200px;
  }
}

/* ===== NEW DESIGN SYSTEM COMPONENTS ===== */

/* Range Pills */
.range-pill:hover {
  background: var(--color-surface-elevated) !important;
  border-color: var(--accent-color) !important;
  transform: translateY(-1px);
}

/* Filters Panel */
.filters-panel input:focus,
.filters-panel select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

/* Product Cards - Accent Stripe Design */
.accent-stripe-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-left: 3px solid #2563eb;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.accent-stripe-card:hover {
  transform: translateY(-2px);
  border-color: #2563eb;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Site-specific accent colors */
.accent-stripe-card[data-site*="militaria"] {
  border-left-color: #059669; /* Green for militaria sites */
}

.accent-stripe-card[data-site*="chase"] {
  border-left-color: #dc2626; /* Red for chase */
}

.accent-stripe-card[data-site*="ebay"] {
  border-left-color: #7c3aed; /* Purple for ebay */
}

.accent-stripe-card[data-site*="auction"] {
  border-left-color: #ea580c; /* Orange for auction sites */
}

/* Ensure consistent card heights */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-sm);
}

/* Cluster Animation */
@keyframes fade-in-cluster {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== ENHANCED CLUSTER HEADERS ===== */

.cluster-logo-container {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.cluster-logo-fallback {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--accent-color);
  color: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
}

.cluster-text-content {
  min-width: 0; /* Allow text to wrap */
}

.cluster-site-name-enhanced {
  margin: 0 0 var(--space-xs) 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}

.cluster-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.cluster-stats span {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.cluster-count-badge {
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  text-align: center;
  min-width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.cluster-count-number {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.cluster-count-label {
  font-size: var(--font-size-xs);
  opacity: 0.8;
  line-height: 1;
}

/* Better responsive behavior for cluster headers */
@media (max-width: 768px) {
  .cluster-header-content {
    flex-direction: column;
    gap: var(--space-sm);
    align-items: flex-start;
  }
  
  .cluster-item-count-enhanced {
    align-self: flex-end;
  }
  
  .cluster-stats {
    flex-direction: column;
    gap: var(--space-xs);
  }
}

@media (max-width: 480px) {
  .cluster-site-info {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }
  
  .cluster-logo-container {
    align-self: center;
  }
  
  .cluster-text-content {
    text-align: center;
  }
  
  .cluster-item-count-enhanced {
    align-self: center;
  }
}

/* ===== ENHANCED LAZY LOADING & IMAGES ===== */

/* Loading state for images */
.product-tile-image {
  background: linear-gradient(90deg, var(--color-surface-soft) 25%, rgba(255,255,255,0.5) 50%, var(--color-surface-soft) 75%);
  background-size: 200px 100%;
  animation: shimmer 2s infinite linear;
}

.product-tile-image img {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-tile-image img.loaded {
  opacity: 1;
}

/* Image placeholder with icon */
.image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-soft);
  color: var(--color-text-tertiary);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
}

.image-placeholder::before {
  content: '🖼️';
  font-size: var(--font-size-2xl);
  opacity: 0.5;
}

/* Progressive image enhancement */
.progressive-image {
  position: relative;
  overflow: hidden;
}

.progressive-image-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-surface-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.progressive-image img {
  position: relative;
  z-index: 1;
}

/* ===== RESPONSIVE CONSISTENCY ===== */

/* Consistent spacing scale across all devices */
@media (max-width: 1400px) {
  :root {
    --space-3xl: 48px; /* Reduced from 64px */
  }
}

@media (max-width: 1200px) {
  :root {
    --space-2xl: 32px; /* Reduced from 48px */
    --space-3xl: 40px; /* Reduced from 64px */
  }
  
  .header-inner {
    padding: var(--space-md) var(--space-md);
  }
  
  nav {
    gap: var(--space-lg); /* Reduced from xl */
  }
}

@media (max-width: 768px) {
  :root {
    --space-xl: 24px; /* Reduced from 32px */
    --space-2xl: 24px; /* Reduced from 48px */
    --space-3xl: 32px; /* Reduced from 64px */
  }
  
  .header-inner {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }
  
  nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
  }
  
  .logo {
    height: 80px; /* Reduced for mobile */
  }
  
  /* Stack filter form on mobile */
  .filter-form-mobile {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-form-mobile > * {
    margin-bottom: var(--space-sm);
  }
}

@media (max-width: 480px) {
  :root {
    --space-lg: 16px; /* Reduced from 24px */
    --space-xl: 20px; /* Reduced from 32px */
    --space-2xl: 20px; /* Reduced from 48px */
  }
  
  .container {
    padding: 0 var(--space-md);
  }
  
  main {
    padding: var(--space-lg) 0;
  }
  
  .beta-notice {
    font-size: var(--font-size-xs);
    padding: var(--space-xs);
  }
  
  /* Ensure minimum touch targets on small screens */
  button, .btn, select, input {
    min-height: 44px;
  }
}

/* Print styles */
@media print {
  .beta-notice,
  .save-btn,
  nav,
  footer::before,
  footer::after,
  main::before {
    display: none !important;
  }
  
  .product-tile {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .cluster-header {
    break-inside: avoid;
    box-shadow: none;
  }
}

/* ===== ENHANCED LINKS ===== */
a {
  color: var(--color-accent-primary);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--color-accent-primary-hover);
  text-decoration: underline;
}

/* ===== NAVIGATION IMPROVEMENTS ===== */
header {
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-border-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.logo {
  height: 87px; /* Reduced by ~8% from 95px for better nav balance */
  transition: var(--transition-fast);
  margin-top: 3px; /* Nudge down to align baseline with nav */
}

.logo:hover {
  transform: scale(1.02);
}

nav {
  display: flex;
  gap: var(--space-xl);
  align-items: center;
  line-height: 1.7; /* Increased line-height for better baseline alignment with logo */
}

nav a {
  text-decoration: none;
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  position: relative;
}

nav a:hover {
  color: var(--color-accent-primary);
  background: var(--color-hover);
  text-decoration: none;
  transform: translateY(-1px);
}

nav a:active {
  transform: translateY(0);
}

/* Beta Notice Styling */
.beta-notice {
  background: var(--color-warning-light);
  color: var(--color-warning);
  text-align: center;
  padding: var(--space-xs) var(--space-md);
  font-size: var(--font-size-sm);
  border-bottom: 1px solid var(--color-warning-border);
  font-weight: var(--font-weight-medium);
}

/* ===== GRID SYSTEM & ALIGNMENT ===== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-lg);
}

.col-span-1 { grid-column: span 1; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }
.col-span-6 { grid-column: span 6; }
.col-span-8 { grid-column: span 8; }
.col-span-9 { grid-column: span 9; }
.col-span-12 { grid-column: span 12; }

/* Vertical Rhythm */
.space-y > * + * {
  margin-top: var(--space-md);
}

.space-y-lg > * + * {
  margin-top: var(--space-lg);
}

.space-y-xl > * + * {
  margin-top: var(--space-xl);
}

/* ===== ENHANCED CLUSTER STYLING ===== */
.cluster-header {
  position: relative;
}

.cluster-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--cluster-tint, var(--color-surface-soft));
  opacity: 0.3;
  border-radius: var(--radius-md);
  pointer-events: none;
}

.cluster-header-content {
  position: relative;
  z-index: 1;
}

/* Subtle color tints for different sites */
.cluster-tint-1 { --cluster-tint: #e0f2fe; } /* Light blue */
.cluster-tint-2 { --cluster-tint: #f0fdf4; } /* Light green */
.cluster-tint-3 { --cluster-tint: #fef7cd; } /* Light yellow */
.cluster-tint-4 { --cluster-tint: #fef2f2; } /* Light red */
.cluster-tint-5 { --cluster-tint: #f3e8ff; } /* Light purple */
.cluster-tint-6 { --cluster-tint: #fff7ed; } /* Light orange */
.cluster-tint-7 { --cluster-tint: #ecfdf5; } /* Light emerald */
.cluster-tint-8 { --cluster-tint: #f0f9ff; } /* Light sky */
.cluster-tint-9 { --cluster-tint: #fdf4ff; } /* Light fuchsia */
.cluster-tint-10 { --cluster-tint: #f5f3ff; } /* Light indigo */
.cluster-tint-11 { --cluster-tint: #fffbeb; } /* Light amber */
.cluster-tint-12 { --cluster-tint: #f1f5f9; } /* Light slate */

.cluster-logo-enhanced {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--color-surface);
  box-shadow: var(--shadow-sm);
  background: var(--color-surface);
  padding: var(--space-xs);
  transition: var(--transition-fast);
}

.cluster-logo-enhanced:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.cluster-site-name-enhanced {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin: 0;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.cluster-stats {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.cluster-item-count-enhanced {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-full);
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
}

/* ===== HOME PAGE COMPACT CLUSTER HEADERS ===== */
.cluster-header-compact {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-light);
  border-left: 3px solid var(--color-accent-primary);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  margin: var(--space-lg) 0 var(--space-md) 0;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.cluster-header-compact:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.cluster-header-compact .cluster-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cluster-header-compact .cluster-site-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.cluster-compact-logo {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-light);
  background: var(--color-surface);
  padding: var(--space-xs);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cluster-compact-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cluster-compact-count {
  background: var(--color-accent-primary);
  color: white;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

/* ===== TIME LABELS STANDARDIZATION ===== */
.time-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  font-weight: var(--font-weight-normal);
  text-transform: lowercase;
}

.time-badge {
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  backdrop-filter: blur(4px);
}

/* ===== SECTION DIVIDERS ===== */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--color-border-light) 20%, var(--color-border-light) 80%, transparent 100%);
  margin: var(--space-3xl) 0;
  position: relative;
}

.section-divider--subtle {
  height: 1px;
  background: var(--color-border-light);
  margin: var(--space-2xl) 0;
  opacity: 0.5;
}

.section-divider--with-text {
  display: flex;
  align-items: center;
  margin: var(--space-3xl) 0;
  color: var(--color-text-tertiary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.section-divider--with-text::before,
.section-divider--with-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border-light);
}

.section-divider--with-text::before {
  margin-right: var(--space-md);
}

.section-divider--with-text::after {
  margin-left: var(--space-md);
}

/* ===== ENHANCED ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: 200px 0;
  }
}

/* Animation Classes */
.animate-fade-in {
  animation: fadeIn 0.6s ease-out;
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out;
}

.animate-slide-in {
  animation: slideIn 0.6s ease-out;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

/* Staggered animations for grids */
.stagger-animation > * {
  animation: fadeInUp 0.6s ease-out;
  animation-fill-mode: both;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }
.stagger-animation > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-animation > *:nth-child(8) { animation-delay: 0.8s; }
.stagger-animation > *:nth-child(9) { animation-delay: 0.9s; }
.stagger-animation > *:nth-child(10) { animation-delay: 1.0s; }

/* ===== ACCESSIBILITY & CONTRAST IMPROVEMENTS ===== */

/* Respect user's motion preferences */
@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;
  }
  
  .stagger-animation > * {
    animation: none;
  }
}

/* Enhanced focus indicators for accessibility */
*:focus {
  outline: 2px solid var(--color-accent-primary);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--color-accent-primary);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --color-text-primary: #000000;
    --color-text-secondary: #333333;
    --color-background: #ffffff;
    --color-border: #000000;
    --color-accent-primary: #0000ff;
  }
}

/* Enhanced button focus states */
button:focus,
.btn:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--color-accent-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--color-accent-primary-light);
}

/* Screen reader only text */
.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;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--color-accent-primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  z-index: 9999;
  transition: var(--transition-fast);
}

.skip-link:focus {
  top: 6px;
}