/* Service photos & videos: title button + viewer (booking-service-media.js). */

.service-summary-title-row {
    display: flex;
    flex: 1;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    min-width: 0;
}

/* Content-sized, so a title that wraps pushes the button onto its own line
   instead of squeezing beside it. */
.service-summary-title-row .service-summary-title {
    flex: 0 1 auto;
    margin-bottom: 0;
}

.service-media-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    height: 30px;
    padding: 0 11px 0 9px;
    border: 1px solid rgba(229, 0, 80, 0.35);
    border-radius: 999px;
    background: #fff;
    color: #e50050;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.service-media-btn[hidden] {
    display: none;
}

.service-media-btn:hover,
.service-media-btn:focus-visible {
    background: #fff0f5;
    border-color: #e50050;
}

.service-media-btn:focus-visible {
    outline: 2px solid #e50050;
    outline-offset: 2px;
}

.service-media-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 12010; /* above the booking page overlays (add-service modal: 12000) */
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(12, 12, 12, 0.82);
}

.service-media-modal.show {
    display: flex;
}

.service-media-modal__dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 480px;
}

/* Fixed minimum height so the viewer keeps its shape while media loads. */
.service-media-modal__stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: min(60vh, 520px);
    touch-action: pan-y;
}

.service-media-modal__stage.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: service-media-spin 0.8s linear infinite;
}

@keyframes service-media-spin {
    to {
        transform: rotate(360deg);
    }
}

.service-media-modal__media {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 140px);
    max-height: calc(100dvh - 140px);
    border-radius: 16px;
    background: #000;
    object-fit: contain;
}

.service-media-modal__close {
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    cursor: pointer;
}

.service-media-modal__nav {
    position: absolute;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-top: 6px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #1c1c1c;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transform: translateY(-50%);
}

.service-media-modal__nav[hidden] {
    display: none;
}

.service-media-modal__nav--prev {
    left: -60px;
}

.service-media-modal__nav--next {
    right: -60px;
}

.service-media-modal__close:focus-visible,
.service-media-modal__nav:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.service-media-modal__counter {
    min-height: 18px;
    margin: 0;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Arrows move onto the media where there is no room beside it. */
@media (max-width: 620px) {
    .service-media-modal__nav--prev {
        left: 8px;
    }

    .service-media-modal__nav--next {
        right: 8px;
    }
}

/* In a partner's iframe the frame is as tall as its page, so a fixed overlay
   would span the whole frame and centre the media far off-screen.
   embed-frame-bridge.js publishes the part the visitor sees. */
html[data-embed-viewport] .service-media-modal {
    top: var(--embed-view-top, 0px);
    bottom: auto;
    height: var(--embed-view-height, 100vh);
}

html[data-embed-viewport] .service-media-modal__stage {
    min-height: min(calc(var(--embed-view-height, 100vh) * 0.6), 520px);
}

html[data-embed-viewport] .service-media-modal__media {
    max-height: calc(var(--embed-view-height, 100vh) - 140px);
}

/* Service notes: (i) button beside the title and its popup — bottom sheet on
   phones, centred card from 760px. */
.service-notes-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8a8a8a;
    cursor: pointer;
}

.service-notes-btn:hover,
.service-notes-btn:focus-visible {
    color: #e50050;
}

.service-notes-modal {
    position: fixed;
    inset: 0;
    z-index: 12010;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
}

.service-notes-modal[hidden] {
    display: none;
}

.service-notes-modal__card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    max-height: 80dvh;
    background: #fff;
    border-radius: 24px 24px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.service-notes-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.service-notes-modal__title {
    font-size: 18px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.service-notes-modal__close {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff0f5;
    color: #e50050;
    cursor: pointer;
}

.service-notes-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px 20px;
    font-size: 14.5px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

@media (min-width: 760px) {
    .service-notes-modal {
        align-items: center;
    }

    .service-notes-modal__card {
        border-radius: 24px;
        box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3);
    }
}
