/**
 * Trang chi tiết SP — kiểu meta.vn (scope body.dmctn-single-meta)
 */

body.dmctn-single-meta.woocommerce.single-product {
  background:
    linear-gradient(90deg, rgba(59, 130, 246, 0.12) 0%, transparent min(12%, 140px), transparent max(88%, calc(100% - 140px)), rgba(59, 130, 246, 0.12) 100%),
    #f3f4f6;
}

/* Nền họa tiết xanh ngọc khi bật pattern (khớp dmctn-header-meta.css) */
body.dmctn-single-meta.dmctn-meta-pattern.woocommerce.single-product {
  background-color: #e3f2f1;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(15, 118, 110, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 88% 70%, rgba(30, 64, 175, 0.06) 0%, transparent 42%),
    repeating-linear-gradient(
      -11deg,
      transparent,
      transparent 22px,
      rgba(255, 255, 255, 0.28) 22px,
      rgba(255, 255, 255, 0.28) 23px
    );
}
body.dmctn-single-meta.dmctn-meta-pattern.woocommerce.single-product #primary,
body.dmctn-single-meta.dmctn-meta-pattern.woocommerce.single-product .site-main,
body.dmctn-single-meta.dmctn-meta-pattern.woocommerce.single-product .content-area {
  background: transparent;
}

body.dmctn-single-meta.woocommerce.single-product #primary,
body.dmctn-single-meta.woocommerce.single-product .site-main,
body.dmctn-single-meta.woocommerce.single-product .content-area {
  position: relative;
  max-width: var(--dmctn-container, 1260px);
  margin-left: auto;
  margin-right: auto;
}

body.dmctn-single-meta.woocommerce.single-product .woocommerce div.product {
  position: relative;
  z-index: 1;
  background: var(--dmctn-surface, #fff);
  border-radius: var(--dmctn-radius-lg, 16px);
  padding: 1.25rem;
  box-shadow: var(--dmctn-shadow-elev, 0 4px 14px rgba(30, 64, 175, 0.08));
}

@media (min-width: 768px) {
  body.dmctn-single-meta.woocommerce.single-product .woocommerce div.product {
    padding: 1.5rem 1.75rem;
  }
}

/* Banner cam kết dưới gallery */
.dmctn-sp-commitment {
  margin-top: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: #1f2937;
  background: linear-gradient(90deg, #fef08a 0%, #fde047 100%);
  border-radius: var(--dmctn-radius-sm, 8px);
  border: 1px solid rgba(234, 179, 8, 0.45);
}

/* Thương hiệu / danh mục */
.dmctn-sp-brand-line {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--dmctn-text-muted, #64748b);
}
.dmctn-sp-brand-line a {
  color: var(--dmctn-color-primary, #1e40af);
  font-weight: 600;
  text-decoration: none;
}
.dmctn-sp-brand-line a:hover {
  text-decoration: underline;
}

/* Rating + so sánh */
.dmctn-sp-rating-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.dmctn-sp-rating-row .woocommerce-product-rating {
  margin-bottom: 0;
}
.dmctn-sp-compare {
  font-size: 14px;
  font-weight: 600;
  color: var(--dmctn-color-primary, #1e40af);
  text-decoration: none;
}
.dmctn-sp-compare:hover {
  text-decoration: underline;
}

/* Giá */
body.dmctn-single-meta.woocommerce.single-product .summary .price {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 800;
  color: var(--dmctn-price-loop, #be1e2d);
  margin-bottom: 4px;
}
body.dmctn-single-meta.woocommerce.single-product .summary .price del {
  font-size: 1rem;
  font-weight: 500;
  color: var(--dmctn-old, #94a3b8);
  opacity: 1;
}
body.dmctn-single-meta.woocommerce.single-product .summary .price ins {
  text-decoration: none;
  color: var(--dmctn-price-loop, #be1e2d);
}

/* % giảm cạnh giá (span ngay sau p.price) */
body.dmctn-single-meta.woocommerce.single-product .summary p.price {
  display: inline-block;
  margin-bottom: 4px;
  vertical-align: middle;
}
.dmctn-sp-pct {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  vertical-align: middle;
  color: #fff;
  background: var(--dmctn-meta-red, #d0021b);
  border-radius: 6px;
}

.dmctn-sp-vat-note,
.dmctn-sp-used-note {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--dmctn-text-muted, #64748b);
}
.dmctn-sp-used-note {
  font-weight: 600;
  color: var(--dmctn-text, #0f172a);
}

/* Tồn kho */
body.dmctn-single-meta.woocommerce.single-product .stock {
  font-size: 14px;
  font-weight: 600;
}
body.dmctn-single-meta.woocommerce.single-product .stock.in-stock {
  color: #15803d;
}
body.dmctn-single-meta.woocommerce.single-product .stock.in-stock::before {
  content: "✓ ";
  font-weight: 800;
}
body.dmctn-single-meta.woocommerce.single-product .stock.out-of-stock {
  color: #b91c1c;
}
body.dmctn-single-meta.woocommerce.single-product .stock.out-of-stock::before {
  content: "✕ ";
  font-weight: 800;
}

/* Nhóm tiêu đề trong bảng thông số (nếu theme/plugin thêm hàng <tr class="dmctn-spec-group">) */
body.dmctn-single-meta.woocommerce.single-product table.shop_attributes tr.dmctn-spec-group th,
body.dmctn-single-meta.woocommerce.single-product table.woocommerce-product-attributes tr.dmctn-spec-group th {
  width: auto;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #374151;
  background: #e5e7eb;
  border-bottom: 1px solid #d1d5db;
}
body.dmctn-single-meta.woocommerce.single-product table.shop_attributes tr.dmctn-spec-group td,
body.dmctn-single-meta.woocommerce.single-product table.woocommerce-product-attributes tr.dmctn-spec-group td {
  display: none;
}

/* Thứ tự tóm tắt: mô tả ngắn trước form khi theme đẩy DOM lệch */
body.dmctn-single-meta.woocommerce.single-product .summary.entry-summary {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
body.dmctn-single-meta.woocommerce.single-product .summary.entry-summary > .woocommerce-product-details__short-description {
  order: 28;
}
body.dmctn-single-meta.woocommerce.single-product .summary.entry-summary > .dmctn-sp-cta-row1 {
  order: 30;
}

/* Gallery: khung ảnh chính + khoảng cách thumbnail */
body.dmctn-single-meta.woocommerce.single-product .woocommerce-product-gallery__wrapper {
  border: 2px solid var(--dmctn-meta-red, #d0021b);
  border-radius: var(--dmctn-radius-md, 12px);
  overflow: hidden;
  box-sizing: border-box;
}
body.dmctn-single-meta.woocommerce.single-product .flex-control-thumbs {
  margin-top: 10px !important;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
body.dmctn-single-meta.woocommerce.single-product .flex-control-thumbs li {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
}
body.dmctn-single-meta.woocommerce.single-product .flex-control-thumbs img {
  border-radius: 8px;
  border: 1px solid var(--dmctn-border, #e2e8f0);
}

/* Form giỏ */
body.dmctn-single-meta.woocommerce.single-product form.cart {
  margin-top: 0;
}

/* CTA hai hàng: Đặt mua | Tư vấn — Trả góp | Trả góp thẻ */
.dmctn-sp-cta-row1 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;
  margin-top: 1rem;
}
.dmctn-sp-cta-row1--solo {
  grid-template-columns: 1fr;
}
.dmctn-sp-cta-row1 form.cart {
  margin-top: 0;
  min-width: 0;
}
.dmctn-sp-cta-row1 .dmctn-sp-btn--consult {
  align-self: stretch;
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 480px) {
  .dmctn-sp-cta-row1:not(.dmctn-sp-cta-row1--solo) {
    grid-template-columns: 1fr;
  }
}
.dmctn-sp-cta-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.dmctn-sp-cta-row2 .dmctn-sp-btn {
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 480px) {
  .dmctn-sp-cta-row2 {
    grid-template-columns: 1fr;
  }
}

body.dmctn-single-meta.woocommerce.single-product .single_add_to_cart_button,
body.dmctn-single-meta.woocommerce.single-product button.single_add_to_cart_button {
  width: 100%;
  max-width: 100%;
  padding: 14px 18px !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%) !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--dmctn-radius-md, 12px) !important;
  box-shadow: 0 4px 14px rgba(185, 28, 28, 0.35) !important;
}
body.dmctn-single-meta.woocommerce.single-product .single_add_to_cart_button:hover {
  filter: brightness(1.05);
}

/* Khối cam kết */
.dmctn-sp-trust {
  margin-top: 1.25rem;
  padding: 14px 16px;
  border: 1px solid var(--dmctn-border, #e2e8f0);
  border-radius: var(--dmctn-radius-md, 12px);
  background: #f8fafc;
}
.dmctn-sp-trust__list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.dmctn-sp-trust__item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--dmctn-text, #0f172a);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}
.dmctn-sp-trust__item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.dmctn-sp-trust__icon {
  flex-shrink: 0;
  color: #15803d;
  font-weight: 800;
}

/* CTA phụ */
.dmctn-sp-extra-cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
@media (max-width: 480px) {
  .dmctn-sp-extra-cta {
    grid-template-columns: 1fr;
  }
}
.dmctn-sp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  border-radius: var(--dmctn-radius-md, 12px);
  transition: filter 0.15s ease, transform 0.12s ease;
}
.dmctn-sp-btn--consult {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}
.dmctn-sp-btn--installment {
  background: linear-gradient(180deg, #facc15 0%, #eab308 100%);
  color: #422006 !important;
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.4);
}
.dmctn-sp-btn:hover {
  filter: brightness(1.06);
}

.dmctn-sp-hotlines {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--dmctn-text-muted, #64748b);
}
.dmctn-sp-hotlines__item {
  font-weight: 600;
}

/* Tabs: bảng thông số */
body.dmctn-single-meta.woocommerce.single-product table.shop_attributes,
body.dmctn-single-meta.woocommerce.single-product table.woocommerce-product-attributes {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  border: 1px solid var(--dmctn-border, #e2e8f0);
  border-radius: var(--dmctn-radius-md, 12px);
  overflow: hidden;
}
body.dmctn-single-meta.woocommerce.single-product table.shop_attributes th,
body.dmctn-single-meta.woocommerce.single-product table.shop_attributes td,
body.dmctn-single-meta.woocommerce.single-product table.woocommerce-product-attributes th,
body.dmctn-single-meta.woocommerce.single-product table.woocommerce-product-attributes td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}
body.dmctn-single-meta.woocommerce.single-product table.shop_attributes tr:nth-child(even),
body.dmctn-single-meta.woocommerce.single-product table.woocommerce-product-attributes tr:nth-child(even) {
  background: #f9fafb;
}
body.dmctn-single-meta.woocommerce.single-product table.shop_attributes th,
body.dmctn-single-meta.woocommerce.single-product table.woocommerce-product-attributes th {
  width: 38%;
  font-weight: 700;
  color: var(--dmctn-text, #0f172a);
  background: #f3f4f6;
}

body.dmctn-single-meta.woocommerce.single-product .woocommerce-tabs {
  margin-top: 1.5rem;
}

/* Sticky bar */
.dmctn-sticky-buy {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9998;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0));
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--dmctn-border, #e2e8f0);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.12);
  transform: translateY(100%);
  transition: transform 0.28s ease;
}
.dmctn-sticky-buy.is-visible {
  transform: translateY(0);
}
.dmctn-sticky-buy__inner {
  max-width: var(--dmctn-container, 1260px);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.dmctn-sticky-buy__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 160px;
}
.dmctn-sticky-buy__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--dmctn-text, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dmctn-sticky-buy__price {
  font-size: 15px;
  font-weight: 800;
  color: var(--dmctn-price-loop, #be1e2d);
}
.dmctn-sticky-buy__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.dmctn-sticky-buy__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 800;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
}
.dmctn-sticky-buy__btn--consult {
  background: #16a34a;
  color: #fff !important;
}
.dmctn-sticky-buy__btn--buy {
  background: #b91c1c;
  color: #fff;
}
.dmctn-sticky-buy__btn--inst {
  background: #eab308;
  color: #422006 !important;
}
.dmctn-sticky-buy__btn--inst-card {
  background: linear-gradient(180deg, #facc15 0%, #eab308 100%);
  color: #422006 !important;
  box-shadow: 0 2px 10px rgba(234, 179, 8, 0.35);
}
@media (max-width: 420px) {
  .dmctn-sticky-buy__actions {
    justify-content: stretch;
  }
  .dmctn-sticky-buy__btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    padding-left: 10px;
    padding-right: 10px;
    font-size: 13px;
  }
}

/* Cross-sells “Thường mua cùng” */
.dmctn-sp-crosssell {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--dmctn-border, #e2e8f0);
}
.dmctn-sp-crosssell__title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--dmctn-text, #0f172a);
}
.dmctn-sp-crosssell ul.products {
  margin-bottom: 0;
}

.admin-bar .dmctn-sticky-buy {
  /* không chồng admin bar — sticky bottom vẫn ok */
}

@media (prefers-reduced-motion: reduce) {
  .dmctn-sticky-buy {
    transition: none;
  }
}

body.dmctn-single-meta.woocommerce.single-product .woocommerce div.product {
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

body.dmctn-single-meta.woocommerce.single-product .summary.entry-summary {
  gap: 8px;
}

.dmctn-sp-gallery-trust {
  margin-top: 12px;
  padding: 14px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.92);
}

.dmctn-sp-gallery-trust__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.dmctn-sp-gallery-trust__item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  color: #0f172a;
}

.dmctn-sp-gallery-trust__item::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 999px;
  background: #16a34a;
}

body.dmctn-single-meta.woocommerce.single-product .summary .price {
  margin-bottom: 0;
}

.dmctn-sp-cta-row1,
.dmctn-sp-cta-row2,
.dmctn-sp-trust,
.dmctn-sp-hotlines,
.dmctn-sp-microcopy {
  border-left: 0;
  border-right: 0;
}

.dmctn-sp-cta-row1 {
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  border: 1px solid rgba(226, 232, 240, 0.94);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

body.dmctn-single-meta.woocommerce.single-product .single_add_to_cart_button,
body.dmctn-single-meta.woocommerce.single-product button.single_add_to_cart_button {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
  box-shadow: 0 18px 28px rgba(249, 115, 22, 0.22) !important;
}

.dmctn-sp-btn--consult {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  box-shadow: 0 14px 24px rgba(30, 64, 175, 0.2);
}

.dmctn-sp-btn--installment {
  background: #fff7ed;
  color: #9a3412 !important;
  box-shadow: none;
  border: 1px solid rgba(249, 115, 22, 0.16);
}

.dmctn-sp-trust {
  margin-top: 12px;
  border-radius: 20px;
  background: #fff;
}

.dmctn-sp-trust__item {
  font-size: 13px;
}

.dmctn-sp-microcopy {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.dmctn-sp-microcopy__item {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 700;
}

.dmctn-sp-faq {
  display: grid;
  gap: 12px;
}

.dmctn-sp-faq__item {
  padding: 16px 18px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.dmctn-sp-faq__q {
  margin: 0 0 8px;
  font-size: 16px;
  color: #0f172a;
}

.dmctn-sp-faq__a {
  margin: 0;
  color: #475569;
  line-height: 1.6;
}

.dmctn-sticky-buy__btn--consult {
  background: #1e3a8a;
}

.dmctn-sticky-buy__btn--buy {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

@media (max-width: 640px) {
  .dmctn-sp-gallery-trust__list {
    grid-template-columns: 1fr;
  }
}
