/* =========================================================
   HARD FORCED VARIATION CARD LAYOUT
   FINAL v12 + SALE FIRST + GAP + ACTIVE PRICE + STOCK LOGIC
   ========================================================= */


/* =========================================================
   GLOBAL RESET
   ========================================================= */
.woovr-variations,
.woovr-variations[class*="grid"],
.woovr-variations[class*="woovr-variations-grid"] {
    border: none !important;
    box-shadow: none !important;
    background: #fff7f7 !important;
}


/* =========================================================
   VARIATION CARD
   ========================================================= */
.woovr-variation {
    display: grid !important;
    grid-template-columns: 1fr 50px;
    grid-template-rows: auto auto auto;
    gap: 0 !important;
    border-radius: 10px;
    padding: 12px 12px 0 12px;

    /* ✅ UPDATED BORDER */
    border: 2px solid #3e06f2;

    background: #ffffff;
    cursor: pointer;
    position: relative;
    box-sizing: border-box;
}


/* =========================================================
   REMOVE DEFAULT ELEMENTS
   ========================================================= */
.woovr-variation:before,
.woovr-variation-image:before {
    display: none !important;
}

.woovr-variation-selector {
    display: none !important;
}

.woovr-variation-info {
    display: contents !important;
}

.woovr-variation-description,
.woovr-variation-availability {
    display: none !important;
}


/* =========================================================
   ROW 1: VARIATION NAME (DESKTOP)
   ========================================================= */
.woovr-variation-name,
.woovr-variation-name *,
.woovr-variation-name p,
.woovr-variation-name span {
    grid-column: 1 / -1;
    font-size: 20px !important;
    font-weight: 700;
    color: #000000;
    text-align: left;
    line-height: 1.2;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.woovr-variation-name {
    margin-bottom: 5px !important;
}


/* =========================================================
   ROW 2: IMAGE (RIGHT)
   ========================================================= */
.woovr-variation-image {
    grid-column: 2 / 3;
    grid-row: 2;
    width: 50px !important;
    height: 50px !important;
    justify-self: end;
    align-self: center;
    margin-right: -2px;
    margin-top: 4px;
}

.woovr-variation-image img {
    width: 40px !important;
    height: 40px !important;
    object-fit: contain;
    display: block;
}


/* =========================================================
   ROW 3: PRICE WRAPPER
   ========================================================= */
.woovr-variation-price {
    grid-column: 1 / -1;
    margin-top: 2px;
    margin-left: -10px;
    margin-right: -10px;
    margin-bottom: -10px;
    padding: 8px 10px;
    background: #f5f5f5;
    border-radius: 0 0 9px 9px;
    border-top: 1px solid;
    display: flex !important;
    align-items: center;
    gap: 8px;
}


/* =========================================================
   PRICE ORDER (SALE FIRST)
   ========================================================= */
.woovr-variation-price ins {
    order: 1 !important;
    text-decoration: none !important;
}

.woovr-variation-price del {
    order: 2 !important;
    opacity: 0.75;
}


/* PRICE COLORS — DEFAULT */
.woovr-variation-price ins .woocommerce-Price-amount,
.woovr-variation-price > .woocommerce-Price-amount {
    font-size: 18px !important;
    font-weight: 700;
    color: #000000;
}

.woovr-variation-price del .woocommerce-Price-amount {
    font-size: 15px !important;
    font-weight: 500;
    color: #444444;
}


/* =========================================================
   ACTIVE STATE (IN-STOCK ONLY)
   ========================================================= */
.woovr-variation.woovr-variation-active {
    border-color: #2563eb;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.woovr-variation.woovr-variation-active::after {
    content: "✓";
    position: absolute;
    top: 1px;
    right: 1px;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    background: #2563eb;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    border-radius: 50%;
    z-index: 5;
}


/* ACTIVE PRICE */
.woovr-variation.woovr-variation-active .woovr-variation-price {
    background: #2563eb !important;
}

.woovr-variation.woovr-variation-active .woovr-variation-price ins .woocommerce-Price-amount,
.woovr-variation.woovr-variation-active .woovr-variation-price del .woocommerce-Price-amount,
.woovr-variation.woovr-variation-active .woovr-variation-price > .woocommerce-Price-amount {
    color: #ffffff !important;
}


/* =========================================================
   🚫 STOCK OUT VARIATIONS (SHOW BUT DISABLE)
   ========================================================= */
.woovr-variation.outofstock,
.woovr-variation.out-of-stock,
.woovr-variation:has(.stock.out-of-stock) {
    opacity: 0.45;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.woovr-variation.outofstock::after,
.woovr-variation.out-of-stock::after {
    display: none !important;
}

.woovr-variation.outofstock .woovr-variation-price,
.woovr-variation.out-of-stock .woovr-variation-price {
    background: #e5e7eb !important;
}


/* =========================================================
   MOBILE ONLY (≤ 600px)
   ========================================================= */
@media (max-width: 600px) {

    .woovr-variation-name,
    .woovr-variation-name *,
    .woovr-variation-name p,
    .woovr-variation-name span {
        font-size: 18px !important;
        line-height: 1.25;
    }

    .woovr-variation-name {
        margin-bottom: 6px !important;
    }

    .woovr-variation-image {
        margin-top: 6px !important;
        margin-right: -8px !important;
    }

    .woovr-variation-price ins .woocommerce-Price-amount,
    .woovr-variation-price > .woocommerce-Price-amount {
        font-size: 16px !important;
    }

    .woovr-variation-price del .woocommerce-Price-amount {
        font-size: 14px !important;
    }

    .woovr-variation.woovr-variation-active::after {
        width: 18px;
        height: 18px;
        line-height: 18px;
        font-size: 12px;
        top: 6px;
        right: 6px;
    }
}
