/* Overlay */
#wv-upsale-addtocart-popup.wv-upsale-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
/* Content */
.wv-upsale-popup-content {
	position: relative;
    background: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}
/* 1. Product just added */
.wv-just-added-wrapper {
    display: flex;
    gap: 20px;
	background: #f1f1f1;
    padding: 10px;
}
.wv-just-added-left img {
    width: 120px;
    object-fit: cover;
    border-radius: 8px;
}
.wv-just-added-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.wv-just-added-label {
    font-size: 14px;
    color: #3fbc1a;
    font-weight: bold;
}
.wv-just-added-title {
    font-size: 18px;
    margin: 5px 0;
}
.wv-just-added-qty {
    font-size: 14px;
    color: #555;
}

/* 3. Frequently bought with */
.wv-upsale-frequently-bought {
    font-weight: bold;
    font-size: 16px;
	padding: 0px 15px;
	margin-bottom: 15px;
}
/* 4. Related products */
.wv-related-products-wrapper {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
	padding: 20px;
	padding-top: 0px;
}
.wv-related-products-scroll {
    display: flex;
    flex-direction: column;
    gap: 10px;
	padding-top: 10px;
}
.wv-related-product-item {
    display: flex;
    gap: 15px;
    padding: 10px;
    border-bottom: 1px solid #eee;
    border-radius: 6px;
    align-items: center;
}
.wv-related-product-item:last-child {
	border: none;
}
.wv-related-product-left img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
}
.wv-related-product-right h4 {
    margin: 0;
    font-size: 16px;
}
.wv-related-product-right .wv-simple-default-wrapper button.single_add_to_cart_button {
    font-size: 16px !important;
    font-weight: bold !important;
    margin-top: 3px;
}

.wv-related-product-right .wv-simple-default-wrapper form.cart .quantity input.qty {
	width: 3.331em;
	margin-top: -3px;
}

.wv-related-product-right .price {
    font-size: 14px;
    color: #333;
    margin: 3px 0;
}
.wv-add-to-cart-btn {
	margin-top: 5px;
    padding: 6px 12px;
    background-color: #e55e1d;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: none;
}
.wv-add-to-cart-btn:hover {
    background-color: #c1460a;
	box-shadow: none;
}
.wv-add-to-cart-btn:disabled {
    background-color: #7b7b7b;
	box-shadow: none;
}
/* 5. Footer */
.wv-upsale-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
    padding: 20px;
}
.wv-footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
}
.wv-footer-right .wv-checkout-link {
    display: inline-block;
    padding: 8px 15px;
    background-color: #3fbc1a;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
	text-transform: uppercase;
}

.wv-footer-right .wv-view-cart-link {
	text-transform: uppercase;
	text-decoration: none;
    color: #000000;
    font-weight: 500;
    border: 1px solid #868686;
    padding: 7px;
    border-radius: 5px;
}

.wv-footer-right .wv-view-cart-link:hover {
	background: #ebebeb;
}

.wv-footer-right .wv-checkout-link:hover {
    background-color: #218838;
}
/* Close button */
#wv-popup-close {
    position: absolute;
    top: 2px;
    right: 2px;
    padding: 6px 12px;
    border: none;
    background-color: rgb(0 0 0 / 42%);
    color: #fff;
    border-radius: 25px;
    cursor: pointer;
    z-index: 1001;
    box-shadow: none;
}
#wv-popup-close:hover {
    background-color: #c82333;
}
#wv-popup-close:hover {
    background-color: #c82333;
}
/* Scrollbar for related products */
.wv-related-products-wrapper::-webkit-scrollbar {
    width: 6px;
}
.wv-related-products-wrapper::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 3px;
}
.wv-related-product-right form.cart {
	display: unset !important;
}
/** Add to cart Poup variants mặc định**/
/* Ẩn table mặc định */
.wv-variable-default-wrapper table.variations,
.wv-variable-default-wrapper table.variations tbody {
    display: flex;
    flex-wrap: wrap; /* nếu quá rộng thì xuống dòng */
    gap: 10px;
}
/* Mỗi option */
.wv-variable-default-wrapper table.variations tr {
    display: flex;
    flex-direction: row; /* label + select trên 1 dòng */
    align-items: center;
    margin: 0;
}
/* Label */
.wv-variable-default-wrapper table.variations th.label {
    display: none;
}
/* Select */
.wv-variable-default-wrapper table.variations td.value {
    flex: 0 0 auto;
}
select.wv-upsale-add-to-cart-select {
	margin: 10px 10px 10px 0px;
}
select.wv-upsale-add-to-cart-select:last-child {
	margin-right: 0px;
}
select.wv-upsale-add-to-cart-select, .wv-variable-default-wrapper table.variations td.value select {
	height: 35px;
    border-radius: 5px;
    padding: 0px 5px;
}
.wv-variable-default-wrapper table.variations td.value a.reset_variations{
	margin-left: 10px;
}
/* --- Quantity + Add to Cart --- */
.wv-simple-default-wrapper form.cart, .wv-variable-default-wrapper .woocommerce-variation-add-to-cart {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-top: 10px;
}
/* Quantity input */
.wv-simple-default-wrapper form.cart .quantity input.qty, .wv-variable-default-wrapper .woocommerce-variation-add-to-cart .quantity input.qty {
    height: 35px;
    box-sizing: border-box;
}
input.wv-upsale-add-to-cart-qty {
    margin-right: 10px;
    height: 34px;
    width: 3.331em;
	text-align: center;
	border-radius: 5px;
	border: 1px solid #767676;
}

/* Nút Add to Cart */
button.wv-upsale-add-to-cart-btn, .wv-simple-default-wrapper form.cart button.single_add_to_cart_button, .wv-variable-default-wrapper .woocommerce-variation-add-to-cart button.single_add_to_cart_button {
    border: none;
    height: 35px !important;
    text-transform: uppercase;
    font-weight: bold;
	box-shadow: none;
	line-height: 17px;
}
button.wv-upsale-add-to-cart-btn:hover, .wv-simple-default-wrapper form.cart button.single_add_to_cart_button, .wv-variable-default-wrapper .woocommerce-variation-add-to-cart button.single_add_to_cart_button:hover, button.wv-upsale-add-to-cart-btn:active, .wv-simple-default-wrapper form.cart button.single_add_to_cart_button, .wv-variable-default-wrapper .woocommerce-variation-add-to-cart button.single_add_to_cart_button:active{
	box-shadow: none;
}
.wv-simple-default-wrapper, .wv-variable-default-wrapper {
	margin-top: 10px;
}
.wv-upsale-price {
	margin-top: 5px;
    margin-bottom: 10px;
}


/* Wrapper cho related products */
.wvupsale-related-wrapper {
    margin-top: 40px;
}
/* Tiêu đề */
.wvupsale-related-title {
    margin-bottom: 20px;
    font-weight: bold;
    font-size: 22px;
}


/* Danh sách sản phẩm */
.wvupsale-related-products {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 0;
    margin: 0;
    list-style: none;
}
/* Các item */
.wvupsale-related-products li.wvupsale-product-item {
    box-sizing: border-box;
}
/* Các item */
.wvupsale-related-products li.wvupsale-product-item a{
    text-decoration: none;
}

.wvupsale-related-products li.wvupsale-product-item a img {
    margin-bottom: 15px;
	max-width: 100%;
	height: auto;
}

/* Cột động */
.wvupsale-related-products.columns-1 li.wvupsale-product-item { width: 100%; }
.wvupsale-related-products.columns-2 li.wvupsale-product-item { width: calc(50% - 10px); }
.wvupsale-related-products.columns-3 li.wvupsale-product-item { width: calc(33.333% - 13.33px); }
.wvupsale-related-products.columns-4 li.wvupsale-product-item { width: calc(25% - 15px); }
.wvupsale-related-products.columns-5 li.wvupsale-product-item { width: calc(20% - 16px); }
/* Responsive */
@media (max-width: 768px) {
    .wvupsale-related-products li.wvupsale-product-item { width: calc(50% - 10px) !important; }
}
@media (max-width: 480px) {
    .wvupsale-related-products li.wvupsale-product-item { width: 100% !important; }
}
/* Tiêu đề sản phẩm */
ul.wvupsale-related-products h3.wvupsale-product-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Ẩn nút add to cart cũ (nếu có) */
ul.wvupsale-related-products .add_to_cart_button {
    display: none !important;
}
/* Giá sản phẩm */
ul.wvupsale-related-products .wvupsale-product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}
ul.wvupsale-related-products .wvupsale-product-price del,
ul.wvupsale-related-products .wvupsale-product-price ins {
    margin: 0;
    font-size: 14px;
}
ul.wvupsale-related-products .wvupsale-product-price del {
    color: #999;
    text-decoration: line-through;
}
ul.wvupsale-related-products .wvupsale-product-price ins {
    color: #e74c3c;
    font-weight: bold;
}
/* Nút add to cart custom */
ul.wvupsale-related-products .wvupsale-add-to-cart {
    background-color: #ff7f00;
    color: #fff;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    font-weight: bold;
}


/* ========== Tổng thể danh sách sản phẩm ========== */
.wvupsale-related-products {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ========== Mỗi item sản phẩm ========== */
.wvupsale-product-item {
  flex: 1 1 calc(25% - 20px); /* 4 cột desktop */
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}
.wvupsale-product-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

/* ========== Ảnh sản phẩm ========== */
.wvupsale-product-link img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 10px;
  transition: transform 0.3s ease;
}
.wvupsale-product-item:hover img {
  transform: scale(1.05);
}

/* ========== Tiêu đề sản phẩm ========== */
.wvupsale-product-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
  transition: color 0.2s;
  text-decoration: none;
}

/* ========== Form chọn biến thể + giá + nút ========== */
.wvupsale-woovaria-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.wvupsale-woovaria-form select,
.wvupsale-woovaria-form input[type="number"] {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.wv-upsale-price {
  font-size: 16px;
  font-weight: 600;
  color: #222;
  align-self: flex-start;
  width: 100%;
}

.wv-upsale-add-to-cart-btn {
  background-color: #3fbc1a !important;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: background-color 0.3s;
  width: 100%;
  max-width: 200px;
}

/* ========== Responsive Mobile ========== */
@media (max-width: 1024px) {
  .wvupsale-product-item {
    flex: 1 1 calc(33.333% - 20px); /* 3 cột tablet */
  }
}
@media (max-width: 768px) {
  .wvupsale-product-item {
    flex: 1 1 calc(50% - 15px); /* 2 cột mobile */
  }
}
@media (max-width: 480px) {
  .wvupsale-product-item {
    flex: 1 1 100%; /* 1 cột nếu màn nhỏ hơn */
  }
}

.wvupsale-quantity-addrow {
	display: flex;
	align-items: stretch;
	width: 100%;
	gap: 8px; /* khoảng cách giữa ô và nút */
}

/* Ô quantity: fix chiều rộng */
.wvupsale-quantity-addrow .wv-upsale-add-to-cart-qty {
	width: 50px !important;
	text-align: center;
}

/* Nút Add to Cart: chiếm toàn bộ phần còn lại */
.wvupsale-quantity-addrow .wv-upsale-add-to-cart-btn {
	flex: 1;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	padding: 8px 12px;
	transition: background-color 0.3s;
	box-sizing: border-box;
}

.wvupsale-quantity-addrow .wv-upsale-add-to-cart-btn:hover {
	background-color: #319d11 !important;
}

/** Nút sản phẩm simple **/
li.wvupsale-product-item > form {
	display: flex;
	margin-top: 15px;
	align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}
li.wvupsale-product-item > form > .quantity > input.qty{
	width: 50px;
    height: 35px;
}
li.wvupsale-product-item > form > button.single_add_to_cart_button {
	height: 35px !important;
    font-size: 15px !important;
	margin-top: 2px;
}

/* Popup Mobile styles */
@media (max-width: 768px) {
    /* Container popup */
    #wv-related-popup {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    /* Mỗi sản phẩm */
    .wv-related-product-item {
        display: flex;
        flex-direction: column;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 10px;
        background-color: #fff;
        box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    }

    /* Ảnh sản phẩm */
    .wv-related-product-left {
        width: 120px;
        margin-bottom: 10px;
        text-align: center;
    }

    .wv-related-product-left img {
        max-width: 80%;
        height: auto;
        border-radius: 5px;
    }

    /* Thông tin sản phẩm */
    .wv-related-product-right {
        width: 100%;
    }

    .wv-related-product-right h4 {
        font-size: 16px;
        margin-bottom: 8px;
        line-height: 1.3;
    }

    /* Form thêm vào giỏ hàng */
    .wv-related-product-right .cart,
    .wv-simple-default-wrapper,
    .wv-related-variant-profile {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

	.wv-related-variant-profile .wv-upsale-price .text-muted {
	    font-size: 18px;
	}

    /* Input số lượng */
    .wv-related-product-right .quantity input {
		width: 20% !important;
	}

    .wv-upsale-add-to-cart-qty {
        width: 20% !important;
		margin-right: 4% !important;
        padding: 8px;
        font-size: 14px;
        border: 1px solid #ccc;
        border-radius: 5px;
        box-sizing: border-box;
    }

    /* Button thêm vào giỏ hàng */
    .wv-related-product-right .single_add_to_cart_button,
    .wv-upsale-add-to-cart-btn {
		width: 76% !important;
        max-width: unset;
        padding: 10px;
        font-size: 14px;
        border: none;
        border-radius: 5px;
        background-color: #0071a1;
        color: #fff;
        cursor: pointer;
        transition: background 0.3s;
    }

    .wv-related-product-right .single_add_to_cart_button:hover,
    .wv-upsale-add-to-cart-btn:hover {
        background-color: #005577;
    }

    /* Select box biến thể */
    .wv-upsale-add-to-cart-select {
        width: 100%;
        padding: 8px;
        font-size: 14px;
        border: 1px solid #ccc;
        border-radius: 5px;
        box-sizing: border-box;
    }

    /* Giá sản phẩm */
    .wv-upsale-price {
        margin-top: 5px;
        font-size: 14px;
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
        align-items: center;
    }

    .wv-upsale-price .woocommerce-Price-amount {
        font-size: 18px;
    }

	.wv-just-added-title, .wv-upsale-footer {
		font-size: 14px;
	}
	.wvupsale-next-tier-container{
		font-size: 12px;
	}
}


.wvupsale-related-products .wvupsale-product-item div.quantity input.qty {
    width: 50px;
    height: 35px;
    border: 1px solid #dddddd;
}

.wvupsale-related-products .wvupsale-product-item button.single_add_to_cart_button {
    font-size: 15px !important;
    width: 69% !important;
    height: 35px !important;
    margin-top: 12px;
}

.coupon-exclusive_cart_offer a {
	display: none;
}

.cart-discount a {
	text-decoration: none;
    color: #ff0000;
}

.wv-variant-change .wv-upsale-customtext-wrapper label {
	font-weight: 400 !important;
}
.wv-related-product-right .wv-upsale-customtext-input {
	max-width: 265px;
}

.wv-related-product-right .wv-simple-default-wrapper button.single_add_to_cart_button {
	max-width: 200px !important;
}