/* ======================================================================
   Product variations picker — Cohort 8
   Design: #8 Floating Tile (from variation-designs-demo)
   Bootstrap-first: btn / badge / alert / d-flex / gap come from Bootstrap.
   Visual language: borderless tiles, soft shadow elevation. Hover lifts
   the tile (-1px) with bigger shadow; active gains deepest shadow plus
   ink fill (text) or 2px ink ring (color/image). Premium / boutique vibe.
   ====================================================================== */

/* ---------- Grid spacing — needs room for shadows to breathe ---------- */
.product-variations-8 .products-variations-grid {
    gap: 12px;
    padding: 6px 2px;
}

/* ---------- TEXT pill (default mode) — floating tile ---------- */
.product-variations-8-pill {
    cursor: pointer;
    user-select: none;
    background: var(--bs-body-bg);
    border: 0;
    border-radius: 12px;
    padding: 10px 18px;
    margin: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.18s ease, transform 0.15s ease, 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-8-pill:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
}

.product-variations-8-pill.active {
    background: var(--bs-body-color);
    color: var(--bs-body-bg);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
    transform: translateY(-1px);
    font-weight: 600;
}

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

/* Floating Tile uses shadow + fill for active — hide check badge */
.product-variations-8-pill .product-variations-8-check {
    display: none !important;
}

/* Discount badge — floating chip on the tile */
.product-variations-8-pill .product-variations-8-discount {
    position: absolute !important;
    top: -8px !important;
    right: -4px !important;
    transform: none !important;
    background: var(--bs-danger) !important;
    color: var(--bs-body-bg) !important;
    border-radius: 999px;
    padding: 2px 8px !important;
    font-size: 0.625rem !important;
    line-height: 1.4;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
    z-index: 2;
}

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

/* ---------- COLOR mode — floating swatch tile with ring on active ---------- */
.product-variations-8-pill-color {
    padding: 0 !important;
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border: 0;
    border-radius: 12px !important;
    background: var(--bs-body-bg);
    overflow: hidden;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.product-variations-8-pill-color:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.product-variations-8-pill-color .product-variations-8-swatch {
    width: 100% !important;
    height: 100% !important;
    border-radius: 11px !important;
    border: 0 !important;
    box-shadow: none !important;
    display: block !important;
    flex-shrink: 0;
}

.product-variations-8-pill-color.active {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28), 0 0 0 2px var(--bs-body-color);
}

/* Color-mode label kept for screen readers only */
.product-variations-8-pill-color .product-variations-8-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 — floating thumb tile ---------- */
.product-variations-8-pill-image {
    padding: 0 !important;
    width: 60px;
    height: 60px;
    min-width: 60px;
    border: 0;
    border-radius: 12px;
    background: var(--bs-body-bg);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.product-variations-8-pill-image:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}

.product-variations-8-pill-image .product-variations-8-thumb {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    border-radius: 0;
    border: 0;
    margin: 0;
    display: block;
}

.product-variations-8-pill-image.active {
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22), 0 0 0 2px var(--bs-body-color);
}

/* Image-mode text label kept for screen readers only */
.product-variations-8-pill-image .product-variations-8-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-8-pill {
    flex-direction: row;
    align-items: center;
}

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

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

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

.product-variations-8-pill-color.is-disabled,
.product-variations-8-pill-image.is-disabled {
    text-decoration: none;
    opacity: 0.45;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transform: none;
}

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

.product-variations-8-pill.is-disabled:hover {
    transform: none !important;
    box-shadow: none !important;
    background: var(--bs-secondary-bg) !important;
}

/* ---------- SELECT mode — floating dropdown ---------- */
.product-variations-8-select.form-select {
    max-width: 320px;
    border: 0;
    border-radius: 12px;
    padding: 10px 36px 10px 16px;
    font-size: 0.9375rem;
    line-height: 1.3;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.04);
    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: box-shadow 0.18s ease, transform 0.15s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.product-variations-8-select.form-select:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
}

.product-variations-8-select.form-select:focus {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--bs-body-color);
    outline: 0;
}

.product-variations-8-select.form-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

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

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

.product-variations-8-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-8-visual {
    margin: 0;
}
