/* Product detail disclosure sections */
.detail-modal-disclosure {
    overflow: hidden;
    padding: 0;
}

.detail-modal-disclosure__trigger {
    align-items: center;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: flex;
    gap: .85rem;
    min-height: 4.75rem;
    padding: 1.1rem 1.25rem;
    text-align: left;
    width: 100%;
}

.detail-modal-disclosure__trigger:hover {
    background: #fbfdfc;
}

.detail-modal-disclosure__trigger:focus-visible {
    outline: 3px solid rgba(31, 184, 120, .32);
    outline-offset: -3px;
}

.detail-modal-disclosure__icon {
    align-items: center;
    background: #e8f8ef;
    border-radius: .85rem;
    color: #14945f;
    display: inline-flex;
    flex: 0 0 2.35rem;
    height: 2.35rem;
    justify-content: center;
    width: 2.35rem;
}

.detail-modal-disclosure__copy {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: .2rem;
    min-width: 0;
}

.detail-modal-disclosure__copy .detail-modal-section-title {
    color: #334155;
}

.detail-modal-disclosure__copy .detail-modal-meta-note {
    margin-top: 0;
}

.detail-modal-disclosure__toggle {
    align-items: center;
    border: 1px solid #cfe5d8;
    border-radius: 999px;
    color: #168447;
    display: inline-flex;
    flex: 0 0 2rem;
    font-size: 1.35rem;
    font-weight: 700;
    height: 2rem;
    justify-content: center;
    line-height: 1;
    transition: transform .2s ease, background-color .2s ease;
    width: 2rem;
}

.detail-modal-disclosure__trigger:hover .detail-modal-disclosure__toggle {
    background: #effaf3;
}

.detail-modal-disclosure.is-open .detail-modal-disclosure__toggle {
    transform: rotate(45deg);
}

.detail-modal-disclosure__content {
    border-top: 1px solid #eef2f6;
    margin-top: 0 !important;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 1.25rem;
    transition: max-height .34s ease, opacity .22s ease, padding .34s ease, border-color .22s ease;
}

.detail-modal-disclosure.is-open .detail-modal-disclosure__content {
    border-color: #eef2f6;
    max-height: 1000px;
    opacity: 1;
    padding-bottom: 1.25rem;
    padding-top: 1.1rem;
}

.detail-modal-disclosure__content[hidden] {
    display: none;
}

/* Related products stay in one row and can be swiped or scrolled horizontally. */
.detail-modal-related-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    padding: .25rem .15rem .75rem;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-color: #b7d7c5 transparent;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.detail-related-card {
    flex: 0 0 min(17rem, calc(100% - .5rem));
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.detail-modal-related-grid:focus-visible {
    border-radius: .5rem;
    outline: 3px solid rgba(31, 184, 120, .32);
    outline-offset: 2px;
}

.detail-modal-related-grid::-webkit-scrollbar {
    height: .4rem;
}

.detail-modal-related-grid::-webkit-scrollbar-thumb {
    background: #b7d7c5;
    border-radius: 999px;
}

.detail-modal-related-grid::-webkit-scrollbar-track {
    background: transparent;
}

/* The legacy #modal-items-list grid rule has higher specificity than [hidden]. */
#modal-meta-list[hidden],
#modal-items-list[hidden] {
    display: none !important;
}

/* Payday price highlight: pulse the border, not the content. */
.detail-modal-secondary-price {
    animation: detail-modal-payday-border-pulse 2.8s ease-in-out infinite;
}

@keyframes detail-modal-payday-border-pulse {
    0%, 100% {
        border-color: #e4edf9;
        box-shadow: 0 0 0 0 rgba(40, 86, 166, 0);
    }
    50% {
        border-color: #6f9bd8;
        box-shadow: 0 0 0 4px rgba(40, 86, 166, .12);
    }
}

@media (prefers-reduced-motion: reduce) {
    .detail-modal-disclosure__content,
    .detail-modal-disclosure__toggle,
    .detail-modal-secondary-price {
        animation: none;
        transition: none;
    }

    .detail-modal-related-grid {
        scroll-behavior: auto;
    }
}

@media (max-width: 640px) {
    .detail-modal-disclosure__trigger {
        min-height: 4.5rem;
        padding: 1rem;
    }

    .detail-modal-disclosure__content {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .detail-modal-disclosure.is-open .detail-modal-disclosure__content {
        padding-bottom: 1rem;
    }
}
