/* Accessory slot row (#331, #339): a native snap-scroll row, no carousel library. Picture boxes are square from
   the first paint, so the row's height is known before images load and the page does not shift. */

.pp-accessory {
    margin: 0 0 28px;
    min-width: 0;
}

.pp-accessory__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
}

.pp-accessory__copy {
    font-size: 14px;
    line-height: 1.5;
    color: #7a5028;
    margin: 0;
    text-wrap: pretty;
}

.pp-accessory__arrows {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
}

.pp-accessory__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0 0 2px;
    font-size: 22px;
    line-height: 1;
    color: #92560e;
    background: #fef9f3;
    border: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #f0d9b5;
    cursor: pointer;
    transition-property: background-color, box-shadow, opacity, transform;
    transition-duration: 150ms;
}

.pp-accessory__arrow[hidden] {
    display: none;
}

.pp-accessory__arrow:hover,
.pp-accessory__arrow:focus-visible {
    background: #faeddf;
    box-shadow: 0 0 0 1px #e7c98c;
}

.pp-accessory__arrow:active {
    transform: scale(0.94);
}

.pp-accessory__arrow:disabled {
    opacity: 0.35;
    cursor: default;
    transform: none;
}

.pp-accessory__row {
    display: flex;
    gap: 12px;
    margin: 0;
    padding: 2px 2px 6px;
    list-style: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 2px;
    scrollbar-width: thin;
}

.pp-accessory__item {
    flex: 0 0 82%;
    min-width: 0;
    scroll-snap-align: start;
}

.pp-accessory__card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    padding: 10px 10px 14px;
    background: #fef9f3;
    border-radius: 16px;
    box-shadow: 0 0 0 1px #f0d9b5;
    color: #0d2642;
    text-decoration: none;
    transition-property: background-color, box-shadow;
    transition-duration: 150ms;
}

.pp-accessory__card:hover,
.pp-accessory__card:focus-visible {
    background: #faeddf;
    box-shadow: 0 0 0 1px #e7c98c;
    color: #0d2642;
    text-decoration: none;
}

.pp-accessory__media {
    display: block;
    aspect-ratio: 1 / 1;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
}

.pp-accessory__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
    outline: 1px solid rgba(0, 0, 0, 0.1);
    outline-offset: -1px;
}

.pp-accessory__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    padding: 0 4px;
    min-width: 0;
}

.pp-accessory__title {
    display: -webkit-box;
    color: #0d2642;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    text-wrap: pretty;
}

.pp-accessory__description {
    font-size: 14px;
    line-height: 1.45;
    color: #34465c;
    text-wrap: pretty;
}

.pp-accessory__facts {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    line-height: 1.4;
    color: #34465c;
}

.pp-accessory__fact::before {
    content: "\2713";
    margin-right: 6px;
    color: #4f8a3a;
}

.pp-accessory__rating,
.pp-accessory__retailer {
    font-size: 13px;
    color: #7a5028;
    font-variant-numeric: tabular-nums;
}

.pp-accessory__rating span {
    color: #d99a1e;
}

.pp-accessory__link {
    margin-top: auto;
    padding-top: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #92560e;
}

.pp-accessory__card:hover .pp-accessory__link,
.pp-accessory__card:focus-visible .pp-accessory__link {
    text-decoration: underline;
}

.pp-accessory__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
    margin: 4px 0 0;
}

.pp-accessory__note {
    font-size: 12px;
    line-height: 1.5;
    color: #8b7454;
    margin: 0;
}

.pp-accessory__guide {
    font-size: 14px;
    font-weight: 500;
    color: #92560e;
}

/*
 * On guide pages the row sits inside .article-content, whose theme rules give every list item a bottom margin
 * and an absolutely placed arrow (::before), and every link the article colour and a dashed bottom border.
 * Their selectors weigh up to four classes, so these overrides repeat a class to weigh five; they apply only
 * inside an article.
 */
.article-content .pp-accessory .pp-accessory__row > .pp-accessory__item.pp-accessory__item,
.article-content .pp-accessory .pp-accessory__facts > .pp-accessory__fact.pp-accessory__fact {
    margin: 0;
    padding: 0;
}

.article-content .pp-accessory .pp-accessory__row > .pp-accessory__item.pp-accessory__item::before {
    content: none;
}

.article-content .pp-accessory .pp-accessory__facts > .pp-accessory__fact.pp-accessory__fact::before {
    position: static;
    margin: 0 6px 0 0;
    font-family: inherit;
    font-size: inherit;
    content: "\2713";
    color: #4f8a3a;
    background: none;
}

.article-content .pp-accessory .pp-accessory__item a.pp-accessory__card.pp-accessory__card,
.article-content .pp-accessory .pp-accessory__foot a.pp-accessory__guide.pp-accessory__guide {
    border-bottom: 0;
}

.article-content .pp-accessory .pp-accessory__foot a.pp-accessory__guide.pp-accessory__guide {
    color: #92560e;
}

@media (min-width: 768px) {
    /* three cards and the edge of a fourth */
    .pp-accessory__item {
        flex-basis: calc((100% - 24px) / 3.15);
    }
}

@media (max-width: 767px) {
    .pp-accessory__arrows {
        display: none;
    }
}
