/**
 * Presta Lab - collection variant swatches on the product miniature.
 *
 * Only the structural rules live here. Everything a shop owner is meant to change - size,
 * spacing, border width/colour/radius, alignment - comes from the widget's own CE style
 * controls, which generate their CSS into the per-miniature stylesheet.
 *
 * These class names are deliberately not CE's own .ce-product-variants*: CE 2.14 ships those
 * rules in views/css/widget-product-variants.css, enqueued only when CE's own variants widget
 * is on the page, so borrowing them would leave this widget unstyled on most listings.
 */

.pl-cv {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
    line-height: 1;
}

.pl-cv__item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: inherit;
    text-decoration: none;
}

.pl-cv__item:hover,
.pl-cv__item:focus {
    text-decoration: none;
}

.pl-cv__pattern {
    display: block;
    box-sizing: content-box;
    width: 32px;
    height: 32px;
    border: 1px solid #818a91;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

/*
 * The label is hidden by default, but in a way that keeps it available to screen readers.
 * This is defined here rather than relying on the theme's .screen-reader-text / .sr-only,
 * which not every PrestaShop theme provides - without it the name was drawn over the swatch.
 */
.pl-cv__label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* "Show label under swatch" switched on. */
.pl-cv--with-labels .pl-cv__label {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    max-width: 8em;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
}

.pl-cv__count {
    display: inline-block;
    align-self: center;
    white-space: nowrap;
}

/* The placeholder is only ever rendered inside the CE builder. */
.pl-cv--placeholder {
    opacity: .5;
}
