/* ==========================================================================
   Allied Pharmacies shared UI
   Components reused across redesigned pages. Load before the page stylesheet.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Scroll reveal
   Hidden state only applies once JS has flagged the document, so the content
   stays visible without JS. Motion is dropped for reduced-motion users.
   -------------------------------------------------------------------------- */

.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .3, 1);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}

.js-reveal [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Quick links
   -------------------------------------------------------------------------- */

/* Full-bleed teal band, same gradient as the Pharmacy First card. */
.quick-links-section {
  width: 100%;
  padding: 2.5rem 0 3rem;
  background: linear-gradient(135deg, #0F5257 0%, #1A7A82 100%);
}

.quick-links {
  display: flex;
  flex-direction: column;
  gap: .625rem;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(37, 84, 93, .14);
  border-radius: 14px;
  background: #fff;
  color: #25545D;
  text-decoration: none;
  box-shadow: 0 3px 12px rgba(37, 84, 93, .05);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

a.quick-link:hover,
a.quick-link:focus {
  color: #25545D;
  text-decoration: none;
  border-color: rgba(37, 84, 93, .4);
  box-shadow: 0 10px 22px rgba(37, 84, 93, .1);
  transform: translateY(-2px);
}

.quick-link--primary {
  flex-wrap: wrap;
  background: #F6F6EF;
  border-color: rgba(128, 171, 89, .45);
}

.quick-link__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(128, 171, 89, .14);
  color: #80AB59;
}

.quick-link__icon svg {
  width: 20px;
  height: 20px;
}

.quick-link__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 12rem;
  min-width: 0;
}

.quick-link__title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.quick-link__sub {
  margin-top: 2px;
  color: rgba(37, 84, 93, .75);
  font-size: .8125rem;
  font-weight: 400;
  line-height: 1.45;
}

.quick-link__arrow {
  display: inline-flex;
  align-items: center;
  color: rgba(37, 84, 93, .45);
  transition: transform .18s ease, color .18s ease;
}

.quick-link__arrow svg {
  width: 18px;
  height: 18px;
}

a.quick-link:hover .quick-link__arrow,
a.quick-link:focus .quick-link__arrow {
  color: #25545D;
  transform: translateX(3px);
}

.quick-links .quick-link__cta {
  flex: 1 1 100%;
  padding: .8rem 1.4rem;
  font-size: .9375rem;
}

@media (min-width: 576px) {
  .quick-links .quick-link__cta {
    flex: 0 0 auto;
  }
}

@media (min-width: 768px) {
  .quick-links-section { padding: 3rem 0 3.5rem; }
  .quick-link { padding: 18px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .quick-link,
  .quick-link__arrow { transition: none; }
  a.quick-link:hover { transform: none; }
}


/* --------------------------------------------------------------------------
   Teal feature card (services + service detail pages)
   -------------------------------------------------------------------------- */

.popular-services {
  width: 100%;
}

.pf-card {
  display: block;
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #0F5257 0%, #1A7A82 100%);
}

/* Every link inside the card is white; style.css colours anchors green. */
.pf-card a {
  color: #fff;
  text-decoration: none;
}

.pf-card a:hover,
.pf-card a:focus {
  color: #fff;
  text-decoration: none;
}

.pf-card a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* Concentric rings, echoing the hero's cross watermark. */
.pf-card::before {
  content: "";
  position: absolute;
  right: -105px;
  bottom: -105px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255, 255, 255, .03), 0 0 0 58px rgba(255, 255, 255, .02);
  pointer-events: none;
}

.pf-card__main {
  display: block;
  position: relative;
  z-index: 1;
  padding: 28px 0 24px;
}

.pf-card__top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.pf-card__heading {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.pf-card__kicker {
  color: #d7e2cd;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.pf-card__title {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
}

.pf-card__badge {
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: 999px;
  background: #fff;
  color: #25545D;
  font-size: .6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  box-shadow: 0 5px 14px rgba(37, 84, 93, .18);
}

.pf-card__copy {
  display: block;
  max-width: 38rem;
  margin: 0 0 16px;
  color: rgba(255, 255, 255, .85);
  font-size: .9375rem;
  line-height: 1.55;
}

.pf-card__chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pf-card__chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .14);
  font-size: .8125rem;
  font-weight: 700;
  line-height: 1.3;
  min-height: 44px;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.pf-card__chip:hover,
.pf-card__chip:focus {
  background: rgba(255, 255, 255, .2);
  border-color: rgba(255, 255, 255, .38);
  transform: translateY(-2px);
}

.pf-card__chip::before {
  content: "";
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d7e2cd;
  box-shadow: 0 0 0 3px rgba(215, 226, 205, .18);
}

.pf-card__chip--wide {
  grid-column: 1 / -1;
}

.pf-card__footer {
  position: relative;
  z-index: 1;
  padding: 14px 0;
  background: rgba(15, 82, 87, .45);
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.pf-card__footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.pf-card__note {
  max-width: 22rem;
  color: rgba(255, 255, 255, .7);
  font-size: .6875rem;
  line-height: 1.45;
}

.pf-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-size: .875rem;
  font-weight: 800;
  white-space: nowrap;
}

.pf-card__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  color: #25545D;
  font-size: 1.0625rem;
  transition: transform .25s ease;
}

.pf-card__cta:hover .pf-card__arrow,
.pf-card__cta:focus .pf-card__arrow {
  transform: translateX(3px);
}

.pf-card__title-link:hover,
.pf-card__title-link:focus {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Chips cascade in behind the card itself. */
.js-reveal .pf-card.is-revealed .pf-card__chip {
  animation: pf-chip-in .45s cubic-bezier(.2, .7, .3, 1) backwards;
}

.js-reveal .pf-card.is-revealed .pf-card__chip:nth-child(1) { animation-delay: .12s; }
.js-reveal .pf-card.is-revealed .pf-card__chip:nth-child(2) { animation-delay: .18s; }
.js-reveal .pf-card.is-revealed .pf-card__chip:nth-child(3) { animation-delay: .24s; }
.js-reveal .pf-card.is-revealed .pf-card__chip:nth-child(4) { animation-delay: .30s; }
.js-reveal .pf-card.is-revealed .pf-card__chip:nth-child(5) { animation-delay: .36s; }
.js-reveal .pf-card.is-revealed .pf-card__chip:nth-child(6) { animation-delay: .42s; }
.js-reveal .pf-card.is-revealed .pf-card__chip:nth-child(7) { animation-delay: .48s; }

@keyframes pf-chip-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal .pf-card.is-revealed .pf-card__chip { animation: none; }
  .pf-card__chip,
  .pf-card__arrow { transition: none; }
  .pf-card__chip:hover,
  .pf-card__chip:focus { transform: none; }
}

/* Narrow phones: tighten the badge so it stays inline, and stack the footer. */
@media (max-width: 419.98px) {
  .pf-card__badge {
    padding: 6px 9px;
    font-size: .625rem;
    letter-spacing: .02em;
  }

  .pf-card__footer-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .pf-card__note { max-width: none; }

  .pf-card__cta {
    justify-content: space-between;
    width: 100%;
  }
}

@media (min-width: 576px) {
  .pf-card__chips { grid-template-columns: repeat(3, 1fr); }
  .pf-card__chip--wide { grid-column: span 2; }
}

@media (min-width: 768px) {
  .pf-card__main { padding: 40px 0 34px; }
  .pf-card__footer { padding: 18px 0; }
  .pf-card__title { font-size: 1.625rem; }
  .pf-card__copy { font-size: 1rem; }
  .pf-card__chips { grid-template-columns: repeat(4, 1fr); }
  .pf-card__chip--wide { grid-column: span 2; }
}


/* Ticked statements variant, used on service detail pages in place of chips. */
.pf-card__ticks {
  display: grid;
  gap: 2px;
  /* Single column, centred as a block; rows stay left-aligned to stay readable. */
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.pf-card .pf-card__ticks li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.45;
}

.pf-card .pf-card__ticks li:last-child {
  border-bottom: 0;
}

.pf-card .pf-card__ticks li::before {
  content: "\2713";
  flex-shrink: 0;
  color: #d7e2cd;
  font-weight: 800;
}

/* Deliberately one column at every width: two columns leaves ragged half-empty
   rows when a service has an odd number of statements. */

/* --------------------------------------------------------------------------
   Hero (services + service detail pages)
   -------------------------------------------------------------------------- */

.services-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 6% 0%, rgba(128, 171, 89, .16), rgba(128, 171, 89, 0) 62%),
    #F6F6EF !important;
}

/* Decorative pharmacy cross, built from two bars so it needs no asset. */
.services-hero::after {
  content: "";
  position: absolute;
  top: -4rem;
  right: -4rem;
  width: 17rem;
  height: 17rem;
  background:
    linear-gradient(#25545D, #25545D) center / 100% 28% no-repeat,
    linear-gradient(#25545D, #25545D) center / 28% 100% no-repeat;
  opacity: .05;
  transform: rotate(12deg);
  pointer-events: none;
}

.services-hero__content {
  position: relative;
  z-index: 1;
  padding: 2.25rem 0 2.5rem;
}

.services-hero__eyebrow {
  display: inline-block;
  margin-bottom: 1rem;
  padding: .4rem .8rem;
  border-radius: 999px;
  background: rgba(37, 84, 93, .08);
  color: #25545D;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.services-hero .services-hero__title {
  max-width: 20ch;
  margin-bottom: .75rem;
  font-size: clamp(1.85rem, 6.4vw, 2.675rem) !important;
  line-height: 1.12;
  letter-spacing: -.02em;
}

.services-hero .services-hero__accent {
  color: #80AB59;
}

.services-hero__lead {
  max-width: 36rem;
  margin-bottom: 1.5rem;
  color: rgba(37, 84, 93, .78);
  font-size: clamp(.95rem, 3.6vw, 1.0625rem);
  line-height: 1.6;
}

/* Actions */

.services-hero__actions {
  display: flex;
  flex-direction: column;
  gap: .625rem;
}

.services-hero .services-hero__cta {
  padding: .9rem 1.5rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.services-hero .services-hero__cta:hover,
.services-hero .services-hero__cta:focus {
  text-decoration: none;
}

.services-hero .services-hero__cta--ghost {
  background: #fff;
  color: #25545D;
  box-shadow: inset 0 0 0 1px rgba(37, 84, 93, .28);
}

.services-hero .services-hero__cta--ghost:hover,
.services-hero .services-hero__cta--ghost:focus {
  background: #25545D;
  color: #fff;
}

/* Media */

.services-hero__media {
  position: relative;
  z-index: 1;
}

@media screen and (min-width: 576px) {
  .services-hero__actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .services-hero .services-hero__cta {
    flex: 0 1 auto;
  }
}

@media screen and (min-width: 992px) {
  .services-hero__content {
    padding: 3.5rem 0;
  }

  .services-hero::after {
    width: 22rem;
    height: 22rem;
  }
}


/* Walk-in note under the hero actions on service detail pages. */
.services-hero__walkin {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 34rem;
  margin-top: 1.25rem;
  color: rgba(37, 84, 93, .8);
  font-size: .8125rem;
  line-height: 1.5;
}

.services-hero .services-hero__walkin strong {
  display: block;
  margin-bottom: 2px;
  color: #25545D;
  font-size: .875rem;
  font-weight: 700;
}

.services-hero__walkin-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #80AB59;
}

.services-hero__walkin-icon svg {
  width: 18px;
  height: 18px;
}

/* --------------------------------------------------------------------------
   Branch results panel (service detail sidebar)
   -------------------------------------------------------------------------- */

@media (min-width: 992px) {
  .service-sidebar {
    position: sticky;
    top: 1rem;
  }
}

.branch-card {
  padding: 14px 16px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: #fff;
  color: #25545D;
  text-align: left;
}

.branch-card__top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.branch-card__distance {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: #F6F6EF;
  border: 1px solid rgba(37, 84, 93, .14);
  color: rgba(37, 84, 93, .8);
  font-size: .6875rem;
  font-weight: 700;
  white-space: nowrap;
}

.branch-card .branch-card__name {
  margin: 0 0 2px;
  color: #25545D;
  font-size: 1rem !important;
  font-weight: 700 !important;
  line-height: 1.3;
}

.branch-card .branch-card__address {
  margin: 0;
  color: rgba(37, 84, 93, .7);
  font-size: .8125rem;
  line-height: 1.45;
}

.branch-card__details {
  margin-top: 10px;
  border-top: 1px solid rgba(37, 84, 93, .12);
  padding-top: 8px;
}

.branch-card__details summary {
  color: #25545D;
  font-size: .8125rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.branch-card__details summary::-webkit-details-marker { display: none; }

.branch-card__details summary::after {
  content: "\25BE";
  margin-left: 6px;
  color: rgba(37, 84, 93, .5);
}

.branch-card__details[open] summary::after { content: "\25B4"; }

.branch-card__hours {
  margin-top: 8px;
}

.branch-card__hours-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  color: rgba(37, 84, 93, .75);
  font-size: .8125rem;
}

.branch-card__hours-row.is-today {
  color: #25545D;
  font-weight: 700;
}

.branch-card__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.branch-card .branch-card__btn {
  flex: 1 1 0;
  padding: .6rem .5rem;
  border-radius: 10px;
  background: #fff;
  color: #25545D;
  box-shadow: inset 0 0 0 1px rgba(37, 84, 93, .28);
  font-size: .8125rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.branch-card .branch-card__btn:hover,
.branch-card .branch-card__btn:focus {
  background: #25545D;
  color: #fff;
  text-decoration: none;
}

.branch-card .branch-card__btn--primary {
  background: #80AB59;
  color: #fff;
  box-shadow: none;
}

.branch-card .branch-card__btn--primary:hover,
.branch-card .branch-card__btn--primary:focus {
  background: #25545D;
  color: #fff;
}

/* --------------------------------------------------------------------------
   Search band (find a pharmacy + home hero)
   -------------------------------------------------------------------------- */

/* Full-bleed teal strapline band under the hero. */
.fp-search-band {
  width: 100%;
  background: linear-gradient(135deg, #0F5257 0%, #1A7A82 100%);
}

.fp-search-band .fp-search-band__caption {
  margin: 0;
  padding: 1.15rem 0;
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -.01em;
  text-align: center;
}

/* The search sits in the hero, under the copy. */
.fp-search {
  position: relative;
  z-index: 2;
  max-width: 34rem;
  margin-bottom: 1.5rem;
}

.fp-search__group {
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(37, 84, 93, .1), inset 0 0 0 1px rgba(37, 84, 93, .18);
  overflow: hidden;
}

.fp-search .fp-search__locate,
.fp-search .fp-search__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 54px;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #25545D;
}

.fp-search .fp-search__locate img {
  width: 20px;
  height: 20px;
}

.fp-search .fp-search__locate:hover,
.fp-search .fp-search__submit:hover {
  background: #F6F6EF;
}

.fp-search .fp-search__submit {
  background: #25545D;
  color: #fff;
}

.fp-search .fp-search__submit:hover {
  background: #80AB59;
  color: #fff;
}

.fp-search .fp-search__submit svg {
  width: 20px;
  height: 20px;
}

.fp-search .fp-search__input {
  height: 54px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #25545D;
  font-size: 1rem;
}

.fp-search .fp-search__input::placeholder {
  color: rgba(37, 84, 93, .5);
}

.fp-search .fp-search__input:focus {
  box-shadow: none;
  outline: 0;
}

.fp-search__group:focus-within {
  box-shadow: 0 6px 18px rgba(37, 84, 93, .12), inset 0 0 0 2px #25545D;
}

.fp-search .clear-location {
  align-self: center;
  margin-right: 6px;
  color: rgba(37, 84, 93, .5);
  cursor: pointer;
}


/* --------------------------------------------------------------------------
   Popular services sidebar (service detail pages)
   -------------------------------------------------------------------------- */

.service-popular {
  padding: 20px;
  border: 1px solid rgba(37, 84, 93, .14);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(37, 84, 93, .07);
}

.service-popular .service-popular__title {
  margin: 0 0 .875rem;
  color: #25545D;
  font-size: 1.125rem !important;
  font-weight: 800 !important;
}

.service-popular__list {
  margin: 0 0 .875rem;
  padding: 0;
  list-style: none;
}

.service-popular__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(37, 84, 93, .1);
  color: #25545D;
  font-size: .9375rem;
  font-weight: 700;
  text-decoration: none;
}

.service-popular__list li:last-child .service-popular__item {
  border-bottom: 0;
}

.service-popular__item:hover,
.service-popular__item:focus {
  color: #80AB59;
  text-decoration: none;
}

.service-popular__item img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.service-popular__item span { flex: 1; line-height: 1.3; }

.service-popular__item svg {
  width: 18px;
  height: 18px;
  color: rgba(37, 84, 93, .45);
  flex-shrink: 0;
}

.service-popular__all {
  display: block;
  padding: .8rem 1rem;
  border-radius: 10px;
  background: #25545D;
  color: #fff;
  font-size: .9375rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.service-popular__all:hover,
.service-popular__all:focus {
  background: #1c4148;
  color: #fff;
  text-decoration: none;
}

/* The sidebar starts level with the article, not tight under the teal band. */
@media (min-width: 992px) {
  .service-popular.service-sidebar {
    margin-top: 4rem;
    top: 2rem;
  }
}

/* Wide screens: step each tick row further right so the single column fills
   the band diagonally. The list shifts left by half the total stagger, so the
   block still reads as centred. */
@media (min-width: 992px) {
  /* margin:auto already centres the staggered block, indents included. */
  .pf-card__ticks {
    --pf-tick-step: 0rem;
  }

  .pf-card__ticks li:nth-child(2) { margin-left: var(--pf-tick-step); }
  .pf-card__ticks li:nth-child(3) { margin-left: calc(2 * var(--pf-tick-step)); }
  .pf-card__ticks li:nth-child(4) { margin-left: calc(3 * var(--pf-tick-step)); }
  .pf-card__ticks li:nth-child(5) { margin-left: calc(4 * var(--pf-tick-step)); }
  .pf-card__ticks li:nth-child(6) { margin-left: calc(5 * var(--pf-tick-step)); }
  .pf-card__ticks li:nth-child(n+7) { margin-left: calc(6 * var(--pf-tick-step)); }
}
