/*
 * "Goes well with": the accessory cards, the details dialog and the one
 * checkout offer. Loaded only on the pages that show them. Uses the tokens
 * from store.css.
 */

.xs { padding: var(--s7) 0 var(--s2); }
.xs h2 { margin-bottom: var(--s4); }

.xs-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--s5) var(--s4);
    margin: 0;
    padding: 0;
    list-style: none;
}

.xs-card { display: flex; flex-direction: column; gap: var(--s1); min-width: 0; }
.xs-card .card-pic { margin-bottom: var(--s2); }
.xs-card .card-title { color: var(--ink); text-decoration: none; }
.xs-card .card-title:hover { color: var(--oxblood); }

.xs-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s2) var(--s4);
    margin-top: var(--s2);
}
.xs-actions form { margin: 0; }

.xs-note { min-height: 20px; margin: 0; color: var(--ink-2); font-size: 14px; line-height: 20px; }
.xs-note.is-error { color: var(--oxblood); }

.xs-dialog {
    width: min(720px, calc(100vw - 2 * var(--gutter)));
    max-height: calc(100dvh - 2 * var(--gutter));
    padding: var(--s5);
    border: 1px solid var(--sand);
    border-radius: var(--radius);
    background: var(--cream);
    color: var(--ink);
}
.xs-dialog::backdrop { background: var(--veil); }
.xs-dialog > form { margin: 0 0 var(--s3); text-align: right; }
.xs-close { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }

.xs-details { display: grid; gap: var(--s5); }
.xs-gallery {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 70%;
    gap: var(--s2);
    margin: 0;
    padding: 0;
    overflow-x: auto;
    list-style: none;
    scroll-snap-type: x mandatory;
}
.xs-gallery li { scroll-snap-align: start; }
.xs-info > * { margin: 0 0 var(--s3); }
.xs-info h2:focus { outline: none; }
.xs-field { display: grid; gap: var(--s1); margin-bottom: var(--s3); }
.xs-info .button { margin-bottom: var(--s2); }

.child-kinds {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2);
    margin: 0 0 var(--s5);
    padding: 0;
    list-style: none;
}

/* The one offer on the checkout page: a compact row above the totals. */
.offer {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--s3);
    padding: var(--s3) 0;
    border-top: 1px solid var(--sand);
}
.offer .card-pic { width: 56px; }
.offer-name { margin: 0; font-weight: 600; }
.offer-text { margin: 0; color: var(--ink-2); }
.offer-remove { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }

@media (min-width: 700px) {
    .xs-row { grid-template-columns: repeat(3, minmax(0, 290px)); gap: var(--s5); }
    .xs-details { grid-template-columns: 280px minmax(0, 1fr); }
    .xs-gallery { grid-auto-columns: 100%; }
}
