/* Delivery location strip (element/location_bar.php) — layouts 1 and 2.
   Mirrors layout 9's .layout9-locbar (css/header9.css), under neutral .loc-bar names.
   Accent colour: --loc-bar-accent, set per layout below, falling back to the vendor theme. */

.loc-bar {
  --loc-bar-accent: var(--default-color, #0b4a7d);
  position: relative;
  background: #eaf2f9;
  background: color-mix(in srgb, var(--loc-bar-accent) 8%, #fff);
  color: #23364a;
  font-size: 13px;
  line-height: 1.3;
}

.v2-header .loc-bar { --loc-bar-accent: var(--v2-primary, var(--default-color, #0b4a7d)); }
.app-header .loc-bar { --loc-bar-accent: var(--app-theme, var(--default-color, #0b4a7d)); }

.loc-bar.loc-bar--closed { display: none; }

.loc-bar__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 8px 0;
}

.loc-bar__icon {
  flex: 0 0 auto;
  color: var(--loc-bar-accent);
  font-size: 14px;
}

.loc-bar__text {
  flex: 1 1 auto;
  min-width: 0;
}

/* The pin element's own trigger, laid out as one line */
.loc-bar .user-address-pin {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  margin: 0;
}

.loc-bar--prompt .user-address-pin,
.loc-bar--nsv .user-address-pin { display: none; }

.loc-bar .user-address-pin .pin-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
}

.loc-bar .user-address-pin .pin-trigger-icon {
  width: auto;
  height: auto;
  margin: 0;
  background: none;
  font-size: 14px;
  color: var(--loc-bar-accent);
}

.loc-bar .user-address-pin .pin-trigger-lines {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.loc-bar .user-address-pin .pin-eyebrow {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: inherit;
  opacity: 0.8;
}

.loc-bar .user-address-pin .pin-eyebrow::after { content: ":"; }
.loc-bar .user-address-pin .pin-eyebrow-caret { display: none; }

.loc-bar .user-address-pin .pin-line-address {
  flex: 0 1 auto;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  min-width: 0;
  max-width: none;
  font-size: 13px;
  font-weight: 700;
  color: inherit;
}

.loc-bar .user-address-pin .pin-line-city {
  flex: 0 0 auto;
  font-size: 13px;
  color: inherit;
  opacity: 0.8;
}

/* Address text, built by the element's script: only the first copy shows on wide screens, the phone rules run the marquee */
.loc-bar__marq { display: inline; }
.loc-bar__marq-item:nth-child(2),
.loc-bar__marq-city { display: none; }

.loc-bar__btn {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 6px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--loc-bar-accent);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.loc-bar__btn:hover,
.loc-bar__btn:focus {
  filter: brightness(0.92);
  outline: 0;
}

.loc-bar--prompt .loc-bar__btn,
.loc-bar--nsv .loc-bar__btn { margin-left: 0; }

/* "We don't deliver here": only the icon and the message are red */
.loc-bar--nsv .loc-bar__icon,
.loc-bar--nsv .loc-bar__text {
  color: #d92d20;
  font-weight: 600;
}

.loc-bar__close {
  flex: 0 0 auto;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  opacity: 0.7;
  cursor: pointer;
}

.loc-bar__close:hover { opacity: 1; }

/* ---- Layout 2: sits between the top bar and the nav, aligned to the page container ---- */
.v2-header .loc-bar { border-bottom: 1px solid var(--v2-line, rgba(0, 0, 0, .08)); }
.v2-header .loc-bar__inner { max-width: 1480px; margin: 0 auto; padding: 8px 20px; }
@media (max-width: 1199px) { .v2-header .loc-bar__inner { padding-left: 16px; padding-right: 16px; } }

/* ---- Layout 1: full-bleed band inside the sticky header, below the main bar ----
   Same negative-margin trick as .app-header-utility: cancel the header's side/bottom padding, re-open the gap above. */
.app-header .loc-bar {
  margin: 8px calc(var(--app-pad) * -1) -8px;
  border-top: 1px solid rgba(0, 0, 0, .06);
}
.app-header .loc-bar__inner { padding: 8px var(--app-pad); }
.app-header .loc-bar ~ .app-header-utility { margin-top: 0; }
/* The strip's own -8px bottom margin would pull a following utility strip up over it */
.app-header .loc-bar:has(~ .app-header-utility) { margin-bottom: 0; }

@media (min-width: 768px) {
  .app-header .loc-bar { margin: 10px calc(var(--app-pad) * -1) -10px; }
  .app-header .loc-bar ~ .app-header-utility { margin-top: 0; }
  .app-header .loc-bar:has(~ .app-header-utility) { margin-bottom: 0; }
}

@media (max-width: 991.98px) {
  .loc-bar__inner { gap: 10px; }
}

@media (max-width: 575.98px) {
  .loc-bar { font-size: 12px; }

  .loc-bar__inner { padding-top: 7px; padding-bottom: 7px; min-height: 40px; gap: 8px; }

  /* Narrow: drop the "Deliver to Home:" label and the city line, keep the address on one line */
  .loc-bar .user-address-pin .pin-eyebrow,
  .loc-bar .user-address-pin .pin-line-city { display: none; }

  /* Phone: the address scrolls instead of being cut off */
  .loc-bar .user-address-pin .pin-line-address {
    flex: 1 1 0;
    font-size: 12px;
    overflow: hidden;
    white-space: nowrap;
  }

  .loc-bar .user-address-pin .pin-trigger,
  .loc-bar .user-address-pin { flex: 1 1 0; min-width: 0; }

  .loc-bar .user-address-pin .pin-trigger-lines { flex: 1 1 0; }

  .loc-bar__marq {
    display: flex;
    flex-wrap: nowrap;
    width: max-content;
    animation: loc-bar-marquee 14s linear infinite;
    will-change: transform;
  }

  .loc-bar__marq-item {
    flex: 0 0 auto;
    white-space: nowrap;
    padding-right: 40px;
  }

  .loc-bar__marq-item:nth-child(2),
  .loc-bar__marq-city { display: inline; }

  .loc-bar .user-address-pin .pin-trigger:active .loc-bar__marq { animation-play-state: paused; }

  .loc-bar__btn { padding: 5px 12px; font-size: 11.5px; }

  .loc-bar__text { font-size: 11.5px; }
}

@media (max-width: 767px) {
  .loc-bar__text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* The "not delivering here" message is the whole point of the strip: let it wrap rather than cut it */
  .loc-bar--nsv .loc-bar__text {
    white-space: normal;
    overflow: visible;
  }
}

@keyframes loc-bar-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .loc-bar__marq { animation: none !important; }
}
