/* ----------------------------------------------------------------------------------------
 * Prospera — Service detail dialog
 *
 * Opened from a catalogue card. Two columns where the service has photos, one
 * where it does not. The subcategory's accent is passed in on the dialog's
 * style attribute, so the dialog reads as part of the group it came from.
 *
 * Sits below .booking-modal-overlay (z-index 9999) and closes before booking
 * opens, so the two never stack.
 * -------------------------------------------------------------------------------------- */

.svc-modal-overlay {
  --svc-ink: var(--primary-color, #0d3b66);
  --svc-muted: var(--text-color, #4a4a4a);
  --svc-line: rgba(13, 59, 102, 0.1);
  --svc-tint: var(--secondary-color, #eef6f5);
  --svc-accent: var(--accent-color, #2fa8a0);

  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 32, 56, 0.62);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.25s ease;
  overflow-y: auto;
}

.svc-modal-overlay[hidden] {
  display: none;
}

.svc-modal-overlay.is-open {
  opacity: 1;
}

.svc-modal {
  position: relative;
  width: 100%;
  max-width: 940px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 30px 70px rgba(8, 32, 56, 0.32);
  transform: translateY(14px) scale(0.985);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.svc-modal-overlay.is-open .svc-modal {
  transform: none;
}

/* ---------------------------------------------------------------- Close */

.svc-modal__close {
  position: absolute;
  inset-block-start: 16px;
  inset-inline-end: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 2px 10px rgba(8, 32, 56, 0.16);
  color: var(--svc-ink);
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.svc-modal__close svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.svc-modal__close:hover,
.svc-modal__close:focus-visible {
  background: var(--svc-ink);
  color: #fff;
}

/* ---------------------------------------------------------------- Layout */

.svc-modal__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  gap: 34px;
  padding: 34px 36px 8px;
}

/* No photos: one column, and the dialog itself narrows to match so the content
   is not stranded against a wide empty panel. */
.svc-modal__grid--text {
  grid-template-columns: minmax(0, 1fr);
}

.svc-modal--text {
  max-width: 660px;
}

/* ---------------------------------------------------------------- Photos */

.svc-modal__media {
  align-self: start;
}

/* Same leaf as the card, so the dialog is visibly the card opened up. */
.svc-modal__stage {
  position: relative;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 54px 12px 54px 12px;
  background: var(--svc-tint);
}

html[dir='rtl'] .svc-modal__stage {
  border-radius: 12px 54px 12px 54px;
}

.svc-modal__stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.45s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.svc-modal__stage.is-loading img {
  opacity: 0;
  transform: scale(1.05);
}

.svc-modal__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.svc-modal__thumb {
  width: 54px;
  height: 54px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--svc-line);
  border-radius: 10px;
  background: var(--svc-tint);
  cursor: pointer;
  opacity: 0.62;
  transition: opacity 0.25s ease, border-color 0.25s ease;
}

.svc-modal__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.svc-modal__thumb:hover {
  opacity: 1;
}

.svc-modal__thumb.is-active {
  opacity: 1;
  border-color: var(--svc-accent);
  box-shadow: 0 0 0 1px var(--svc-accent);
}

.svc-modal__thumb:focus-visible {
  outline: 2px solid var(--svc-ink);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- Content */

/* Holds the tag and the match badge on one line -- see .svc-card__meta, which
   this mirrors. Owns the spacing before the title that .svc-modal__tag used
   to carry alone, so the layout is identical whether or not a badge joins it. */
.svc-modal__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.svc-modal__tag {
  font-family: var(--default-font, sans-serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--svc-accent);
}

/* Same badge as the card's -- see .svc-card__match. */
.svc-modal__match {
  margin-inline-start: auto;
  flex: 0 0 auto;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--svc-accent);
  font-family: var(--default-font, sans-serif);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  color: #fff;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.svc-modal__title {
  margin: 0 0 10px;
  padding-inline-end: 40px;
  font-family: var(--accent-font, serif);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--svc-ink);
}

.svc-modal__price {
  margin: 0 0 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--svc-line);
  font-family: var(--default-font, sans-serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--svc-ink);
  font-variant-numeric: tabular-nums;
}

.svc-modal__price--muted {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--svc-muted);
  opacity: 0.75;
}

.svc-modal__text p {
  margin: 0 0 12px;
  font-family: var(--default-font, sans-serif);
  font-size: 14px;
  line-height: 1.75;
  color: var(--svc-muted);
}

.svc-modal__text p:last-child {
  margin-bottom: 0;
}

.svc-modal__empty {
  font-style: italic;
  opacity: 0.8;
}

/* ---------------------------------------------------------------- Lists */

.svc-modal__list {
  margin-top: 24px;
}

.svc-modal__list-title {
  margin: 0 0 10px;
  font-family: var(--default-font, sans-serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--svc-ink);
}

.svc-modal__list ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.svc-modal__list li {
  position: relative;
  padding-inline-start: 22px;
  margin-bottom: 7px;
  font-family: var(--default-font, sans-serif);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--svc-muted);
}

.svc-modal__list li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 8px 2px 8px 2px;
  background: var(--svc-accent);
}

.svc-modal__list--no li::before {
  background: transparent;
  border: 1px solid rgba(13, 59, 102, 0.28);
}

/* ---------------------------------------------------------------- Footer */

.svc-modal__foot {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  padding: 18px 36px 26px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 30%);
}

.svc-modal__book {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 32px;
  border: none;
  border-radius: 100px;
  background: var(--svc-ink);
  font-family: var(--default-font, sans-serif);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.svc-modal__book svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[dir='rtl'] .svc-modal__book svg {
  transform: scaleX(-1);
}

.svc-modal__book:hover,
.svc-modal__book:focus-visible {
  background: var(--svc-accent);
}

/* ---------------------------------------------------------------- Responsive */

@media only screen and (max-width: 900px) {
  .svc-modal__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 28px 24px 4px;
  }

  .svc-modal__stage {
    aspect-ratio: 16 / 10;
    border-radius: 40px 10px 40px 10px;
  }

  html[dir='rtl'] .svc-modal__stage {
    border-radius: 10px 40px 10px 40px;
  }

  .svc-modal__title {
    font-size: 25px;
  }

  .svc-modal__foot {
    padding: 16px 24px 22px;
  }

  .svc-modal__book {
    width: 100%;
    justify-content: center;
  }
}

@media only screen and (max-width: 575px) {
  .svc-modal-overlay {
    padding: 12px;
  }

  .svc-modal {
    max-height: 92vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .svc-modal-overlay,
  .svc-modal,
  .svc-modal__stage img,
  .svc-modal__thumb,
  .svc-modal__book,
  .svc-modal__close {
    transition: none;
  }

  .svc-modal {
    transform: none;
  }

  .svc-modal__stage.is-loading img {
    opacity: 1;
    transform: none;
  }
}

/* ---------------------------------------------------------------- Tags
 *
 * The full tag list, uncapped — the card showed at most three. Sits under the
 * price block's divider and above the description.
 * Markup: services-modal.js renderContents.
 * ------------------------------------------------------------------------- */

.svc-modal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -8px 0 18px;
  padding: 0;
  list-style: none;
}

.svc-modal__chip {
  padding: 4px 11px;
  border-radius: 100px;
  background: rgba(13, 59, 102, 0.06);
  font-family: var(--default-font, sans-serif);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.5;
  color: var(--svc-muted);
}
