/* 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;
    }
}
