/* WC Mua Kem - Frontend CSS */

.wc-mua-kem-wrap {
    margin: 0 0 20px;
    border: 2px solid #f0a500;
    border-radius: 12px;
    overflow: hidden;
    font-family: inherit;
}

.wc-mua-kem-header {
    background: #f0a500;
    color: #fff;
    padding: 10px 16px;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wc-mua-kem-icon {
    font-size: 18px;
}

.wc-mua-kem-form {
    padding: 14px 16px;
    background: #fffdf5;
}

/* ── Item (simple hoặc group variation) ── */
.wc-mua-kem-item {
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    margin-bottom: 10px;
    background-color: #fff;
    transition: box-shadow .2s;
    overflow: hidden;
}

.wc-mua-kem-item:hover {
    box-shadow: 0 2px 10px rgba(240, 165, 0, .2);
}

/* Hàng cha (tên sp + ảnh) cho variable product */
.wc-mua-kem-parent-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 6px;
    border-bottom: 1px dashed var(--primary-color);
}

.wc-mua-kem-parent-img img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 5px;
    display: block;
}

.wc-mua-kem-parent-name {
    font-weight: 700;
    font-size: 13px;
    color: #444;
}

.wc-mua-kem-discount-badge {
    margin-left: auto;
    background: #e00;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Mỗi variation / simple product row */
.wc-mua-kem-item-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f9f3e0;
    transition: background .15s;
}

.wc-mua-kem-item-label:last-child {
    border-bottom: none;
}

.wc-mua-kem-item-label:hover {
    background: #fffbee;
}

.wc-mua-kem-checkbox {
    width: 17px;
    height: 17px;
    accent-color: var(--primary-color);
    flex-shrink: 0;
    cursor: pointer;
}

/* Ảnh thumbnail (simple product) */
.wc-mua-kem-thumb-wrap {
    position: relative;
    flex-shrink: 0;
}

.wc-mua-kem-thumb-wrap img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.wc-mua-kem-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    background: #e00;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Info */
.wc-mua-kem-info {
    flex: 1;
    min-width: 0;
    padding-left: 10px;
}

.wc-mua-kem-name {
    font-weight: 700;
    font-size: 13px;
    color: #222;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.wc-mua-kem-variation-attrs {
    font-size: 11px;
    color: #888;
    margin-bottom: 3px;
}

.wc-mua-kem-qty-info {
    font-size: 11px;
    color: #666;
    margin-bottom: 3px;
}

.wc-mua-kem-prices {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.wc-mua-kem-old-price {
    font-size: 12px;
    color: #aaa;
    text-decoration: line-through;
}

.wc-mua-kem-new-price {
    font-size: 14px;
    font-weight: 700;
    color: #e00;
}

.wc-mua-kem-save-label {
    font-size: 11px;
    color: #27ae60;
    font-weight: 600;
    margin-top: 2px;
    min-height: 16px;
}

/* Dropdown chọn variation */
.wc-mua-kem-var-select {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 5px 0 6px;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    background-color: #fff;
    cursor: pointer;
    color: #333;
}

.wc-mua-kem-var-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(240, 165, 0, .15);
}

/* Footer */
.wc-mua-kem-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px dashed var(--primary-color);
    margin-top: 4px;
    flex-wrap: wrap;
    gap: 10px;
}

.wc-mua-kem-total-wrap {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.wc-mua-kem-total {
    color: #e00;
    font-size: 18px;
    font-weight: 700;
    margin-left: 8px;
}

.wc-mua-kem-btn.button {
    border-radius: 6px;
    font-size: 14px;
    margin: 0;
}


input.wc-mua-kem-checkbox {
    margin: 0 !important;
}

.wc-mua-kem-list {
    max-height: 350px;
    overflow-y: auto;
}

@media screen and (max-width: 850px) {
    .wc-mua-kem-item-label {
        padding: 5px;
        gap: 4px;
    }

    .wc-mua-kem-form {
        padding: 10px;
    }

    .wc-mua-kem-var-select {
        height: 25px;
        padding: 0;
        padding-left: 10px;
    }

    .wc-mua-kem-header {
        padding: 5px 10px;
    }
}