.product-media-rail {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 3px;
    margin: 4px 0 12px;
    scroll-snap-type: x proximity;
}
.product-media-tile {
    color: #222;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    font: inherit;
    cursor: pointer;
}
.product-media-tile {
    flex: 0 0 136px;
    padding: 5px;
    display: flex;
    flex-direction: column;
    text-align: left;
    scroll-snap-align: start;
}
.product-media-tile:hover {
    color: #222;
    text-decoration: none;
    border-color: #737373;
}
.product-media-tile:focus-visible, .product-media-dialog button:focus-visible {
    outline: 2px solid #2466bd;
    outline-offset: 1px;
}
.product-media-thumb {
    display: grid;
    place-items: center;
    position: relative;
    aspect-ratio: 16 / 10;
    width: 100%;
    background: #f6f6f6;
    border-radius: 3px;
    overflow: hidden;
}
.product-media-thumb img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.product-media-pdf, .product-media-play {
    position: absolute;
    background: #344457;
    color: white;
}
.product-media-pdf {
    left: 4px;
    bottom: 4px;
    padding: 2px 5px;
    border-radius: 3px;
    font: bold 11px/1.3 sans-serif;
}
.product-media-play {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    padding-left: 2px;
}
.product-media-caption {
    padding: 5px 3px 2px;
    font-size: 13px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.product-media-dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(78vw, 860px);
    max-height: calc(100dvh - 32px);
    padding: 0;
    border: 0;
    border-radius: 9px;
    color: #222;
    background: #fff;
    box-shadow: 0 12px 48px rgba(0, 0, 0, .35);
}
.product-media-dialog::backdrop { background: rgba(16, 22, 28, .52); }
html:has(.product-media-dialog[open]) { overflow: hidden; }
.product-media-window { padding: 10px; }
.product-media-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-left: 8px;
}
.product-media-header h2 { font-size: 18px; margin: 0; }
.product-media-position { color: #555; font-size: 13px; }
.product-media-dialog button {
    flex-shrink: 0;
    border: 0;
    background: transparent;
    color: #344457;
    font: 30px/1 sans-serif;
    min-height: 44px;
    width: 44px;
    border-radius: 5px;
}
.product-media-prev::before, .product-media-next::before {
    content: "";
    display: inline-block;
    width: 13px;
    height: 13px;
    border: solid currentColor;
    border-width: 2px 2px 0 0;
    transform: rotate(45deg);
}
.product-media-prev::before { transform: rotate(-135deg); }
.product-media-dialog button:hover { background: #edf1f6; }
.product-media-stage { display: flex; align-items: center; }
.product-media-content {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: min(58dvh, 540px);
}
.product-media-content img, .product-media-content iframe {
    display: block;
    flex: 1;
    min-height: 0;
    width: 100%;
    object-fit: contain;
    border: 0;
}
.product-media-content img[hidden], .product-media-dialog button[hidden] { display: none; }
.product-media-status { position: absolute; color: #555; }
.product-media-content a { margin: 8px; text-decoration: underline; }
.product-media-ready:has(.product-media-tile[data-media-type="photo"]) .pdb-image-sidebar { display: none; }
@media (max-width: 600px) {
    .product-media-tile { flex-basis: 112px; }
    .product-media-dialog { width: calc(100vw - 20px); }
    .product-media-window { padding: 6px; }
    .product-media-content { height: min(50dvh, 380px); }
}
