/* =====================================================
   CBF Variation Grid — Styles v2.0
   CleanBabyFormula.com
   Brand: #97aa82 (sage green) · #f8f8f8 · #000 · #fff
   ===================================================== */

/* ---------------------------------------------------------
   1. HIDE ORIGINAL SELECT
   --------------------------------------------------------- */

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

/* Hide the default QUANTITY label row styling —
   let the grid speak for itself */
.variations .label {
    padding-bottom: 4px;
}

.variations .label label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #888;
}

/* ---------------------------------------------------------
   2. GRID CONTAINER
   --------------------------------------------------------- */

.cbf-variation-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin: 16px 0 12px;
    width: 100%;
    box-sizing: border-box;
}

/* ---------------------------------------------------------
   3. CARD — Base
   --------------------------------------------------------- */

.cbf-vg-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 10px 20px;
    border: 1.5px solid #e4e4e4;
    border-radius: 14px;
    background: #ffffff;
    cursor: pointer;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}

/* --- Hover --- */
.cbf-vg-card:hover {
    border-color: #b5c5a3;
    background: #fbfdf9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(151, 170, 130, 0.12),
                0 2px 6px rgba(0, 0, 0, 0.04);
}

/* --- Active / Selected --- */
.cbf-vg-card--active {
    border-color: #97aa82;
    background: #f6f9f2;
    box-shadow: 0 0 0 3px rgba(151, 170, 130, 0.2),
                0 4px 16px rgba(151, 170, 130, 0.1);
    transform: translateY(-1px);
}

.cbf-vg-card--active:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 0 3px rgba(151, 170, 130, 0.25),
                0 6px 20px rgba(151, 170, 130, 0.15);
}

/* Checkmark indicator for selected card */
.cbf-vg-card--active::after {
    content: '✓';
    position: absolute;
    bottom: 8px;
    right: 10px;
    width: 20px;
    height: 20px;
    background: #97aa82;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
    animation: cbf-check-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cbf-check-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ---------------------------------------------------------
   4. BEST DEAL CARD
   --------------------------------------------------------- */

.cbf-vg-card--best {
    border-color: #97aa82;
    background: linear-gradient(172deg, #f2f7ec 0%, #ffffff 60%);
    padding-top: 38px;
}

.cbf-vg-card--best:hover {
    background: linear-gradient(172deg, #edf4e5 0%, #fcfdfa 60%);
    border-color: #88a06e;
    box-shadow: 0 8px 28px rgba(151, 170, 130, 0.18),
                0 2px 8px rgba(0, 0, 0, 0.04);
}

.cbf-vg-card--best.cbf-vg-card--active {
    background: linear-gradient(172deg, #e8f0df 0%, #f6f9f2 60%);
    box-shadow: 0 0 0 3px rgba(151, 170, 130, 0.25),
                0 6px 24px rgba(151, 170, 130, 0.18);
}

/* Subtle attention pulse — only when NOT selected */
@keyframes cbf-glow-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(151, 170, 130, 0);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(151, 170, 130, 0.12);
    }
}

.cbf-vg-card--best:not(.cbf-vg-card--active) {
    animation: cbf-glow-pulse 3s ease-in-out infinite;
}

.cbf-vg-card--best:not(.cbf-vg-card--active):hover {
    animation: none;
}

/* ---------------------------------------------------------
   5. SAVINGS BADGE — Standard
   --------------------------------------------------------- */

.cbf-vg-badge {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    background: #97aa82;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3.5px 14px;
    border-radius: 20px;
    white-space: nowrap;
    letter-spacing: 0.4px;
    line-height: 1.3;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(151, 170, 130, 0.3);
}

/* ---------------------------------------------------------
   6. BEST DEAL BADGE
   --------------------------------------------------------- */

.cbf-vg-badge--best {
    top: -24px;
    padding: 6px 18px 7px;
    background: linear-gradient(135deg, #7a9d5c 0%, #97aa82 100%);
    text-align: center;
    box-shadow: 0 4px 14px rgba(110, 144, 80, 0.35);
    border-radius: 22px;
    line-height: 1.35;
    font-size: 11px;
}

.cbf-vg-badge-label {
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.2;
    margin-bottom: 1px;
    text-transform: uppercase;
}

/* ---------------------------------------------------------
   7. CARD CONTENT
   --------------------------------------------------------- */

.cbf-vg-qty {
    display: block;
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.35;
    margin-bottom: 4px;
}

.cbf-vg-price {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #777;
    line-height: 1.3;
}

/* Highlight price on active card */
.cbf-vg-card--active .cbf-vg-price {
    color: #5c7a47;
    font-weight: 600;
}

/* Best deal price always has brand color weight */
.cbf-vg-card--best .cbf-vg-price {
    color: #5c7a47;
    font-weight: 600;
}

/* ---------------------------------------------------------
   8. RESET LINK CLEANUP
   --------------------------------------------------------- */

.variations td.value .reset_variations {
    margin-top: 10px;
    display: inline-block;
    font-size: 12px;
    color: #999;
    text-decoration: none;
    transition: color 0.2s ease;
}

.variations td.value .reset_variations:hover {
    color: #97aa82;
}

/* ---------------------------------------------------------
   9. RESPONSIVE — Tablet (≤ 900px)
   --------------------------------------------------------- */

@media (max-width: 900px) {

    .cbf-variation-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }

    .cbf-vg-card {
        padding: 28px 8px 18px;
    }

    .cbf-vg-card--best {
        padding-top: 36px;
    }
}

/* ---------------------------------------------------------
   10. RESPONSIVE — Large Mobile (≤ 600px)
   --------------------------------------------------------- */

@media (max-width: 600px) {

    .cbf-variation-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .cbf-vg-card {
        padding: 26px 6px 16px;
        border-radius: 12px;
    }

    .cbf-vg-card--best {
        padding-top: 34px;
    }

    .cbf-vg-qty {
        font-size: 14px;
    }

    .cbf-vg-price {
        font-size: 12px;
    }

    .cbf-vg-badge {
        font-size: 9.5px;
        padding: 3px 10px;
        top: -10px;
    }

    .cbf-vg-badge--best {
        top: -21px;
        padding: 5px 14px 5px;
        font-size: 10px;
    }

    .cbf-vg-badge-label {
        font-size: 8.5px;
        letter-spacing: 0.6px;
    }

    .cbf-vg-card--active::after {
        width: 18px;
        height: 18px;
        font-size: 10px;
        line-height: 18px;
        bottom: 6px;
        right: 7px;
    }
}

/* ---------------------------------------------------------
   11. RESPONSIVE — Small Mobile (≤ 420px)
   --------------------------------------------------------- */

@media (max-width: 420px) {

    .cbf-variation-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .cbf-vg-card {
        padding: 24px 6px 14px;
        border-radius: 11px;
    }

    .cbf-vg-card--best {
        padding-top: 32px;
    }

    .cbf-vg-qty {
        font-size: 14px;
    }

    .cbf-vg-price {
        font-size: 12px;
    }

    .cbf-vg-badge {
        font-size: 9px;
        padding: 2.5px 9px;
    }

    .cbf-vg-badge--best {
        top: -20px;
        padding: 4px 12px 5px;
        font-size: 9.5px;
    }

    .cbf-vg-badge-label {
        font-size: 8px;
    }
}

/* ---------------------------------------------------------
   12. RESPONSIVE — Extra Small (≤ 340px)
   --------------------------------------------------------- */

@media (max-width: 340px) {

    .cbf-variation-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .cbf-vg-card {
        padding: 22px 4px 12px;
        border-radius: 10px;
    }

    .cbf-vg-qty {
        font-size: 13px;
    }

    .cbf-vg-price {
        font-size: 11px;
    }
}