/*
  Header (from Figma)
  - Width: 1648
  - Height: 97
  - Stroke: #F0F4E5 (inside) weight 2
*/

/* Sticky header */
#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #ffffff;
}

.site-header {
  width: 100%;
  display: flex;
  justify-content: center;
}

.site-header__inner {
  width: min(1648px, 100%);
  height: 97px;
  display: flex;
  align-items: center;
  gap: 28px;
  
  
  background: #ffffff;
  border-top: 2px solid #f0f4e5;
  border-bottom: 2px solid #F0F4F5;
  font-family: var(--font-base);
}

.site-header__menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #f0f4e5;
  border-radius: 10px;
  cursor: pointer;
}

.site-header__menu-toggle-lines {
  width: 20px;
  height: 14px;
  position: relative;
  display: block;
}

.site-header__menu-toggle-lines::before,
.site-header__menu-toggle-lines::after,
.site-header__menu-toggle-lines span {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #6b6b6b;
  border-radius: 999px;
}

.site-header__menu-toggle-lines::before {
  top: 0;
}

.site-header__menu-toggle-lines span {
  top: 6px;
}

.site-header__menu-toggle-lines::after {
  bottom: 0;
}

.site-header__menu {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-header__backdrop {
  display: none;
}

.site-header__search-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid #f0f4e5;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}

.site-header__search-toggle-icon {
  width: 18px;
  height: 18px;
  display: block;
  background-image: url(../images/icons/search.png);
  background-repeat: no-repeat;
  background-size: 18px 18px;
  background-position: center;
  opacity: 0.8;
}

.site-header__search-modal-backdrop,
.site-header__search-modal {
  display: none;
}

.site-header__lang {
  display: flex;
  align-items: center;
}

.site-header__lang-select {
  height: 40px;
  padding: 0 12px;
  border: 1px solid #669999;
  border-radius: 12px;
  background: #ffffff;
  color: #0b0b0b;
  font-family: var(--font-base);
  font-weight: 600;
  cursor: pointer;
}

.site-header__lang-select--flags {
  width: 56px;
  padding: 0;
  text-align: center;
  font-size: 18px;
  line-height: 1;
}

.site-header__lang--mobile {
  display: none;
}

.site-header__drawer-header {
  display: none;
}

.site-header__icon-row {
  display: contents;
}

@media (min-width: 1025px) {
  .site-header__nav {
    order: 1;
  }

  .site-header__upload-btn {
    order: 2;
  }

  .site-header__search {
    order: 3;
  }

  .site-header__actions {
    order: 4;
    margin-left: auto;
    padding-right: 70px;
  }

  .site-header__lang--desktop {
    order: 5;
    margin-left: 12px;
  }

  .site-header__auth {
    order: 6;
  }
}

.site-header__logo {
  color: #9bb1b8;
  font-weight: 700;
  font-size: 22px;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.site-header__logo-img {
  height: 24px;
  width: auto;
  display: block;
}

.site-header__nav {
    display: flex;
    gap: 48px;
    padding-left: 83px;
}

.site-header__upload-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 100px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.site-header__link {
  color: #6b6b6b;
  text-decoration: none;
  font-size: 20px;
  font-weight: 400;
}

.site-header__link:hover,
.site-header__link:focus-visible {
  color: #0db4f2;
}

.site-header__search {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
}

.site-header__search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header__search-input {
    width: 100%;
    max-width: 450px;
    height: 33px;
    padding: 0 36px 0 12px;
    border: 1px solid #669999;
    border-radius: 4px;
    outline: none;
    background-image: url(../images/icons/search.png);
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 15px 15px;
    border-top-right-radius: 25px;
    border-bottom-right-radius: 25px;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
    margin-left: 0;
}

.site-header__search-input:focus {
  border-color: #7aa7a2;
  box-shadow: 0 0 0 3px rgba(122, 167, 162, 0.2);
}

.site-header__search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(100%, 450px);
  max-height: min(62vh, 420px);
  overflow: auto;
  border: 1px solid #e2ece8;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 14px 32px rgba(11, 11, 11, 0.16);
  z-index: 1100;
  padding: 6px;
}

.site-header__search-result {
  display: block;
  text-decoration: none;
  border-radius: 10px;
  padding: 8px;
  color: inherit;
  transition: background-color 140ms ease;
}

.site-header__search-result-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px;
  gap: 10px;
  align-items: center;
}

.site-header__search-result-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-header__search-result-title {
  font-family: var(--font-cta);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: #0b0b0b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-header__search-result-brand {
  font-family: var(--font-base);
  font-size: 13px;
  font-weight: 600;
  color: #61706d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-header__search-result-thumb-wrap {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #ebf1ee;
  background: #f8fbfa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-header__search-result-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.site-header__search-result:hover,
.site-header__search-result:focus-visible {
  background: rgba(13, 180, 242, 0.09);
  outline: none;
}

.site-header__search-empty {
  padding: 16px 14px;
  text-align: center;
  color: #65726f;
  font-family: var(--font-base);
  font-size: 14px;
  font-weight: 600;
}

.site-header__search-loading {
  padding: 16px 14px;
  text-align: center;
  color: #5c8d87;
  font-family: var(--font-base);
  font-size: 14px;
  font-weight: 700;
}

.site-header__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 25px;
    padding-right: 50px;
}

.site-header__icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.site-header__count {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(50%, -50%);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #0db4f2;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  font-family: var(--font-cta);
}

.site-header__icon-btn--cart .site-header__count {
  background: #ff0000;
}

.site-header__icon-btn--favorites .site-header__count {
  background: #ff0000;
}

.site-header__icon-btn--cart .site-header__icon-img {
  width: 30px;
  height: 24px;
}

.site-header__icon-btn--favorites .site-header__icon-img {
  width: 24px;
  height: 24px;
}


.site-header__icon-btn:hover,
.site-header__icon-btn:focus-visible {
  opacity: 0.85;
}

.site-header__icon-img {
  height: 30px;
  width: 30px;
  display: block;
}

.site-header__auth {
    display: flex;
    align-items: center;
    gap: 12px; /* buttons ke beech space */
}

.site-header__account {
  position: relative;
}

.site-header__account-summary {
  list-style: none;
  height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  border: 1px solid #f0f4e5;
  background: #ffffff;
  color: #0b0b0b;
  font-family: var(--font-cta);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.site-header__account-summary::-webkit-details-marker {
  display: none;
}

.site-header__account-summary:hover,
.site-header__account-summary:focus-visible {
  border-color: #7aa7a2;
  box-shadow: 0 0 0 3px rgba(122, 167, 162, 0.18);
  outline: none;
}

.site-header__account-avatar {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: #f0f4e5;
  color: #6b6b6b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-cta);
  font-weight: 700;
  font-size: 14px;
}

.site-header__account-name {
  white-space: nowrap;
}

.site-header__account-caret {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #6b6b6b;
  margin-left: 2px;
  transition: transform 180ms ease;
}

.site-header__account[open] .site-header__account-caret {
  transform: rotate(180deg);
}

.site-header__account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 290px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid #f0f4e5;
  background: #ffffff;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
  z-index: 1005;
}

.site-header__account-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 10px;
  border-radius: 12px;
}

.site-header__account-header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #f0f4e5;
  color: #6b6b6b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-cta);
  font-weight: 700;
  font-size: 14px;
  flex: 0 0 auto;
}

.site-header__account-header-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-header__account-header-name {
  font-family: var(--font-cta);
  font-weight: 700;
  font-size: 16px;
  color: #0b0b0b;
  line-height: 1.2;
}

.site-header__account-header-email {
  font-size: 13px;
  color: #6b6b6b;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-header__account-divider {
  height: 1px;
  background: #f0f4e5;
  margin: 8px 6px;
}

.site-header__account-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: #2b2b2b;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-base);
}

.site-header__account-item-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0b0b0b;
  opacity: 0.85;
  flex: 0 0 auto;
}

.site-header__account-item:hover,
.site-header__account-item:focus-visible {
  background: rgba(13, 180, 242, 0.08);
  outline: none;
}

.site-header__account-item--danger {
  color: #ff0000;
}

.site-header__account-item--danger .site-header__account-item-icon {
  color: #ff0000;
}

.site-header__account-item--danger:hover,
.site-header__account-item--danger:focus-visible {
  background: rgba(255, 0, 0, 0.07);
}

.site-header__btn {
  height: 40px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-cta);
  text-decoration: none;
  white-space: nowrap;
}

.site-header__btn--login {
 background: #FFAE00;

  color: #ffffff;
}

.site-header__btn--signup {
  background: #00AEFF;
  color: #ffffff;
}

@media (max-width: 1700px) {
  .site-header__inner {
    width: 100%;
    height: auto;
    flex-wrap: wrap;
  }

  .site-header__search {
    order: 3;
    flex: 1 1 100%;
  }

  .site-header__search-input {
    max-width: none;
  }
}

@media (max-width: 1024px) {
  .site-header__inner {
    height: auto;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
  }

  .site-header__logo {
    flex: 1 1 auto;
    min-width: 0;
  }

  .site-header__logo-img {
    max-width: 170px;
    height: auto;
  }

  .site-header__search-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .site-header__lang--mobile {
    display: flex;
  }

  .site-header__menu-toggle {
    display: inline-flex;
  }

  .site-header__backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
    z-index: 1000;
  }

  #site-header.is-menu-open .site-header__backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .site-header__search-modal-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
    z-index: 1002;
  }

  #site-header.is-search-open .site-header__search-modal-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .site-header__search-modal {
    display: block;
    position: fixed;
    left: 50%;
    top: calc(16px + env(safe-area-inset-top));
    transform: translate(-50%, -10px);
    width: min(520px, calc(100vw - 32px));
    padding: 14px;
    border: 1px solid #f0f4e5;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease, transform 220ms ease;
    z-index: 1003;
  }

  #site-header.is-search-open .site-header__search-modal {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
  }

  .site-header__search-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
  }

  .site-header__search-modal-title {
    font-family: var(--font-cta);
    font-weight: 700;
    font-size: 18px;
    color: #0b0b0b;
  }

  .site-header__search-modal-close {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #f0f4e5;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    font-size: 26px;
    line-height: 1;
    color: #6b6b6b;
  }

  .site-header__search-input--modal {
    height: 44px;
    border-radius: 12px;
    padding-right: 44px;
    background-position: right 14px center;
    background-size: 18px 18px;
  }

  .site-header__menu {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: min(340px, 88vw);
    padding: calc(16px + env(safe-area-inset-top)) 16px
      calc(16px + env(safe-area-inset-bottom));
    overflow: auto;
    border-right: 1px solid #f0f4e5;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    z-index: 1001;

    display: flex;
    flex-direction: column;
    gap: 14px;

    transform: translateX(-105%);
    transition: transform 260ms ease;
    will-change: transform;
  }

  #site-header.is-menu-open .site-header__menu {
    transform: translateX(0);
  }

  .site-header__nav {
    width: 100%;
    padding-left: 0;
    gap: 10px;
    flex-direction: column;
    align-items: flex-start;
  }

  .site-header__link {
    display: block;
    width: 100%;
    font-size: 18px;
    padding: 10px 12px;
    border-radius: 12px;
  }

  .site-header__link:hover,
  .site-header__link:focus-visible {
    background: rgba(13, 180, 242, 0.08);
  }

  .site-header__search {
    display: none;
  }

  .site-header__search-input {
    margin-left: 0;
    height: 40px;
    border-radius: 12px;
    max-width: none;
  }

  .site-header__search-modal-form {
    position: relative;
  }

  .site-header__search-modal-form .site-header__search-results {
    position: static;
    width: 100%;
    max-height: min(58vh, 380px);
    margin-top: 10px;
    border-radius: 12px;
    box-shadow: none;
    border-color: #edf2ef;
  }

  .site-header__icon-row {
    display: flex;
    align-items: center;
    margin-left: 0;
    width: 100%;
    padding-right: 0;
    gap: 12px;
    justify-content: flex-start;
  }

  .site-header__upload-btn {
    padding-left: 0;
    width: 44px;
    height: 44px;
    border: 1px solid #f0f4e5;
    border-radius: 10px;
  }

  .site-header__actions {
    margin-left: 0;
    padding-right: 0;
    gap: 12px;
  }

  .site-header__icon-btn {
    width: 44px;
    height: 44px;
    border: 1px solid #f0f4e5;
    border-radius: 10px;
  }

  .site-header__count {
    top: 6px;
    right: 6px;
    transform: none;
  }

  .site-header__auth {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .site-header__account-summary {
    width: 100%;
    justify-content: space-between;
  }

  .site-header__account-menu {
    position: static;
    width: 100%;
    box-shadow: none;
    margin-top: 10px;
  }

  .site-header__btn {
    width: 100%;
    height: 48px;
    border-radius: 14px;
  }

  .site-header__drawer-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f4e5;
    margin-bottom: 4px;
  }

  .site-header__drawer-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
  }

  .site-header__lang--desktop {
    display: none;
  }

  .site-header__lang-select {
    height: 40px;
    border-radius: 12px;
    padding: 0 10px;
  }

  .site-header__lang-select--flags {
    height: 44px;
    width: 56px;
    padding: 0;
  }

  .site-header__drawer-close {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #f0f4e5;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    color: #6b6b6b;
  }

  /* Safety: hide any header items that might exist outside `.site-header__menu` on mobile */
  #site-header:not(.is-menu-open) .site-header__inner > .site-header__nav,
  #site-header:not(.is-menu-open) .site-header__inner > .site-header__search,
  #site-header:not(.is-menu-open) .site-header__inner > .site-header__upload-btn,
  #site-header:not(.is-menu-open) .site-header__inner > .site-header__actions,
  #site-header:not(.is-menu-open) .site-header__inner > .site-header__auth {
    display: none;
  }

  @media (prefers-reduced-motion: reduce) {
    .site-header__backdrop,
    .site-header__menu,
    .site-header__search-modal-backdrop,
    .site-header__search-modal {
      transition: none;
    }
  }
}

@media (max-width: 480px) {
  .site-header__inner {
    gap: 6px;
    padding: 8px 10px;
  }

  .site-header__logo-img {
    max-width: 150px;
  }

  .site-header__search-toggle,
  .site-header__menu-toggle,
  .site-header__lang-select--flags {
    width: 40px;
    height: 40px;
  }

  .site-header__auth {
    grid-template-columns: 1fr;
  }
}
