/* Site header (partials/_header.pug, <smart-site-header>): light bar with the
   logo, links per role and the account menu. It scrolls away with the page;
   on phones the links move into the menu button. */

.sf-header {
  --sf-header-height: 72px;
  --sf-header-bg: #fff;
  --sf-header-text: #2f2c29;
  --sf-header-muted: #5c636a;
  --sf-header-line: #dee2e6;
  --sf-header-soft: #f1f3f5;

  position: relative;
  z-index: 1000;
  background: var(--sf-header-bg);
  border-bottom: 1px solid var(--sf-header-line);
  color: var(--sf-header-text);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.4;
}

.sf-header a {
  color: inherit;
  text-decoration: none;
}

.sf-header a:focus-visible,
.sf-header button:focus-visible {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

.sf-header ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Family and size only: the weight comes from each button's own rule, so
   "Verkaufen" matches the links next to it. */
.sf-header button {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  cursor: pointer;
}

.sf-header-bar {
  display: flex;
  align-items: center;
  gap: 32px;
  height: var(--sf-header-height);
  padding: 0 16px 0 24px;
}

.sf-header-logo img {
  display: block;
  width: 152px;
  height: auto;
}

.sf-header-nav {
  flex: 1 1 auto;
  min-width: 0;
  align-self: stretch;
}

.sf-header-links {
  display: flex;
  align-items: stretch;
  gap: 4px;
  height: 100%;
}

.sf-header-item {
  position: relative;
  display: flex;
  align-items: stretch;
}

.sf-header-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border: 0;
  border-top: 2px solid transparent;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--sf-header-text);
  font-weight: 500;
  white-space: nowrap;
}

.sf-header .sf-header-link:hover,
.sf-header-link[aria-expanded="true"] {
  color: var(--sf-header-text);
}

.sf-header .sf-header-link[aria-current="page"],
.sf-header-link.is-current {
  border-bottom-color: var(--sf-header-text);
  color: var(--sf-header-text);
  font-weight: 600;
}

.sf-header-chevron {
  flex: none;
  transition: transform 0.15s ease;
}

[aria-expanded="true"] > .sf-header-chevron {
  transform: rotate(180deg);
}

/* The heading of the "Verkaufen" links in the phone menu. */
.sf-header-group-title {
  display: none;
}

.sf-header-dropdown {
  position: absolute;
  top: calc(100% - 6px);
  left: 0;
  display: none;
  flex-direction: column;
  width: 260px;
  padding: 8px;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(33, 37, 41, 0.14);
}

.sf-header-dropdown.is-open {
  display: flex;
}

.sf-header-dropdown-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--sf-header-text);
}

.sf-header .sf-header-dropdown-link:hover,
.sf-header .sf-header-dropdown-link[aria-current="page"] {
  background: var(--sf-header-soft);
  color: var(--sf-header-text);
}

.sf-header-dropdown-label {
  font-weight: 500;
}

.sf-header-dropdown-hint {
  color: var(--sf-header-muted);
  font-size: 13px;
}

.sf-header-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.sf-header .sf-header-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--sf-header-text);
  color: #fff;
  font-weight: 600;
}

.sf-header .sf-header-login:hover {
  background: #000;
  color: #fff;
}

.sf-header-icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--sf-header-text);
}

.sf-header .sf-header-icon-button:hover {
  background: var(--sf-header-soft);
  color: var(--sf-header-text);
}

.sf-header-cart {
  position: relative;
}

.sf-header-cart-count {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--sf-header-text);
  color: var(--sf-header-bg);
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.sf-header-cart-count[hidden] {
  display: none;
}

.sf-header-account {
  position: relative;
}

.sf-header-account-button {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 10px 0 4px;
  border: 1px solid var(--sf-header-line);
  border-radius: 999px;
  background: transparent;
  color: var(--sf-header-text);
  font-weight: 500;
}

.sf-header-account-button:hover,
.sf-header-account-button[aria-expanded="true"] {
  border-color: var(--sf-header-text);
}

.sf-header-avatar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--sf-header-text);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.sf-header-avatar-large {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.sf-header-avatar:has(img) {
  position: relative;
  overflow: hidden;
}

.sf-header-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sf-header-account-menu {
  top: calc(100% + 10px);
  right: 0;
  left: auto;
}

.sf-header-account-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid #e9ecef;
}

.sf-header-account-who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sf-header-account-who strong {
  font-weight: 600;
}

.sf-header-account-who span {
  color: var(--sf-header-muted);
  font-size: 13px;
}

/* "Mein Abo" with the photographer's plan as a badge on the right. */
.sf-header-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sf-header-plan-badge {
  flex: none;
  padding: 2px 8px;
  border: 1px solid var(--sf-header-line);
  border-radius: 999px;
  background: var(--sf-header-soft);
  color: var(--sf-header-text);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
}

.sf-header-logout {
  margin-top: 6px;
  border-top: 1px solid #e9ecef;
  border-radius: 0 0 6px 6px;
}

.sf-header-menu-button,
.sf-header-menu-close {
  display: none;
}

/* Phones and small tablets: logo, cart, account and menu button in the bar;
   the links open as a panel below it. */
@media (max-width: 991.98px) {
  .sf-header {
    --sf-header-height: 64px;
  }

  .sf-header-bar {
    gap: 4px;
    padding: 0 8px 0 16px;
  }

  .sf-header-logo {
    margin-right: auto;
  }

  .sf-header-logo img {
    width: 128px;
  }

  .sf-header-menu-button {
    display: flex;
  }

  .sf-header-menu-button[aria-expanded="true"] .sf-header-menu-open {
    display: none;
  }

  .sf-header-menu-button[aria-expanded="true"] .sf-header-menu-close {
    display: block;
  }

  .sf-header-actions {
    gap: 4px;
    margin-left: 0;
  }

  .sf-header-account-name,
  .sf-header-account-button .sf-header-chevron {
    display: none;
  }

  .sf-header .sf-header-login {
    height: 40px;
    padding: 0 16px;
    margin-right: 4px;
  }

  .sf-header-account-button {
    justify-content: center;
    width: 44px;
    padding: 0;
    border: 2px solid transparent;
  }

  .sf-header-account-button:hover {
    border-color: transparent;
  }

  .sf-header-account-button[aria-expanded="true"] {
    border-color: var(--sf-header-text);
  }

  .sf-header-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    gap: 20px;
    height: calc(100dvh - var(--sf-header-height));
    padding: 8px 16px 24px;
    box-sizing: border-box;
    overflow-y: auto;
    background: var(--sf-header-bg);
    border-top: 1px solid var(--sf-header-line);
  }

  .sf-header-nav.is-open {
    display: flex;
  }

  .sf-header-links {
    flex-direction: column;
    gap: 0;
    height: auto;
    padding-top: 8px;
  }

  .sf-header-item {
    flex-direction: column;
  }

  .sf-header-link {
    min-height: 48px;
    padding: 0 12px;
    margin: 0 -12px;
    border: 0;
    border-radius: 8px;
    color: var(--sf-header-text);
    font-size: 17px;
    font-weight: 400;
  }

  .sf-header .sf-header-link[aria-current="page"] {
    background: var(--sf-header-soft);
    font-weight: 600;
  }

  /* In the panel the "Verkaufen" links are always open under a heading. */
  .sf-header-item > button.sf-header-link {
    display: none;
  }

  .sf-header-group-title {
    display: block;
    padding: 20px 0 6px;
    color: var(--sf-header-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .sf-header-nav .sf-header-dropdown {
    position: static;
    display: flex;
    width: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .sf-header-nav .sf-header-dropdown-link {
    justify-content: center;
    min-height: 48px;
    padding: 0 12px;
    margin: 0 -12px;
    border-radius: 8px;
    font-size: 17px;
  }

  .sf-header-nav .sf-header-dropdown-label {
    font-weight: 400;
  }

  .sf-header-nav .sf-header-dropdown-link[aria-current="page"] .sf-header-dropdown-label {
    font-weight: 600;
  }

  .sf-header-nav .sf-header-dropdown-hint {
    display: none;
  }

  .sf-header-account {
    position: static;
  }

  .sf-header-account-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 8px;
    left: 8px;
    z-index: 2;
    width: auto;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(33, 37, 41, 0.18);
  }

  .sf-header-account-menu .sf-header-dropdown-link {
    justify-content: center;
    min-height: 48px;
    padding: 0 12px;
    font-size: 16px;
  }

  .sf-header-account-menu .sf-header-plan-link {
    padding: 6px 12px;
  }

  /* Dims the page below the header while the account card is open. */
  smart-site-header[data-open="account"] .sf-header::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 1;
    height: calc(100dvh - var(--sf-header-height));
    background: rgba(33, 37, 41, 0.32);
  }
}

/* Admins only: the band below the header (partials/_header.pug). */
.sf-admin-band {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 30px;
  padding: 4px 16px;
  background: repeating-linear-gradient(
    -45deg,
    #f5b301 0 14px,
    #f0a800 14px 28px
  );
  border-bottom: 1px solid #d89400;
  color: #2f2c29;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.3;
}

.sf-admin-band strong {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sf-admin-band-hint::before {
  content: "·";
  margin-right: 8px;
}

@media (max-width: 575.98px) {
  .sf-admin-band-hint {
    display: none;
  }
}
