/* Woo Variation Gallery Flatsome v3.0 */

.wvgf-wrapper {
    margin: 15px 0 20px;
    font-family: inherit;
}

.wvgf-current-label {
    font-size: 14px;
    color: #333;
    margin-bottom: 12px;
    line-height: 1.5;
}
.wvgf-current-label strong {
    color: #222;
    font-weight: 600;
}

/* ============ COMBO GRID (Linked Products) ============ */
.wvgf-combo-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

a.wvgf-combo-item,
a.wvgf-combo-item:hover,
a.wvgf-combo-item:focus,
a.wvgf-combo-item:visited {
    text-decoration: none !important;
    color: inherit !important;
    box-shadow: none !important;
}

.wvgf-combo-item {
    position: relative;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    display: block;
    padding: 10px 12px;
}

.wvgf-combo-item:hover {
    border-color: var(--wvgf-primary, #d32f2f);
}

.wvgf-combo-item.wvgf-active {
    border-color: var(--wvgf-primary, #d32f2f);
    box-shadow: 0 0 0 1px var(--wvgf-primary, #d32f2f);
    background: #fff9f9;
}

.wvgf-combo-inner {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wvgf-combo-head {
    padding-right: 22px; /* tránh đè icon check */
}

.wvgf-combo-name {
    font-size: 13px;
    line-height: 1.35;
    color: #222;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wvgf-combo-body {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wvgf-combo-thumb {
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    background: #f7f7f7;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wvgf-combo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.wvgf-combo-price-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wvgf-combo-price {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--wvgf-primary, #d32f2f);
}

.wvgf-combo-price .woocommerce-Price-amount,
.wvgf-combo-price bdi,
.wvgf-combo-price ins {
    color: var(--wvgf-primary, #d32f2f);
    text-decoration: none;
    font-weight: 700;
}

.wvgf-combo-price ins {
    background: transparent;
    display: block;
}

.wvgf-combo-price del {
    color: #999;
    font-size: 12px;
    font-weight: 400;
    display: block;
    text-decoration: line-through;
}
.wvgf-combo-price del .woocommerce-Price-amount,
.wvgf-combo-price del bdi {
    color: #999;
}

.wvgf-savings {
    font-size: 12px;
    color: #00a000;
    font-weight: 500;
    line-height: 1.3;
    margin-top: 2px;
}
.wvgf-savings strong {
    font-weight: 600;
}

/* ============ VARIATION GRID (Attribute như màu sắc) ============ */
.wvgf-variation-wrap {
    margin-top: 15px;
}

.wvgf-variation-label {
    font-size: 14px;
    margin-bottom: 10px;
    color: #333;
}
.wvgf-variation-label strong {
    font-weight: 500;
    color: #333;
}
.wvgf-variation-current {
    margin-left: 6px;
    color: #222;
    font-weight: 600;
}
.wvgf-variation-current::before {
    content: ": ";
    color: #666;
    font-weight: 400;
}

.wvgf-variation-grid {
    display: grid;
    gap: 10px;
}

.wvgf-variation-item {
    position: relative;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.wvgf-variation-item:hover {
    border-color: var(--wvgf-primary, #d32f2f);
}

.wvgf-variation-item.wvgf-active {
    border-color: var(--wvgf-primary, #d32f2f);
    box-shadow: 0 0 0 1px var(--wvgf-primary, #d32f2f);
}

.wvgf-variation-inner {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    gap: 10px;
}

.wvgf-variation-thumb {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    background: #f7f7f7;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wvgf-variation-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.wvgf-variation-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wvgf-variation-name {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    line-height: 1.2;
}

.wvgf-variation-price {
    font-size: 12px;
    line-height: 1.3;
    color: var(--wvgf-primary, #d32f2f);
    font-weight: 500;
}

.wvgf-variation-price del {
    color: #999;
    font-size: 11px;
    font-weight: 400;
    margin-right: 4px;
}
.wvgf-variation-price ins {
    background: transparent;
    text-decoration: none;
    font-weight: 600;
}
.wvgf-variation-price .woocommerce-Price-amount,
.wvgf-variation-price bdi,
.wvgf-variation-price ins {
    color: var(--wvgf-primary, #d32f2f);
}

/* ============ CHECK ICON (common) ============ */
.wvgf-check {
    position: absolute;
    top: 0;
    right: 0;
    width: 22px;
    height: 22px;
    background: var(--wvgf-primary, #d32f2f);
    border-radius: 0 4px 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
    z-index: 2;
}

.wvgf-active .wvgf-check {
    opacity: 1;
    transform: scale(1);
}

/* ============ MAIN PRICE (Phần giá chính phía trên summary) ============ */
.wvgf-main-savings {
    font-size: 14px;
    color: #00a000;
    font-weight: 500;
    line-height: 1.4;
    margin-top: 4px;
    margin-bottom: 12px;
}
.wvgf-main-savings strong {
    color: var(--wvgf-primary, #d32f2f);
    font-weight: 700;
}

.price.wvgf-price-updated {
    transition: color 0.15s ease;
}
.price.wvgf-price-updated .wvgf-big {
    font-size: 1.1em;
    font-weight: 700;
}
.price.wvgf-price-updated del {
    color: #999 !important;
    font-size: 0.75em;
    font-weight: 400;
    margin-right: 6px;
}
.price.wvgf-price-updated del .woocommerce-Price-amount,
.price.wvgf-price-updated del bdi {
    color: #999 !important;
}
.price.wvgf-price-updated ins {
    background: transparent !important;
    text-decoration: none !important;
}
.price.wvgf-price-updated ins .woocommerce-Price-amount,
.price.wvgf-price-updated ins bdi {
    color: var(--wvgf-primary, #d32f2f) !important;
    font-weight: 700;
}

/* ============ MOBILE ============ */
@media (max-width: 576px) {
    .wvgf-combo-grid { gap: 8px; }
    .wvgf-variation-grid { gap: 8px; }
    .wvgf-combo-name { font-size: 13px; }
    .wvgf-combo-price { font-size: 15px; }
}

/* ============ QUICK VIEW (Flatsome Lightbox) ============ */
/* Flatsome Quick View sử dụng .product-lightbox, .mfp-content, .quick-view */

.product-lightbox .wvgf-wrapper,
.mfp-content .wvgf-wrapper,
.quick-view .wvgf-wrapper {
    margin: 10px 0 15px;
}

/* Ẩn label "Bạn đang xem" trong quick view */
.product-lightbox .wvgf-current-label,
.mfp-content .wvgf-current-label,
.quick-view .wvgf-current-label {
    display: none;
}

/* Combo grid: 2 cột compact */
.product-lightbox .wvgf-combo-grid,
.mfp-content .wvgf-combo-grid,
.quick-view .wvgf-combo-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px;
}

.product-lightbox .wvgf-combo-item,
.mfp-content .wvgf-combo-item,
.quick-view .wvgf-combo-item {
    padding: 6px 8px;
}

.product-lightbox .wvgf-combo-head,
.mfp-content .wvgf-combo-head,
.quick-view .wvgf-combo-head {
    display: none;
}

.product-lightbox .wvgf-combo-thumb,
.mfp-content .wvgf-combo-thumb,
.quick-view .wvgf-combo-thumb {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
}

.product-lightbox .wvgf-combo-price,
.mfp-content .wvgf-combo-price,
.quick-view .wvgf-combo-price {
    font-size: 12px;
}

.product-lightbox .wvgf-combo-price del,
.mfp-content .wvgf-combo-price del,
.quick-view .wvgf-combo-price del {
    font-size: 10px;
}

.product-lightbox .wvgf-savings,
.mfp-content .wvgf-savings,
.quick-view .wvgf-savings {
    display: none;
}

/* Variation grid: compact */
.product-lightbox .wvgf-variation-wrap,
.mfp-content .wvgf-variation-wrap,
.quick-view .wvgf-variation-wrap {
    margin-top: 10px;
}

.product-lightbox .wvgf-variation-label,
.mfp-content .wvgf-variation-label,
.quick-view .wvgf-variation-label {
    font-size: 13px;
    margin-bottom: 6px;
}

.product-lightbox .wvgf-variation-grid,
.mfp-content .wvgf-variation-grid,
.quick-view .wvgf-variation-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px;
}

.product-lightbox .wvgf-variation-inner,
.mfp-content .wvgf-variation-inner,
.quick-view .wvgf-variation-inner {
    padding: 5px 8px;
    gap: 6px;
}

.product-lightbox .wvgf-variation-thumb,
.mfp-content .wvgf-variation-thumb,
.quick-view .wvgf-variation-thumb {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
}

.product-lightbox .wvgf-variation-name,
.mfp-content .wvgf-variation-name,
.quick-view .wvgf-variation-name {
    font-size: 12px;
}

.product-lightbox .wvgf-variation-price,
.mfp-content .wvgf-variation-price,
.quick-view .wvgf-variation-price {
    font-size: 11px;
}

.product-lightbox .wvgf-check,
.mfp-content .wvgf-check,
.quick-view .wvgf-check {
    width: 18px;
    height: 18px;
}

.product-lightbox .wvgf-check svg,
.mfp-content .wvgf-check svg,
.quick-view .wvgf-check svg {
    width: 10px;
    height: 10px;
}

/* Ẩn main price savings trong quick view */
.product-lightbox .wvgf-main-savings,
.mfp-content .wvgf-main-savings,
.quick-view .wvgf-main-savings {
    display: none;
}

/* OpenClaw: ensure variation cards are clickable above any theme overlay */
.wvgf-wrapper,
.wvgf-variation-wrap,
.wvgf-variation-grid,
.wvgf-variation-item {
    position: relative;
    z-index: 20;
    pointer-events: auto !important;
}
.wvgf-variation-item * {
    pointer-events: none;
}
.wvgf-variation-item.wvgf-disabled {
    opacity: .45;
}
