/* ==========================================================================
   Pharmacy page
   Hero, branch action cards and the opening-hours popup.
   Loaded after ap-ui.css, which supplies the .quick-link cards reused here.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

/* style.css caps .pharmacy_banner_section at max-height: 23.25rem with no
   overflow set, so anything past 372px used to spill out and paint over the
   section below - the old JS margin was compensating for that, and it is why
   the band stopped short of the last button. The hero sizes to its content now. */
.pharmacy-hero.pharmacy_banner_section {
  max-height: none;
}

/* Same ground and warm corner light as the services and service heroes.
   Note: no overflow:hidden, so the watermark below is inset rather than pulled
   out past the corner - a rotated overhang would raise a scrollbar. */
.pharmacy-hero {
  position: relative;
  background:
    radial-gradient(120% 90% at 6% 0%, rgba(128, 171, 89, .16), rgba(128, 171, 89, 0) 62%),
    #F6F6EF !important;
}

/* The pharmacy cross the other pages carry, two bars so it needs no asset.
   Kept inside the box: at 12deg a 13rem square reaches about 1rem past its
   corner, and the 2rem inset covers that without a horizontal scrollbar. */
.pharmacy-hero::after {
  content: "";
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 13rem;
  height: 13rem;
  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;
}

.pharmacy-hero > .container {
  position: relative;
  z-index: 1;
}

.pharmacy-hero__content {
  padding: .5rem 0 1.5rem;
}

.pharmacy-hero__eyebrow {
  display: inline-block;
  margin-bottom: .875rem;
  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;
}

/* The name stacks: chain over branch. Both lines are one heading, so the
   branch keeps the accent colour without a second element in the outline. */
.pharmacy-hero .pharmacy-hero__title {
  margin-bottom: .875rem;
  font-size: clamp(1.85rem, 6.4vw, 2.675rem) !important;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.pharmacy-hero__chain,
.pharmacy-hero__branch {
  display: block;
}

.pharmacy-hero__chain {
  color: #25545D;
}

.pharmacy-hero__branch {
  color: #80AB59;
}

/* A single name (no " - ") has nothing to stack, so it carries the accent
   itself rather than sitting in the muted chain colour alone. */
.pharmacy-hero__chain:only-child {
  color: #25545D;
}

/* Address on its own line with a pin, postcode as a chip after it. Beats the
   old run-on line of address + postcode in body text. */
.pharmacy-hero__address {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 34rem;
  margin: 0;
  color: rgba(37, 84, 93, .78);
  font-size: clamp(.95rem, 3.6vw, 1.0625rem);
  line-height: 1.5;
}

.pharmacy-hero__address-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: rgba(128, 171, 89, .14);
  color: #80AB59;
}

.pharmacy-hero__address-icon svg {
  width: 16px;
  height: 16px;
}

.pharmacy-hero__address-text {
  padding-top: 2px;
}

.pharmacy-hero__postcode {
  display: inline-block;
  margin-left: .25rem;
  padding: .1rem .45rem;
  border-radius: 6px;
  background: rgba(37, 84, 93, .08);
  color: #25545D;
  font-size: .875em;
  font-weight: 700;
  white-space: nowrap;
}

/* Photo and map frame. Wider than the old 310/267 so the shopfront reads as a
   photo rather than a square tile; the map swap shares the same box. */
.pharmacy-hero__frame {
  position: relative;
  aspect-ratio: 3 / 2;
  max-width: 34rem;
}

/* Older browsers with no aspect-ratio support: hold the old fixed height. */
@supports not (aspect-ratio: 3 / 2) {
  .pharmacy-hero__frame { height: 16rem; }
}

/* Desktop: the photo takes the column it is given rather than sitting at a
   fixed 31rem inside it, so it reads at the same weight as the text beside it. */
@media (min-width: 992px) {
  .pharmacy-hero__frame { max-width: 40rem; }
}

/* The hours card and buttons are in normal flow, so the band grows to hold
   them - no JS clearance, and the last button can never fall outside it. */
.pharmacy-hero__panel {
  width: 100%;
  margin-top: 1.5rem;
}

@media (min-width: 992px) {
  .pharmacy-hero { padding-bottom: 3rem !important; }
  .pharmacy-hero__panel { margin-top: 1.75rem; }

  /* Trimmed from Bootstrap p-4 to keep the card compact beside the buttons. */
  .pharmacy-hero .pharmacy_banner_section_opening { padding: 1.25rem !important; }
}

/* --------------------------------------------------------------------------
   Branch actions (phones)
   -------------------------------------------------------------------------- */

/* .quick-links-section supplies the teal band and .quick-link the cards, both
   from ap-ui.css. Left here: the band runs a little tighter than the one in the
   page footer, and a <button> needs the resets an <a> gets for free. */
.pharmacy-actions-section {
  padding: 1.75rem 0 2rem;
}

.pharmacy-actions .quick-link {
  width: 100%;
  margin: 0;
  text-align: left;
  font: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.pharmacy-actions button.quick-link:hover,
.pharmacy-actions button.quick-link:focus {
  border-color: rgba(37, 84, 93, .4);
  box-shadow: 0 10px 22px rgba(37, 84, 93, .1);
  transform: translateY(-2px);
}

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

/* Long values (a full email address) must not push the chevron off the card. */
.pharmacy-actions .quick-link__sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .pharmacy-actions button.quick-link:hover,
  .pharmacy-actions button.quick-link:focus { transform: none; }
}

/* --------------------------------------------------------------------------
   Opening hours: rows shared by the hero card and the popup
   -------------------------------------------------------------------------- */

.oh-card__title {
  display: block;
  margin-bottom: .5rem;
  padding-bottom: .625rem;
  border-bottom: 1px solid rgba(255, 255, 255, .25);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.oh-list {
  display: flex;
  flex-direction: column;
}

.oh-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .45rem .5rem;
  border-radius: 8px;
  font-size: .9375rem;
}

.oh-row__day {
  font-weight: 700;
}

.oh-row__times {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Today is the row people are looking for, so it is the one that is marked. */
.oh-row--today {
  background: rgba(128, 171, 89, .16);
  box-shadow: inset 0 0 0 1px rgba(128, 171, 89, .3);
}

.oh-row__closed {
  opacity: .75;
}

.oh-holidays {
  margin-bottom: .75rem;
  padding: .75rem;
  border-radius: 10px;
  background: rgba(37, 84, 93, .06);
}

.oh-holidays__title {
  display: block;
  margin-bottom: .5rem;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.oh-holiday {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  padding: .25rem 0;
  font-size: .875rem;
}

.oh-holiday__date {
  flex-shrink: 0;
  padding: .1rem .4rem;
  border-radius: 6px;
  background: #80AB59;
  color: #fff;
  font-size: .8125rem;
  font-weight: 700;
}

/* The teal hero card: same rows, inverted. */
.oh-list--on-dark,
.oh-list--on-dark .oh-row,
.oh-list--on-dark .oh-holidays {
  color: #fff;
}

.oh-list--on-dark .oh-holidays {
  background: rgba(255, 255, 255, .1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.oh-list--on-dark .oh-row--today {
  background: rgba(128, 171, 89, .3);
  box-shadow: inset 0 0 0 1px rgba(128, 171, 89, .55);
}

/* The card sits beside the buttons in a fixed column, so its rows run one
   size down from the popup and lose a little row padding with them. */
.oh-list--on-dark .oh-row {
  padding: .3rem .45rem;
  font-size: .8125rem;
}

.oh-list--on-dark .oh-holiday,
.oh-list--on-dark .oh-holiday__date {
  font-size: .8125rem;
}

.oh-list--on-dark .oh-card__title,
.oh-card__title {
  font-size: .65rem;
}

/* --------------------------------------------------------------------------
   Opening hours popup
   -------------------------------------------------------------------------- */

.oh-modal .modal-dialog {
  max-width: 26rem;
  width: calc(100% - 1.5rem);
  margin-left: auto;
  margin-right: auto;
}

.oh-modal .oh-modal__content {
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(15, 82, 87, .28);
}

.oh-modal__header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.125rem 1.25rem;
  background: linear-gradient(135deg, #0F5257 0%, #1A7A82 100%);
  color: #fff;
}

.oh-modal__heading {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

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

.oh-modal__title {
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.oh-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  cursor: pointer;
}

.oh-modal__close:hover,
.oh-modal__close:focus {
  background: rgba(255, 255, 255, .3);
}

.oh-modal__close svg {
  width: 18px;
  height: 18px;
}

.oh-modal__body {
  padding: 1rem 1.25rem;
  color: #25545D;
}

.oh-modal__footer {
  padding: 0 1.25rem 1.25rem;
}

.oh-modal .oh-modal__cta {
  display: block;
  width: 100%;
  padding: .85rem 1.25rem;
  border-radius: 10px;
  font-size: .9375rem;
  font-weight: 700;
  text-align: center;
}
