/* ======================================================================
   Product variations picker — Cohort 4
   Design: #4 Soft Chips (from variation-designs-demo)
   Bootstrap-first: btn / badge / alert / d-flex / gap come from Bootstrap.
   Visual language: borderless light chips on tinted bg, friendly + modern.
   Active = solid ink fill with white text. Color = pill chip with mini
   swatch + name beside. Image = padded square with thumb that gains
   ink frame on active. OOS = .55 opacity + ghost strikethrough.
   ====================================================================== */

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

/* ---------- TEXT pill (default mode) — soft chip ---------- */
.product-variations-4-pill {
    cursor: pointer;
    user-select: none;
    background: var(--bs-secondary-bg);
    border: 0;
    border-radius: 8px;
    padding: 8px 16px;
    margin: 0;
    transition: background 0.15s ease, color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    font-size: 0.9375rem;
    color: var(--bs-body-color);
    line-height: 1.3;
    font-weight: 500;
}

.product-variations-4-pill:hover {
    background: var(--bs-tertiary-bg, #e9ecef);
}

.product-variations-4-pill.active {
    background: var(--bs-body-color);
    color: var(--bs-body-bg);
    font-weight: 600;
}

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

/* Soft Chips uses fill-inversion for active — hide check badge */
.product-variations-4-pill .product-variations-4-check {
    display: none !important;
}

/* Discount badge — floating chip on the chip */
.product-variations-4-pill .product-variations-4-discount {
    position: absolute !important;
    top: -6px !important;
    right: -4px !important;
    transform: none !important;
    background: var(--bs-danger) !important;
    color: var(--bs-body-bg) !important;
    border-radius: 999px;
    padding: 1px 7px !important;
    font-size: 0.625rem !important;
    line-height: 1.4;
    font-weight: 600;
    z-index: 2;
}

/* Meta block hidden */
.product-variations-4-pill .product-variations-4-meta {
    display: none;
}

/* ---------- COLOR mode — rounded chip with swatch + name beside ---------- */
.product-variations-4-pill-color {
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 6px 14px 6px 8px !important;
    border-radius: 999px !important;
    background: var(--bs-secondary-bg);
    font-size: 0.8125rem;
}

.product-variations-4-pill-color:hover {
    background: var(--bs-tertiary-bg, #e9ecef);
}

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

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

.product-variations-4-pill-color.active .product-variations-4-swatch {
    border-color: rgba(255, 255, 255, 0.5) !important;
}

/* Un-hide color name beside swatch */
.product-variations-4-pill-color .product-variations-4-pill-text {
    position: static !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: nowrap !important;
    border: 0 !important;
    font-size: 0.8125rem !important;
    color: var(--bs-body-color) !important;
    line-height: 1.2;
    font-weight: 500;
}

.product-variations-4-pill-color.active .product-variations-4-pill-text {
    color: var(--bs-body-bg) !important;
    font-weight: 600;
}

/* ---------- IMAGE mode — padded square with thumb, ink frame on active ---------- */
.product-variations-4-pill-image {
    padding: 5px !important;
    border-radius: 10px;
    background: var(--bs-secondary-bg);
    border: 0;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

.product-variations-4-pill-image:hover {
    background: var(--bs-tertiary-bg, #e9ecef);
}

.product-variations-4-pill-image .product-variations-4-thumb {
    width: 48px !important;
    height: 48px !important;
    object-fit: cover;
    border-radius: 6px;
    border: 0;
    margin: 0;
    display: block;
}

.product-variations-4-pill-image.active {
    background: var(--bs-body-color);
}

/* Image-mode text hidden (thumb-only chip) */
.product-variations-4-pill-image .product-variations-4-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 cohort-default column layouts */
.variation-layout-image .product-variations-4-pill {
    flex-direction: row;
    padding: 5px;
}

.variation-layout-image .product-variations-4-thumb {
    width: 48px;
    height: 48px;
    margin: 0;
    border-radius: 6px;
}

.variation-layout-color .product-variations-4-pill {
    flex-direction: row;
    padding: 6px 14px 6px 8px;
    gap: 8px;
}

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

.product-variations-4-pill-color.is-disabled,
.product-variations-4-pill-image.is-disabled {
    text-decoration: none;
}

.product-variations-4-pill-color.is-disabled .product-variations-4-pill-text {
    text-decoration: line-through;
}

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

.product-variations-4-pill.is-disabled:hover {
    background: var(--bs-secondary-bg) !important;
}

/* ---------- SELECT mode — soft chip dropdown ---------- */
.product-variations-4-select.form-select {
    max-width: 320px;
    border: 0;
    border-radius: 8px;
    padding: 9px 36px 9px 16px;
    font-size: 0.9375rem;
    line-height: 1.3;
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color);
    font-weight: 500;
    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 12px center;
    background-size: 12px 9px;
    cursor: pointer;
    transition: background 0.15s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.product-variations-4-select.form-select:hover {
    background-color: var(--bs-tertiary-bg, #e9ecef);
}

.product-variations-4-select.form-select:focus {
    background-color: var(--bs-tertiary-bg, #e9ecef);
    box-shadow: none;
    outline: 0;
}

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

/* ---------- Axis head ---------- */
.product-variations-4-axis-head .products-variations-label-text {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    color: var(--bs-body-color) !important;
}

.product-variations-4-axis-head .products-variations-count {
    font-size: 0.75rem !important;
    color: var(--bs-secondary-color) !important;
}

.product-variations-4-axis-selected.products-variations-axis-selected {
    font-size: 0.75rem !important;
    color: var(--bs-body-color) !important;
    font-weight: 600 !important;
}

/* ---------- BUNDLE pill (child-row variant) ---------- */
.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-4-visual {
    margin: 0;
}
