/**
 * With Love NAIJA — Walmart-style store header
 * Brand: cream #F9F6F0 | orange #D36127 | navy #0F3B68 | teal #008B94
 */

/* Hide default Astra header when store header is active */
body.wln-store-header-active #ast-desktop-header > .main-header-bar-wrap,
body.wln-store-header-active #ast-desktop-header > .ast-above-header-wrap,
body.wln-store-header-active #ast-desktop-header > .ast-below-header-wrap,
body.wln-store-header-active .site-header-primary-section-wrap,
body.wln-store-header-active #ast-mobile-header,
body.wln-store-header-active .ast-main-header-wrap:not(.wln-store-header) {
  display: none !important;
}

body.wln-store-header-active #masthead,
body.wln-store-header-active .site-header {
  background: transparent;
  border: none;
  box-shadow: none;
  margin-bottom: 0 !important;
  padding-bottom: 0;
}

body.wln-store-header-active #masthead {
  position: sticky;
  top: 0;
  z-index: 9999;
}

/* No theme gap below header — use Elementor section spacing instead */
body.wln-store-header-active #ast-desktop-header,
body.wln-store-header-active .ast-desktop-header,
body.wln-store-header-active .ast-main-header-wrap,
body.wln-store-header-active .wln-store-header {
  margin-bottom: 0 !important;
}

body.wln-store-header-active #masthead + #content,
body.wln-store-header-active #masthead + .site-content {
  margin-top: 0;
  padding-top: 0;
}

.wln-store-header {
  font-family: var(--wln-font-sans, "Everyday Sans", system-ui, sans-serif);
}

/* --- Primary row (navy bar) --- */
.wln-store-header__primary {
  background: var(--wln-navy, #0f3b68);
  color: #fff;
  padding: 0.65rem 0;
}

.wln-store-header__inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Primary row: logo | delivery | centered search | actions */
.wln-store-header__primary .wln-store-header__inner {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 0.65rem 1rem;
}

/* Logo — curved corners only (no outer white border) */
.wln-store-header__logo {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  line-height: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.wln-store-header__logo:hover {
  transform: translateY(-1px);
}

.wln-store-header__logo img {
  display: block;
  max-height: 52px;
  width: auto;
  max-width: 150px;
  height: auto;
  object-fit: contain;
  /* Rounded rectangle — not a circle */
  border-radius: 12px;
  background: transparent;
}

/* Delivery pill */
.wln-delivery {
  position: relative;
  flex: 0 0 auto;
}

.wln-delivery__display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem 0.45rem 0.55rem;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  font-family: inherit;
  text-align: left;
  max-width: 220px;
}

.wln-icon {
  display: block;
  flex-shrink: 0;
}

.wln-delivery__icon {
  flex-shrink: 0;
  display: flex;
  color: var(--wln-orange, #d36127);
}

.wln-delivery__icon .wln-icon {
  display: block;
}

.wln-delivery__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.wln-delivery__title {
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.wln-delivery__location {
  font-size: 0.68rem;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

/* Search — small, centered in header */
.wln-store-search {
  grid-column: 3;
  justify-self: center;
  width: 100%;
  max-width: 300px;
  min-width: 0;
  display: flex;
  align-items: center;
  margin: 0 auto;
  padding: 2px 3px 2px 0;
  min-height: 36px;
  background: #fff;
  border: none;
  border-radius: 999px;
  box-shadow: none;
  overflow: visible;
  box-sizing: border-box;
}

.wln-store-search:focus-within {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.wln-store-search__input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 28px;
  margin: 0;
  padding: 0.3rem 0.3rem 0.3rem 0.75rem;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  border-radius: 999px 0 0 999px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--wln-navy, #0f3b68);
  -webkit-appearance: none;
  appearance: none;
}

.wln-store-search__input::placeholder {
  color: rgba(15, 59, 104, 0.55);
  opacity: 1;
}

.wln-store-search__input:focus {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

/* Remove browser search field chrome */
.wln-store-search__input::-webkit-search-decoration,
.wln-store-search__input::-webkit-search-cancel-button,
.wln-store-search__input::-webkit-search-results-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.wln-store-search__btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  margin: 0 2px 0 0.2rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--wln-navy, #0f3b68);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  transition: background 0.2s ease;
}

.wln-store-search__btn svg {
  width: 14px;
  height: 14px;
  display: block;
  flex-shrink: 0;
}

.wln-store-search__btn:hover {
  background: var(--wln-orange, #d36127);
}

/* Beat Astra / WooCommerce input borders inside header */
body.wln-store-header-active .wln-store-search input[type="search"],
body.wln-store-header-active .wln-store-search input[type="text"] {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Actions */
.wln-store-actions {
  grid-column: 4;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  margin-left: 0;
}

.wln-store-action {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.2s;
}

.wln-store-action:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.wln-store-action__icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.wln-store-action__icon .wln-icon {
  display: block;
}

.wln-store-action__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.wln-store-action__line {
  font-size: 0.68rem;
  white-space: nowrap;
}

.wln-store-action__line--bold {
  font-size: 0.82rem;
  font-weight: 700;
}

.wln-store-action__icon-wrap {
  position: relative;
  display: flex;
}

.wln-store-action__badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--wln-orange, #d36127);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Secondary row (cream pills — horizontal swipe like Amazon) --- */
.wln-store-header__secondary {
  background: var(--wln-cream, #f9f6f0);
  border-bottom: 1px solid rgba(15, 59, 104, 0.08);
  padding: 0.5rem 0;
  position: relative;
  z-index: 50;
}

/* Scroll track: swipe / drag on touch and trackpad */
.wln-store-nav-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  touch-action: pan-x;
}

.wln-store-nav-scroll::-webkit-scrollbar {
  display: none;
}

.wln-store-nav-scroll:focus-visible {
  outline: 2px solid var(--wln-orange, #d36127);
  outline-offset: -2px;
}

.wln-store-nav {
  display: block;
  width: max-content;
  min-width: 100%;
}

@media (min-width: 1025px) {
  .wln-store-nav-scroll {
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 1.25rem;
  }
}

.wln-store-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
}

.wln-store-nav__list li {
  margin: 0;
  flex-shrink: 0;
  scroll-snap-align: start;
}

.wln-store-nav__list a,
.wln-store-nav__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: #fff;
  color: var(--wln-navy, #0f3b68);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid rgba(15, 59, 104, 0.12);
  transition: border-color 0.2s ease;
}

.wln-store-nav__list a:hover,
.wln-store-nav__pill:hover,
.wln-store-nav__list a:focus-visible,
.wln-store-nav__pill:focus-visible {
  background: #fff;
  color: var(--wln-navy, #0f3b68);
  border-color: var(--wln-orange, #d36127);
}

body.wln-store-header-active .wln-store-nav__list a:hover,
body.wln-store-header-active .wln-store-nav__list a:focus-visible,
body.wln-store-header-active .wln-store-nav__pill:hover,
body.wln-store-header-active .wln-store-nav__pill:focus-visible {
  background: #fff !important;
  color: var(--wln-navy, #0f3b68) !important;
  border-color: var(--wln-orange, #d36127) !important;
}

/* Promo bar stacks above store header */
body.wln-has-promo-bar .wln-store-header {
  top: 0;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .wln-store-action__text {
    display: none;
  }

  .wln-store-action--cart .wln-store-action__text {
    display: flex;
  }

  /* Tablet & phone — full-width swipeable pill strip (Amazon-style) */
  .wln-store-header__secondary::before,
  .wln-store-header__secondary::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1.25rem;
    z-index: 2;
    pointer-events: none;
  }

  .wln-store-header__secondary::before {
    left: 0;
    background: linear-gradient(
      to right,
      var(--wln-cream, #f9f6f0) 0%,
      rgba(249, 246, 240, 0) 100%
    );
  }

  .wln-store-header__secondary::after {
    right: 0;
    background: linear-gradient(
      to left,
      var(--wln-cream, #f9f6f0) 0%,
      rgba(249, 246, 240, 0) 100%
    );
  }

  .wln-store-nav-scroll {
    scroll-padding-inline: 0.75rem;
  }

  .wln-store-nav__list {
    padding-inline: 0.75rem;
    gap: 0.5rem;
  }
}

@media (max-width: 768px) {
  .wln-store-header__primary .wln-store-header__inner {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 0.5rem;
  }

  .wln-store-header__logo {
    grid-column: 1;
    grid-row: 1;
  }

  .wln-store-actions {
    grid-column: 3;
    grid-row: 1;
    margin-left: 0;
  }

  .wln-delivery {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .wln-delivery__display {
    max-width: none;
    width: 100%;
  }

  .wln-store-search {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: center;
    max-width: min(300px, 92vw);
    width: 100%;
  }

  .wln-store-header__primary {
    padding-bottom: 0.75rem;
  }
}
