/* ══════════════════════════════════════════
   SaniApp — Global Stylesheet
   Consumer Marketplace PWA for Local Services
   Brand: coral/orange → purple fade (SaniDesk family)
   ══════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  /* Brand Colors */
  --orange: #FF8C42;
  --coral: #FF6B6B;
  --pink: #D65D7A;
  --purple: #8B5A9F;
  --purple-dark: #6a3d82;
  --purple-deep: #4a2668;

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #FF8C42, #FF6B6B, #D65D7A);
  --gradient-purple: linear-gradient(135deg, #8B5A9F, #6a3d82);
  --gradient-header: linear-gradient(135deg, #FF8C42 0%, #D65D7A 50%, #8B5A9F 100%);
  --gradient-subtle: linear-gradient(135deg, #fff5ed 0%, #f8f4fb 100%);
  --gradient-card: linear-gradient(135deg, rgba(255,140,66,0.08), rgba(139,90,159,0.08));

  /* Neutrals */
  --white: #ffffff;
  --bg: #f8f8fa;
  --bg-card: #ffffff;
  --bg-muted: #f3f3f6;
  --border: #e8e8ee;
  --border-light: #f0f0f5;

  /* Text */
  --text: #1a1a2e;
  --text-secondary: #5a5a72;
  --text-muted: #9494a8;
  --text-inverse: #ffffff;

  /* Semantic */
  --success: #22c55e;
  --success-light: #f0fdf4;
  --error: #ef4444;
  --error-light: #fef2f2;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --info: #3b82f6;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
  --space-3xl: 32px;
  --space-4xl: 40px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.02);
  --shadow-brand: 0 4px 20px rgba(214,93,122,0.2);

  /* Bottom nav height */
  --nav-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom));
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
}

/* ── App Shell ── */
.app {
  width: 100%;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--white);
  position: relative;
}

/* ── Status Bar Spacer (PWA) ── */
.status-bar-spacer {
  height: env(safe-area-inset-top, 0px);
  background: var(--white);
}

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  padding: var(--space-md) var(--space-lg);
}

.header-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  height: 28px;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
}

.header-logo-icon {
  flex-shrink: 0;
}

.header-logo-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

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

.header-location {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  transition: background 0.2s;
}

.header-location:active {
  background: var(--border);
}

.header-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background 0.2s;
}

.header-icon:active {
  background: var(--border);
}

/* ── Search Bar ── */
.search-bar {
  background: var(--bg-muted);
  border-radius: var(--radius-full);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-muted);
  transition: all 0.2s;
}

.search-bar:active {
  background: var(--border);
}

.search-bar svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.search-bar span {
  font-size: 15px;
  font-weight: 400;
}

/* ── Category Grid ── */
.categories {
  padding: var(--space-xl) var(--space-lg);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg) var(--space-sm);
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.category-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: transform 0.2s;
  position: relative;
  overflow: hidden;
}

.category-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.12;
  border-radius: inherit;
}

.category-item:active .category-icon {
  transform: scale(0.92);
}

/* Category color variants */
.cat-orange .category-icon { background: rgba(255,140,66,0.12); }
.cat-coral .category-icon { background: rgba(255,107,107,0.12); }
.cat-purple .category-icon { background: rgba(139,90,159,0.12); }
.cat-pink .category-icon { background: rgba(214,93,122,0.12); }
.cat-green .category-icon { background: rgba(34,197,94,0.12); }
.cat-blue .category-icon { background: rgba(59,130,246,0.12); }
.cat-amber .category-icon { background: rgba(245,158,11,0.12); }
.cat-teal .category-icon { background: rgba(20,184,166,0.12); }
.cat-rose .category-icon { background: rgba(244,63,94,0.12); }
.cat-slate .category-icon { background: rgba(100,116,139,0.12); }
.cat-indigo .category-icon { background: rgba(99,102,241,0.12); }
.cat-neutral .category-icon { background: var(--bg-muted); }

.category-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
}

/* ── Section Headers ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  padding-bottom: var(--space-md);
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.section-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--purple);
}

/* ── Deal Banner Carousel ── */
.deals-carousel {
  padding: 0 var(--space-lg);
  margin-bottom: var(--space-lg);
}

.deals-track {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: var(--space-md);
}

.deals-track::-webkit-scrollbar {
  display: none;
}

.deal-card {
  flex: 0 0 85%;
  scroll-snap-align: start;
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--text-inverse);
  position: relative;
  overflow: hidden;
}

.deal-card-1 {
  background: var(--gradient-header);
}

.deal-card-2 {
  background: var(--gradient-purple);
}

.deal-card-3 {
  background: linear-gradient(135deg, #22c55e, #059669);
}

.deal-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.3px;
}

.deal-subtitle {
  font-size: 13px;
  font-weight: 400;
  opacity: 0.85;
  margin-top: var(--space-xs);
}

.deal-badge {
  align-self: flex-start;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  padding: var(--space-xs) var(--space-md);
  font-size: 12px;
  font-weight: 600;
  margin-top: var(--space-md);
}

/* Carousel dots */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  padding-top: var(--space-sm);
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--border);
  transition: all 0.3s;
}

.carousel-dot.active {
  width: 20px;
  background: var(--purple);
}

/* ── Recommendation Feed ── */
.feed {
  padding: 0 var(--space-lg);
}

.feed-card {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--border-light);
  -webkit-tap-highlight-color: transparent;
}

.feed-card:last-child {
  border-bottom: none;
}

.feed-card:active {
  opacity: 0.7;
}

.feed-image {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-md);
  object-fit: cover;
  object-position: center;
  flex-shrink: 0;
  background: var(--bg-muted);
}

.feed-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}

.feed-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-rating {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 13px;
  color: var(--text-secondary);
}

.feed-stars {
  color: var(--warning);
  font-size: 12px;
  letter-spacing: 1px;
}

.feed-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 13px;
  color: var(--text-muted);
}

.feed-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--text-muted);
}

.feed-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
}

.feed-price span {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Availability Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px var(--space-sm);
  border-radius: var(--radius-full);
}

.badge-available {
  color: var(--success);
  background: var(--success-light);
}

.badge-full {
  color: var(--error);
  background: var(--error-light);
}

/* ── Bottom Navigation ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--white);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 200;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-sm) var(--space-lg);
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-label {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-item.active svg {
  color: var(--purple);
}

.nav-item.active .nav-label {
  color: var(--purple);
  font-weight: 600;
}

.nav-item:active {
  transform: scale(0.92);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--gradient-brand);
  color: var(--text-inverse);
  box-shadow: var(--shadow-brand);
}

.btn-secondary {
  background: var(--bg-muted);
  color: var(--text);
}

.btn-outline {
  background: transparent;
  color: var(--purple);
  border: 1.5px solid var(--purple);
}

.btn-full {
  width: 100%;
  padding: var(--space-lg) var(--space-xl);
}

.btn-sm {
  padding: var(--space-sm) var(--space-lg);
  font-size: 13px;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* ── Divider ── */
.divider {
  height: 8px;
  background: var(--bg);
}

/* ── Tags / Pills ── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-muted);
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.pill:active, .pill.active {
  background: var(--purple);
  color: var(--text-inverse);
  border-color: var(--purple);
}

/* ── Utilities ── */
.px { padding-left: var(--space-lg); padding-right: var(--space-lg); }
.py { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-lg { margin-bottom: var(--space-lg); }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.font-semibold { font-weight: 600; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

/* ── Animations ── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 0.4s ease-out forwards;
}

.animate-in-delay-1 { animation-delay: 0.05s; opacity: 0; }
.animate-in-delay-2 { animation-delay: 0.1s; opacity: 0; }
.animate-in-delay-3 { animation-delay: 0.15s; opacity: 0; }
.animate-in-delay-4 { animation-delay: 0.2s; opacity: 0; }

/* ── Scrollbar hide ── */
.no-scrollbar {
  scrollbar-width: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* ── PWA Standalone Mode ── */
@media (display-mode: standalone) {
  body {
    background: var(--white);
  }

  .app {
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    min-height: 100dvh;
  }

  .status-bar-spacer {
    height: env(safe-area-inset-top, 44px);
    background: var(--white);
  }

  .bottom-nav {
    border-radius: 0;
  }
}

/* ── Mobile browser: full bleed, no frame ── */
@media (max-width: 430px) {
  body {
    background: var(--white);
  }

  .app {
    border-radius: 0;
    box-shadow: none;
    margin: 0;
  }

  .bottom-nav {
    border-radius: 0;
  }
}

/* ── Desktop browser: phone preview frame ── */
@media (min-width: 431px) and (display-mode: browser) {
  body {
    background: #e8e8ee;
  }

  .app {
    max-width: 430px;
    box-shadow: 0 0 60px rgba(0,0,0,0.1);
    border-radius: 32px;
    margin-top: 20px;
    margin-bottom: 20px;
    overflow: hidden;
    min-height: calc(100dvh - 40px);
  }

  .bottom-nav {
    max-width: 430px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    border-radius: 0 0 32px 32px;
  }
}

/* ══════════════════════════════════════════
   Category View Page (kategorie.html)
   ══════════════════════════════════════════ */

/* ── Category Header ── */
.cat-header {
  padding-bottom: var(--space-md);
}

.cat-header-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.cat-header-title {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* Active map icon highlight */
.header-icon.active-icon {
  background: var(--purple);
  color: var(--text-inverse);
}

/* ── Filter Pills Row ── */
.filter-pills {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: var(--space-xs);
  -webkit-overflow-scrolling: touch;
}

.filter-pills::-webkit-scrollbar {
  display: none;
}

.filter-pills .pill {
  flex-shrink: 0;
  white-space: nowrap;
}

.pill-icon-only {
  padding: var(--space-sm) var(--space-sm);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Category Business List ── */
.cat-list {
  padding-top: var(--space-sm);
}

/* ── Map Container ── */
.map-container {
  margin: var(--space-lg);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.map-container iframe {
  width: 100%;
  height: 400px;
  display: block;
  border: none;
}
