/* ======================================================================
   Product variations picker — Cohort 1
   Design: #1 Classic Pill (from variation-designs-demo)
   Bootstrap-first: btn / badge / alert / d-flex / gap come from Bootstrap.
   Visual language: fully rounded pill (border-radius 999px), 1px neutral
   border, hover → ink border, active → ink fill + white text. Color =
   circular swatch with ring on active. Image = 48x48 square thumb with
   ring on active. OOS = .5 opacity + horizontal strikethrough.
   ====================================================================== */

/* ---------- Grid spacing ---------- */
.product-variations-1 .products-variations-grid {
    gap: 10px;
}

/* ---------- TEXT pill (default mode) ---------- */
.product-variations-1-pill {
    cursor: pointer;
    user-select: none;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 999px;
    padding: 9px 18px;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    margin: 0;
    font-size: 0.875rem;
    color: var(--bs-body-color);
    line-height: 1.3;
}

.product-variations-1-pill:hover {
    border-color: var(--bs-body-color);
}

.product-variations-1-pill.active {
    background: var(--bs-body-color);
    color: var(--bs-body-bg);
    border-color: var(--bs-body-color);
}

.product-variations-1-pill.active .product-variations-1-name,
.product-variations-1-pill.active .product-variations-1-pill-text {
    color: var(--bs-body-bg);
}

/* Classic Pill uses inverted fill to signal selection — hide the check badge */
.product-variations-1-pill .product-variations-1-check {
    display: none !important;
}

/* Discount badge — small floating pill, top-right */
.product-variations-1-pill .product-variations-1-discount {
    position: absolute !important;
    top: -6px !important;
    right: 10px !important;
    transform: none !important;
    background: var(--bs-danger) !important;
    color: var(--bs-body-bg) !important;
    border-radius: 999px;
    padding: 1px 8px !important;
    font-size: 0.62rem !important;
    line-height: 1.4;
    letter-spacing: 0.02em;
    z-index: 2;
}

/* Meta block — Classic Pill stays minimal, hide name/price inside the pill */
.product-variations-1-pill .product-variations-1-meta {
    display: none;
}

/* ---------- COLOR mode — circular swatch with ring on active ---------- */
.product-variations-1-pill-color {
    padding: 4px !important;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border: 1.5px solid var(--bs-border-color);
    outline: 0;
    border-radius: 999px !important;
    background: var(--bs-body-bg);
    overflow: visible;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.product-variations-1-pill-color:hover {
    border-color: var(--bs-body-color);
}

.product-variations-1-pill-color .product-variations-1-swatch {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px;
    min-height: 26px;
    border-radius: 999px !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: none !important;
    display: block !important;
    flex-shrink: 0;
}

.product-variations-1-pill-color.active {
    border-color: var(--bs-body-color);
    box-shadow: 0 0 0 2px var(--bs-body-bg), 0 0 0 3.5px var(--bs-body-color);
}

/* Color-mode label kept for screen readers only */
.product-variations-1-pill-color .product-variations-1-pill-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- IMAGE mode — 48x48 square thumb with ring on active ---------- */
.product-variations-1-pill-image {
    padding: 0 !important;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: var(--bs-body-bg);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-variations-1-pill-image:hover {
    border-color: var(--bs-body-color);
}

.product-variations-1-pill-image .product-variations-1-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    border: 0;
    margin: 0;
}

.product-variations-1-pill-image.active {
    border-color: var(--bs-body-color);
    outline: 2px solid var(--bs-body-color);
    outline-offset: 2px;
    background: var(--bs-body-bg);
}

/* Image-mode text label kept for screen readers only */
.product-variations-1-pill-image .product-variations-1-pill-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Reset column-layout overrides from cohort default so thumb fills pill */
.variation-layout-image .product-variations-1-pill {
    flex-direction: row;
    align-items: center;
    text-align: left;
}

.variation-layout-image .product-variations-1-thumb {
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0;
    border: 0;
}

.variation-layout-color .product-variations-1-pill {
    flex-direction: row;
    padding-top: 0;
    gap: 0;
}

/* ---------- DISABLED (out-of-stock / cross-axis impossible) ---------- */
.product-variations-1-pill.is-disabled,
.ic-single-row.is-disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none;
    color: var(--bs-secondary-color);
    background: var(--bs-body-bg);
    border-color: var(--bs-border-color);
    position: relative;
}

.product-variations-1-pill.is-disabled::after,
.ic-single-row.is-disabled::after {
    content: "";
    position: absolute;
    inset: 50% 14px auto 14px;
    height: 1px;
    background: var(--bs-secondary-color);
    transform: translateY(-50%);
    pointer-events: none;
}

.product-variations-1-pill-color.is-disabled::after {
    inset: 50% 4px auto 4px;
}

.product-variations-1-pill-image.is-disabled::after {
    inset: 50% 6px auto 6px;
}

.product-variations-1-pill.is-disabled:hover {
    border-color: var(--bs-border-color) !important;
    background: var(--bs-body-bg) !important;
    transform: none !important;
}

/* Active + disabled (rare combo) — keep inverted look readable */
.product-variations-1-pill.active.is-disabled {
    background: var(--bs-body-bg);
    color: var(--bs-secondary-color);
}

/* ---------- SELECT mode (8+ values) — pill-shaped to match design ---------- */
.product-variations-1-select.form-select {
    max-width: 320px;
    border: 1px solid var(--bs-border-color);
    border-radius: 999px;
    padding: 9px 40px 9px 18px;
    font-size: 0.875rem;
    line-height: 1.3;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23111418' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 9px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.product-variations-1-select.form-select:hover {
    border-color: var(--bs-body-color);
}

.product-variations-1-select.form-select:focus {
    border-color: var(--bs-body-color);
    box-shadow: 0 0 0 0.15rem rgba(0, 0, 0, 0.08);
    outline: 0;
}

.product-variations-1-select.form-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---------- BUNDLE pill (child-row variant, smaller) ---------- */
.bundle-pill.btn.btn-outline-secondary.active,
.bundle-pill.btn.btn-outline-secondary:has(.bundle-pill-input:checked) {
    background: var(--bs-body-color);
    border-color: var(--bs-body-color);
    color: var(--bs-body-bg);
}

/* Legacy alias kept for older partials still on disk */
.product-variations-1-visual {
    margin: 0;
}
