/* Tank-App Stationsdarstellung v5 */

.brand-choice .brand-logo-frame {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  overflow: hidden;
  background: #34343b;
  display: grid;
  place-items: center;
  padding: 3px;
  font-weight: 700;
}
.brand-choice .brand-logo-frame.has-logo { background: #fff; }
.brand-choice .brand-logo-frame img,
.brand-choice .brand-logo-frame svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-badge.brand-badge-logo {
  display: grid !important;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 3px;
  overflow: hidden;
  background: #fff;
  border-radius: 9px;
  place-items: center;
}
.brand-badge.brand-badge-logo img,
.brand-badge.brand-badge-logo svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

html[data-theme="light"] .brand-choice .brand-logo-frame:not(.has-logo),
html[data-theme="light"] .brand-choice .brand-logo-frame[data-brand-visual="fallback"] {
  background: #ececf1 !important;
  color: #252529 !important;
}

.detail-name-line {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  align-items: start;
  gap: 12px;
}
.detail-brand-logo {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #2d2d33;
  font-weight: 800;
  font-size: .82rem;
}
.detail-brand-logo img,
.detail-brand-logo svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.detail-brand-logo.has-logo {
  padding: 4px;
  background: rgba(255,255,255,.96);
}
.detail-fav { grid-column: 3; }
html[data-theme="light"] .detail-brand-fallback {
  background: #e9e9ee;
  color: #242428;
  border: 1px solid #d2d2d7;
}

/* Detail-Sheet wird je nach Ausgangsansicht direkt an deren Inhaltskante verankert. */
.detail-overlay.detail-context-anchored {
  inset: var(--detail-sheet-top, 0px) 0 0 !important;
  align-items: flex-start !important;
  background: transparent !important;
}
.detail-overlay.detail-context-anchored .detail-panel {
  width: min(900px, 100%);
  height: 100%;
  max-height: 100% !important;
}
body.detail-open #tankTipCard {
  visibility: hidden !important;
}

/* Entfernung und Route als gemeinsamer Aktionsbutton. */
.detail-actions {
  justify-content: flex-end !important;
}
.detail-distance {
  display: none !important;
}
.detail-route {
  min-width: 148px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 24px;
  padding: 9px 18px;
  margin-right: 17px;
  font-size: 1.08rem;
  font-weight: 800;
  white-space: nowrap;
}
.detail-route.button-with-icon[data-distance] > span {
  display: none !important;
}
.detail-route.button-with-icon[data-distance]::before {
  content: attr(data-distance);
}
.detail-route.button-with-icon[data-distance] > .ui-icon-solid {
  order: 2;
  width: 23px !important;
  height: 23px !important;
}

/* Öffnungszeiten im Tankstellen-Bottom-Sheet. */
.opening-status {
  margin-top: 12px;
  font-size: 1rem;
  font-weight: 750;
}
.opening-status-toggle,
.opening-status-static {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 0;
  color: var(--text);
  text-align: left;
}
.opening-status-toggle {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-weight: inherit;
}
.opening-status-label {
  min-width: 0;
  line-height: 1.25;
}
.opening-status-unavailable .opening-status-static {
  color: var(--muted);
  font-weight: 650;
}
.opening-caret {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  margin: -4px 18px 0 0;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .18s ease;
}
.opening-status-toggle[aria-expanded="true"] .opening-caret {
  margin-top: 4px;
  transform: rotate(225deg);
}
.opening-times.opening-times-inline {
  margin-top: 4px;
  padding: 9px 0 2px;
  border-top: 1px solid var(--line);
}
.opening-times.opening-times-inline .opening-time-row {
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 5px 0;
  color: var(--muted);
  line-height: 1.25;
}
.opening-times.opening-times-inline .opening-time-row span:last-child {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

html[data-theme="light"] .opening-status-toggle,
html[data-theme="light"] .opening-status-static,
html[data-theme="light"] .opening-times.opening-times-inline .opening-time-row span:last-child {
  color: var(--text);
}
html[data-theme="light"] .opening-status-unavailable .opening-status-static,
html[data-theme="light"] .opening-times.opening-times-inline .opening-time-row {
  color: var(--muted);
}

@media (max-width: 420px) {
  .detail-brand-logo {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 10px;
  }
  .detail-name-line { gap: 9px; }
  .detail-route {
    min-width: 140px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .opening-times.opening-times-inline .opening-time-row {
    gap: 10px;
    font-size: .94rem;
  }
}

@media (max-width: 390px) {
  .brand-badge.brand-badge-logo {
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 2px;
  }
  .station-title-line { gap: 6px; }
}

/* X, Favorit, Route und Caret teilen sich optisch dieselbe rechte Kante. */
.detail-name-line {
  padding-right: 0 !important;
}
.detail-fav {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  justify-self: end;
  padding: 0;
  margin-right: 5px;
}
.detail-fav > svg,
.detail-fav .ui-icon-solid {
  width: 30px !important;
  height: 30px !important;
}
