/* Tên sản phẩm */
.product_title.entry-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 6px;
}

/* Danh mục chính */
.product-main-category {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.6;
  margin: 2px 0 14px;
}

/* Giá */
.price-all.devvn_single_price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 18px;
}

.price-label {
  font-size: 15px;
  color: #555;
  font-weight: 400;
  white-space: nowrap;
}

.price-all.devvn_single_price p {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  color: #393f46 !important;
  margin: 0;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
  color: #393f46 !important;
}

/* Form giỏ hàng & sản phẩm biến thể */
.woocommerce div.product form.cart {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.woocommerce div.product form.variations_form {
  display: block !important;
}

.woocommerce div.product form.cart::before {
  content: unset !important;
  position: unset !important;
}

/* ===================================================
   BỘ CHỌN BIẾN THỂ (PRODUCT VARIATIONS)
   =================================================== */
.woocommerce div.product form.cart table.variations {
  width: 100%;
  border: none;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0 0 18px 0;
  background: transparent;
}

.woocommerce div.product form.cart table.variations tbody {
  display: block;
  width: 100%;
}

.woocommerce div.product form.cart table.variations tr {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 0;
  border: none;
  border-bottom: 1px dashed #e5e5e5;
}

.woocommerce div.product form.cart table.variations tr:last-child {
  border-bottom: none;
}

/* Label biến thể */
.woocommerce div.product form.cart table.variations td.label {
  padding: 0;
  border: none;
  min-width: 110px;
  text-align: left;
}

.woocommerce div.product form.cart table.variations td.label label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin: 0;
  line-height: 1.4;
  cursor: pointer;
}

/* Value chứa dropdown chọn và nút xóa */
.woocommerce div.product form.cart table.variations td.value {
  padding: 0;
  border: none;
  flex: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
}

/* Dropdown <select> chuẩn giao diện hiện đại */
.woocommerce div.product form.cart table.variations select {
  width: auto;
  min-width: 200px;
  max-width: 100%;
  height: 42px;
  padding: 0 38px 0 14px;
  font-size: 14px;
  font-weight: 500;
  color: #222;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
  border: 1.5px solid #d5d5d5;
  border-radius: 6px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.25s ease;
}

.woocommerce div.product form.cart table.variations select:hover {
  border-color: #999;
}

.woocommerce div.product form.cart table.variations select:focus {
  border-color: #111;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

/* Nút chọn kiểu Pills hiện đại */
.kw-variation-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.kw-variation-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  height: 38px;
  padding: 0 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: #333;
  background: #fff;
  border: 1.5px solid #d5d5d5;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.kw-variation-pill:hover {
  border-color: #111;
  color: #111;
}

.kw-variation-pill.active {
  background: #111 !important;
  color: #fff !important;
  border-color: #111 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.kw-variation-pill.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-style: dashed;
  pointer-events: none;
}

/* Nút Xóa / Reset lựa chọn biến thể */
.woocommerce div.product form.cart .reset_variations {
  display: inline-flex !important;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: #e53935 !important;
  background: #fff1f0;
  padding: 4px 10px;
  border-radius: 20px;
  text-decoration: none;
  border: 1px solid #ffccc7;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.woocommerce div.product form.cart .reset_variations:hover {
  background: #ff4d4f;
  color: #fff !important;
  border-color: #ff4d4f;
}

/* Khối hiển thị thông tin biến thể đã chọn */
.woocommerce div.product .single_variation_wrap {
  width: 100%;
}

.woocommerce div.product .woocommerce-variation.single_variation {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #fbfbfb;
  border-left: 3px solid #2d7a46;
  border-radius: 0 6px 6px 0;
}

.woocommerce div.product .woocommerce-variation.single_variation:empty {
  display: none !important;
  padding: 0;
  margin: 0;
  border: none;
}

.woocommerce div.product .woocommerce-variation-price .price {
  font-size: 1.4rem !important;
  font-weight: 700 !important;
  color: #d32f2f !important;
  line-height: 1.3;
}

.woocommerce div.product .woocommerce-variation-description {
  font-size: 13.5px;
  color: #555;
  margin-bottom: 6px;
  line-height: 1.5;
}

.woocommerce div.product .woocommerce-variation-availability {
  font-size: 13px;
  font-weight: 600;
  color: #2d7a46;
  margin-top: 4px;
}

.woocommerce div.product .woocommerce-variation-availability .out-of-stock {
  color: #d32f2f;
}

/* Vùng nút thêm vào giỏ và mua ngay của biến thể */
.woocommerce div.product form.cart .woocommerce-variation-add-to-cart {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* Ô số lượng */
.woocommerce div.product form.cart .quantity {
  display: flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 6px;
  overflow: hidden;
  height: 48px;
}

.woocommerce div.product form.cart .quantity input.qty {
  width: 48px;
  height: 100%;
  text-align: center;
  border: none;
  font-size: 16px;
  font-weight: 500;
}

.qty-btn {
  width: 28px;
  height: 100%;
  background: #fff;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #333;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-btn:hover {
  background: #f5f5f5;
}

/* Nút Thêm vào giỏ và Mua ngay */
.woocommerce div.product form.cart .single_add_to_cart_button,
.woocommerce div.product form.cart button[type="submit"],
.btn-buy-now {
  height: 48px;
  padding: 0 28px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: #111 !important;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.woocommerce div.product form.cart .single_add_to_cart_button:hover,
.btn-buy-now:hover {
  background: #333 !important;
}

.woocommerce div.product form.cart .single_add_to_cart_button.disabled,
.woocommerce div.product form.cart .single_add_to_cart_button:disabled {
  background: #777 !important;
  color: #eee !important;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Box short description có viền dashed */
.product-short-desc-box {
  border: 1.5px dashed #bbb;
  border-radius: 8px;
  padding: 18px 20px;
  margin: 0 0 20px;
  background: #fafafa;
}

.product-short-desc-box ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.product-short-desc-box ul li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
  color: #333;
  line-height: 1.5;
}

.product-short-desc-box ul li::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96-.44l-1.008-6.05A2.5 2.5 0 0 1 8 10.5v-1A2.5 2.5 0 0 1 9.5 7'/%3E%3Cpath d='M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96-.44l1.008-6.05A2.5 2.5 0 0 0 16 10.5v-1A2.5 2.5 0 0 0 14.5 7'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  margin-top: 1px;
}

/* Tags */
.product-tags {
  margin-top: 20px;
}

.tags-label {
  font-size: 12px;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 8px;
}

.tag-button {
  display: inline-block;
  background: #f5f5f5;
  color: #444;
  padding: 5px 14px;
  border-radius: 20px;
  margin: 4px 4px 4px 0;
  font-size: 13px;
  text-decoration: none;
  border: 1px solid #e0e0e0;
  transition:
    background 0.2s,
    color 0.2s;
}

.tag-button:hover {
  background: #333;
  color: #fff;
  border-color: #333;
}

@media (max-width: 820px) {
  .woocommerce .woocommerce-breadcrumb {
    display: block;
  }
  .entry-summary {
    text-align: center;
  }
  .woocommerce div.product .product_title{
    margin-top: 15px;
  }
  .price-all.devvn_single_price {
    justify-content: center;
  }
  .woocommerce div.product form.cart {
    flex-direction: column;
    align-items: center;
  }

  /* Biến thể trên mobile */
  .woocommerce div.product form.cart table.variations tr {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
  }

  .woocommerce div.product form.cart table.variations td.label {
    min-width: unset;
    text-align: center;
  }

  .woocommerce div.product form.cart table.variations td.value {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 8px;
  }

  .kw-variation-pills {
    justify-content: center;
  }

  .woocommerce div.product form.cart table.variations select {
    width: 100%;
    max-width: 320px;
    height: 44px;
  }

  .woocommerce div.product .woocommerce-variation.single_variation {
    text-align: center;
    border-left: none;
    border-top: 3px solid #2d7a46;
    border-radius: 6px;
  }

  .woocommerce div.product form.cart .woocommerce-variation-add-to-cart {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .woocommerce div.product form.cart .woocommerce-variation-add-to-cart .quantity {
    margin-bottom: 4px;
  }

  .woocommerce div.product form.cart .single_add_to_cart_button,
  .woocommerce div.product form.cart button[type="submit"],
  .btn-buy-now {
    width: 100%;
    max-width: 320px;
  }

}

/* Tranh trung lap nut MUA NGAY */
.btn-buy-now ~ .btn-buy-now,
form.cart .btn-buy-now + .btn-buy-now,
form.cart > .btn-buy-now:not(:first-of-type) {
  display: none !important;
}
