/* Top utility bar above main navigation */

:root {
  --top-bar-height: 2.25rem;
  --top-bar-tear-height: 12px;
}

.is-visible-desktop,
.is-visible-mobile {
  display: none !important;
}

@media (min-width: 768px) {
  .is-visible-desktop {
    display: block !important;
  }

  .site-top-bar__phone.is-visible-desktop,
  .site-top-bar__social.is-visible-desktop,
  .site-top-bar__social-link.is-visible-desktop {
    display: inline-flex !important;
  }
}

@media (max-width: 767px) {
  .is-visible-mobile {
    display: block !important;
  }

  .site-top-bar__phone.is-visible-mobile,
  .site-top-bar__social.is-visible-mobile {
    display: inline-flex !important;
  }

  .site-top-bar__social-link.is-visible-mobile {
    display: inline-flex !important;
  }
}

.site-header-shell--has-top-bar {
  --site-header-offset: calc(var(--header-height) + var(--top-bar-height) + var(--top-bar-tear-height));
}

body.has-top-bar {
  --site-header-offset: calc(var(--header-height) + var(--top-bar-height) + var(--top-bar-tear-height));
  padding-top: var(--site-header-offset);
}

@media (max-width: 767px) {
  body.has-top-bar:not(.has-top-bar-mobile) {
    --top-bar-height: 0px;
    --site-header-offset: var(--header-height);
  }
}

@media (min-width: 768px) {
  body.has-top-bar:not(.has-top-bar-desktop) {
    --top-bar-height: 0px;
    --site-header-offset: var(--header-height);
  }
}

@media (max-width: 767px) {
  body.has-top-bar.has-top-bar-mobile:not(.has-top-bar-desktop) {
    --top-bar-height: 2rem;
  }
}

body.has-top-bar:has(.site-header.is-scrolled.is-compact) {
  padding-top: calc(var(--header-height-compact, 3.25rem) + var(--top-bar-height) + var(--top-bar-tear-height));
}

.site-top-bar {
  position: relative;
  z-index: 2;
  background: var(--color-top-bar, var(--color-ink));
  color: rgba(255, 255, 255, 0.88);
  border-bottom: 0;
  font-size: var(--text-xs);
  line-height: 1.3;
}

.site-top-bar__tear {
  display: block;
  height: var(--top-bar-tear-height);
  line-height: 0;
  color: var(--color-top-bar, var(--color-ink));
  pointer-events: none;
  margin-bottom: -1px;
}

.site-top-bar__tear-svg {
  display: block;
  width: 100%;
  height: var(--top-bar-tear-height);
}

.site-top-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: var(--top-bar-height);
  max-width: var(--max-width);
  margin-inline: auto;
  padding: 0.35rem var(--space-3);
}

.site-top-bar__tagline {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-serif);
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-terracotta);
}

.site-top-bar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-shrink: 0;
}

.site-top-bar__icon {
  font-size: 0.8125rem;
  line-height: 1;
  flex-shrink: 0;
}

.site-top-bar__phone {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}

.site-top-bar__phone:hover {
  color: #fff;
  text-decoration: none;
}

.site-top-bar__phone:hover .site-top-bar__phone-label {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-top-bar__phone-label {
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
}

.site-top-bar__social {
  align-items: center;
  gap: 0.55rem;
}

.site-top-bar__social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  padding: 0.15rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease;
}

.site-top-bar__social-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.site-top-bar__social-link .site-top-bar__icon {
  font-size: 0.875rem;
}

.site-top-bar__social-text {
  text-transform: capitalize;
}

@media (max-width: 767px) {
  .site-top-bar__inner {
    padding-inline: var(--space-2);
    gap: var(--space-1);
  }

  .site-top-bar__tagline {
    font-size: 0.75rem;
  }

  .site-top-bar__actions {
    gap: 0.75rem;
  }

  .site-top-bar__phone-label {
    font-size: 0.75rem;
  }

  .site-top-bar__social {
    gap: 0.45rem;
  }

  /* Icons only on small screens to save space; number stays visible */
  .site-top-bar__social-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .site-top-bar__social-link {
    width: 1.75rem;
    height: 1.75rem;
    justify-content: center;
    padding: 0;
  }

  .site-top-bar__social-link .site-top-bar__icon {
    font-size: 0.9375rem;
  }
}

@media (min-width: 768px) {
  .site-top-bar__tagline:not(.is-visible-desktop) + .site-top-bar__actions {
    margin-left: auto;
    width: 100%;
    justify-content: flex-end;
  }

  .site-top-bar__social-text {
    display: inline;
  }
}

.driftwood-top-bar-visibility thead th {
  font-weight: 600;
  padding-bottom: 0.35rem;
}

.driftwood-top-bar-visibility tbody th {
  font-weight: 500;
}

.driftwood-top-bar-visibility td {
  text-align: center;
  width: 5rem;
}

.driftwood-top-bar-settings h3 {
  margin: 1.25em 0 0.35em;
  font-size: 1em;
}
