/* An upsell's options (comps/upsells, P3 of task dev/tasks/whole_plugin/upsell-follow-up-05-11-2026.md): what every type
   that shows options needs whatever its design — the cards, ticks (the product page's tick boxes too) and
   Bought together looks and Thank-you all print them through look/parts/option_pickers.php, in `.cl-upsell-options`. Loaded with those looks
   (UpsellsControllerFR_cl::lookFiles()). The look's own rules (the dropdown, a missing option's message and frame) are
   the design's compiled CSS. */

/* Options shown in a pop-up (look_variations_display = popup): not on the card; the options pop-up's copy
   (variations_all_pages.js showMissingOptions(), `.cl-vr-picker`) shows them. !important: a card design on the holder
   (the thank-you's) may set its own display. */
.cl-upsell-options.cl-upsell-options-in-popup:not(.cl-vr-picker) {
    display: none !important;
}
/* The product's name, at the top of the pop-up's copy only: a Bought together box and tick lines hold several products. */
.cl-upsell-options-product {
    display: none;
}
.cl-vr-picker .cl-upsell-options-product {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}
/* A dropdown's options, which a pick clicks (handleSelectSelection) and the add reads: never shown. */
.cl-upsell-options .cl-upsell-options-list {
    display: none !important;
}

/* Each option by its type: the listing card's pickers (plist1/.../product_card/v1/variations/*.php). plist1.css styles
   them under .plist1 only, so their structure is repeated here: a wrapping row, the colour dot (its colour is the
   variable the view prints), the photo thumbnail, the picked ring. Each option's frame is its design preset
   (look_variations_*_preset). In upsells_thankyou.css under the thank-you card until 05-11-2026 (G102). */
.cl-upsell-options .cl-vr-parent ul.cl-vr-elements {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.cl-upsell-options .cl-vr-parent ul.cl-vr-elements li {
    cursor: pointer;
    user-select: none;
}
.cl-upsell-options .cl-vr-buttons ul li {
    display: inline-flex;
    align-items: center;
}
/* position: relative: the sold-out line below is drawn across the option. */
.cl-upsell-options .cl-vr-colorbox ul li,
.cl-upsell-options .cl-vr-images ul li {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.cl-upsell-options .cl-vr-colorbox ul li span:nth-child(1) {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    background-color: var(--cl-vr-swatch-color);
}
.cl-upsell-options .cl-vr-colorbox ul li.vr-is-selected span:nth-child(1) {
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--cl-border-color2);
}
.cl-upsell-options .cl-vr-images ul li img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
}
.cl-upsell-options .cl-vr-images ul li.vr-is-selected img {
    box-shadow: 0 0 0 2px var(--cl-border-color2);
}

/* A sold-out option: the product page's mark (product.css, G103), which this mirrors — variations_all_pages.js puts
   vr-is-soldout on every option whose combination is sold out, given the other groups' picks; it stays pickable.
   look_soldout_option_display (`vr-soldout-{cross,dim,none}` on the holder) draws it as Shopify Dawn does: a colour or a
   photo at 40 % with a line across the option, a text button at 60 % and struck through. Only a swatch's fill dims, so a
   picked one keeps its full picked frame. In a dropdown, the option's name takes the sold-out text instead. */
.cl-upsell-options.vr-soldout-cross .cl-vr-colorbox ul li.vr-is-soldout span:nth-child(1),
.cl-upsell-options.vr-soldout-dim .cl-vr-colorbox ul li.vr-is-soldout span:nth-child(1),
.cl-upsell-options.vr-soldout-cross .cl-vr-images ul li.vr-is-soldout img,
.cl-upsell-options.vr-soldout-dim .cl-vr-images ul li.vr-is-soldout img {
    opacity: 0.4;
}
.cl-upsell-options.vr-soldout-cross .cl-vr-buttons ul li.vr-is-soldout,
.cl-upsell-options.vr-soldout-dim .cl-vr-buttons ul li.vr-is-soldout {
    opacity: 0.6;
}
/* !important: an option design with "Force styles" on compiles `text-decoration: none !important` (product.css). */
.cl-upsell-options.vr-soldout-cross .cl-vr-buttons ul li.vr-is-soldout {
    text-decoration: line-through !important;
}
/* The line, from the option's bottom-left corner to its top-right, in its text colour with a white edge so it shows on
   a dark colour too. */
.cl-upsell-options.vr-soldout-cross .cl-vr-colorbox ul li.vr-is-soldout::after,
.cl-upsell-options.vr-soldout-cross .cl-vr-images ul li.vr-is-soldout::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        linear-gradient(to top left, transparent calc(50% - 1px), currentColor calc(50% - 1px), currentColor calc(50% + 1px), transparent calc(50% + 1px)),
        linear-gradient(to top left, transparent calc(50% - 2.5px), rgba(255, 255, 255, 0.85) calc(50% - 2.5px), rgba(255, 255, 255, 0.85) calc(50% + 2.5px), transparent calc(50% + 2.5px));
}
