/**
 * UNBREAK ONE - Premium Enhancement Layer
 * High-Class UX & Polish (non-destructive additions)
 */

/* ===================================
   PREMIUM DESIGN TOKENS
   =================================== */
:root {
  --premium-border-radius: 20px;
  --premium-border-radius-sm: 12px;
  --premium-border-radius-lg: 24px;
  
  --premium-shadow-soft: 0 8px 32px rgba(10, 108, 116, 0.08);
  --premium-shadow-medium: 0 12px 48px rgba(10, 108, 116, 0.12);
  --premium-shadow-strong: 0 16px 64px rgba(10, 108, 116, 0.18);
  
  --premium-glow-teal: 0 0 28px rgba(0, 255, 220, 0.25);
  --premium-glow-teal-hover: 0 0 40px rgba(0, 255, 220, 0.4);
  
  --premium-backdrop: blur(20px);
  --premium-backdrop-strong: blur(32px);
  
  --premium-transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --premium-transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   RESPONSIVE TYPOGRAPHY (CLAMP)
   =================================== */
h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  line-height: 1.3;
}

.subheadline,
.hero-content p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.6;
}

/* ===================================
   CONTAINER & SPACING
   =================================== */
.container {
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2rem);
}

section {
  padding-block: clamp(3rem, 8vw, 6rem);
  scroll-margin-top: 80px; /* Fix 3: Mobile Header-Höhe */
}

@media (max-width: 768px) {
  section {
    scroll-margin-top: 72px; /* Mobile Header kompakter */
  }
}

/* ===================================
   PREMIUM HERO OVERLAY CARD
   =================================== */
.hero-content {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.08) 100%
  );
  backdrop-filter: var(--premium-backdrop);
  -webkit-backdrop-filter: var(--premium-backdrop);
  
  border-radius: var(--premium-border-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.18);
  
  padding: clamp(2rem, 5vw, 3.5rem);
  box-shadow: var(--premium-shadow-medium);
  
  position: relative;
  overflow: visible;
}

/* Subtle inner glow */
.hero-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top left,
    rgba(0, 255, 220, 0.08) 0%,
    transparent 60%
  );
  pointer-events: none;
  border-radius: inherit;
}

/* ===================================
   PREMIUM BUTTONS (CTA)
   =================================== */
.btn {
  min-height: 48px;
  padding: 0.875rem 2rem;
  
  font-family: var(--font-heading);
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  font-weight: 600;
  line-height: 1;
  
  border-radius: var(--premium-border-radius-sm);
  border: 2px solid transparent;
  
  cursor: pointer;
  transition: var(--premium-transition);
  
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  
  text-decoration: none;
  white-space: nowrap;
  
  position: relative;
  overflow: hidden;
}

/* Primary CTA - Teal with subtle glow */
.btn-primary {
  background: linear-gradient(135deg, #00FFDC 0%, #0A6C74 100%);
  color: var(--color-graphit);
  border-color: rgba(0, 255, 220, 0.3);
  box-shadow: var(--premium-shadow-soft), var(--premium-glow-teal);
}

/* Shimmer effect on hover (desktop only) */
@media (hover: hover) {
  .btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.3) 50%,
      transparent 100%
    );
    transition: left 0.6s ease;
  }
  
  .btn-primary:hover::before {
    left: 100%;
  }
  
  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--premium-shadow-medium), var(--premium-glow-teal-hover);
    border-color: rgba(0, 255, 220, 0.6);
  }
  
  .btn-primary:active {
    transform: translateY(0);
  }
}

/* Focus state (accessibility) */
.btn-primary:focus-visible {
  outline: 3px solid rgba(0, 255, 220, 0.5);
  outline-offset: 3px;
}

/* Secondary button polish */
.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.25);
}

@media (hover: hover) {
  .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
  }
}

/* ===================================
   HERO BUTTONS LAYOUT
   =================================== */
.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 2rem;
}

.hero-buttons .btn {
  max-width: 420px;
  flex: 1 1 auto;
}

@media (max-width: 768px) {
  .hero-buttons {
    flex-direction: column;
  }
  
  .hero-buttons .btn {
    width: 100%;
    max-width: none;
  }
}

/* ===================================
   HEADER POLISH (SCROLL STATE)
   ENTFERNT - Glassmorphismus wird in styles.css konsistent gehandhabt
   Keine Overrides mehr, die den Glas-Effekt deaktivieren
   =================================== */

/* ===================================
   BADGE POLISH - OBERHALB HERO-CONTENT (MOBILE FIX)
   =================================== */
.badge-mig {
  position: absolute;
  top: -60px;
  right: 1.5rem;
  max-width: 120px;
  height: auto;
  z-index: 100;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
  transition: var(--premium-transition-fast);
  pointer-events: none;
  transform-origin: top right;
}

@media (hover: hover) {
  .badge-mig:hover {
    transform: scale(1.05);
    transform-origin: top right;
  }
}

@media (max-width: 768px) {
  .badge-mig {
    max-width: 80px;
    top: -50px;
    right: 1rem;
    transform: scale(0.85);
  }
  
  .hero-content {
    padding-top: 3rem !important;
  }
}

@media (max-width: 768px) {
  .badge-mig {
    max-width: 90px;
    top: 1rem;
    right: 1rem;
    transform: scale(0.9);
    transform-origin: top right;
  }
}

/* ===================================
   MODAL OVERLAY (CONFIGURATOR)
   =================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  
  display: none;
  align-items: center;
  justify-content: center;
  
  padding: env(safe-area-inset-top, 0) 
           env(safe-area-inset-right, 0)
           env(safe-area-inset-bottom, 0)
           env(safe-area-inset-left, 0);
  
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

/* Modal container */
.modal-container {
  position: relative;
  width: 100%;
  max-width: 1400px;
  max-height: 90vh;
  
  background: var(--color-graphit);
  border-radius: var(--premium-border-radius-lg);
  box-shadow: var(--premium-shadow-strong);
  
  overflow: hidden;
  
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

/* Close button - UNTEN RECHTS */
.modal-close {
  position: absolute;
  bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  right: 1.5rem;
  z-index: 10000;
  
  width: 52px;
  height: 52px;
  
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  
  color: var(--color-white);
  font-size: 1.75rem;
  line-height: 1;
  
  cursor: pointer;
  transition: var(--premium-transition-fast);
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* Verhindert Überschneidung mit Action-Buttons */
  margin-left: auto;
}

@media (hover: hover) {
  .modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(0, 255, 220, 0.5);
    transform: rotate(90deg);
  }
}

.modal-close:focus-visible {
  outline: 2px solid rgba(0, 255, 220, 0.5);
  outline-offset: 2px;
}

/* iFrame */
.modal-iframe {
  width: 100%;
  height: 85vh;
  border: none;
  display: block;
  background: var(--color-graphit);
}

/* Mobile fullscreen */
@media (max-width: 768px) {
  .modal-overlay {
    padding: 0;
  }
  
  .modal-container {
    max-width: 100%;
    max-height: 100%;
    height: 100vh;
    border-radius: 0;
  }
  
  .modal-iframe {
    height: 100vh;
  }
  
  .modal-close {
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    right: calc(1rem + env(safe-area-inset-right, 0px));
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }
}

/* ===================================
   SCROLL LOCK (when modal open)
   =================================== */
body.modal-open {
  overflow: hidden;
  height: 100vh;
}

/* ===================================
   REDUCED MOTION SUPPORT
   =================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .btn-primary::before {
    display: none;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* ===================================
   MOBILE OPTIMIZATIONS
   =================================== */
@media (max-width: 768px) {
  section {
    padding-block: clamp(2rem, 6vw, 4rem);
  }
  
  .hero-content {
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border-radius: var(--premium-border-radius);
  }
  
  .hero-content ul {
    font-size: 0.95rem;
    padding-left: 1.25rem;
  }
  
  .hero-content ul li {
    margin-bottom: 0.75rem;
  }
}

/* Touch device optimizations */
@media (hover: none) {
  .btn {
    -webkit-tap-highlight-color: transparent;
  }
  
  .btn:active {
    transform: scale(0.98);
  }
}

/* ===================================
   SHOP: GLASSMORPHIC PRODUCT CARDS
   =================================== */

/* Glass Card Base (reusable) */
.glass-card {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.85) 100%
  );
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  
  border-radius: var(--premium-border-radius);
  border: 1px solid rgba(10, 108, 116, 0.12);
  
  box-shadow: var(--premium-shadow-soft);
  
  transition: var(--premium-transition);
  overflow: hidden;
  position: relative;
}

/* Subtle inner highlight */
.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 255, 220, 0.3),
    transparent
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Hover state - lift and glow */
@media (hover: hover) {
  .glass-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--premium-shadow-medium), var(--premium-glow-teal);
    border-color: rgba(0, 255, 220, 0.3);
  }
  
  .glass-card:hover::before {
    opacity: 1;
  }
}

/* Shop-specific grid */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: var(--spacing-lg);
}

@media (max-width: 1024px) {
  .shop-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 640px) {
  .shop-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* Product Card Structure */
.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-image-wrapper {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #F5F5F5 0%, #E8E8E8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(10, 108, 116, 0.08);
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (hover: hover) {
  .glass-card:hover .product-image {
    transform: scale(1.05);
  }
}

.product-content {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

.product-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--color-graphit);
  margin: 0;
  font-family: var(--font-heading);
}

.product-description {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-anthrazit);
  opacity: 0.85;
  margin: 0;
  flex: 1;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(10, 108, 116, 0.08);
}

.product-price {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-petrol-dark);
  font-family: var(--font-heading);
}

/* Buy Button - matches global CTA style */
.btn-buy {
  min-height: 44px;
  padding: 0.75rem 1.5rem;
  
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  
  background: linear-gradient(135deg, #00FFDC 0%, #0A6C74 100%);
  color: var(--color-graphit);
  
  border: 2px solid rgba(0, 255, 220, 0.3);
  border-radius: var(--premium-border-radius-sm);
  
  cursor: pointer;
  transition: var(--premium-transition-fast);
  
  box-shadow: 0 4px 12px rgba(0, 255, 220, 0.15);
}

@media (hover: hover) {
  .btn-buy:hover {
    transform: translateY(-2px);
    box-shadow: var(--premium-glow-teal-hover);
    border-color: rgba(0, 255, 220, 0.6);
  }
}

.btn-buy:active {
  transform: translateY(0);
}

/* Shop Hero - matches site hero style */
.shop-hero {
  padding: calc(var(--spacing-xl) * 1.5) 0 var(--spacing-xl);
  background: linear-gradient(135deg, #084F55 0%, #0A6C74 100%);
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Subtle animated gradient overlay */
.shop-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 30% 50%,
    rgba(0, 255, 220, 0.12) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.shop-hero .container {
  position: relative;
  z-index: 1;
}

.shop-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin-bottom: 1rem;
  font-weight: 700;
  color: white;
}

.shop-hero p {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  opacity: 0.95;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Products Section */
.products-section {
  padding: var(--spacing-xl) 0;
  background: var(--color-hellgrau);
}

/* Loading/Error States */
.loading-state,
.error-state,
.empty-state {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-md);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(10, 108, 116, 0.1);
  border-top-color: var(--color-petrol-deep);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto var(--spacing-md);
}

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

.error-message {
  color: #D32F2F;
  margin-bottom: var(--spacing-md);
}

.btn-retry {
  min-height: 44px;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  background: var(--color-petrol-deep);
  color: white;
  border: none;
  border-radius: var(--premium-border-radius-sm);
  cursor: pointer;
  transition: var(--premium-transition-fast);
}

.btn-retry:hover {
  background: var(--color-petrol-dark);
  transform: translateY(-2px);
}

/* CTA Section */
.cta-section {
  padding: var(--spacing-xl) 0;
  background: linear-gradient(135deg, #084F55 0%, #0A6C74 100%);
  color: white;
  text-align: center;
}

.cta-section h2 {
  color: white;
  margin-bottom: var(--spacing-sm);
}

.cta-section p {
  font-size: 1.15rem;
  opacity: 0.9;
  margin-bottom: var(--spacing-lg);
}

.btn-cta-secondary {
  min-height: 48px;
  padding: 0.875rem 2rem;
  
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  color: white;
  
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--premium-border-radius-sm);
  
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  
  cursor: pointer;
  transition: var(--premium-transition);
}

@media (hover: hover) {
  .btn-cta-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  }
}
