/* Horizontal, independently scrollable related design rows. */
.idd-related-designs {
    --idd-related-height: clamp(132px, 12vw, 180px);
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid rgba(128,128,128,.12);
    min-width: 0;
}
.idd-related-row { margin-bottom: 28px; min-width: 0; }
.idd-related-heading {
    margin: 0 0 12px !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.5 !important;
    color: inherit;
}
.idd-related-viewport { position: relative; min-width: 0; }
.idd-related-track {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 4px;
    width: 100%;
    min-width: 0;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}
.idd-related-track::-webkit-scrollbar { display: none; }
.idd-related-track:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.idd-related-card {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: clamp(130px, calc(var(--idd-related-height) * var(--idd-related-ratio, 1.33)), 340px);
    height: var(--idd-related-height);
    overflow: hidden;
    border-radius: 12px;
    border: 0;
    background: rgba(128,128,128,.1);
    scroll-snap-align: start;
    text-decoration: none;
}
.idd-related-card img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .18s ease; }
.idd-related-card:hover img { transform: scale(1.025); }
.idd-related-card:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.idd-related-premium {
    position: absolute;
    left: 8px;
    bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: #ffc400;
    background: rgba(0,0,0,.76);
    pointer-events: none;
}
.idd-related-media {
    position: absolute;
    right: 9px;
    bottom: 9px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    background: rgba(0,0,0,.65);
    pointer-events: none;
}
.idd-related-scroll[hidden] { display: none !important; }
.idd-related-scroll {
    position: absolute;
    z-index: 2;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(0,0,0,.07);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #202024;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    cursor: pointer;
}
.idd-related-prev { left: 6px; }
.idd-related-next { right: 6px; }
[data-theme="dark"] .idd-related-scroll,
body.theme-dark .idd-related-scroll { background: #29292d; color: #f4f4f5; border-color: rgba(255,255,255,.1); }
@media (max-width: 767.98px) {
    .idd-related-track { gap: 10px; }
    .idd-related-row { margin-bottom: 24px; }
    .idd-related-scroll { width: 32px; height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
    .idd-related-track { scroll-behavior: auto; }
    .idd-related-card img { transition: none; }
}

/* Keep the crown gold even when the theme applies a general SVG color. */
#msAppLayout .idd-related-card .idd-related-premium,
#imageDetailModal .idd-related-card .idd-related-premium,
#msAppLayout .idd-related-card .idd-related-premium svg,
#imageDetailModal .idd-related-card .idd-related-premium svg,
#msAppLayout .idd-related-card .idd-related-premium svg path,
#imageDetailModal .idd-related-card .idd-related-premium svg path {
    color: #ffc400 !important;
    fill: #ffc400 !important;
}
#msAppLayout .idd-related-card .idd-related-premium svg,
#imageDetailModal .idd-related-card .idd-related-premium svg,
#msAppLayout .idd-related-card .idd-related-premium svg path,
#imageDetailModal .idd-related-card .idd-related-premium svg path {
    stroke: none !important;
}
/* Keywords are rendered once, directly after the related-design rows. */
.idd-wrap > .container > .idd-product-keywords {
    margin-top: 12px;
    width: 100%;
    min-width: 0;
}
