/* ============================================================
   MQ Product Detail Beautify — 2026-10-22
   Làm đẹp trang chi tiết SP (chỉ CSS, không đụng cấu trúc).
   File theme riêng trong lw_customize, enqueue khi is_product().
   Màu chủ đạo: xanh dương #0d47a1 + giá đỏ #c84236 (đồng bộ màu trang chủ),
   nút Mua ngay đỏ cam #f57224, nền phụ #f6f7f9.
   ============================================================ */

/* ---------- 1. Vùng thông tin: khung card bo tròn + bóng nhẹ ---------- */
.single-product .product-info {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 22px 22px 18px !important;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.06);
}

/* ---------- 2. Tiêu đề: to, đậm ---------- */
.single-product .product-info h1,
.single-product h1.product-title {
  font-size: clamp(22px, 2.6vw, 28px) !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  color: #111 !important;
  margin-bottom: 8px !important;
}

/* ---------- 3. Giá: to, đỏ đậm; giá gốc gạch xám ---------- */
.single-product p.price.product-page-price {
  font-size: clamp(28px, 3.4vw, 34px) !important;
  font-weight: 800 !important;
  color: #c84236 !important;
  line-height: 1.2 !important;
  margin: 10px 0 4px !important;
}
.single-product p.price.product-page-price del,
.single-product p.price.product-page-price del .woocommerce-Price-amount {
  font-size: 17px !important;
  font-weight: 400 !important;
  color: #999 !important;
}
.single-product p.price.product-page-price ins {
  text-decoration: none !important;
}
/* Số giá thật (span .amount): rule .price .amount của Additional CSS đang đè màu của <p>, phải chỉ rõ span mới ăn màu */
.single-product p.price.product-page-price .woocommerce-Price-amount {
  color: #c84236 !important;
}
/* Pill giảm % (PHP gắn cạnh giá khi SP đang sale) */
.mq-discount-pill {
  display: inline-block;
  vertical-align: middle;
  margin-left: 10px;
  padding: 3px 10px;
  background: #c84236;
  color: #fff !important;
  font-size: 14px;
  font-weight: 700;
  border-radius: 999px;
  line-height: 1.5;
}
/* Số đã bán (PHP gắn dưới tiêu đề) */
.mq-sold-count {
  font-size: 14px;
  color: #666;
  margin: 2px 0 6px;
}
.mq-sold-count strong {
  color: #c84236;
}

/* ---------- 4. Nút mua: Mua ngay đỏ cam full-width, Thêm giỏ viền xanh ---------- */
.single-product .single_add_to_cart_button,
.single-product .ux-buy-now-button {
  height: 52px !important;
  min-height: 52px !important;
  border-radius: 10px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
/* Mua ngay: đỏ cam, full-width */
.single-product .ux-buy-now-button {
  width: 100% !important;
  grid-column: 1 / -1 !important;
  background: #f57224 !important;
  border-color: #f57224 !important;
  color: #fff !important;
  margin-top: 10px !important;
}
/* Thêm vào giỏ: viền xanh, nền trắng */
.single-product .single_add_to_cart_button {
  background: #fff !important;
  border: 2px solid #0d47a1 !important;
  color: #0d47a1 !important;
}
.single-product .single_add_to_cart_button:hover {
  background: #eef3fd !important;
}
/* Số lượng + nút mua xếp gọn */
.single-product .product-info .quantity {
  height: 52px !important;
}
.single-product .product-info .quantity input.qty {
  height: 52px !important;
  border-radius: 10px !important;
}

/* ---------- 5. Yêu thích / So sánh: nút icon tròn gọn ---------- */
.single-product .mq-wish-btn,
.single-product .mqcc-compare-button {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  border: 1px solid #ddd !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background-color: #fff !important;
}

/* ---------- 6. Gallery: ảnh chính bo tròn, thumbnail bo + viền khi chọn ---------- */
.single-product .product-images .woocommerce-product-gallery__image img,
.single-product .product-images img.wp-post-image {
  border-radius: 16px !important;
  border: 1px solid #eee !important;
}
/* Badge sale trên ảnh: đỏ, nổi bật */
.single-product .badge-inner.on-sale,
.single-product .badge-inner.secondary.on-sale {
  background: #c84236 !important;
  color: #fff !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  padding: 6px 12px !important;
  border-radius: 999px !important;
}
/* Thumbnail slider nav */
.single-product .product-images .slider-nav-small .flickity-slider > *,
.single-product .product-images .flex-control-thumbs li img {
  border-radius: 10px !important;
  border: 2px solid transparent !important;
}
.single-product .product-images .slider-nav-small .is-selected img,
.single-product .product-images .flex-control-thumbs li img.flex-active {
  border-color: #0d47a1 !important;
}

/* ---------- 7. Box tin cậy: dải 4 icon, nền xanh nhạt bo tròn ---------- */
.mq-trust-box {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: #eef3fd;
  border: 1px solid #dbe6fb;
  border-radius: 14px;
  padding: 14px 12px;
  margin: 16px 0 4px;
}
.mq-trust-box__item {
  text-align: center;
  font-size: 12.5px;
  line-height: 1.35;
  color: #333;
}
.mq-trust-box__icon {
  font-size: 22px;
  line-height: 1;
  display: block;
  margin-bottom: 5px;
}
@media (max-width: 480px) {
  .mq-trust-box {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 8px;
  }
}

/* ---------- 8. Tab: dạng pill, tab active nền xanh ---------- */
.single-product .tabbed-content .nav {
  /* gap đã có sẵn từ rule global cũ (.tabbed-content .nav) → không lặp lại */
  border-bottom: none !important;
}
.single-product .tabbed-content .nav > li {
  margin: 0 !important;
}
.single-product .tabbed-content .nav > li > a {
  border-radius: 999px !important;
  border: 1px solid #ddd !important;
  background: #fff !important;
  padding: 9px 20px !important;
  font-weight: 600 !important;
  color: #333 !important;
}
.single-product .tabbed-content .nav > li.active > a,
.single-product .tabbed-content .nav > li > a.active {
  background: #0d47a1 !important;
  border-color: #0d47a1 !important;
  color: #fff !important;
}
/* Nội dung tab: tiêu đề con đậm, bảng thông số zebra + bo tròn */
.single-product .tabbed-content .panel h2,
.single-product .tabbed-content .panel h3 {
  font-weight: 700 !important;
  color: #111 !important;
}
.single-product table.shop_attributes {
  border: 1px solid #eee !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  border-collapse: separate !important;
}
.single-product table.shop_attributes tr:nth-child(even) th,
.single-product table.shop_attributes tr:nth-child(even) td {
  background: #f6f7f9 !important;
}
.single-product table.shop_attributes th {
  font-weight: 600 !important;
  color: #333 !important;
}

/* ---------- 9. SP liên quan: ĐÃ ĐẸP SẴN từ Additional CSS cũ
   (body.single-product .products .product-small: bo 14px + bóng + hover nâng)
   → KHÔNG viết lại ở đây để tránh đè lớp trùng lặp. ---------- */

/* ---------- 10. Thanh mua dính mobile (PHP gắn ở footer) ---------- */
#mq-sticky-buy {
  display: none;
}
@media (max-width: 767px) {
  .single-product .product-info {
    padding: 16px !important;
    border-radius: 14px;
  }
  .single-product p.price.product-page-price {
    font-size: 28px !important;
  }
  /* Tab mobile: giữ 1 hàng, cuộn ngang thay vì rớt "Đánh giá" xuống hàng 2 */
  .single-product .tabbed-content .nav {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
  }
  .single-product .tabbed-content .nav > li {
    flex-shrink: 0 !important;
  }
  #mq-sticky-buy {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    transform: translateY(110%);
    transition: transform 0.25s ease;
  }
  #mq-sticky-buy.is-visible {
    transform: translateY(0);
  }
  #mq-sticky-buy img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
  }
  #mq-sticky-buy .mq-sticky-buy__info {
    flex: 1;
    min-width: 0;
  }
  #mq-sticky-buy .mq-sticky-buy__price {
    font-size: 17px;
    font-weight: 800;
    color: #c84236;
    line-height: 1.2;
  }
  #mq-sticky-buy .mq-sticky-buy__name {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #mq-sticky-buy .mq-sticky-buy__btn {
    flex-shrink: 0;
    height: 46px;
    padding: 0 22px;
    border: none;
    border-radius: 10px;
    background: #f57224;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
  }
}

/* SẢN PHẨM ĐÃ XEM (true history, shortcode mq_recently_viewed) */
.mq-viewed-section { margin-top: 0; }
.mq-viewed-title { text-align: center; margin: 0 0 32px; }
