/* =========================================================================
 * Limitless Gang Sheet Builder — collapsed design lists
 *
 * Cart, checkout review, thank-you page and My Account > View Order
 * (markup: DesignList::summary() + the three customer templates; enqueued
 * by Frontend::enqueue_order_display_assets()).
 *
 * These surfaces render OUTSIDE #lgsb-uploader and gang-sheet.css is not
 * loaded on them, so this file is self-contained: no design tokens, plain
 * brand teal (#066D7E, the same value the View Order card already uses).
 *
 * The lists are native <details>, so they open and close with no script
 * and stay usable if this file fails to load (the browser's own disclosure
 * triangle shows instead of the chevron and Show / Hide hint below).
 *
 * `:not(#lgsb-dl-x)` is a specificity lift, not a real exclusion: theme list
 * rules such as Divi's `#left-area ul { padding: 0 0 23px 1em }` carry an
 * ID, and the scroll box needs its own padding to keep bullets inside it.
 * No !important anywhere in this file.
 * ========================================================================= */

.lgsb-dl-group {
    display: block;
    margin: 4px 0;
}

/* --- Summary row ------------------------------------------------------- */

.lgsb-dl-group > .lgsb-dl-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 6px;
    margin: 0;
    padding: 4px 0;
    cursor: pointer;
    list-style: none;
    font-weight: 400;
    line-height: 1.4;
    color: inherit;
    -webkit-user-select: none;
    user-select: none;
}

.lgsb-dl-group > .lgsb-dl-summary::-webkit-details-marker {
    display: none;
}

/* Chevron: points right when closed, down when open. */
.lgsb-dl-group > .lgsb-dl-summary::before {
    content: "";
    flex: none;
    align-self: center;
    width: 0;
    height: 0;
    margin-right: 2px;
    border-style: solid;
    border-width: 5px 0 5px 7px;
    border-color: transparent transparent transparent #066D7E;
    transition: transform 0.15s ease;
}

.lgsb-dl-group[open] > .lgsb-dl-summary::before {
    transform: rotate(90deg);
}

/* Show / Hide hint — the labels arrive translated in data attributes. */
.lgsb-dl-group > .lgsb-dl-summary::after {
    content: attr(data-lgsb-show);
    margin-left: 4px;
    color: #066D7E;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: underline;
}

.lgsb-dl-group[open] > .lgsb-dl-summary::after {
    content: attr(data-lgsb-hide);
}

.lgsb-dl-group > .lgsb-dl-summary:hover .lgsb-dl-title {
    color: #066D7E;
}

.lgsb-dl-group > .lgsb-dl-summary:focus-visible {
    outline: 2px solid #066D7E;
    outline-offset: 2px;
    border-radius: 3px;
}

.lgsb-dl-summary .lgsb-dl-title {
    font-weight: 600;
}

.lgsb-dl-summary .lgsb-dl-meta {
    color: #555;
}

/* --- Expanded list ------------------------------------------------------
 * Capped and scrolled inside its own box so opening a 150-design order
 * does not push the totals / Place order button far down the page. */

.lgsb-dl-group > .lgsb-dl-body:not(#lgsb-dl-x) {
    max-height: 340px;
    margin: 2px 0 8px 3px;
    padding: 2px 10px 2px 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-left: 2px solid rgba(0, 0, 0, 0.12);
}

/* Bulleted lists (cart, checkout, thank-you): room for the markers, which
   an overflow box would otherwise clip. */
.lgsb-dl-group > ul.lgsb-dl-body:not(#lgsb-dl-x) {
    padding-left: 28px;
    list-style: disc outside;
}

.lgsb-dl-group > ul.lgsb-dl-body > li {
    margin: 0;
    padding: 1px 0;
}

/* A printed order page should show whatever the customer opened in full. */
@media print {
    .lgsb-dl-group > .lgsb-dl-body:not(#lgsb-dl-x) {
        max-height: none;
        overflow: visible;
    }

    .lgsb-dl-group > .lgsb-dl-summary::after {
        content: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lgsb-dl-group > .lgsb-dl-summary::before {
        transition: none;
    }
}
