/*
 * sm-betriebe.css – Frontend-Styles
 * Basiert auf engelberg-modern.html, angepasst für WordPress-Shortcode-Kontext.
 * Alle Klassen sind mit sm- oder card- Präfix namespaced.
 */

/* ── Schriften ──────────────────────────────────────────────────────────────── */
/* Werden per wp_enqueue_style geladen – hier kein @import nötig */

/* ── CSS-Variablen ──────────────────────────────────────────────────────────── */
.sm-betriebe-root {
  --snow:           #F7F9FC;
  --ice:            #E8EFF7;
  --glacier:        #C5D8EC;
  --alpine:         #1A3A5C;
  --summit:         #0D2035;
  --accent:         #E8531A;
  --open:           #2E7D32;
  --closed:         #C62828;
  --warn:           #E65100;
  --radius:         16px;
  --shadow:         0 4px 24px rgba(26,58,92,0.10);
  --shadow-hover:   0 8px 40px rgba(26,58,92,0.18);
  --transition:     all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  font-family:      'Nunito', sans-serif;
  color:            var(--summit);
  box-sizing:       border-box;
}

.sm-betriebe-root *,
.sm-betriebe-root *::before,
.sm-betriebe-root *::after {
  box-sizing: inherit;
}

/* ── Navigationsleiste ──────────────────────────────────────────────────────── */
.sm-section-nav {
  background: var(--summit);
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
  margin-bottom: 0;
}

.sm-section-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.sm-section-nav-inner::-webkit-scrollbar { display: none; }

.sm-nav-tab {
  padding: 16px 28px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sm-nav-tab:hover         { color: #fff; text-decoration: none; }
.sm-nav-tab.active        { color: #fff; border-bottom-color: var(--accent); }

.sm-count {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.8);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
}

/* ── Update-Hinweis (kompakt, ausklappbar) ──────────────────────────────────── */
.sm-update-notice {
  border: 1px solid rgba(26,58,92,0.1);
  border-radius: 8px;
  margin: 16px 0 32px;
  overflow: hidden;
}

.sm-notice-toggle {
  width: 100%;
  background: none;
  border: none;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: #a0b4c8;
  text-align: left;
  transition: color 0.2s, background 0.2s;
}

.sm-notice-toggle:hover { color: var(--alpine); background: rgba(26,58,92,0.04); }

.sm-notice-icon { font-size: 13px; flex-shrink: 0; }

.sm-notice-chevron {
  margin-left: auto;
  display: inline-block;
  transition: transform 0.25s ease;
  font-size: 14px;
  color: #c0ccd8;
  font-style: normal;
}

.sm-notice-toggle[aria-expanded="true"] .sm-notice-chevron {
  transform: rotate(90deg);
}

.sm-notice-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, padding 0.25s ease;
  padding: 0 14px;
  font-size: 12px;
  color: #8aa0b8;
  border-top: 1px solid transparent;
}

.sm-notice-body.expanded {
  max-height: 48px;
  padding: 8px 14px;
  border-top-color: rgba(26,58,92,0.08);
}

/* ── Sektionen ──────────────────────────────────────────────────────────────── */
.sm-section {
  margin-bottom: 64px;
}

.sm-section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.sm-section-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.sm-icon-rest { background: #FFF3E0; }
.sm-icon-shop { background: #E8F5E9; }
.sm-icon-serv { background: #E3F2FD; }

.sm-section-title {
  font-family: 'Nunito', sans-serif;
  font-size: 1.8rem;
  color: var(--summit);
  letter-spacing: -0.01em;
  margin: 0;
}

.sm-section-line {
  flex: 1;
  height: 1px;
  background: var(--ice);
  border: none;
  margin: 0;
}

/* ── Karten-Grid ────────────────────────────────────────────────────────────── */
.sm-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* ── Skeleton-Loader ────────────────────────────────────────────────────────── */
.sm-loading .sm-skeleton {
  background: linear-gradient(90deg, var(--ice) 25%, var(--glacier) 50%, var(--ice) 75%);
  background-size: 200% 100%;
  animation: smShimmer 1.4s infinite;
  border-radius: var(--radius);
  height: 220px;
}

@keyframes smShimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

/* ── Einzelne Karte ─────────────────────────────────────────────────────────── */
.sm-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ice);
  animation: smFadeUp 0.4s ease both;
}

.sm-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

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

/* ── Karten-Header ──────────────────────────────────────────────────────────── */
.sm-card .card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--ice);
}

.sm-card .card-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--ice);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--alpine);
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid rgba(197,216,236,0.5);
}

.sm-card .card-logo.has-color { color: #fff; }

.sm-card .card-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.sm-card .card-info      { flex: 1; min-width: 0; }
.sm-card .card-name      { font-weight: 600; font-size: 1rem; color: var(--summit); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-card .card-phone     { font-size: 12px; color: #8aa0b8; margin-top: 2px; }

/* ── Status-Badge ───────────────────────────────────────────────────────────── */
.status-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.status-open    { background: #E8F5E9; color: var(--open); }
.status-closed  { background: #FFEBEE; color: var(--closed); }
.status-soon    { background: #FFF3E0; color: var(--warn); }
.status-unknown { background: var(--ice); color: #8aa0b8; }

/* ── Öffnungszeiten ─────────────────────────────────────────────────────────── */
.sm-card .card-hours {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hours-toggle {
  width: 100%;
  background: none;
  border: none;
  border-top: 1px solid var(--ice);
  padding: 10px 20px;
  font-size: 12px;
  color: #8aa0b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: 'Nunito', sans-serif;
  font-weight: 500;
  transition: color 0.2s;
}

.hours-toggle:hover { color: var(--alpine); }

.hours-body {
  overflow: hidden;
  transition: max-height 0.35s ease;
  padding: 0 20px;
}

.hours-body.collapsed { max-height: 0; }
.hours-body.expanded  { max-height: 400px; }

.hours-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  padding: 4px 0;
}

.hours-row .day        { color: #8aa0b8; font-weight: 500; min-width: 80px; }
.hours-row.today .day  { color: var(--summit); font-weight: 700; }
.hours-row .time       { color: var(--summit); font-variant-numeric: tabular-nums; }
.hours-row.today .time { color: var(--accent); font-weight: 600; }
.hours-row .time.closed-day { color: #c0ccd8; font-style: italic; }

/* ── Karten-Aktionen ────────────────────────────────────────────────────────── */
.sm-card .card-actions {
  padding: 14px 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--ice);
  margin-top: auto;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-family: 'Nunito', sans-serif;
}

.btn-primary             { background: var(--alpine); color: #fff; }
.btn-primary:hover       { background: var(--summit); text-decoration: none; color: #fff; }
.btn-secondary           { background: var(--ice); color: var(--alpine); }
.btn-secondary:hover     { background: var(--glacier); text-decoration: none; color: var(--alpine); }

/* ── Dienste-Grid ───────────────────────────────────────────────────────────── */
.sm-dienste-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.dienst-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--ice);
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 16px;
}

.dienst-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}

.dienst-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--ice);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.dienst-label { font-weight: 600; font-size: 14px; color: var(--summit); }
.dienst-sub   { font-size: 12px; color: #8aa0b8; margin-top: 2px; }

.dienst-links {
  margin-left: auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.dienst-link-chip {
  background: var(--ice);
  color: var(--alpine);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}

.dienst-link-chip:hover { background: var(--glacier); text-decoration: none; }

/* ── Fehler / Leer ──────────────────────────────────────────────────────────── */
.sm-error,
.sm-empty {
  color: #8aa0b8;
  font-size: 14px;
  padding: 24px;
  text-align: center;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .sm-nav-tab         { padding: 14px 16px; font-size: 12px; }
  .sm-cards-grid      { grid-template-columns: 1fr; }
  .sm-update-notice   { flex-wrap: wrap; }

  /* Karten-Header: Logo links, Name + Badge in zwei Zeilen rechts davon */
  .sm-card .card-header {
    display: grid;
    grid-template-columns: 52px 1fr;
    grid-template-rows: auto auto;
    column-gap: 16px;
    row-gap: 6px;
    align-items: start;
  }
  .sm-card .card-logo   { grid-row: 1 / 3; align-self: center; }
  .sm-card .card-info   { grid-column: 2; grid-row: 1; }
  .sm-card .card-name   { white-space: normal; overflow: visible; text-overflow: unset; }
  .status-badge         { grid-column: 2; grid-row: 2; align-self: start; }
}
