/* Live order progress shown in the home hero. */
.peh-order-progress {
  position: relative;
  margin-top: 5.8rem;
  padding: 1.5rem 1.7rem 1.35rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 22px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.07),
    rgba(255, 255, 255, 0.025)
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.peh-order-progress__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.peh-order-progress__eyebrow {
  margin: 0 0 0.25rem;
  color: #c09637;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.peh-order-progress__message {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.45;
}

.peh-order-progress__order-number {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.45rem 0.7rem;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(5, 18, 48, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.peh-order-progress__segments {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
  gap: 0.7rem;
  margin-bottom: 1.15rem;
}

.peh-order-progress__segment {
  height: 7px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.peh-order-progress__segment span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #c09637, #f2d58f);
  border-radius: inherit;
  box-shadow: 0 0 12px rgba(192, 150, 55, 0.5);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1s linear;
}

.peh-order-progress__steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
  align-items: start;
}

.peh-order-progress__step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  text-align: center;
}

.peh-order-progress__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: rgba(255, 255, 255, 0.43);
  background: #142551;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 0 6px #112249;
  transition:
    color 0.35s ease,
    border-color 0.35s ease,
    background-color 0.35s ease,
    box-shadow 0.35s ease;
}

.peh-order-progress__icon .material-symbols-outlined {
  font-size: 21px;
}

.peh-order-progress__step.is-complete .peh-order-progress__icon {
  color: #10224c;
  background: #c09637;
  border-color: #e3c274;
  box-shadow:
    0 0 0 6px #112249,
    0 0 18px rgba(192, 150, 55, 0.5);
}

.peh-order-progress__step.is-current .peh-order-progress__icon {
  color: #f4d889;
  border-color: #c09637;
  animation: peh-order-progress-pulse 1.8s ease-in-out infinite;
}

.peh-order-progress__label {
  margin: 0;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.peh-order-progress__step.is-complete .peh-order-progress__label,
.peh-order-progress__step.is-current .peh-order-progress__label {
  color: #ffffff;
}

.peh-order-progress__step-note {
  display: block;
  margin-top: 0.18rem;
  color: rgba(255, 255, 255, 0.46);
  font-size: 0.66rem;
  font-weight: 500;
}

.peh-order-progress.is-loading .peh-order-progress__message {
  opacity: 0.65;
}

@keyframes peh-order-progress-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 6px #112249,
      0 0 0 0 rgba(192, 150, 55, 0.34);
  }
  50% {
    box-shadow:
      0 0 0 6px #112249,
      0 0 0 10px rgba(192, 150, 55, 0);
  }
}

@media (max-width: 920px) {
  .peh-order-progress {
    margin-top: 2.7rem;
  }
}

@media (max-width: 640px) {
  .peh-order-progress {
    margin: 1.7rem 0 0;
    padding: 1.15rem 0.75rem 1.05rem;
    border-radius: 17px;
  }

  .peh-order-progress__header {
    align-items: center;
    margin-bottom: 1.2rem;
    padding: 0 0.35rem;
  }

  .peh-order-progress__eyebrow {
    font-size: 0.62rem;
  }

  .peh-order-progress__message {
    font-size: 0.76rem;
  }

  .peh-order-progress__order-number {
    padding: 0.4rem 0.55rem;
    font-size: 0.62rem;
  }

  .peh-order-progress__segments {
    gap: 0.4rem;
    margin-bottom: 0.9rem;
  }

  .peh-order-progress__segment {
    height: 6px;
  }

  .peh-order-progress__icon {
    width: 37px;
    height: 37px;
    box-shadow: 0 0 0 4px #112249;
  }

  .peh-order-progress__step.is-complete .peh-order-progress__icon {
    box-shadow:
      0 0 0 4px #112249,
      0 0 13px rgba(192, 150, 55, 0.45);
  }

  .peh-order-progress__icon .material-symbols-outlined {
    font-size: 18px;
  }

  .peh-order-progress__label {
    font-size: 0.68rem;
  }

  .peh-order-progress__step-note {
    font-size: 0.58rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .peh-order-progress__segment span,
  .peh-order-progress__icon {
    transition-duration: 0.01ms;
    animation: none !important;
  }
}

/* Center the tracking card in the open space below the hero content. */
@media (min-width: 921px) {
  .peh-hero__shell {
    display: flex;
    flex-direction: column;
  }

  .peh-hero__navbar,
  .peh-hero__main,
  .peh-order-progress {
    flex: 0 0 auto;
  }

  .peh-order-progress {
    width: 100%;
    margin-top: auto;
    margin-bottom: auto;
  }
}

/* Responsive tracking-card sizing and larger readable type. */
.peh-order-progress {
  width: 100%;
  max-width: 100%;
  margin-right: auto;
  margin-left: auto;
  padding: clamp(1.35rem, 1rem + 1vw, 2rem)
    clamp(1rem, 0.65rem + 1.5vw, 2.25rem)
    clamp(1.25rem, 0.95rem + 0.9vw, 1.8rem);
}

.peh-order-progress__eyebrow {
  font-size: clamp(0.8rem, 0.72rem + 0.22vw, 1rem);
}

.peh-order-progress__message {
  font-size: clamp(0.95rem, 0.84rem + 0.3vw, 1.2rem);
}

.peh-order-progress__order-number {
  padding: 0.55rem 0.85rem;
  font-size: clamp(0.74rem, 0.68rem + 0.18vw, 0.92rem);
}

.peh-order-progress__label {
  font-size: clamp(0.88rem, 0.78rem + 0.28vw, 1.1rem);
  line-height: 1.35;
}

.peh-order-progress__step-note {
  margin-top: 0.3rem;
  font-size: clamp(0.7rem, 0.64rem + 0.17vw, 0.84rem);
  line-height: 1.35;
}

.peh-order-progress__icon {
  width: clamp(44px, 2.5vw, 54px);
  height: clamp(44px, 2.5vw, 54px);
}

.peh-order-progress__icon .material-symbols-outlined {
  font-size: clamp(21px, 1.3vw, 27px);
}

@media (max-width: 920px) {
  .peh-order-progress {
    width: min(100%, 760px);
    margin: 2.5rem auto 0;
  }

  .peh-order-progress__header {
    margin-bottom: 1.2rem;
  }

  .peh-order-progress__segments {
    gap: 0.55rem;
  }
}

@media (max-width: 640px) {
  .peh-order-progress {
    width: 100%;
    margin: 1.8rem auto 0;
    padding: 1.2rem 0.85rem 1.15rem;
  }

  .peh-order-progress__header {
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0;
  }

  .peh-order-progress__eyebrow {
    font-size: 0.76rem;
  }

  .peh-order-progress__message {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .peh-order-progress__order-number {
    padding: 0.45rem 0.6rem;
    font-size: 0.68rem;
  }

  .peh-order-progress__steps {
    gap: 0.35rem;
  }

  .peh-order-progress__step {
    gap: 0.7rem;
  }

  .peh-order-progress__icon {
    width: 42px;
    height: 42px;
  }

  .peh-order-progress__icon .material-symbols-outlined {
    font-size: 21px;
  }

  .peh-order-progress__label {
    font-size: 0.78rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  .peh-order-progress__step-note {
    font-size: 0.65rem;
    line-height: 1.3;
  }
}

@media (max-width: 420px) {
  .peh-order-progress {
    padding-right: 0.65rem;
    padding-left: 0.65rem;
    border-radius: 15px;
  }

  .peh-order-progress__header {
    flex-wrap: wrap;
  }

  .peh-order-progress__order-number {
    margin-left: auto;
  }

  .peh-order-progress__segments {
    gap: 0.32rem;
  }

  .peh-order-progress__steps {
    gap: 0.2rem;
  }

  .peh-order-progress__icon {
    width: 39px;
    height: 39px;
  }

  .peh-order-progress__label {
    font-size: 0.72rem;
  }

  .peh-order-progress__step-note {
    font-size: 0.6rem;
  }
}

@media (max-width: 340px) {
  .peh-order-progress__message {
    font-size: 0.82rem;
  }

  .peh-order-progress__label {
    font-size: 0.67rem;
  }

  .peh-order-progress__step-note {
    font-size: 0.56rem;
  }
}

/* Fill the visible mobile screen; allow growth on short screens or with larger text. */
@media (max-width: 920px) {
  .peh-hero__shell {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: max(3rem, env(safe-area-inset-bottom));
  }

  .peh-hero__navbar,
  .peh-order-progress {
    flex: 0 0 auto;
  }

  .peh-hero__navbar {
    margin-bottom: clamp(1rem, 2dvh, 2rem);
  }

  .peh-hero__main {
    /* Preserve the upper layout and a minimum gap before the tracking card. */
    flex: 0 0 auto;
    padding-top: clamp(8px, 2dvh, 20px);
    padding-bottom: 0;
    margin-bottom: 3rem;
  }

  .peh-order-progress {
    /* Share spare height equally above and below, with matching 3rem gutters. */
    margin-top: auto;
    margin-bottom: auto;
  }
}

@media (max-width: 640px) {
  .peh-hero__shell {
    --peh-content-gap-extra: clamp(2px, 0.5dvh, 4px);
    padding-bottom: max(3rem, env(safe-area-inset-bottom));
  }

  .peh-hero__navbar {
    gap: 1rem;
  }

  .peh-hero__auth {
    min-width: 0;
    margin-left: auto;
  }

  .peh-hero__title {
    font-size: clamp(2.2rem, 6.75vw, 2.65rem);
  }

  .peh-hero__main {
    /* Redistribute space into the four content gaps without moving the tracker. */
    margin-bottom: calc(3rem - 4 * var(--peh-content-gap-extra));
  }

  .peh-hero__content {
    gap: calc(clamp(1.5rem, 3dvh, 3rem) + var(--peh-content-gap-extra));
  }

  .peh-hero__stats {
    /* Extra separation from the buttons, without shifting tracking. */
    position: relative;
    top: 12px;
  }

  .peh-order-progress {
    padding: 1.15rem 0.9rem 1.2rem;
    border-radius: 18px;
  }

  .peh-order-progress__header {
    margin-bottom: 1rem;
  }

  .peh-order-progress__segments {
    margin-bottom: 1rem;
  }

  .peh-order-progress__step {
    gap: 0.65rem;
  }

  .peh-order-progress__icon {
    width: 44px;
    height: 44px;
  }

  .peh-order-progress__label {
    font-size: 0.84rem;
    line-height: 1.25;
  }

  .peh-order-progress__step-note {
    font-size: 0.68rem;
    line-height: 1.25;
  }
}

@media (max-width: 420px) {
  .peh-order-progress {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }

  .peh-order-progress__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .peh-order-progress__order-number {
    margin-left: 0;
  }

  .peh-order-progress__segments {
    gap: 0.4rem;
  }

  .peh-order-progress__steps {
    gap: 0.35rem;
  }

  .peh-order-progress__icon {
    width: 42px;
    height: 42px;
  }

  .peh-order-progress__label {
    font-size: 0.78rem;
  }

  .peh-order-progress__step-note {
    font-size: 0.63rem;
  }
}

@media (max-width: 350px) {
  .peh-order-progress {
    padding-right: 0.6rem;
    padding-left: 0.6rem;
  }

  .peh-order-progress__header {
    grid-template-columns: 1fr;
  }

  .peh-order-progress__order-number {
    width: fit-content;
  }

  .peh-order-progress__icon {
    width: 39px;
    height: 39px;
  }

  .peh-order-progress__label {
    font-size: 0.72rem;
  }

  .peh-order-progress__step-note {
    font-size: 0.58rem;
  }
}

/* Keep the tracker in view on shorter phones without shrinking its text. */
@media (max-width: 640px) and (max-height: 700px) {
  .peh-hero__navbar {
    margin-bottom: 1rem;
  }

  .peh-hero__main {
    padding-top: 15px;
    padding-bottom: 0;
  }

  .peh-hero__content {
    gap: calc(1.5rem + var(--peh-content-gap-extra));
  }
}

/* iOS Safari can reveal page content behind its translucent bottom toolbar.
   Extend only the hero background to the large viewport; keep the inner shell
   sized to the visible viewport so the content and tracking card stay in place. */
@supports (-webkit-touch-callout: none) {
  @media (max-width: 920px) {
    .peh-hero {
      /* Keep the next section below Safari's translucent bottom controls,
         including devices where the large viewport omits the bottom inset. */
      min-height: calc(100vh + 48px);
      min-height: calc(100lvh + max(48px, env(safe-area-inset-bottom)));
      min-height: calc(max(100lvh, 100dvh) + max(48px, env(safe-area-inset-bottom)));
    }
  }
}

/* Phone readability: larger copy and labels, with slightly smaller icons. */
@media (max-width: 640px),
  (max-width: 920px) and (max-height: 500px) and (pointer: coarse) {
  .peh-order-progress__eyebrow,
  .peh-order-progress__message,
  .peh-order-progress__label {
    font-size: clamp(12px, 3.5vw, 14px);
    line-height: 1.4;
  }

  .peh-order-progress__eyebrow {
    letter-spacing: 0.1em;
    margin-bottom: 4px;
  }

  .peh-order-progress__header {
    padding-left: 6px;
  }

  .peh-order-progress__steps {
    gap: 8px;
  }

  .peh-order-progress__step {
    gap: 10px;
  }

  .peh-order-progress__icon {
    width: 36px;
    height: 36px;
  }

  .peh-order-progress__icon .material-symbols-outlined {
    font-size: 18px;
  }

  .peh-order-progress__label {
    font-size: clamp(10px, 2.8vw, 11px);
    overflow-wrap: normal;
  }
}

/* Match both rows exactly so icons and labels center beneath their segments. */
.peh-order-progress__segments,
.peh-order-progress__steps {
  column-gap: clamp(4px, 0.7vw, 7px);
}
