/* VNFAST Variation Thumbnails */

.vnfast-vt-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 16px 0 20px;
}

@media (max-width: 380px) {
    .vnfast-vt-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .vnfast-vt-card {
        gap: 8px;
        padding: 8px;
    }

    .vnfast-vt-thumb {
        width: 60px;
        height: 60px;
    }

    .vnfast-vt-title {
        font-size: 12px;
    }

    /* Giá đã hiển thị ở khối giá chính phía trên (tự cập nhật theo
       biến thể đang chọn), nên ẩn giá trong thẻ trên mobile để
       tránh tràn / xuống dòng xấu trong card hẹp. */
    .vnfast-vt-price {
        display: none;
    }
}

.vnfast-vt-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 2px solid #e3e3e3;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.vnfast-vt-card:hover {
    border-color: #f3a3a0;
}

.vnfast-vt-card:focus {
    outline: none;
    border-color: #e53935;
}

.vnfast-vt-card.vnfast-vt-selected {
    border-color: #e53935;
    box-shadow: 0 0 0 1px #e53935 inset;
}

.vnfast-vt-card.vnfast-vt-selected .vnfast-vt-check {
    opacity: 1;
    transform: scale(1);
}

.vnfast-vt-check {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e53935;
    color: #fff;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    font-weight: 700;
    opacity: 0;
    transform: scale(0.6);
    transition: all .15s ease;
}

.vnfast-vt-thumb {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 8px;
    background: #f7f7f7;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vnfast-vt-img {
    /* !important để thắng các rule chung của theme/WooCommerce
       kiểu ".woocommerce img, .woocommerce-page img { height: 80px;
       max-width: 80px; }" - rule đó có thêm selector "img" nên độ ưu
       tiên cao hơn .vnfast-vt-img, làm ảnh bị bóp/cắt méo. */
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    object-fit: contain !important;
    border-radius: 0 !important;
    background: transparent !important;
}

.vnfast-vt-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.vnfast-vt-title {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    color: #222;
    overflow-wrap: break-word;
    word-break: break-word;
}

.vnfast-vt-price {
    font-weight: 700;
    color: #e53935;
    font-size: 14px;
    overflow-wrap: break-word;
    word-break: break-word;
}

.vnfast-vt-price del {
    color: #999;
    font-weight: 400;
    margin-right: 4px;
}

.vnfast-vt-stock {
    font-size: 12px;
    color: #999;
}

.vnfast-vt-card.vnfast-vt-disabled {
    opacity: .5;
    cursor: not-allowed;
}

.vnfast-vt-card.vnfast-vt-disabled:hover {
    border-color: #e3e3e3;
}

/* ===== Debug mode (?vt_debug=1) ===== */
#vnfast-vt-debug-toggle {
    position: fixed;
    bottom: 12px;
    right: 12px;
    z-index: 999999;
    background: #1d1d1d;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    opacity: .85;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}

#vnfast-vt-debug-toggle:hover {
    opacity: 1;
}

#vnfast-vt-debug-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 56px;
    max-height: 65vh;
    overflow: auto;
    background: rgba(15, 15, 15, .95);
    color: #7CFC00;
    border-radius: 8px;
    padding: 10px;
    z-index: 999999;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .4);
}

#vnfast-vt-debug-body {
    margin: 0;
    font-family: monospace;
    font-size: 11px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
