/* ======================================================================
   Product variations picker — Cohort 2
   Design: #2 Underline Tabs (from variation-designs-demo)
   Bootstrap-first: btn / badge / alert / d-flex / gap come from Bootstrap.
   Visual language: borderless text-mode with 2px ink underline on active.
   Editorial / magazine-style — minimal chrome, type-driven hierarchy.
   Color = small circle with underline indicator. Image = small thumb with
   bottom shadow on active. OOS = .45 opacity + strikethrough.
   ====================================================================== */

/* ---------- Grid spacing — wider gap to breathe between tab items ---------- */
.product-variations-2 .products-variations-grid {
    gap: 22px;
}

/* ---------- TEXT pill (default mode) — borderless tab with underline ---------- */
.product-variations-2-pill {
    cursor: pointer;
    user-select: none;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 6px 0;
    margin: 0;
    transition: color 0.15s ease, border-color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    font-size: 0.9375rem;
    color: var(--bs-secondary-color);
    line-height: 1.4;
    letter-spacing: 0.01em;
}

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

.product-variations-2-pill.active {
    color: var(--bs-body-color);
    border-bottom-color: var(--bs-body-color);
    font-weight: 600;
}

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

/* Underline cohort doesn't use the check badge — indicator IS the underline */
.product-variations-2-pill .product-variations-2-check {
    display: none !important;
}

/* Discount badge — small inline text indicator after the value name */
.product-variations-2-pill .product-variations-2-discount {
    position: static !important;
    transform: none !important;
    background: transparent !important;
    color: var(--bs-danger) !important;
    border-radius: 0;
    padding: 0 !important;
    font-size: 0.6875rem !important;
    line-height: 1;
    letter-spacing: 0.02em;
    margin-left: 4px;
    font-weight: 600;
}

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

/* ---------- COLOR mode — small circular swatch with underline indicator ---------- */
.product-variations-2-pill-color {
    padding: 6px 0 !important;
    border-bottom: 2px solid transparent;
    width: auto;
    min-width: 0;
    background: transparent;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

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

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

.product-variations-2-pill-color.active {
    border-bottom-color: var(--bs-body-color);
}

.product-variations-2-pill-color.active .product-variations-2-swatch {
    border-color: var(--bs-body-color) !important;
    box-shadow: 0 0 0 1.5px var(--bs-body-bg), 0 0 0 2.5px var(--bs-body-color) !important;
}

/* Color-mode label kept for screen readers only */
.product-variations-2-pill-color .product-variations-2-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 — small thumb with bottom-border indicator ---------- */
.product-variations-2-pill-image {
    padding: 0 0 4px !important;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    width: 50px;
    height: 40px;
    min-width: 50px;
    background: transparent;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    overflow: visible;
    position: relative;
}

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

.product-variations-2-pill-image .product-variations-2-thumb {
    width: 50px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    border: 0;
    margin: 0;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.product-variations-2-pill-image:hover .product-variations-2-thumb {
    opacity: 1;
}

.product-variations-2-pill-image.active {
    border-bottom-color: var(--bs-body-color);
}

.product-variations-2-pill-image.active .product-variations-2-thumb {
    opacity: 1;
}

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

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

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

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

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

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

.product-variations-2-pill.is-disabled:hover {
    color: var(--bs-secondary-color) !important;
    border-bottom-color: transparent !important;
}

/* ---------- SELECT mode — underline-only dropdown ---------- */
.product-variations-2-select.form-select {
    max-width: 320px;
    border: 0;
    border-bottom: 2px solid var(--bs-border-color);
    border-radius: 0;
    padding: 6px 28px 6px 0;
    font-size: 0.9375rem;
    line-height: 1.4;
    font-weight: 600;
    background-color: transparent;
    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 4px center;
    background-size: 12px 9px;
    cursor: pointer;
    transition: border-color 0.15s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

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

.product-variations-2-select.form-select:focus {
    border-bottom-color: var(--bs-body-color);
    box-shadow: none;
    outline: 0;
}

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

/* ---------- Axis head — minimal uppercase label ---------- */
.product-variations-2-axis-head .products-variations-label-text {
    font-size: 0.6875rem !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600 !important;
    color: var(--bs-secondary-color) !important;
}

.product-variations-2-axis-head .products-variations-count {
    font-size: 0.6875rem !important;
    letter-spacing: 0.04em;
    color: var(--bs-secondary-color) !important;
}

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