/* ========================================
   UNTERKATEGORIEN-SEITEN - ZENTRALE CSS
   ========================================
   Einheitliche Styles für alle Kategorie-Seiten
   (z.B. /categories/auto, /categories/immobilien)
   ======================================== */

/* ===== GRAY CARD CONTAINER ===== */
.gray-card {
  background: #f5f5f7;
  border-radius: 16px;
  padding: 0;
  margin: 40px auto 20px auto;
  max-width: 800px;
  box-shadow: none;
  /* overflow: visible – verhindert Abschneiden von Kacheltext auf iOS (Layout/Categories-Mobile würden sonst greifen) */
  overflow: visible;
}

/* ===== RED BANNER (Header) – 72px Höhe, Pfeil links, Text mittig ===== */
.red-banner {
  background: #8b0000;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 16px 16px 0 0;
  height: 72px;
  box-sizing: border-box;
}

/* Zurück-Pfeil: abgerundetes Quadrat wie Referenz (40×40, Radius 12px), dünner Rand */
.gray-card .red-banner .back-button {
  position: absolute !important;
  left: 20px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 40px !important;
  height: 40px !important;
  text-decoration: none !important;
  border: 1.5px solid rgba(255,255,255,0.55) !important;
  background: rgba(255,255,255,0.22) !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  transition: background 0.2s !important;
  z-index: 2;
  box-sizing: border-box !important;
}
.gray-card .red-banner .back-button:hover {
  background: rgba(255,255,255,0.35) !important;
}
.gray-card .red-banner .back-button .arrow-circle {
  width: auto !important;
  height: auto !important;
  min-width: unset !important;
  background: transparent !important;
  color: white !important;
  border: none !important;
  border-radius: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  transition: none !important;
  box-shadow: none !important;
  line-height: 1 !important;
}

.back-button {
  text-decoration: none;
  margin-right: 20px;
}

/*
 * Pfeil nur als Symbol – kein runder Kasten.
 * Der sichtbare Rahmen kommt ausschließlich von .back-button (abgerundetes Quadrat).
 */
.back-button .arrow-circle {
  width: auto !important;
  height: auto !important;
  min-width: unset !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: inherit;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  box-shadow: none !important;
  transition: none !important;
}

.back-button:hover .arrow-circle {
  background: transparent !important;
  color: inherit;
}

/* Roter Banner: Pfeil immer weiß */
.gray-card .red-banner .back-button,
.red-filter-banner .back-button {
  color: #fff;
}

.red-filter-banner .back-button .arrow-circle {
  color: #fff !important;
}

/* Global fallback */
.banner-title {
  text-align: center;
  color: white;
}

/* Banner-Title: mittig im Banner dank position:absolute am Back-Button */
.gray-card .red-banner .banner-title {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  color: white !important;
  width: 100% !important;
}

.banner-title h2 {
  font-family: "Arial Narrow", Arial, sans-serif;
  margin: 0 0 4px 0;
  font-size: 20px;
  font-weight: 600;
  color: white !important;
}

.banner-title p {
  font-family: "Arial Narrow", Arial, sans-serif;
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
  color: white !important;
}

/* Banner-Schrift: Lesbar, nicht zu klein */
.gray-card .red-banner .banner-title h2 {
  font-size: 1.1rem !important;
  line-height: 1.3;
}
.gray-card .red-banner .banner-title p {
  font-size: 13px !important;
  line-height: 1.3;
  opacity: 0.95;
}

/* ===== CATEGORIES GRID (Desktop) – nur Unterkategorien (.gray-card) ===== */
/* Überschreibt Layout (margin-left: -15px) und categories-mobile (3 Spalten !important) */
.gray-card .categories-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 16px !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 24px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  justify-items: stretch !important;
  align-items: stretch !important;
  box-sizing: border-box !important;
}

/* ===== CATEGORY ITEM (Kachel) – Bild bündig am Rand wie Startseite ===== */
.gray-card .category-item {
  background: white !important;
  border: 1px solid #e0e0e0 !important;
  border-radius: 12px !important;
  padding: 0 !important;
  text-align: center !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.3s ease !important;
  text-decoration: none !important;
  color: inherit !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: stretch !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  gap: 0 !important;
  min-height: unset !important;
}

.gray-card .category-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  color: inherit;
}

/* Bild: bündig am Kartenrahmen oben — wie Startseite */
.gray-card .category-item .cat-img {
  width: 100% !important;
  height: 130px !important;
  object-fit: cover !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
  border-radius: 0 !important;
}

.gray-card .category-name {
  font-family: "Arial Narrow", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #8B0000;
  margin: 0;
  padding: 9px 8px;
  line-height: 1.3;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  overflow: visible !important;
  white-space: normal !important;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Unterstützung für restaurants.php (category-title + category-desc) */
.gray-card .category-title {
  font-family: "Arial Narrow", Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin: 0 0 4px 0;
  line-height: 1.3;
  text-align: center;
  overflow: visible !important;
  white-space: normal !important;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.gray-card .category-desc {
  font-family: "Arial Narrow", Arial, sans-serif;
  font-size: 12px;
  color: #666;
  margin: 0;
  line-height: 1.3;
  text-align: center;
  overflow: visible !important;
  white-space: normal !important;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ===== CATEGORY DETAIL PAGES (category-header) – roter Streifen wie Übersichten ===== */
/* Gilt für /category/moebel, /category/auto-verkaufen, Restaurants-Detail, etc. */
.category-header {
  border-radius: 16px 16px 0 0 !important;
}

.category-header .category-title,
.category-header .category-subtitle {
  color: white !important;
}

/* ===== TABLET (768px) – Flexbox bleibt aktiv, keine Pixelwerte nötig ===== */
@media (max-width: 768px) {
  /* Banner-Title bleibt zentriert durch Flexbox - keine Änderung nötig */

  .gray-card .red-banner .banner-title h2 {
    font-size: 0.9rem !important;
  }
  .gray-card .red-banner .banner-title p {
    font-size: 10px !important;
  }

  .gray-card .categories-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    padding: 20px !important;
  }

  .gray-card .category-item {
    padding: 0 !important;
    min-height: unset !important;
    gap: 0 !important;
    overflow: hidden !important;
  }

  .gray-card .category-icon {
    font-size: 40px !important;
    margin-bottom: 0 !important;
    flex-shrink: 0;
  }

  .gray-card .category-name {
    font-size: 15px;
  }
}

/* ===== MOBILE (520px) – 2 SPALTEN (wie Phase 1 Startseite) ===== */
@media (max-width: 520px) {
  .gray-card {
    margin: 20px auto 20px auto;
  }

  .gray-card {
    max-width: 358px;
  }

  .red-banner {
    padding: 0 16px;
    height: 72px;
    box-sizing: border-box;
  }

  .gray-card .red-banner .back-button {
    margin-right: 12px;
    left: 16px !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
  }

  /* Pfeil nur als Symbol – kein zweiter Kasten (wie Desktop) */
  .gray-card .red-banner .back-button .arrow-circle {
    width: auto !important;
    height: auto !important;
    font-size: 15px !important;
    font-weight: 400 !important;
  }

  /* Banner-Title bleibt zentriert durch Flexbox - keine Änderung nötig */

  .gray-card .red-banner .banner-title h2 {
    font-size: 0.9rem !important;
  }
  .gray-card .red-banner .banner-title p {
    font-size: 10px !important;
  }

  .gray-card .categories-grid {
    /* Handy: 2 Spalten – konsistent mit Phase 1, kein Text-Cutoff */
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    padding: 16px !important;
    justify-items: stretch !important;
  }

  .gray-card .category-item {
    padding: 0;
    min-height: unset;
    width: 100%;
    gap: 0;
  }

  .gray-card .category-icon {
    font-size: 36px !important;
    margin-bottom: 0 !important;
    flex-shrink: 0;
  }

  .gray-card .category-name {
    font-size: 14px;
    line-height: 1.35;
  }
}

/* ===== IPHONE (428px) – 2 SPALTEN, iOS-OPTIMIERT ===== */
@media (max-width: 428px) {
  .gray-card .red-banner .back-button {
    margin-right: 10px;
    left: 12px !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 9px !important;
  }

  .gray-card .red-banner .back-button .arrow-circle {
    font-size: 15px !important;
    font-weight: 400 !important;
  }

  /* Banner-Title bleibt zentriert durch Flexbox - keine Änderung nötig */

  .gray-card .red-banner .banner-title h2 {
    font-size: 0.85rem !important;
  }
  .gray-card .red-banner .banner-title p {
    font-size: 9px !important;
  }

  .gray-card .categories-grid {
    /* iPhone: 2 Spalten – wie Phase 1, zuverlässiges Rendering auf echtem Gerät */
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    padding: 12px !important;
    justify-items: stretch !important;
  }

  .gray-card .category-item {
    padding: 0;
    min-height: unset;
    overflow: hidden !important;
    gap: 0;
  }

  .gray-card .category-icon {
    font-size: 32px !important;
    margin-bottom: 0 !important;
    flex-shrink: 0;
  }

  .gray-card .category-name {
    font-size: 13px;
    line-height: 1.3;
    overflow: visible !important;
    white-space: normal !important;
    display: block;
    /* Min. 13px: iOS-Safari-Rendering stabil */
    min-height: 0;
    max-height: none !important;
  }

  @supports (-webkit-touch-callout: none) {
    .gray-card .category-name {
      -webkit-font-smoothing: antialiased;
      text-rendering: optimizeLegibility;
    }
  }
}

/* ========================================
   ANGEBOTS-KARTEN – Detail-Blöcke (alle Kategorien)
   Stellt sicher, dass Zielgruppe, Art, Marke, etc. sichtbar sind
   ======================================== */

.offers-section .offer-content {
  display: block !important;
  padding: 16px 20px 20px !important;
}

.offers-section .offer-title {
  font-size: 20px !important;
  font-weight: 600 !important;
  color: #1d1d1f !important;
  margin: 0 0 16px !important;
  display: block !important;
}

/* Detail-Blöcke: immer sichtbar (alle Kategorien) */
.offers-section .events-details,
.offers-section .auto-details,
.offers-section .sportfitness-details,
.offers-section .immobilien-details,
.offers-section .restaurant-details,
.offers-section .homeshop-details,
.offers-section .offer-description,
.offers-section .offer-details {
  display: block !important;
  visibility: visible !important;
}

/* Events: Zielgruppe, Art des Events */
.offers-section .events-details {
  margin-bottom: 16px;
  padding: 14px;
  background: #f9f9fb;
  border-radius: 12px;
}

.offers-section .events-detail-item {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 8px;
  visibility: visible !important;
}

.offers-section .events-detail-label,
.offers-section .events-detail-value {
  display: inline !important;
  visibility: visible !important;
}

.offers-section .events-detail-label {
  font-weight: 700 !important;
  color: #8B0000 !important;
}

/* Auto: Marke, km, Kraftstoff, etc. */
.offers-section .auto-details {
  margin-bottom: 16px;
  padding: 14px;
  background: #f9f9fb;
  border-radius: 12px;
}

.offers-section .auto-detail-item {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 8px;
  visibility: visible !important;
}

.offers-section .auto-detail-label,
.offers-section .auto-detail-value {
  display: inline !important;
  visibility: visible !important;
}

.offers-section .auto-detail-label {
  font-weight: 700 !important;
  color: #8B0000 !important;
}

/* Sport & Fitness */
.offers-section .sportfitness-details {
  margin-bottom: 16px;
  padding: 14px;
  background: #f9f9fb;
  border-radius: 12px;
}

.offers-section .sportfitness-detail-item {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 8px;
  visibility: visible !important;
}

.offers-section .sportfitness-detail-label,
.offers-section .sportfitness-detail-value {
  display: inline !important;
  visibility: visible !important;
}

.offers-section .sportfitness-detail-label {
  font-weight: 700 !important;
  color: #8B0000 !important;
}

/* Immobilien */
.offers-section .immobilien-details {
  margin-bottom: 16px;
  padding: 14px;
  background: #f9f9fb;
  border-radius: 12px;
}

.offers-section .immobilien-detail-item {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 8px;
  visibility: visible !important;
}

.offers-section .immobilien-detail-label,
.offers-section .immobilien-detail-value {
  display: inline !important;
  visibility: visible !important;
}

.offers-section .immobilien-detail-label {
  font-weight: 700 !important;
  color: #8B0000 !important;
}

/* Restaurant-Details */
.offers-section .restaurant-details {
  margin-bottom: 16px;
  padding: 14px;
  background: #f9f9fb;
  border-radius: 12px;
}

.offers-section .restaurant-detail-item {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 8px;
  visibility: visible !important;
}

.offers-section .restaurant-detail-label {
  font-weight: 700 !important;
  color: #8B0000 !important;
}

/* Homeshop-Details (Möbel, Geschirr, etc.) */
.offers-section .homeshop-details {
  margin-bottom: 16px;
  padding: 14px;
  background: #f9f9fb;
  border-radius: 12px;
}

.offers-section .homeshop-detail-item {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 8px;
  visibility: visible !important;
}

.offers-section .homeshop-detail-label {
  font-weight: 700 !important;
  color: #8B0000 !important;
}

/* Confidence-Bar (Events, Sport) */
.offers-section .offer-confidence {
  display: block !important;
  visibility: visible !important;
  padding: 12px 20px 8px;
}

.offers-section .confidence-score,
.offers-section .confidence-bar {
  display: block !important;
  visibility: visible !important;
}

/* Standort, Preis, Datum */
.offers-section .offer-location {
  display: flex !important;
  align-items: center !important;
  visibility: visible !important;
  margin-bottom: 12px;
}

.offers-section .offer-price {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
  visibility: visible !important;
  margin-bottom: 12px;
}

.offers-section .offer-meta,
.offers-section .offer-date {
  display: block !important;
  visibility: visible !important;
}

/* 2-Spalten-Grid für alle Angebotsseiten */
.offers-section .offers-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 16px !important;
  max-width: 900px !important;
  margin: 0 auto !important;
  padding: 20px 16px 24px !important;
}

@media (max-width: 768px) {
  .offers-section .offers-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ===== KOSTENFREI BADGE (Freizeitgestaltung) – Oranger Glanz-Stil ===== */
.kostenfrei-badge {
  background: linear-gradient(135deg, #ff8c00 0%, #ffa500 50%, #ffb347 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(255, 140, 0, 0.4), 0 0 12px rgba(255, 165, 0, 0.25);
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ===== DASHBOARD „MEIN BEREICH“ – Zurück-Button vs. social-icons-fix.css =====
 * social-icons-fix setzt html body .back-button mit border-radius:25px !important,
 * padding und transparentem Hintergrund → sieht aus wie Kreis/Pille (Bild 1).
 * Hier: gleicher Look wie Kategorie-Banner – abgerundetes Quadrat (Bild 2). */
html body .dashboard-page-banner .back-button {
  position: absolute !important;
  left: 20px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 4 !important;
  width: 40px !important;
  height: 40px !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  border: 1.5px solid rgba(255, 255, 255, 0.55) !important;
  background: rgba(255, 255, 255, 0.22) !important;
  border-radius: 12px !important;
  text-decoration: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  color: #fff !important;
  font-weight: 400 !important;
  transition: background 0.2s ease !important;
}

html body .dashboard-page-banner .back-button:hover {
  background: rgba(255, 255, 255, 0.35) !important;
  color: #fff !important;
  text-decoration: none !important;
}

html body .dashboard-page-banner .back-button .arrow-circle {
  width: auto !important;
  height: auto !important;
  min-width: unset !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  box-shadow: none !important;
}

@media (max-width: 768px) {
  html body .dashboard-page-banner .back-button {
    left: 12px !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
  }
}

@media (max-width: 480px) {
  html body .dashboard-page-banner .back-button {
    left: 10px !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 9px !important;
  }
  html body .dashboard-page-banner .back-button .arrow-circle {
    font-size: 15px !important;
  }
}
