/**
 * SUMA Center - Core Styles
 * Nur globale Variablen, Reset und Layout-System
 * Widgets sind in separaten CSS-Dateien organisiert
 *
 * ✅ WIDGET BASE FRAMEWORK wird automatisch geladen
 * Alle Widgets nutzen konsistente Base-Klassen für DRY-Prinzipien
 */

/* ========================================
   IMPORTS - MUST BE AT TOP
   ======================================== */
/* ✅ Modular CSS wird über Asset Manager geladen */
/* global-slider-navigation.css wird über components/ geladen */
/* responsive-system.css, performance-optimizations.css, ai-toggle-widget-2025.css wurden entfernt/verschoben */

/* ========================================
   1. CSS CUSTOM PROPERTIES & VARIABLES
   ======================================== */
:root {
  /* ⚠️ WICHTIG: Brand Colors werden dynamisch von functions.php generiert! */
  /* Die folgenden Variablen werden automatisch gesetzt: */
  /* --smg-50 bis --smg-950, --smg-50 bis --smg-950 */
  /* --smg-primary, --smg-primary-dark, --smg-primary-light */
  /* --accent-primary, --accent-secondary, --accent-light */
  /* --smg-600-rgb und alle anderen RGB-Varianten */
  /* NICHT hier überschreiben - sonst funktioniert das dynamische Farbsystem nicht! */

  /* Moderne Akzent-Farben - werden dynamisch überschrieben */
  /* Fallback-Werte für den Fall, dass keine Farbe gesetzt ist */
  --accent-light: #fd6c70;
  --accent-glow: #ff6b6b;
  
  /* Moderne Neutrals */
  --smg-white: #ffffff;
  --smg-gray-50: #fafafa;
  --smg-gray-100: #f5f5f5;
  --smg-gray-200: #eeeeee;
  --smg-gray-300: #e0e0e0;
  --smg-gray-400: #bdbdbd;
  --smg-gray-500: #9e9e9e;
  --smg-gray-600: #757575;
  --smg-gray-700: #424242;
  --smg-gray-800: #2c2c2c;
  --smg-gray-900: #1a1a1a;
  
  /* Desktop Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  --space-4xl: 8rem;
  
  /* Typography */
  --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: 2rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3rem;
  --text-6xl: 4rem;
  --text-7xl: 5rem;
  
  /* Modern Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.16);
  
  /* Header/Footer Heights - Dynamic */
  --header-height: clamp(70px, 8vh, 100px);
  --footer-height: clamp(200px, 20vh, 300px);
  --content-height: calc(100vh - var(--header-height) - var(--footer-height));
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   2. RESET & BASE STYLES
   ======================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'SF Pro Display', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--smg-gray-800);
  background: var(--smg-gray-50);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   3. CLEAN MINIMALIST HEADER (LETNANY STYLE)
   ======================================== */

/* Modern Clean Header */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px) saturate(1.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-2xl);
  transition: all var(--transition-normal);
}

.app-header.scrolled {
  --header-height: 60px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.99);
}

/* Clean Navigation Container */
.app-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
}

/* Minimalist Logo Section */
.app-logo-section {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  text-decoration: none;
  transition: all var(--transition-normal);
}

.app-logo-section:hover {
  transform: translateY(-1px);
}

.app-logo-image {
  height: clamp(32px, 4vh, 42px);
  width: auto;
  transition: all var(--transition-normal);
}

.app-logo {
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  font-weight: 800;
  color: var(--smg-gray-900);
  text-decoration: none;
  letter-spacing: -0.02em;
  margin-left: var(--space-sm);
}

/* Opening Hours Pill (Letnany Style) */
.opening-hours-pill {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background: var(--smg-500);
  color: white;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-left: var(--space-lg);
  box-shadow: 0 1px 4px rgba(227, 30, 36, 0.15);
  white-space: nowrap;
}

.opening-status {
  font-weight: 600;
  font-size: var(--text-xs);
}

.opening-separator {
  opacity: 0.7;
  font-weight: 400;
}

.opening-time {
  opacity: 0.95;
  font-weight: 500;
  font-size: var(--text-xs);
}

/* Clean Navigation Items */
.app-nav-items {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  list-style: none;
}

.app-nav-link {
  padding: var(--space-md) var(--space-lg);
  color: var(--smg-gray-700);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--text-base);
  border-radius: var(--radius);
  transition: all var(--transition-normal);
  position: relative;
}

.app-nav-link:hover {
  color: var(--smg-gray-900);
  background: var(--smg-gray-50);
}

.app-nav-link.active {
  color: var(--smg-500);
  font-weight: 600;
}

.app-nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--smg-500);
  border-radius: 50%;
}

/* Minimalist Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.header-search-btn {
  /* Verwende einheitliches Button-System */
}

.header-ai-btn {
  /* Verwende einheitliches Button-System */
}

/* Mobile Navigation Toggle */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  gap: 3px;
  padding: var(--space-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.mobile-nav-toggle span {
  width: 20px;
  height: 2px;
  background: var(--smg-gray-700);
  border-radius: 1px;
  transition: all var(--transition-normal);
}

.mobile-nav-toggle:hover span {
  background: var(--smg-gray-900);
}

/* ========================================
   4. DESKTOP APP LAYOUT SYSTEM
   ======================================== */
.app-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-main {
  margin-top: var(--header-height);
  margin-bottom: var(--footer-height);
  height: var(--content-height);
  overflow-y: auto;
  overflow-x: hidden;
}

.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-height);
  background: var(--smg-gray-900);
  color: var(--smg-white);
  z-index: 100;
  padding: var(--space-xl) var(--space-2xl);
}

/* ========================================
   5. BUTTONS - Globale Rundungen für ALLE Buttons
   ======================================== */

/* ✅ GLOBALE BUTTON-RUNDUNGEN - Überschreibt alle Standard-Buttons */
button,
input[type="button"],
input[type="submit"],
input[type="reset"],
.button,
.btn,
.wp-block-button__link,
.elementor-button,
.woocommerce-button,
.wc-block-components-button,
.wp-element-button {
    border-radius: 0.75rem !important; /* ✅ SUMA Standard: 12px */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ✅ Kleine Buttons bekommen kleinere Rundungen */
button.small,
input[type="button"].small,
input[type="submit"].small,
.button.small,
.btn.small,
.btn-sm,
.button-small {
    border-radius: 0.5rem !important; /* ✅ SUMA Small: 8px */
}

/* ✅ Große Buttons bekommen größere Rundungen */
button.large,
input[type="button"].large,
input[type="submit"].large,
.button.large,
.btn.large,
.btn-lg,
.button-large {
    border-radius: 1rem !important; /* ✅ SUMA Large: 16px */
}

/* ✅ WordPress Admin Buttons */
.wp-admin button,
.wp-admin input[type="button"],
.wp-admin input[type="submit"],
.wp-admin .button {
    border-radius: 0.5rem !important; /* ✅ Admin: 8px */
}

/* ✅ WordPress Admin Primary Buttons */
.wp-admin .button-primary {
    border-radius: 0.5rem !important; /* ✅ Admin Primary: 8px */
}

/* ✅ Elementor Buttons */
.elementor-button {
    border-radius: 0.75rem !important; /* ✅ Elementor: 12px */
}

/* ✅ WooCommerce Buttons */
.woocommerce .button,
.woocommerce button,
.woocommerce input[type="submit"] {
    border-radius: 0.75rem !important; /* ✅ WooCommerce: 12px */
}

/* ✅ Alle Button-Styles sind jetzt in suma-buttons.css */

/* ========================================
   6. SECTION CONTAINERS
   ======================================== */
.section-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--space-4xl) var(--space-2xl);
}

.section-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  color: var(--smg-gray-900);
  text-align: center;
  margin-bottom: var(--space-3xl);
  letter-spacing: -0.02em;
}

/* ========================================
   7. UTILITY CLASSES
   ======================================== */
.text-center { text-align: center; }
.text-accent { color: var(--accent-primary); }
.text-suma-red { color: var(--smg-primary); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.gap-2 { gap: var(--space-xs); }
.gap-4 { gap: var(--space-sm); }
.gap-6 { gap: var(--space-md); }
.gap-8 { gap: var(--space-lg); }

/* ========================================
   9. WEBSITE TRANSFORMATION FOR AI - CLEAN
   ======================================== */
.website-transform {
  transition: none;
}

.website-transform.ai-mode {
  /* Keine Blur-Effekte mehr */
}

/* ========================================
   10. RESPONSIVE
   ======================================== */
@media (max-width: 1200px) {
  .app-header {
    padding: 0 var(--space-xl);
  }
  
  .section-container {
    padding: var(--space-3xl) var(--space-xl);
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 60px;
    --footer-height: 150px;
  }
  
  .app-header {
    padding: 0 var(--space-md);
  }
  
  .app-nav-items {
    display: none;
  }
  
  .section-container {
    padding: var(--space-xl) var(--space-md);
  }
}

/* ========================================
   10. RESPONSIVE HEADER
   ======================================== */
@media (max-width: 1200px) {
  .app-header {
    padding: 0 var(--space-xl);
  }
  
  .app-nav {
    gap: var(--space-xl);
  }
  
  .app-nav-items {
    gap: var(--space-md);
    padding: var(--space-xs) var(--space-md);
  }
  
  .app-nav-link {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
  }
}

@media (max-width: 968px) {
  .app-nav-items {
    display: none;
  }
  
  .mobile-nav-toggle {
    display: flex;
  }
  
  .header-actions {
    gap: var(--space-sm);
  }
  
  .header-ai-btn {
    width: 36px;
    height: 36px;
    padding: var(--space-xs);
    font-size: var(--text-base);
  }
  
  .app-logo {
    font-size: clamp(1.25rem, 4vw, 1.6rem);
  }
  
  .app-logo-image {
    height: clamp(28px, 4vh, 36px);
  }
  
  .opening-hours-pill {
    margin-left: var(--space-md);
    padding: var(--space-xs) var(--space-sm);
  }
  
  .opening-status,
  .opening-time {
    font-size: 0.6rem;
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: 0 var(--space-md);
  }
  
  .app-nav {
    gap: var(--space-sm);
  }
  
  .header-actions {
    gap: var(--space-xs);
  }
  
  .header-ai-btn {
    width: 32px;
    height: 32px;
    padding: var(--space-xs);
    font-size: var(--text-sm);
  }
  
  .opening-hours-pill {
    margin-left: var(--space-sm);
    padding: 2px var(--space-xs);
    gap: 2px;
  }
  
  .opening-status,
  .opening-time {
    font-size: 0.55rem;
  }
  
  .opening-separator {
    font-size: 0.5rem;
  }
}

/* Alpine.js Transitions */
[x-cloak] { display: none !important; }

.animate-fade-in {
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   UNIFIED SEARCH INPUT SYSTEM
   ======================================== */

/* Base search container */
.smg-search-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

/* Unified search input */
.smg-search-input,
.store-search-input,
.smg-search-input {
    width: 100%;
    height: clamp(48px, 8vw, 52px);
    padding: 0 3.5rem 0 1.25rem;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    font-size: max(16px, 1rem);
    background: white;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    will-change: border-color, box-shadow;
    color: var(--smg-gray-800, #1f2937);
    font-weight: 500;
}

/* Left icon variant */
.smg-search-container.icon-left .smg-search-input,
.smg-search-container.icon-left .store-search-input {
    padding: 0 1.25rem 0 3.5rem;
}

/* Focus state */
.smg-search-input:focus,
.store-search-input:focus {
    border-color: var(--smg-500, #e31e24);
    box-shadow: 
        0 0 0 4px rgba(227, 30, 36, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
}

/* Placeholder styling */
.smg-search-input::placeholder,
.store-search-input::placeholder {
    color: var(--smg-gray-400, #9ca3af);
    opacity: 1;
    font-weight: 400;
}

/* Search icon positioning */
.smg-search-icon,
.search-icon {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--smg-gray-400, #9ca3af);
    pointer-events: none;
    transition: color 0.2s ease;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Left icon positioning */
.smg-search-container.icon-left .smg-search-icon,
.smg-search-container.icon-left .search-icon {
    left: 1.25rem;
    right: auto;
}

/* Focus state for icon */
.smg-search-container:focus-within .smg-search-icon,
.smg-search-container:focus-within .search-icon,
.store-search-container:focus-within .search-icon {
    color: var(--smg-500, #e31e24);
}

/* Glass morphism variant */
.smg-search-container.glass .smg-search-input,
.smg-search-container.glass .store-search-input {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.smg-search-container.glass .smg-search-input:focus,
.smg-search-container.glass .store-search-input:focus {
    background: rgba(255, 255, 255, 0.95);
}

/* Dark theme support */
.color-scheme-modern_dark .smg-search-input,
.color-scheme-modern_dark .store-search-input {
    background: rgba(31, 41, 55, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.color-scheme-modern_dark .smg-search-input::placeholder,
.color-scheme-modern_dark .store-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.color-scheme-modern_dark .smg-search-icon,
.color-scheme-modern_dark .search-icon {
    color: rgba(255, 255, 255, 0.5);
}

.color-scheme-modern_dark .smg-search-container:focus-within .smg-search-icon,
.color-scheme-modern_dark .smg-search-container:focus-within .search-icon {
    color: var(--smg-500, #e31e24);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .smg-search-input,
    .store-search-input {
        height: 48px;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0 3rem 0 1rem;
    }
    
    .smg-search-container.icon-left .smg-search-input,
    .smg-search-container.icon-left .store-search-input {
        padding: 0 1rem 0 3rem;
    }
    
    .smg-search-icon,
    .search-icon {
        width: 16px;
        height: 16px;
        right: 1rem;
    }
    
    .smg-search-container.icon-left .smg-search-icon,
    .smg-search-container.icon-left .search-icon {
        left: 1rem;
        right: auto;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .smg-search-input,
    .store-search-input {
        border-color: var(--smg-gray-600, #4b5563);
        background: white;
    }
    
    .smg-search-input:focus,
    .store-search-input:focus {
        border-color: var(--smg-500, #e31e24);
        box-shadow: 0 0 0 2px var(--smg-500, #e31e24);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .smg-search-input,
    .store-search-input,
    .smg-search-icon,
    .search-icon {
        transition: none;
    }

    .smg-search-input:focus,
    .store-search-input:focus {
        transform: none;
    }
}

/* ========================================
   GLOBAL FLOOR/LEVEL DISPLAY
   Alle Etagen-Anzeigen in Großbuchstaben
   ======================================== */
.store-floor,
.office-floor,
.store-location,
.office-location,
.level-name,
.floor-label,
.floor-display,
.etage-display,
[class*="floor-"],
[class*="level-"],
[class*="etage-"] {
    text-transform: uppercase !important;
}
