/* Panacea Express: location button in the navbar, and the "Set your location" dialog.
   Loaded by assets/js/location.js. */

:root {
  --pxl-green: #00a652;
  --pxl-green-dark: #00a652;
  --pxl-green-tint: #f4f4f4;
  --pxl-text: #262626;
  --pxl-muted: #6e6e6e;
  --pxl-border: #e3e3e3;
  --pxl-red: #c62828;
}

/* ---------- Navbar button ---------- */
.pxl-nav-wrap {
  position: relative;
  flex: 0 0 auto;
}

.pxl-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  max-width: 270px;
  margin: 0;
  padding: 0.35rem 0.6rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--pxl-text);
  font: inherit;
  text-align: left;
  transition: background 0.15s ease;
}

.pxl-nav:hover,
.pxl-nav:focus-visible {
  background: #f5f5f5;
}

.pxl-nav:focus-visible {
  outline: 2px solid var(--pxl-green);
  outline-offset: 1px;
}

.pxl-nav__icon {
  display: inline-block;
  flex: 0 0 auto;
  min-width: 1rem; /* keeps its width even before the icon font has arrived */
  color: var(--pxl-green);
  font-size: 1.3rem;
  line-height: 1;
  text-align: center;
}

.pxl-nav--busy .pxl-nav__icon i {
  animation: pxl-pulse 1.1s ease-in-out infinite;
}

.pxl-nav__text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.2;
}

.pxl-nav__label {
  overflow: hidden;
  color: var(--pxl-muted);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pxl-nav__value {
  overflow: hidden;
  color: var(--pxl-text);
  font-size: 0.82rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pxl-nav__status {
  font-size: 0.7rem;
  font-weight: 600;
}

.pxl-nav__status--open {
  color: var(--pxl-green-dark);
}

.pxl-nav__status--closed {
  color: var(--pxl-red);
}

.pxl-nav__change {
  display: none;
  flex: 0 0 auto;
  color: var(--pxl-green-dark);
  font-size: 0.8rem;
  font-weight: 700;
}

.pxl-nav--empty .pxl-nav__value {
  color: var(--pxl-green-dark);
}

/* ---------- Loading state ----------
   The navbar ships a placeholder (.pxl-nav-wrap--loading) with the same box as the real button. The script swaps
   the real button in when it is ready, so nothing jumps and no half-built button is ever shown. If the script never
   arrives (offline, blocked), the placeholder removes itself after 12 seconds. */
.pxl-nav--skeleton {
  pointer-events: none;
}

.pxl-nav--skeleton .pxl-nav__text {
  min-height: 1.825rem; /* the real two-line text is this tall, so the button does not change height */
  justify-content: center;
}

.pxl-skel {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, #ececec 25%, #f7f7f7 40%, #ececec 65%);
  background-size: 300% 100%;
  animation: pxl-shimmer 1.3s ease-in-out infinite;
}

.pxl-skel--icon {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg) scale(0.8);
}

.pxl-skel--short {
  width: 3.6rem;
  height: 0.5rem;
  margin-bottom: 0.4rem;
}

.pxl-skel--line {
  width: 5.76rem;
  height: 0.65rem;
}

.pxl-nav-wrap--loading {
  animation: pxl-skel-expire 0.01s linear 12s forwards;
}

.pxl-nav-wrap:not(.pxl-nav-wrap--loading) .pxl-nav {
  animation: pxl-nav-in 0.25s ease both;
}

@keyframes pxl-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

@keyframes pxl-nav-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pxl-skel-expire {
  to {
    visibility: hidden;
    width: 0;
    height: 0;
    flex-basis: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pxl-skel,
  .pxl-nav-wrap:not(.pxl-nav-wrap--loading) .pxl-nav {
    animation: none;
  }
}

/* Desktop: sits between the logo and the search bar. */
@media (min-width: 992px) and (max-width: 1100px) {
  .pxl-nav__text {
    display: none;
  }
}

/* Phones and tablets: its own full-width strip between the logo row and the search bar. */
@media (max-width: 991px) {
  .top-nav .pxl-nav-wrap {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
  }

  .top-nav .search-container {
    order: 4;
  }

  .pxl-nav {
    width: 100%;
    max-width: none;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--pxl-border);
    background: #f7f9f8;
  }

  .pxl-nav__text {
    flex: 1;
  }

  .pxl-nav__change {
    display: inline;
  }
}

/* ---------- First-visit invitation ---------- */
.pxl-callout {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  width: 310px;
  max-width: calc(100vw - 2rem);
  padding: 0.9rem 1rem;
  border: 1px solid var(--pxl-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  color: var(--pxl-text);
  animation: pxl-pop 0.22s ease-out both;
}

.pxl-callout::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 28px;
  width: 11px;
  height: 11px;
  transform: rotate(45deg);
  border-top: 1px solid var(--pxl-border);
  border-left: 1px solid var(--pxl-border);
  background: #fff;
}

.pxl-callout strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.95rem;
}

.pxl-callout p {
  margin: 0 0 0.7rem;
  color: var(--pxl-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.pxl-callout__actions {
  display: flex;
  gap: 0.5rem;
}

/* ---------- Buttons ---------- */
.pxl-btn {
  min-height: 38px;
  padding: 0 1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.pxl-btn--primary {
  background: var(--pxl-green);
  color: #fff;
}

.pxl-btn--primary:hover:not(:disabled) {
  background: var(--pxl-green-dark);
}

.pxl-btn--primary:disabled {
  background: rgba(0,166,82,0.27);
  cursor: not-allowed;
}

.pxl-btn--quiet {
  background: transparent;
  color: var(--pxl-muted);
}

.pxl-btn--outline {
  border-color: var(--pxl-green);
  background: #fff;
  color: var(--pxl-green-dark);
}

.pxl-btn--outline:hover {
  background: var(--pxl-green-tint);
}

/* ---------- Dialog ---------- */
.pxl-overlay {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(21,21,21,0.55);
  animation: pxl-fade 0.18s ease-out both;
}

.pxl-sheet {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  height: min(780px, 100%);
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  color: var(--pxl-text);
  animation: pxl-pop 0.22s ease-out both;
}

.pxl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--pxl-border);
}

.pxl-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.pxl-close {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--pxl-text);
  font-size: 1.1rem;
}

.pxl-close:hover {
  background: #f3f3f3;
}

.pxl-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.75rem 1rem;
  padding: 0 0.85rem;
  border: 1px solid var(--pxl-border);
  border-radius: 10px;
  background: #fff;
  color: var(--pxl-muted);
}

.pxl-search:focus-within {
  border-color: var(--pxl-green);
}

.pxl-search__input {
  flex: 1;
  min-width: 0;
  height: 42px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--pxl-text);
  font: inherit;
  font-size: 0.92rem;
}

.pxl-search__input:disabled {
  cursor: not-allowed;
}

.pxl-search__results {
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.25rem;
  overflow: hidden;
  list-style: none;
  border: 1px solid var(--pxl-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.pxl-search__results button {
  display: block;
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--pxl-text);
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
}

.pxl-search__results button:hover {
  background: var(--pxl-green-tint);
}

.pxl-search__note {
  padding: 0.6rem 0.7rem;
  color: var(--pxl-muted);
  font-size: 0.85rem;
}

/* Map: the map moves under a fixed centre pin, so a finger never covers the pin. */
.pxl-map {
  position: relative;
  flex: 1 1 240px;
  min-height: 200px;
  background: #ececec;
}

/* Without a map the block shrinks to a short notice. */
.pxl-map--off {
  flex: 0 0 auto;
  min-height: 0;
}

.pxl-map--off .pxl-map__overlay {
  position: static;
  padding: 1rem 1.25rem;
}

.pxl-map__canvas {
  position: absolute;
  inset: 0;
}

.pxl-map__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  margin: 0;
  padding: 1.5rem;
  place-items: center;
  color: var(--pxl-muted);
  font-size: 0.9rem;
  text-align: center;
}

.pxl-map__overlay--problem {
  color: var(--pxl-text);
}

.pxl-pin {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: block;
  transform: translate(-50%, -100%);
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.pxl-pin[hidden],
.pxl-map__locate[hidden],
.pxl-search__results[hidden] {
  display: none;
}

.pxl-pin svg {
  display: block;
}

.pxl-map__locate {
  position: absolute;
  z-index: 2;
  right: 0.75rem;
  bottom: 0.75rem;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--pxl-border);
  border-radius: 50%;
  background: #fff;
  color: var(--pxl-green-dark);
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.pxl-info {
  max-height: 38%;
  padding: 0.85rem 1rem;
  overflow-y: auto;
  border-top: 1px solid var(--pxl-border);
}

.pxl-info > * + * {
  margin-top: 0.6rem;
}

.pxl-info p {
  margin-bottom: 0;
}

.pxl-info__status {
  margin: 0;
  color: var(--pxl-muted);
  font-size: 0.88rem;
}

.pxl-info__problem {
  margin: 0;
  color: #8a5a00;
  font-size: 0.85rem;
  line-height: 1.45;
}

.pxl-info__address {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.pxl-info__meta {
  margin: 0.15rem 0 0;
  color: var(--pxl-muted);
  font-size: 0.82rem;
}

.pxl-branches__title {
  margin: 0.9rem 0 0.4rem;
  color: var(--pxl-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pxl-branches {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pxl-branches__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--pxl-border);
  border-radius: 8px;
  font-size: 0.88rem;
}

.pxl-branches__item--nearest {
  border-color: rgba(0,166,82,0.27);
  background: var(--pxl-green-tint);
}

.pxl-branches__name {
  font-weight: 700;
}

.pxl-branches__name em {
  margin-left: 0.5rem;
  color: var(--pxl-green-dark);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
}

.pxl-branches__meta {
  flex: 0 0 auto;
  color: var(--pxl-muted);
  font-size: 0.82rem;
}

.pxl-open {
  color: var(--pxl-green-dark);
  font-weight: 600;
}

.pxl-closed {
  color: var(--pxl-red);
  font-weight: 600;
}

.pxl-footer {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--pxl-border);
}

.pxl-confirm {
  width: 100%;
  min-height: 46px;
  font-size: 0.95rem;
}

.pxl-privacy {
  margin: 0.5rem 0 0;
  color: var(--pxl-muted);
  font-size: 0.75rem;
  text-align: center;
}

@media (max-width: 600px) {
  .pxl-overlay {
    padding: 0;
  }

  .pxl-sheet {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
}

/* ---------- Motion ---------- */
@keyframes pxl-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pxl-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pxl-pulse {
  50% { opacity: 0.4; }
}

@media (prefers-reduced-motion: reduce) {
  .pxl-callout,
  .pxl-overlay,
  .pxl-sheet,
  .pxl-nav--busy .pxl-nav__icon i {
    animation: none;
  }
}

/* ---------- Checkout: location card, nearest pickup branch ---------- */
.pxl-co {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--pxl-border);
  border-radius: 12px;
  background: #f9fbfa;
}

.pxl-co__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pxl-co__icon {
  flex: 0 0 auto;
  color: var(--pxl-green);
  font-size: 1.25rem;
}

.pxl-co__title {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  line-height: 1.3;
}

.pxl-co__title strong {
  color: var(--pxl-text);
  font-size: 0.92rem;
}

.pxl-co__place {
  color: var(--pxl-muted);
  font-size: 0.82rem;
}

.pxl-co__head .pxl-btn {
  flex: 0 0 auto;
  min-height: 36px;
  white-space: nowrap;
}

.pxl-co__chosen {
  flex: 0 0 auto;
  color: var(--pxl-green-dark);
  font-size: 0.85rem;
  font-weight: 700;
}

.pxl-co__body:empty {
  display: none;
}

.pxl-co__body {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--pxl-border);
}

.pxl-co__rows {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}

.pxl-co__rows > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.88rem;
}

.pxl-co__rows dt {
  color: var(--pxl-muted);
  font-weight: 400;
  white-space: nowrap;
}

.pxl-co__rows dd {
  margin: 0;
  color: var(--pxl-text);
  font-weight: 600;
  text-align: right;
}

.pxl-co__rows small {
  color: var(--pxl-muted);
  font-weight: 400;
}

.pxl-co__note,
.pxl-co__warn {
  margin: 0 0 0.5rem;
  font-size: 0.83rem;
  line-height: 1.45;
}

.pxl-co__note {
  color: var(--pxl-muted);
}

.pxl-co__warn {
  color: #8a5a00;
}

.pxl-co__note:last-child,
.pxl-co__warn:last-child {
  margin-bottom: 0;
}

@media (max-width: 480px) {
  .pxl-co__rows small {
    display: block;
  }

  .pxl-co__head {
    flex-wrap: wrap;
  }

  .pxl-co__head .pxl-btn {
    width: 100%;
  }
}
