/* ============================================
   HEADER SHELL — Single Source of Truth
   Premium dark header with brand gradients
   ============================================ */

.ts-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky, 200);
  width: 100%;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--gem-malachite-flat) 4%, transparent) 0%,
      transparent 60%
    ),
    linear-gradient(180deg, #0a100d 0%, #060b08 100%);
  border-bottom: 1px solid color-mix(in srgb, var(--gem-gold-flat) 12%, transparent);
  box-shadow:
    inset 0 -1px 0 color-mix(in srgb, var(--gem-malachite-flat) 6%, transparent),
    0 4px 24px rgb(0 0 0 / 50%);
  backdrop-filter: blur(18px) saturate(1.3);
  transition:
    background var(--tiller-transition-normal, 0.25s) var(--tiller-ease-smooth, ease),
    box-shadow var(--tiller-transition-normal, 0.25s) var(--tiller-ease-smooth, ease);
}

/* Animated gradient accent line along bottom edge */
.ts-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--gem-malachite-flat) 40%, transparent) 20%,
    color-mix(in srgb, var(--gem-gold-flat) 50%, transparent) 50%,
    color-mix(in srgb, var(--gem-malachite-flat) 40%, transparent) 80%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: header-gradient-sweep 8s ease-in-out infinite alternate;
}

@keyframes header-gradient-sweep {
  0% {
    background-position: 0% 50%;
  }

  100% {
    background-position: 100% 50%;
  }
}

.ts-header--scrolled {
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--gem-malachite-flat) 2%, transparent) 0%,
      transparent 40%
    ),
    rgb(6 11 8 / 97%);
  box-shadow:
    inset 0 -1px 0 color-mix(in srgb, var(--gem-gold-flat) 8%, transparent),
    0 8px 32px rgb(0 0 0 / 65%);
}

.ts-header__container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.5rem clamp(0.75rem, 2vw, 1.5rem);
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 1.5vw, 1.5rem);
}

.ts-header__branding {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

.ts-header__logo-link {
  display: block;
  position: relative;
  transition: transform 0.3s var(--tiller-ease-bounce, cubic-bezier(0.34, 1.56, 0.64, 1));
}

.ts-header__logo-link:hover {
  transform: scale(1.06);
}

/* Subtle emerald glow around logo on hover */
.ts-header__logo-link::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: radial-gradient(circle, rgb(0 225 132 / 20%) 0%, transparent 70%);
  opacity: 0%;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.ts-header__logo-link:hover::after {
  opacity: 100%;
}

.ts-header__logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg, 12px);
  box-shadow:
    0 2px 8px rgb(0 0 0 / 30%),
    0 0 0 1px rgb(0 225 132 / 10%);
  transition:
    width 0.3s var(--tiller-ease-smooth, ease),
    height 0.3s var(--tiller-ease-smooth, ease),
    box-shadow 0.3s ease;
}

.ts-header--scrolled .ts-header__logo {
  width: 40px;
  height: 40px;
}

.ts-header__info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.ts-header__company {
  font-family: var(--font-display, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  font-size: clamp(1rem, 1.1vw, 1.25rem);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.ts-header__region {
  font-size: 0.6875rem;
  color: var(--tiller-color-emerald, #00e184);
  font-weight: 600;
  white-space: nowrap;
  opacity: 60%;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.ts-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.ts-header__actions .btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Hide phone icon on desktop (text visible), show on mobile */
@media (min-width: 481px) {
  .ts-header__actions .btn--ghost .btn-icon {
    display: none;
  }
}

/* ============================================
   RESPONSIVE HEADER — MOBILE (< 769px)
   ============================================ */

@media (max-width: 768px) {
  .ts-header__container {
    padding: 0.625rem 0.75rem;
    gap: 0.5rem;
  }

  .ts-header__logo {
    width: 40px;
    height: 40px;
  }

  .ts-header__info {
    display: flex;
  }

  .ts-header__company {
    font-size: 0.875rem;
  }

  .ts-header__region {
    font-size: 0.625rem;
  }

  .ts-header__actions {
    display: flex;
    gap: 0.375rem;
  }

  /* Hide Call Now text on mobile, show only on ≥480px */
  .ts-header__actions .btn--ghost .btn-text {
    display: none;
  }
}

@media (min-width: 480px) and (max-width: 768px) {
  .ts-header__actions .btn--ghost .btn-text {
    display: inline;
  }
}

/* Tablet: tighten spacing */
@media (min-width: 769px) and (max-width: 1024px) {
  .ts-header__container {
    gap: 0.75rem;
  }

  .ts-header__company {
    font-size: 0.9375rem;
  }
}

/* Ultra-wide: add breathing room */
@media (min-width: 2560px) {
  .ts-header__container {
    max-width: 1600px;
    padding: 1rem 2.5rem;
  }
}

/* Accessibility: disable header animations */
@media (prefers-reduced-motion: reduce) {
  .ts-header,
  .ts-header__logo,
  .ts-header__logo-link {
    transition: none;
  }

  .ts-header::after {
    animation: none;
  }
}
