/* Modern MesseOrder CSS - Complete Redesign (Brand Compliant) */

/* ============================================================================
   GLOBAL BEHAVIOR
   ============================================================================ */
html {
  scroll-behavior: smooth; /* Native smooth scrolling (no JavaScript needed) */
}

/* Disable scroll anchoring to prevent layout shift warnings */
html,
body,
#content,
.messe_planer {
  overflow-anchor: none;
}

/* ============================================================================
   ACCESSIBILITY - SKIP TO CONTENT LINK
   ============================================================================ */
/* Hidden by default, visible when focused with keyboard (Tab key) */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 0;
  z-index: 10000;
  padding: 0.75rem 1.5rem;
  background-color: var(--primary-color, #9e0028);
  color: white;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 0.5rem 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: top 0.2s ease;
}

.skip-to-content:focus {
  top: 0;
  outline: 3px solid var(--accent-color, #f39c12);
  outline-offset: 2px;
}

/* ============================================================================
   CSS CUSTOM PROPERTIES (DESIGN SYSTEM)
   ============================================================================ */
:root {
  /* M.A.X. Messeplaner Brand Colors */
  --primary-color: #9e0028;
  --primary-light: #c41e3a;
  --primary-dark: #580218;
  --secondary-color: #5486B8;
  --secondary-light: #6b9bd2;
  --secondary-dark: #1D395C;
  --accent-color: #f39c12;
  --accent-light: #f5b041;
  --accent-dark: #e67e22;
  
  /* Neutral Colors */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Semantic Colors */
  --success-color: #2ecc71;
  --success-light: #d1fae5;
  --warning-color: #f1c40f;
  --warning-light: #fef3c7;
  --danger-color: #e74c3c;
  --danger-light: #fee2e2;
  --info-color: #5486B8;
  --info-light: #e0f2fe;
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  
  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  
  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-light: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px 0 rgb(0 0 0 / 0.06);
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 200ms ease;
  --transition-slow: 300ms ease;
  
  /* Layout */
  --header-height: 72px;
  --max-width: 1280px;
  
  /* Z-Index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 2000;
  --z-header: 3000;
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-y: scroll; /* Always show scrollbar to prevent layout shift */
}

body {
  font-family: var(--font-primary);
  color: var(--gray-800);
  background-color: var(--gray-100);
  min-height: 100vh;
  padding-top: 100px; /* Account for header (70px) + notice (~30px) */
  display: flex;
  flex-direction: column;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--gray-900);
}

h1 { font-size: var(--text-4xl); margin-bottom: var(--space-6); }
h2 { font-size: var(--text-3xl); margin-bottom: var(--space-5); }
h3 { font-size: var(--text-2xl); margin-bottom: var(--space-4); }
h4 { font-size: var(--text-xl); margin-bottom: var(--space-3); }
h5 { font-size: var(--text-lg); margin-bottom: var(--space-3); }
h6 { font-size: var(--text-base); margin-bottom: var(--space-2); }

p {
  margin-bottom: var(--space-4);
  line-height: 1.6;
}

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

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  border: none;
}

/* ============================================================================
   LAYOUT
   ============================================================================ */
#content {
  margin-top: 0;  /* Body padding-top handles header spacing */
  padding: 0 var(--space-6);
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  flex: 1;
}

/* ============================================================================
   GLOBAL LAYOUT IMPROVEMENTS
   ============================================================================ */
.page-header {
  background: linear-gradient(135deg, white 0%, var(--gray-50) 100%);
  padding: var(--space-6) var(--space-4);
  margin-bottom: var(--space-6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.page-header h1 {
  color: var(--primary-color);
  margin-bottom: var(--space-2);
  font-weight: 700;
}

.page-header p {
  color: var(--gray-600);
  margin-bottom: 0;
}

/* Cart and content containers */
.cart-container, .content-container {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.cart-header, .content-header {
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  padding: var(--space-6);
  border-bottom: 1px solid var(--gray-200);
}

.cart-items, .content-body {
  padding: var(--space-6);
}

/* Product and item cards site-wide */
.product-card, .item-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.product-card:hover, .item-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

/* Buttons - improve existing styles */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition-normal);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: var(--text-sm);
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: white;
  text-decoration: none;
}

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

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
  text-decoration: none;
}

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

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

/* Alerts and notifications */
.alert {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  border: 1px solid transparent;
}

.alert-warning {
  background: var(--warning-light);
  color: var(--gray-800);
  border-color: var(--warning-color);
}

.alert-success {
  background: var(--success-light);
  color: var(--gray-800);
  border-color: var(--success-color);
}

.alert-danger {
  background: var(--danger-light);
  color: var(--gray-800);
  border-color: var(--danger-color);
}

/* ============================================================================
   HEADER & NAVIGATION
   ============================================================================ */
#iTop_bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: white;
  border-bottom: 1px solid var(--gray-200);
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

#iTop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  z-index: 1001;
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  box-shadow: var(--shadow-md);
}

.iTop_item {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-5);
  font-weight: 500;
  color: white;
  border: none;
  transition: all var(--transition-fast);
  position: relative;
  font-size: var(--text-base);
}

.iTop_item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  text-decoration: none;
}

.iTop_item:first-child {
  margin-right: auto;
  font-weight: 700;
  color: white;
  font-size: var(--text-lg);
}

/* Add brand accent highlight */
.iTop_item:first-child::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 3px;
  background-color: var(--accent-color);
  border-radius: var(--radius-full);
}

/* ============================================================================
   CARDS & CONTAINERS
   ============================================================================ */
.card {
  background-color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.card-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--gray-200);
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
}

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

.card-footer {
  padding: var(--space-6);
  border-top: 1px solid var(--gray-200);
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
}

/* ============================================================================
   FAIR INFO CARD
   ============================================================================ */
.fair-info-card {
  background: linear-gradient(135deg, white 0%, var(--gray-50) 100%);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-8);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  position: relative;
}

/* Brand accent line */
.fair-info-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 50%, var(--secondary-color) 100%);
}

.fair-info-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-6);
  align-items: center;
}

.fair-info-details {
  padding: var(--space-8);
}

.fair-info-details h1 {
  font-size: var(--text-3xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
  color: var(--primary-color);
}

.fair-info-details p {
  margin-bottom: var(--space-2);
  color: var(--gray-600);
}

.fair-info-details p:last-of-type {
  margin-bottom: var(--space-6);
  font-style: italic;
  color: var(--gray-500);
}

.fair-info-image {
  padding: var(--space-8);
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
}

.fair-info-image img {
  max-width: 150px;
  max-height: 120px;
  object-fit: contain;
  border-radius: var(--radius-md);
  filter: brightness(1.1) contrast(1.1);
}

/* ============================================================================
   ALERTS & NOTIFICATIONS
   ============================================================================ */
.alert {
  padding: var(--space-4) var(--space-6);
  margin-bottom: var(--space-6);
  border-radius: var(--radius-lg);
  border-left: 4px solid;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  position: relative;
  overflow: hidden;
}

.alert::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.05;
  background-color: currentColor;
  pointer-events: none;
}

.alert-success {
  background-color: var(--success-light);
  border-left-color: var(--success-color);
  color: var(--gray-800);
}

.alert-warning {
  background-color: var(--warning-light);
  border-left-color: var(--warning-color);
  color: var(--gray-800);
}

.alert-danger {
  background-color: var(--danger-light);
  border-left-color: var(--danger-color);
  color: var(--gray-800);
}

.alert-info {
  background-color: var(--info-light);
  border-left-color: var(--secondary-color);
  color: var(--gray-800);
}

/* Notification system */
.notification-alert {
  position: fixed;
  top: calc(var(--header-height) + var(--space-4));
  right: var(--space-6);
  z-index: 9999;
  max-width: 400px;
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  cursor: pointer;
  font-weight: 500;
}

.notification-alert.show {
  transform: translateX(0);
}

.notification-alert.green {
  background-color: var(--success-color);
  color: white;
  border-left: 4px solid var(--success-color);
}

.notification-alert.red {
  background-color: var(--primary-color);
  color: white;
  border-left: 4px solid var(--primary-dark);
}

.notification-alert.yellow {
  background-color: var(--accent-color);
  color: var(--gray-900);
  border-left: 4px solid var(--accent-dark);
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius-lg);
  border: 1px solid;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  border-color: var(--primary-color);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
  border-color: var(--primary-dark);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
  border-color: var(--secondary-color);
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary-color) 100%);
  border-color: var(--secondary-dark);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
  border-color: var(--accent-color);
  color: white;
}

.btn-accent:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent-color) 100%);
  border-color: var(--accent-dark);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

.btn-outline:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

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

/* ============================================================================
   PRODUCT GRID
   ============================================================================ */
.messe_planer {
  width: 100%;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-8);
}

.messe_planer_item {
  background: linear-gradient(135deg, white 0%, var(--gray-50) 100%);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
  min-height: 320px; /* Prevent layout shifts during content loading */
}

.messe_planer_item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%);
  transform: scaleX(0);
  transition: transform var(--transition-normal);
}

.messe_planer_item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.messe_planer_item:hover::before {
  transform: scaleX(1);
}

.product-image {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.product-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--secondary-color) 0%, var(--accent-color) 100%);
}

.product-image img {
  max-width: 90%;
  max-height: 90%;
  width: auto;
  height: 180px; /* Fixed height to prevent layout shifts */
  object-fit: contain;
  transition: transform var(--transition-normal);
}

.messe_planer_item:hover .product-image img {
  transform: scale(1.05);
}

.product-content {
  padding: var(--space-5);
}

.product-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--gray-900);
  line-height: 1.3;
}

.product-description {
  font-size: var(--text-sm);
  color: var(--gray-600);
  margin-bottom: var(--space-4);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: var(--space-4);
}

.product-actions {
  display: flex;
  gap: var(--space-2);
}

/* ============================================================================
   FORMS
   ============================================================================ */
.form-group {
  margin-bottom: var(--space-5);
}

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

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

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

/* ============================================================================
   SHOPPING CART
   ============================================================================ */
.cart-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.cart-table th {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  padding: var(--space-4);
  text-align: left;
  font-weight: 600;
  color: white;
  border-bottom: 1px solid var(--primary-dark);
}

.cart-table td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--gray-100);
  vertical-align: top;
}

.cart-table tr:last-child td {
  border-bottom: none;
}

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

.cart-item-image {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--gray-100);
  border: 2px solid var(--gray-200);
}

.cart-summary {
  background: linear-gradient(135deg, white 0%, var(--gray-50) 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  margin-top: var(--space-6);
  position: relative;
}

.cart-summary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 50%, var(--secondary-color) 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */
@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }
  
  #content {
    padding: 0 var(--space-4);
    margin-top: 0;  /* Body padding-top handles header spacing */
  }
  
  #iTop {
    padding: 0 var(--space-4);
    flex-wrap: wrap;
    height: auto;
    min-height: var(--header-height);
  }
  
  .iTop_item {
    padding: 0 var(--space-3);
    font-size: var(--text-sm);
    height: var(--header-height);
  }
  
  .fair-info-content {
    grid-template-columns: 1fr;
  }
  
  .fair-info-image {
    order: -1;
    padding: var(--space-4);
  }
  
  .product-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  
  .notification-alert {
    right: var(--space-4);
    left: var(--space-4);
    max-width: none;
  }
  
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
}

@media (max-width: 480px) {
  #iTop {
    padding: 0 var(--space-2);
  }
  
  .iTop_item {
    padding: 0 var(--space-2);
    font-size: var(--text-xs);
  }
  
  .fair-info-details {
    padding: var(--space-4);
  }
  
  .product-content {
    padding: var(--space-4);
  }
  
  .cart-table th, .cart-table td {
    padding: var(--space-2);
    font-size: var(--text-sm);
  }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.grid { display: grid; }

.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }
.text-accent { color: var(--accent-color); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-danger { color: var(--danger-color); }

.bg-primary { background-color: var(--primary-color); }
.bg-secondary { background-color: var(--secondary-color); }
.bg-accent { background-color: var(--accent-color); }
.bg-white { background-color: white; }
.bg-gray-50 { background-color: var(--gray-50); }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }

.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Brand accent decorations */
.brand-accent::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1em;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  margin-right: var(--space-2);
  border-radius: var(--radius-full);
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */
@media print {
  #iTop, #iTop_bg, .notification-alert, .no-print {
    display: none !important;
  }
  
  #content {
    margin-top: 0;
    padding: 0;
    max-width: none;
  }
  
  .fair-info-card, .card {
    box-shadow: none;
    border: 1px solid var(--gray-300);
  }
  
  a {
    color: inherit;
    text-decoration: none;
  }
  
  .btn {
    display: none;
  }
  
  /* Print with brand colors but simplified */
  .cart-table th {
    background: var(--gray-200) !important;
    color: var(--gray-900) !important;
  }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.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 styles for keyboard navigation */
.btn:focus, .form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}


/* ============================================================================
   HEADER STYLES
   ============================================================================ */
.header {
  background-color: white !important;
  border-bottom: 1px solid var(--gray-200);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  box-shadow: var(--shadow-light);
  color: var(--gray-800) !important;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

/* Force all header text to be dark (except cart button) */
.header *:not(.cart-button):not(.cart-count):not(.cart-icon), 
.header a:not(.cart-button), 
.header span:not(.cart-count):not(.cart-icon), 
.header div:not(.cart-button) {
  color: var(--gray-800) !important;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 64px;
  width: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.header-nav-item {
  color: var(--gray-800) !important;
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
}

.header-nav-item:hover {
  color: var(--primary-color);
  background-color: var(--gray-50);
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.cart-button {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background-color: var(--primary-color);
  color: white !important;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-normal);
}

.cart-button:hover {
  background-color: var(--primary-dark);
  color: white !important;
  text-decoration: none;
}

.cart-icon {
  font-size: var(--text-lg);
}

.cart-count {
  background-color: white !important;
  color: var(--primary-color) !important;
  font-size: var(--text-xs);
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-1);
}

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

.lang-item {
  display: flex;
  align-items: center;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: var(--transition-normal);
}

.lang-item:hover {
  background-color: var(--gray-100);
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
}

.mobile-menu-toggle span {
  width: 20px;
  height: 2px;
  background-color: var(--gray-700);
  transition: var(--transition-normal);
}

/* ============================================================================
   TOP NOTICE STYLES
   ============================================================================ */
.top-notice {
  background-color: var(--warning-color);
  color: var(--gray-900);
  padding: var(--space-2) var(--space-4);
  text-align: center;
  font-size: var(--text-sm);
  font-weight: 500;
  position: fixed !important;
  top: 70px !important;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  box-shadow: var(--shadow-light);
}

/* ============================================================================
   CONTENT LAYOUT ADJUSTMENTS
   ============================================================================ */
#content {
  padding: var(--space-6);
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 0;
  flex: 1;
}

/* Ensure main content containers are visible */
.messe_planer, .messe_selection {
  position: relative !important;
  min-height: calc(100vh - 200px); /* Ensure full height minus header/footer space */
  display: block !important;
  visibility: visible !important;
}

/* Enhanced messe_planer layout */
.messe_planer {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-4);
}

.messe_planer > * {
  margin-bottom: var(--space-6);
}

/* Product group sections enhancement */
.product-group {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-6);
  overflow: hidden;
}

.product-group-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: var(--space-4) var(--space-6);
  font-weight: 600;
  font-size: var(--text-lg);
}

.product-group-content {
  padding: var(--space-6);
}

/* Product items within groups */
.product-item {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  transition: var(--transition-normal);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.product-item:hover {
  background: white;
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

.product-item:last-child {
  margin-bottom: 0;
}

.product-details {
  flex: 1;
}

.product-name {
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: var(--space-1);
}

.product-description {
  color: var(--gray-600);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.product-price {
  font-weight: 700;
  color: var(--primary-color);
  font-size: var(--text-lg);
}

.product-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.main, .main .inner {
  display: block !important;
  visibility: visible !important;
}

/* ============================================================================
   FORM STYLES
   ============================================================================ */
input, select, textarea {
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-family: var(--font-primary);
  transition: var(--transition-fast);
  background: white;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(158, 0, 40, 0.1);
}

input[type="number"] {
  width: auto;
  min-width: 80px;
}

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

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

.form-row {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

th {
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
  padding: var(--space-4);
  text-align: left;
  font-weight: 600;
  color: var(--gray-800);
  border-bottom: 1px solid var(--gray-300);
}

td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--gray-200);
  vertical-align: top;
}

tr:hover {
  background: var(--gray-50);
}

tr:last-child td {
  border-bottom: none;
}

/* ============================================================================
   CATEGORY NAVIGATION (STICKY)
   ============================================================================ */
.category-nav {
  background: linear-gradient(135deg, white 0%, var(--gray-50) 100%);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  position: relative;
  z-index: 100;
}

/* Sticky state */
.category-nav.sticky {
  position: fixed !important;
  top: calc(var(--header-height) + 40px); /* Below header + top notice + spacing */
  left: 50%;
  transform: translateX(-50%);
  max-width: 1400px;
  width: calc(100% - var(--space-8));
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 250;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.category-nav-item {
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  transition: var(--transition-fast);
  font-weight: 500;
  color: var(--gray-700);
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
}

.category-nav-item:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.category-nav-item.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

/* Sticky navigation placeholder */
.category-nav-placeholder {
  height: 0;
  transition: height var(--transition-normal);
}

.category-nav-placeholder.active {
  height: 80px; /* Approximate height of the nav when sticky */
}

/* Back to top button in navbar */
.nav-back-to-top {
  background: white;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  transition: var(--transition-fast);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.nav-back-to-top:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.nav-back-to-top::before {
  content: "↑";
  font-weight: bold;
}

/* ============================================================================
   EXHIBITION SELECTION STYLES
   ============================================================================ */
.messe_selection {
  padding: var(--space-6) 0 0 0 !important;
  text-align: center !important;
  position: static !important;
  height: auto !important;
  top: auto !important;
  width: 100% !important;
  left: auto !important;
  right: auto !important;
  background: var(--gray-100) !important;
  min-height: auto !important;
  margin-bottom: 0 !important;
}

.messe_selection .main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
  margin-bottom: 0;
}

.messe_selection .inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  justify-content: center;
  align-items: flex-start;
  margin-bottom: 0;
  padding-bottom: 0;
}

.messe_selection .messe_selection_item {
  background: white !important;
  border: 1px solid var(--gray-200) !important;
  border-radius: var(--radius-lg) !important;
  padding: var(--space-6) !important;
  width: 300px !important;
  min-height: 250px !important;
  max-height: none !important;
  box-shadow: var(--shadow-md) !important;
  transition: var(--transition-normal) !important;
  text-decoration: none !important;
  color: var(--gray-900) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  font-size: var(--text-base) !important;
  overflow: visible !important;
  position: static !important;
  margin: 0 !important;
}

.messe_selection .messe_selection_item:hover {
  transform: translateY(-4px) !important;
  box-shadow: var(--shadow-lg) !important;
  border-color: var(--primary-color) !important;
  text-decoration: none !important;
  color: var(--gray-900) !important;
  background: white !important;
  cursor: pointer !important;
}

.messe_selection .messe_selection_item img {
  width: 120px !important;
  height: 80px !important;
  object-fit: cover !important;
  border-radius: var(--radius-md) !important;
  margin-bottom: var(--space-4) !important;
  border: 1px solid var(--gray-100) !important;
}

.messe_selection .messe_selection_item b {
  font-size: var(--text-xl) !important;
  font-weight: 600 !important;
  color: var(--primary-color) !important;
  margin-bottom: var(--space-2) !important;
  display: block !important;
}

.messe_selection .messe_selection_item i {
  font-size: var(--text-sm) !important;
  color: var(--gray-600) !important;
  font-style: normal !important;
  line-height: 1.4 !important;
  margin-top: auto !important;
}

/* Override legacy tile styles */
.messe_selection .tile.messe_selection_item {
  display: flex !important;
  margin: 0 !important;
  overflow: visible !important;
}

.tile {
  display: block;
}

.nolink {
  text-decoration: none;
  color: inherit;
  display: inline-block;
  margin: var(--space-2);
}

.nolink:hover {
  text-decoration: none;
  color: inherit;
}

/* ============================================================================
   FOOTER STYLES
   ============================================================================ */
/* Footer sticks to bottom using flexbox layout from body */
.site-footer {
  margin-top: auto; /* Push footer to bottom when content is short */
  width: 100%;
}

#footer_links {
  background-color: var(--gray-200);
  padding: var(--space-4);
  text-align: center;
  border-top: 1px solid var(--gray-300);
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}

#footer_links a {
  color: var(--gray-600);
  text-decoration: none;
  margin: 0 var(--space-2);
  font-size: var(--text-sm);
}

#footer_links a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

#licence {
  background-color: var(--primary-color);
  padding: var(--space-3);
  text-align: center;
  font-size: var(--text-xs);
  color: white;
  border-top: 1px solid var(--primary-dark);
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}

#licence a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
}

#licence a:hover {
  color: white;
  text-decoration: none;
}

/* Cart page specific layout fixes */
.cart-container {
  min-height: calc(100vh - 200px); /* Account for header and footer space */
}



/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */
@media (max-width: 768px) {
  .header-nav {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .header-container {
    padding: 0 var(--space-3);
  }
  
  .top-notice {
    font-size: var(--text-xs);
    padding: var(--space-1) var(--space-3);
  }

  #content {
    margin-top: 0;  /* Body padding-top handles header spacing */
    padding: var(--space-4);
  }

  /* Mobile sticky navigation adjustments */
  .category-nav.sticky {
    top: calc(var(--header-height) + 30px); /* Adjust for mobile header */
    width: calc(100% - var(--space-4));
    padding: var(--space-2);
    gap: var(--space-2);
  }

  .category-nav-item {
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-sm);
  }
}

/* ============================================================================
   TOAST NOTIFICATIONS (UX Manager)
   ============================================================================ */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 300px;
  max-width: 420px;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast.hiding {
  opacity: 0;
  transform: translateX(100%);
}

.toast-icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.toast-message {
  font-size: 0.8125rem;
  color: #555;
  word-wrap: break-word;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 0;
}

.toast-close:hover {
  color: #333;
}

.toast-success { border-left: 4px solid #28a745; }
.toast-success .toast-icon { background: #28a745; }

.toast-error { border-left: 4px solid #dc3545; }
.toast-error .toast-icon { background: #dc3545; }

.toast-warning { border-left: 4px solid #f39c12; }
.toast-warning .toast-icon { background: #f39c12; }

.toast-info { border-left: 4px solid #5486B8; }
.toast-info .toast-icon { background: #5486B8; }

