/* DeepStay Header Navigation Layout Matrix Rules */
.ds-header {
  --ds-head-bg: rgba(9, 10, 12, 0.7);
  --ds-head-border: rgba(255, 255, 255, 0.08);
  --ds-head-text: #e4e4e7;
  --ds-head-active: #ffffff;
  --ds-head-max-width: 1240px;

  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  position: absolute;
  top: 0;
  z-index: 999;
  border-bottom: 1px solid var(--ds-head-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: var(--ds-head-bg) !important;
}

.ds-header__inner {
  max-width: var(--ds-head-max-width);
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* User Uploaded Logo Handling */
.ds-header__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #ffffff !important;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.ds-header__logo:hover {
  opacity: 0.9;
}

.ds-header__logo-icon {
  width: 22px;
  height: 22px;
  color: #ffffff;
}

.ds-header__logo-img {
  height: 24px;
  width: auto;
  object-fit: contain;
  display: block;
}

.ds-header__logo-text {
  font-family: system-ui, -apple-system, sans-serif;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: #ffffff !important;
}

/* Nav Menu Alignment */
.ds-header__nav {
  display: flex;
  align-items: center;
}

.ds-header__menu-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  gap: 32px;
}

.ds-header__menu-list li {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.ds-header__menu-list a {
  text-decoration: none !important;
  color: var(--ds-head-text) !important;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14.5px;
  font-weight: 400;
  transition: color 0.2s ease;
}

.ds-header__menu-list a:hover {
  color: var(--ds-head-active) !important;
}

.ds-header__menu-mobile-only {
  display: none !important;
}

/* Action Center Controls */
.ds-header__actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}

/* Auto-pushes components rightwards when layout dropdown is set to 'none' */
.ds-header__actions--wide {
  margin-left: auto;
}

.ds-header__link-main {
  text-decoration: none !important;
  color: var(--ds-head-text) !important;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14.5px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.ds-header__link-main:hover {
  color: var(--ds-head-active) !important;
}

/* 
 * CRITICAL HIGH CONTRAST RE-FIX 
 * Prevents theme variables from making button text white over a white background 
 */
.ds-header__btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  background: #ffffff !important;
  border: 1px solid #ffffff !important;
  padding: 10px 22px !important;
  border-radius: 99px !important;
  color: #090a0c !important; /* Fixed dark tracking color override */
  text-decoration: none !important;
  font-family: system-ui, -apple-system, sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
              background-color 0.2s ease, 
              box-shadow 0.2s ease !important;
  line-height: 1.2 !important;
}

.ds-header__btn-txt {
  color: #090a0c !important; /* Strict internal enforcement label */
  display: inline-block !important;
}

.ds-header__btn svg {
  width: 14px !important;
  height: 14px !important;
  color: #090a0c !important; /* Match graphic arrow vector cleanly */
  transition: transform 0.2s ease !important;
  display: inline-block !important;
}

.ds-header__btn:hover {
  background: #f4f4f5 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.16) !important;
}

.ds-header__btn:hover svg {
  transform: translateX(2px) !important;
}

/* Mobile Configurations */
.ds-header__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  width: 40px;
  height: 40px;
  position: relative;
  z-index: 1001;
}

.ds-header__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #ffffff;
  margin: 5px auto;
  transition: all 0.25s ease-in-out;
}

@media (max-width: 991px) {
  .ds-header__toggle {
    display: block;
  }

  .ds-header__toggle.is-active span:nth-child(1) {
    transform: translateY(3.5px) rotate(45deg);
  }

  .ds-header__toggle.is-active span:nth-child(2) {
    transform: translateY(-3.5px) rotate(-45deg);
  }

  .ds-header__link-main {
    display: none !important;
  }

  .ds-header__menu-mobile-only {
    display: block !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding-top: 16px !important;
    margin-top: 8px !important;
  }

  .ds-header__nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #090a0c;
    z-index: 1000;
    padding: 120px 40px 40px;
    display: block;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
  }

  .ds-header.menu-open .ds-header__nav {
    transform: translateX(0);
  }

  .ds-header__menu-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    width: 100%;
  }

  .ds-header__menu-list a {
    font-size: 20px;
    display: block;
    width: 100%;
    padding: 4px 0;
  }
}

@media (max-width: 520px) {
  .ds-header__inner {
    padding: 16px 20px;
  }
  
  .ds-header__btn {
    padding: 8px 16px !important;
    font-size: 13px !important;
  }

  .ds-header__btn-txt {
    display: none !important; /* Safely swaps structural labels for tight viewports */
  }
  .ds-header__btn::before {
    content: "Add to Chrome" !important;
    color: #090a0c !important;
    font-weight: 600 !important;
  }
}