/* ==========================================================================
   Variant Selector - pills, two-line pills, set cards, picture cards
   Figma: Product page > Variant Pill (2455:16021), Variant Pill Detail
   (2455:16193), Set Option (2455:16043), Variant Label (2446:1207),
   "Variant Selector (role=radiogroup)" (2455:15839) and the dev notes.
   ========================================================================== */

.osiris-variant-selector {
    --ovs-black: #000;
    --ovs-red: #DC0039;
    --ovs-border: #949494;
    --ovs-hover-bg: #F3F3F3;
    --ovs-muted: #737373;
    --ovs-muted-inverse: #C7C7C7;
    --ovs-oos-bg: #F6F6F6;
    --ovs-oos-border: #E0E0E0;
    --ovs-oos-text: #9E9E9E;
    --ovs-amber: #F2990D;
    --ovs-saving-inverse: #FF8CA6;
    --ovs-font: var(--theme-font-family-body, "Inter"), sans-serif;
    --ovs-cols: 5;

    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
    font-family: var(--ovs-font);
}

.osiris-variant-selector .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.ovs-attribute,
.ovs-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ovs-attribute--grouped .ovs-radiogroup {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ---------- Label row: WEIGHT: 16kg ---------- */

.ovs-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.ovs-label {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 14px;
    line-height: 1;
    letter-spacing: -0.14px;
    color: var(--ovs-black);
}

.ovs-label__attr {
    font-weight: 700;
    text-transform: uppercase;
}

.ovs-label__value {
    font-weight: 500;
}

.ovs-group__heading {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: -0.28px;
    color: var(--ovs-black);
}

/* ---------- Grid ---------- */

.ovs-grid {
    display: grid;
    grid-template-columns: repeat(var(--ovs-cols), minmax(0, 1fr));
    gap: 8px;
}

.ovs-grid--short    { --ovs-cols: 4; }
.ovs-grid--six      { --ovs-cols: 6; }
.ovs-grid--ranges   { --ovs-cols: 2; }
.ovs-grid--sets     { --ovs-cols: 2; }
.ovs-grid--pictures { --ovs-cols: 4; }

@media (max-width: 767px) {
    .ovs-grid           { --ovs-cols: 4; }
    .ovs-grid--detail   { --ovs-cols: 3; }
    .ovs-grid--ranges   { --ovs-cols: 2; }
    .ovs-grid--sets     { --ovs-cols: 1; }
    .ovs-grid--pictures { --ovs-cols: 2; }
}

.osiris-variant-selector .ovs-option[hidden] {
    display: none !important;
}

/* ---------- Shared option states ---------- */

.osiris-variant-selector .ovs-option {
    position: relative;
    margin: 0;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--ovs-border);
    color: var(--ovs-black);
    font-family: var(--ovs-font);
    text-transform: none; /* never uppercase option labels */
    cursor: pointer;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 140ms ease, border-color 140ms ease;
}

@media (hover: hover) {
    .osiris-variant-selector .ovs-option:not([aria-disabled="true"]):not([aria-checked="true"]):hover {
        background: var(--ovs-hover-bg);
        border-color: var(--ovs-black);
        color: var(--ovs-black);
    }
}

.osiris-variant-selector .ovs-option[aria-checked="true"] {
    background: var(--ovs-black);
    border-color: var(--ovs-black);
    color: #fff;
}

/* Keyboard only: 2px white gap + 2px red ring, outside the fill */
.osiris-variant-selector .ovs-option:focus {
    outline: none;
}

/* [role][tabindex] lifts this above Hello Elementor's reset.css
   [tabindex]:not([tabindex="-1"]):not([contenteditable]):focus-visible */
.osiris-variant-selector .ovs-option[role="radio"][tabindex]:focus-visible {
    outline: none;
    outline-offset: 0;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ovs-red);
}

/* Out of stock: visible and struck through. Still selectable - picking it
   swaps the buttons for the restock panel. */
.osiris-variant-selector .ovs-option.is-oos {
    background: var(--ovs-oos-bg);
    border-color: var(--ovs-oos-border);
    color: var(--ovs-oos-text);
    cursor: pointer;
}

.osiris-variant-selector .ovs-option.is-oos[aria-checked="true"] {
    border-color: #000;
    box-shadow: inset 0 0 0 1px #000;
}

.ovs-option.is-oos .ovs-pill__label,
.ovs-option.is-oos .ovs-set__title,
.ovs-option.is-oos .ovs-picture__name {
    text-decoration: line-through;
}

/* Unavailable with the other choices: dashed border, no strikethrough */
.osiris-variant-selector .ovs-option.is-unavailable {
    background: #fff;
    border-style: dashed;
    border-color: var(--ovs-border);
    color: var(--ovs-oos-text);
    cursor: not-allowed;
}

/* Low stock: 6px amber dot before the label, still selectable */
.ovs-dot {
    display: none;
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ovs-amber);
}

.ovs-option.is-low:not(.is-oos) .ovs-dot,
.ovs-legend .ovs-dot {
    display: inline-block;
}

/* ---------- Variant Pill ---------- */

.osiris-variant-selector .ovs-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 48px;
    padding: 0 8px;
    border-radius: 999px;
}

.ovs-pill__main {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
}

.ovs-pill__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.16px;
}

/* Two-line pill: value + detail (e.g. 22mm / Level 2, 3" / 7.5cm) */
.osiris-variant-selector .ovs-pill--detail {
    height: auto;
    min-height: 56px;
    padding: 10px 8px;
    border-radius: 16px;
}

.ovs-pill__detail {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--ovs-muted);
}

.ovs-option[aria-checked="true"] .ovs-pill__detail {
    color: var(--ovs-muted-inverse);
}

.ovs-option.is-oos .ovs-pill__detail,
.ovs-option.is-unavailable .ovs-pill__detail {
    color: var(--ovs-oos-text);
}

/* ---------- Set Option card ---------- */

.osiris-variant-selector .ovs-set {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 16px 20px;
    border-radius: 16px;
    text-align: left;
}

.ovs-set__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.ovs-set__title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.16px;
}

.ovs-set__tag {
    flex-shrink: 0;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--ovs-red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.22px;
    text-transform: uppercase;
}

.ovs-option.is-oos .ovs-set__tag {
    background: var(--ovs-oos-border);
}

.ovs-set__contents {
    display: block;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: -0.13px;
    color: var(--ovs-muted);
}

.ovs-set__price-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    line-height: 1.3;
}

.ovs-set__price {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.15px;
}

.ovs-set__price .woocommerce-Price-amount,
.ovs-set__saving .woocommerce-Price-amount {
    color: inherit;
    font: inherit;
}

.ovs-set__saving {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.13px;
    color: var(--ovs-red);
}

.ovs-option[aria-checked="true"] .ovs-set__contents { color: var(--ovs-muted-inverse); }
.ovs-option[aria-checked="true"] .ovs-set__saving   { color: var(--ovs-saving-inverse); }
.ovs-option.is-oos .ovs-set__contents,
.ovs-option.is-oos .ovs-set__saving { color: var(--ovs-oos-text); }

/* ---------- Picture card (shapes, e.g. flooring configuration) ---------- */

.osiris-variant-selector .ovs-picture {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: 16px;
}

.osiris-variant-selector .ovs-picture[aria-checked="true"] {
    /* Selected = 2px black border + check badge, not a black fill */
    background: #fff;
    color: var(--ovs-black);
    box-shadow: inset 0 0 0 1px var(--ovs-black);
}

.osiris-variant-selector .ovs-picture[aria-checked="true"][role="radio"][tabindex]:focus-visible {
    box-shadow: inset 0 0 0 1px var(--ovs-black), 0 0 0 2px #fff, 0 0 0 4px var(--ovs-red);
}

.ovs-picture__image {
    display: block;
    width: 100%;
    aspect-ratio: 1;
}

.ovs-picture__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ovs-picture__name {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
}

.ovs-picture__check {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--ovs-black);
}

.ovs-picture__check::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 4px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.ovs-picture[aria-checked="true"] .ovs-picture__check {
    display: block;
}

/* Drawn piece diagrams when no picture is uploaded (Figma 2455:31639 etc.) */
.ovs-diagram {
    position: relative;
    display: block;
    width: 56px;
    height: 56px;
}

.ovs-diagram span,
.ovs-diagram::before,
.ovs-diagram::after {
    content: "";
    position: absolute;
    display: block;
}

.ovs-diagram span {
    left: 6px;
    top: 6px;
    width: 44px;
    height: 44px;
    border-radius: 2px;
    background: #262626;
}

.ovs-diagram--edge::after,
.ovs-diagram--corner::after {
    left: 6px;
    top: 42px;
    width: 44px;
    height: 8px;
    background: #8C8C8C;
}

.ovs-diagram--corner::before {
    z-index: 1;
    left: 42px;
    top: 6px;
    width: 8px;
    height: 44px;
    background: #8C8C8C;
}

.ovs-diagram--internal::after {
    left: 42px;
    top: 42px;
    width: 8px;
    height: 8px;
    background: #8C8C8C;
}

.ovs-option.is-oos .ovs-diagram,
.ovs-option.is-unavailable .ovs-diagram {
    opacity: 0.35;
}

.osiris-variant-selector .ovs-picture:has(.ovs-diagram) {
    gap: 10px;
    padding: 16px 6px 14px;
}

/* ---------- Show all ---------- */

.osiris-variant-selector .ovs-show-all {
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid var(--ovs-black);
    border-radius: 999px;
    background: #fff;
    color: var(--ovs-black);
    font-family: var(--ovs-font);
    font-size: 14px;
    font-weight: 700;
    text-transform: none;
    cursor: pointer;
    transition: background-color 140ms ease;
}

.osiris-variant-selector .ovs-show-all[hidden] {
    display: none;
}

@media (hover: hover) {
    .osiris-variant-selector .ovs-show-all:hover {
        background: var(--ovs-hover-bg);
        color: var(--ovs-black);
    }
}

.osiris-variant-selector .ovs-show-all:focus-visible,
.osiris-variant-selector .ovs-guide__link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ovs-red);
}

/* ---------- Helper row: guide link + legend ---------- */

.ovs-helper-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    line-height: 1.4;
    letter-spacing: -0.13px;
    color: var(--ovs-muted);
}

.ovs-helper-row:empty,
.ovs-helper-row:not(:has(> :not([hidden]))) {
    display: none;
}

.ovs-guide,
.ovs-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

.ovs-legend {
    gap: 6px;
    margin-left: auto;
}

.ovs-legend[hidden] {
    display: none;
}

.osiris-variant-selector .ovs-guide__link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ovs-black);
    font: inherit;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-transform: none;
    cursor: pointer;
}

.ovs-label-row .ovs-guide__link {
    font-size: 13px;
}

.ovs-unavailable-note,
.ovs-note {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--ovs-muted);
}

.ovs-unavailable-note[hidden] {
    display: none;
}

/* ---------- Guide panel ---------- */

.ovs-guide-dialog {
    width: min(640px, calc(100vw - 32px));
    max-height: calc(100vh - 64px);
    padding: 24px;
    border: 0;
    border-radius: 16px;
    font-family: var(--ovs-font);
}

.ovs-guide-dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

.ovs-guide-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.ovs-guide-dialog__title {
    font-family: var(--theme-font-family, "Ebony"), sans-serif;
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
}

.osiris-variant-selector .ovs-guide-dialog__close {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--ovs-black);
    border-radius: 50%;
    background: #fff;
    color: var(--ovs-black);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.ovs-guide-dialog__body img {
    max-width: 100%;
    height: auto;
}

.ovs-guide-dialog__more {
    display: inline-block;
    margin-top: 16px;
    color: var(--ovs-black);
    font-weight: 500;
    text-decoration: underline;
}

/* ---------- Price suffix: "£37.54 for 4kg" ---------- */

/* dynamic-shop.css styles every .product-price as a card column; keep the
   buy box price, was-price and suffix on one line. */
.osiris-single-product .product-details .product-price {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 8px;
}

.osiris-single-product .price-suffix {
    margin-left: 0;
    font-family: var(--ovs-font, "Inter"), sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: #737373;
}

.osiris-single-product .price-suffix[hidden] {
    display: none;
}

/* ---------- Restocking panel (render_notify) ---------- */

/* An out of stock option is picked: the panel replaces quantity + buttons */
.ovs-is-restocking .quantity-selector,
.ovs-is-restocking .action-buttons,
.ovs-is-restocking .osiris-area-calc,
.ovs-is-restocking .ofp-buy-notes {
    display: none !important;
}

.ovs-restock {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    margin-bottom: 24px;
    padding: 24px;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    background: #F8F8F8;
    font-family: var(--theme-font-family-body, "Inter"), sans-serif;
}

.ovs-restock[hidden] {
    display: none;
}

.ovs-restock .ovs-restock__badge {
    margin: 0 0 4px;
    padding: 6px 16px;
    border-radius: 4px;
    background: #CE0037;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
}

.ovs-restock .ovs-restock__title {
    margin: 0;
    font-family: var(--theme-font-family, "Ebony"), sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    color: #23282D;
}

.ovs-restock .ovs-restock__text {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #666;
}

.ovs-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.ovs-restock .ovs-notify {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin: 4px 0 0;
}

.ovs-notify__row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.ovs-restock .ovs-notify__input {
    flex: 1 1 auto;
    min-width: 0;
    height: 48px !important;
    margin: 0;
    padding: 0 20px !important;
    border: 1px solid #949494 !important;
    border-radius: 999px !important;
    background: #fff !important;
    box-shadow: none;
    font: inherit;
    font-size: 16px;
    color: #000;
}

.ovs-restock .ovs-notify__input::placeholder {
    color: #737373;
}

.ovs-restock .ovs-notify__input:focus-visible {
    outline: none;
    border-color: #000 !important;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #DC0039;
}

.ovs-restock .ovs-notify__input[aria-invalid="true"] {
    border-color: #DC0039 !important;
}

.ovs-restock .ovs-notify .ovs-notify__submit,
.ovs-restock .ovs-notify .ovs-notify__submit:focus {
    flex: none;
    min-height: 48px;
    padding: 0 28px;
    border: 0;
    border-radius: 999px;
    background: #DC0039;
    color: #fff;
    font-family: var(--theme-font-family, "Ebony"), sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    cursor: pointer;
}

.ovs-restock .ovs-notify .ovs-notify__submit:hover {
    background: #B8002F;
}

.ovs-restock .ovs-notify .ovs-notify__submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #DC0039;
}

.ovs-restock .ovs-notify .ovs-notify__submit:disabled {
    opacity: 0.6;
    cursor: wait;
}

.ovs-restock .ovs-notify__status {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: #23282D;
}

.ovs-restock .ovs-notify__status:empty {
    display: none;
}

.ovs-restock .ovs-restock__contact {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.4;
    color: #23282D;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ovs-restock .ovs-restock__contact svg {
    flex: none;
    margin-top: 2px;
}

.ovs-restock .ovs-restock__contact:hover {
    color: #CE0037;
}

@media (max-width: 480px) {
    .ovs-notify__row {
        flex-direction: column;
    }

    .ovs-restock .ovs-notify .ovs-notify__submit {
        width: 100%;
    }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .osiris-variant-selector .ovs-option,
    .osiris-variant-selector .ovs-show-all {
        transition: none;
    }
}

/* ---------- Range dropdown (Figma Pattern 2: 2455:29983 closed, 2455:27161 open) ---------- */

.ovs-range {
    position: relative;
    margin-bottom: 16px;
}

.osiris-variant-selector .ovs-range__button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 47px;
    margin: 0;
    padding: 12px 16px;
    border: 1px solid var(--ovs-border);
    border-radius: 12px;
    background: #fff;
    color: var(--ovs-black);
    font-family: var(--ovs-font);
    text-align: left;
    text-transform: none;
    cursor: pointer;
    transition: border-color 140ms ease;
}

/* The theme paints buttons pink on hover / focus; this one stays white */
.osiris-variant-selector .ovs-range__button:hover,
.osiris-variant-selector .ovs-range__button:focus,
.osiris-variant-selector .ovs-range__button:active {
    background: #fff;
    color: var(--ovs-black);
    box-shadow: none;
}

@media (hover: hover) {
    .osiris-variant-selector .ovs-range__button:hover {
        border-color: var(--ovs-black);
    }
}

.osiris-variant-selector .ovs-range__button:focus-visible {
    outline: 2px solid var(--ovs-red);
    outline-offset: 2px;
}

.ovs-range__value {
    display: flex;
    align-items: baseline;
    gap: 6px;
    line-height: 1.4;
}

.ovs-range__label {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: -0.13px;
    color: var(--ovs-muted);
}

.ovs-range__current {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.15px;
    white-space: pre;
}

.ovs-range__chevron {
    flex: none;
    transition: transform 140ms ease;
}

.ovs-range__button[aria-expanded="true"] .ovs-range__chevron {
    transform: rotate(180deg);
}

.ovs-range__list {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 320px;
    margin: 0;
    padding: 6px 0;
    overflow-y: auto;
    list-style: none;
    border: 1px solid var(--ovs-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.12);
    font-family: var(--ovs-font);
}

.ovs-range__list[hidden] {
    display: none;
}

.ovs-range__list:focus {
    outline: none;
}

.ovs-range__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 12px 16px;
    line-height: 1.4;
    cursor: pointer;
}

.ovs-range__option.is-focused {
    background: #F6F6F6;
}

.ovs-range__list:focus .ovs-range__option.is-focused {
    box-shadow: inset 2px 0 0 var(--ovs-red);
}

.ovs-range__name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.15px;
    color: var(--ovs-black);
}

.ovs-range__option[aria-selected="true"] .ovs-range__name {
    font-weight: 700;
}

.ovs-range__check {
    display: none;
}

.ovs-range__option[aria-selected="true"] .ovs-range__check {
    display: block;
}

.ovs-range__count {
    font-size: 13px;
    letter-spacing: -0.13px;
    color: var(--ovs-muted);
    white-space: nowrap;
}

.osiris-variant-selector .ovs-option.is-out-of-range {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .osiris-variant-selector .ovs-range__button,
    .ovs-range__chevron {
        transition: none;
    }
}
