/* Container matches "icon in header" behavior */
.nl-account {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Fit inside the theme's header-action <li> */
.header-account-menu {
  display: inline-flex;
  align-items: center;
}

/* Match theme header icon: .header-action > ul > li > a styles */
.nl-account__btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;

  display: block;
  color: #222222;
  font-size: 28px;
  line-height: 0;
}

/* Transparent header (e.g. /shop): icons are white */
.transparent-header .nl-account__btn {
  color: #ffffff;
}
/* When transparent header becomes sticky, icons revert to dark */
.transparent-header.sticky-menu .nl-account__btn {
  color: #222222;
}

/* Hover color matches theme primary */
.nl-account:hover .nl-account__btn {
  color: var(--tg-primary-color, #4CAF50);
}

.nl-account__icon {
  display: block;
  width: 28px;
  height: 28px;
}

/* Optional name (if enabled) */
.nl-account__name {
  font-size: 14px;
  white-space: nowrap;
}

/* Dropdown */
.nl-account__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;

  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);

  padding: 8px;
  display: none;
  z-index: 99999;
}

/* Invisible bridge so hover doesn't break when moving to dropdown */
.nl-account__menu::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

.nl-account.is-open .nl-account__menu {
  display: block;
}

/* Items */
.nl-account__item {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;

  color: #111;
  font-size: 14px;
  white-space: nowrap;
}

.nl-account__item:hover,
.nl-account__item:focus {
  background: rgba(0,0,0,.06);
  outline: none;
}

/* Tighten spacing on narrow screens to prevent wrapping */
@media (max-width: 575px) {
  /* Force the header icon row to stay on one line */
  .header-action > ul {
    flex-wrap: nowrap !important;
    white-space: nowrap;
  }
  .header-account-menu {
    margin-left: 10px !important;
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  /* Force the entire mobile header row to never wrap */
  .tg-header__area .row,
  .header-area .row,
  #header-area .row {
    flex-wrap: nowrap !important;
  }
  /* Let both header columns collapse to their natural width */
  .tg-header__area .row > [class*="col-"],
  .header-area .row > [class*="col-"],
  #header-area .row > [class*="col-"] {
    flex: 0 1 auto !important;
    width: auto !important;
    max-width: none !important;
  }
  /* Keep header-action + mobile toggler on one row */
  .tg-header__area .header-action,
  .header-area .header-action {
    display: inline-flex !important;
    align-items: center;
    flex-shrink: 0;
  }
  .header-account-menu {
    margin-left: 6px !important;
  }
  .header-action > ul > li {
    margin-left: 8px !important;
  }
  /* Allow logo to shrink so everything fits */
  .tg-header__logo img,
  .header-logo img {
    max-width: 120px !important;
    height: auto !important;
  }
}

@media (max-width: 380px) {
  .header-account-menu {
    margin-left: 2px !important;
  }
  .header-action > ul > li {
    margin-left: 5px !important;
  }
  .tg-header__logo img,
  .header-logo img {
    max-width: 100px !important;
  }
}

@media (max-width: 1024px) {
  .nl-account__menu { min-width: 200px; }
}

/* ── Bottom sheet on mobile (≤ 768px) ── */

/* Backdrop */
.nl-sheet-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 100000;
  opacity: 0;
  transition: opacity .25s ease;
}
.nl-sheet-backdrop.is-visible {
  display: block;
  opacity: 1;
}

/* Sheet container */
.nl-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100001;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.32, .72, 0, 1);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .15);
}
.nl-sheet.is-visible {
  transform: translateY(0);
}

/* Drag handle */
.nl-sheet__handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: #ccc;
  margin: 0 auto 14px;
}

/* Sheet items – large touch targets */
.nl-sheet__item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-radius: 12px;
  text-decoration: none;
  color: #111;
  font-size: 16px;
  font-weight: 500;
  transition: background .15s;
}
.nl-sheet__item + .nl-sheet__item {
  margin-top: 4px;
}
.nl-sheet__item:hover,
.nl-sheet__item:active {
  background: rgba(0, 0, 0, .06);
}

/* On desktop, hide sheet elements entirely */
@media (min-width: 769px) {
  .nl-sheet-backdrop,
  .nl-sheet {
    display: none !important;
  }
}

/* On mobile, hide the inline dropdown (sheet is used instead) */
@media (max-width: 768px) {
  .nl-account__menu {
    display: none !important;
  }
}
