/*
 * YHN 4.0 — Purchase Funnel UI (Mini-Cart, Mobile Cart Drawer, Cart Page, Order Tracking & My Account)
 * Fixes:
 *   1. Opaque #fff Desktop Mini-Cart & Mobile Cart Drawer + crisp close button above drawer + fixed thumbnail padding.
 *   2. High-contrast Mini-Cart CTA hierarchy (Secondary outlined "Xem giỏ hàng" vs Primary Ruby "Thanh toán").
 *   3. Dynamic Freeship 700,000đ Progress Bar styling.
 *   4. Single clean Cart Totals card (eliminates double border & pale pink headers), tablet/mobile full-width stack,
 *      zero mobile top gap, zero duplicate price, and hidden .yhn-contact on Cart & Off-Canvas Drawers.
 *   5. Full-width Order Tracking inputs (no clipped placeholders), My Account H1 header, and Quiet Ruby palette.
 */

/* =========================================================
   1. HEADER CART BADGE & ALIGNMENT HARMONY
   ========================================================= */
html body.yhn-redesign-40 #header .cart-item .header-cart-link {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  line-height: 1 !important;
}

html body.yhn-redesign-40 #header .cart-item .header-cart-title {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px;
  line-height: 1 !important;
  vertical-align: middle !important;
}

html body.yhn-redesign-40 #header .cart-item [data-icon-label]::after,
html body.yhn-redesign-40 #header .header-cart-link [data-icon-label]::after,
html body.yhn-redesign-40 #header [data-icon-label]::after {
  background-color: var(--yhn-topbar-bg) !important;
  color: #ffffff !important;
  border: 1.5px solid #ffffff !important;
  font-weight: 700 !important;
}

/* =========================================================
   2. DESKTOP MINI-CART DROPDOWN & MOBILE CART DRAWER (100% OPAQUE!)
   ========================================================= */
html body.yhn-redesign-40 #header .cart-item > .nav-dropdown,
html body.yhn-redesign-40 #header li.cart-item.has-dropdown > .nav-dropdown {
  background: #ffffff !important;
  background-color: #ffffff !important;
  opacity: 1 !important;
  color: var(--yhn-ink) !important;
  z-index: 10000 !important;
  min-width: 348px !important;
  max-width: 390px !important;
  padding: 16px !important;
  border: 1px solid var(--yhn-line) !important;
  border-top: 2px solid var(--yhn-brand) !important;
  border-radius: 0 0 var(--yhn-radius-lg) var(--yhn-radius-lg) !important;
  box-shadow: 0 24px 54px rgba(26, 23, 21, 0.18) !important;
  left: auto !important;
  right: 0 !important;
  top: 100% !important;
}

html body.yhn-redesign-40 .mfp-wrap.off-canvas {
  z-index: 100000 !important;
}

html body.yhn-redesign-40 #cart-popup,
html body.yhn-redesign-40 .off-canvas-right .mfp-content,
html body.yhn-redesign-40 .mfp-content .widget_shopping_cart {
  background: #ffffff !important;
  background-color: #ffffff !important;
  opacity: 1 !important;
  color: var(--yhn-ink) !important;
}

/* High-contrast close button pinned ABOVE Mobile Off-Canvas Cart Drawer */
html body.yhn-redesign-40 .mfp-wrap.off-canvas .mfp-close,
html body.yhn-redesign-40 .mfp-wrap.off-canvas-right .mfp-close {
  position: fixed !important;
  top: 12px !important;
  right: 12px !important;
  z-index: 100050 !important;
  color: #1a1715 !important;
  -webkit-text-fill-color: #1a1715 !important;
  background: #ffffff !important;
  opacity: 1 !important;
  width: 36px !important;
  height: 36px !important;
  line-height: 34px !important;
  font-size: 24px !important;
  font-weight: 500 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  border: 1px solid var(--yhn-line) !important;
  box-shadow: 0 4px 12px rgba(26, 23, 21, 0.14) !important;
  mix-blend-mode: normal !important;
}

/* Mini-Cart item row — restore left padding for 60x60 absolute thumbnail (fixes text collision) */
html body.yhn-redesign-40 .widget_shopping_cart ul.woocommerce-mini-cart {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

html body.yhn-redesign-40 .widget_shopping_cart .woocommerce-mini-cart-item {
  position: relative !important;
  min-height: 84px !important;
  padding: 12px 30px 12px 74px !important;
  margin: 0 !important;
  border-bottom: 1px solid var(--yhn-line) !important;
  text-align: left !important;
}

html body.yhn-redesign-40 .widget_shopping_cart .woocommerce-mini-cart-item img {
  position: absolute !important;
  left: 0 !important;
  top: 12px !important;
  width: 60px !important;
  height: 60px !important;
  object-fit: cover !important;
  margin: 0 !important;
  border-radius: 8px !important;
  border: 1px solid var(--yhn-line) !important;
  background: var(--yhn-surface) !important;
}

html body.yhn-redesign-40 .widget_shopping_cart .woocommerce-mini-cart-item a.remove {
  position: absolute !important;
  right: 0 !important;
  top: 12px !important;
  left: auto !important;
  width: 24px !important;
  height: 24px !important;
  line-height: 21px !important;
  font-size: 15px !important;
  text-align: center !important;
  border-radius: 50% !important;
  border: 1px solid var(--yhn-line) !important;
  color: var(--yhn-muted) !important;
  -webkit-text-fill-color: var(--yhn-muted) !important;
  background: #ffffff !important;
}

html body.yhn-redesign-40 .widget_shopping_cart .woocommerce-mini-cart-item a.remove:hover {
  border-color: var(--yhn-brand) !important;
  color: var(--yhn-brand) !important;
  -webkit-text-fill-color: var(--yhn-brand) !important;
  background: var(--yhn-brand-soft) !important;
}

html body.yhn-redesign-40 .widget_shopping_cart .woocommerce-mini-cart-item a:not(.remove) {
  display: block !important;
  color: var(--yhn-ink) !important;
  -webkit-text-fill-color: var(--yhn-ink) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  margin-bottom: 4px !important;
  text-decoration: none !important;
}

html body.yhn-redesign-40 .widget_shopping_cart .woocommerce-mini-cart-item a:not(.remove):hover {
  color: var(--yhn-brand) !important;
  -webkit-text-fill-color: var(--yhn-brand) !important;
}

html body.yhn-redesign-40 .widget_shopping_cart .woocommerce-mini-cart-item .quantity,
html body.yhn-redesign-40 .widget_shopping_cart .woocommerce-mini-cart-item .quantity .amount {
  color: var(--yhn-muted) !important;
  -webkit-text-fill-color: var(--yhn-muted) !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
}

html body.yhn-redesign-40 .widget_shopping_cart .woocommerce-mini-cart__total {
  border-top: 1px solid var(--yhn-line) !important;
  border-bottom: 0 !important;
  padding: 12px 0 8px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  color: var(--yhn-ink) !important;
}

html body.yhn-redesign-40 .widget_shopping_cart .woocommerce-mini-cart__total .amount {
  color: var(--yhn-brand) !important;
  -webkit-text-fill-color: var(--yhn-brand) !important;
  font-size: 16px !important;
  font-weight: 800 !important;
}

/* Clear Mini-Cart CTA Hierarchy: Outlined dark-ink "Xem giỏ hàng" vs Solid Ruby "Thanh toán" */
html body.yhn-redesign-40 .widget_shopping_cart .woocommerce-mini-cart__buttons {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  margin-top: 10px !important;
}

html body.yhn-redesign-40 .widget_shopping_cart .woocommerce-mini-cart__buttons a.button,
html body.yhn-redesign-40 #header .cart-item .nav-dropdown .woocommerce-mini-cart__buttons a.button,
html body.yhn-redesign-40 .mfp-content .widget_shopping_cart .woocommerce-mini-cart__buttons a.button {
  width: 100% !important;
  min-height: 44px !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: var(--yhn-radius-md) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em !important;
  text-transform: uppercase !important;
  box-shadow: none !important;
  transition: background-color var(--yhn-transition), color var(--yhn-transition), border-color var(--yhn-transition) !important;
}

html body.yhn-redesign-40 .widget_shopping_cart .woocommerce-mini-cart__buttons a.button:not(.checkout),
html body.yhn-redesign-40 #header .cart-item .nav-dropdown .woocommerce-mini-cart__buttons a.button:not(.checkout),
html body.yhn-redesign-40 .mfp-content .widget_shopping_cart .woocommerce-mini-cart__buttons a.button:not(.checkout) {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border: 1.5px solid #cfc4b8 !important;
  color: #1a1715 !important;
  -webkit-text-fill-color: #1a1715 !important;
}

html body.yhn-redesign-40 .widget_shopping_cart .woocommerce-mini-cart__buttons a.button:not(.checkout):hover,
html body.yhn-redesign-40 #header .cart-item .nav-dropdown .woocommerce-mini-cart__buttons a.button:not(.checkout):hover,
html body.yhn-redesign-40 .mfp-content .widget_shopping_cart .woocommerce-mini-cart__buttons a.button:not(.checkout):hover {
  border-color: var(--yhn-brand) !important;
  background: var(--yhn-brand-soft) !important;
  color: var(--yhn-brand) !important;
  -webkit-text-fill-color: var(--yhn-brand) !important;
}

html body.yhn-redesign-40 .widget_shopping_cart .woocommerce-mini-cart__buttons a.button.checkout,
html body.yhn-redesign-40 #header .cart-item .nav-dropdown .woocommerce-mini-cart__buttons a.button.checkout,
html body.yhn-redesign-40 .mfp-content .widget_shopping_cart .woocommerce-mini-cart__buttons a.button.checkout {
  background: var(--yhn-brand) !important;
  background-color: var(--yhn-brand) !important;
  border: 1.5px solid var(--yhn-brand) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  box-shadow: var(--yhn-shadow-brand) !important;
}

html body.yhn-redesign-40 .widget_shopping_cart .woocommerce-mini-cart__buttons a.button.checkout:hover,
html body.yhn-redesign-40 #header .cart-item .nav-dropdown .woocommerce-mini-cart__buttons a.button.checkout:hover,
html body.yhn-redesign-40 .mfp-content .widget_shopping_cart .woocommerce-mini-cart__buttons a.button.checkout:hover {
  background: var(--yhn-brand-hover) !important;
  border-color: var(--yhn-brand-hover) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* =========================================================
   3. DYNAMIC FREESHIP 700,000đ PROGRESS BAR
   ========================================================= */
.yhn-freeship-meter {
  margin: 0 0 14px;
  padding: 11px 14px;
  border-radius: var(--yhn-radius-md);
  background: var(--yhn-surface);
  border: 1px solid var(--yhn-line);
}

.yhn-freeship-meter.is-unlocked {
  background: var(--yhn-success-soft);
  border-color: #a7f3d0;
}

.yhn-freeship-meter__text {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--yhn-ink);
  margin-bottom: 8px;
}

.yhn-freeship-meter.is-unlocked .yhn-freeship-meter__text {
  color: var(--yhn-success);
}

html body.yhn-redesign-40 .yhn-freeship-meter__text strong,
html body.yhn-redesign-40 .yhn-freeship-meter__text .amount,
html body.yhn-redesign-40 .yhn-freeship-meter__text .woocommerce-Price-amount {
  color: var(--yhn-brand) !important;
  font-weight: 700 !important;
}

html body.yhn-redesign-40 .yhn-freeship-meter.is-unlocked .yhn-freeship-meter__text strong {
  color: var(--yhn-success) !important;
}

.yhn-freeship-meter__track {
  width: 100%;
  height: 6px;
  border-radius: var(--yhn-radius-pill);
  background: var(--yhn-line);
  overflow: hidden;
}

.yhn-freeship-meter__fill {
  display: block;
  height: 100%;
  border-radius: var(--yhn-radius-pill);
  background: var(--yhn-brand);
  transition: width 0.3s ease;
}

.yhn-freeship-meter.is-unlocked .yhn-freeship-meter__fill {
  background: var(--yhn-success);
}

/* =========================================================
   3B. SMART FREESHIP-GAP UPSELLS (MINI-CART & CART PAGE)
   ========================================================= */
.yhn-fs-upsell a.added_to_cart.wc-forward {
  display: none !important;
}

/* Compact Mini-Cart & Mobile Cart Drawer Upsell */
.yhn-fs-upsell--mini-cart {
  margin: 10px 0 8px;
  padding: 10px 10px 8px;
  background: var(--yhn-surface);
  border: 1px solid var(--yhn-line);
  border-radius: var(--yhn-radius-md);
}

.yhn-fs-upsell--mini-cart .yhn-fs-upsell__head {
  margin-bottom: 8px;
}

.yhn-fs-upsell--mini-cart .yhn-fs-upsell__title {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--yhn-brand);
}

.yhn-fs-upsell--mini-cart .yhn-fs-upsell__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.yhn-fs-upsell--mini-cart .yhn-fs-upsell__item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--yhn-line);
  border-radius: 8px;
}

.yhn-fs-upsell--mini-cart .yhn-fs-upsell__thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--yhn-line);
  background: var(--yhn-surface);
  display: block;
}

.yhn-fs-upsell--mini-cart .yhn-fs-upsell__thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  margin: 0 !important;
}

.yhn-fs-upsell--mini-cart .yhn-fs-upsell__info {
  min-width: 0;
}

.yhn-fs-upsell--mini-cart .yhn-fs-upsell__name {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  color: var(--yhn-ink) !important;
  text-decoration: none !important;
}

.yhn-fs-upsell--mini-cart .yhn-fs-upsell__price-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.yhn-fs-upsell--mini-cart .yhn-fs-upsell__price,
.yhn-fs-upsell--mini-cart .yhn-fs-upsell__price .amount {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: var(--yhn-brand) !important;
}

.yhn-fs-upsell__tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: var(--yhn-radius-pill);
  background: var(--yhn-success-soft);
  color: var(--yhn-success);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

html body.yhn-redesign-40 .yhn-fs-upsell--mini-cart a.yhn-fs-upsell__btn {
  min-height: 30px !important;
  height: 30px !important;
  padding: 0 10px !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: var(--yhn-radius-pill) !important;
  border: 1px solid var(--yhn-brand-border) !important;
  background: var(--yhn-brand-soft) !important;
  color: var(--yhn-brand) !important;
  -webkit-text-fill-color: var(--yhn-brand) !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  box-shadow: none !important;
}

html body.yhn-redesign-40 .yhn-fs-upsell--mini-cart a.yhn-fs-upsell__btn:hover {
  background: var(--yhn-brand) !important;
  border-color: var(--yhn-brand) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Full-Width Cart Page (/gio-hang/) 4-Column Quiet Ruby Upsell Strip */
.yhn-fs-upsell--cart {
  margin: 28px 0 12px;
  padding: 22px 24px 24px;
  background: #ffffff;
  border: 1px solid var(--yhn-line);
  border-radius: var(--yhn-radius-lg);
  box-shadow: var(--yhn-shadow-sm);
}

.yhn-fs-upsell--cart .yhn-fs-upsell__head {
  margin-bottom: 18px;
}

.yhn-fs-upsell__eyebrow {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--yhn-brand);
}

.yhn-fs-upsell--cart .yhn-fs-upsell__head h2 {
  margin: 0 0 4px !important;
  font-size: clamp(18px, 1.8vw, 22px) !important;
  font-weight: 700 !important;
  color: var(--yhn-ink) !important;
}

.yhn-fs-upsell--cart .yhn-fs-upsell__head p {
  margin: 0 !important;
  font-size: 13.5px !important;
  color: var(--yhn-muted) !important;
}

.yhn-fs-upsell--cart .yhn-fs-upsell__head strong,
.yhn-fs-upsell--cart .yhn-fs-upsell__head .amount {
  color: var(--yhn-brand) !important;
  font-weight: 700 !important;
}

.yhn-fs-upsell--cart .yhn-fs-upsell__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.yhn-fs-upsell--cart .yhn-fs-upsell__item {
  display: flex;
  flex-direction: column;
  background: var(--yhn-surface);
  border: 1px solid var(--yhn-line);
  border-radius: var(--yhn-radius-md);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.yhn-fs-upsell--cart .yhn-fs-upsell__item:hover {
  transform: translateY(-2px);
  border-color: var(--yhn-brand-border);
  box-shadow: var(--yhn-shadow-md);
}

.yhn-fs-upsell--cart .yhn-fs-upsell__thumb {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  background: #ffffff;
  border-bottom: 1px solid var(--yhn-line);
  overflow: hidden;
}

.yhn-fs-upsell--cart .yhn-fs-upsell__thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  padding: 10px !important;
  box-sizing: border-box !important;
}

.yhn-fs-upsell__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: var(--yhn-radius-pill);
  background: var(--yhn-success);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
}

.yhn-fs-upsell--cart .yhn-fs-upsell__info {
  padding: 12px 12px 10px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.yhn-fs-upsell--cart .yhn-fs-upsell__name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.42 !important;
  color: var(--yhn-ink) !important;
  text-decoration: none !important;
}

.yhn-fs-upsell--cart .yhn-fs-upsell__name:hover {
  color: var(--yhn-brand) !important;
}

.yhn-fs-upsell--cart .yhn-fs-upsell__price,
.yhn-fs-upsell--cart .yhn-fs-upsell__price .amount {
  font-size: 14.5px !important;
  font-weight: 800 !important;
  color: var(--yhn-brand) !important;
}

html body.yhn-redesign-40 .yhn-fs-upsell--cart a.yhn-fs-upsell__btn {
  margin: 0 12px 12px !important;
  min-height: 38px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: var(--yhn-radius-md) !important;
  border: 1.5px solid var(--yhn-brand) !important;
  background: #ffffff !important;
  color: var(--yhn-brand) !important;
  -webkit-text-fill-color: var(--yhn-brand) !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

html body.yhn-redesign-40 .yhn-fs-upsell--cart a.yhn-fs-upsell__btn:hover {
  background: var(--yhn-brand) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

@media (max-width: 959px) {
  .yhn-fs-upsell--cart .yhn-fs-upsell__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (max-width: 549px) {
  .yhn-fs-upsell--cart {
    padding: 16px 14px 18px;
  }

  .yhn-fs-upsell--cart .yhn-fs-upsell__list {
    gap: 10px;
  }

  .yhn-fs-upsell--cart .yhn-fs-upsell__info {
    padding: 10px 10px 8px;
  }

  html body.yhn-redesign-40 .yhn-fs-upsell--cart a.yhn-fs-upsell__btn {
    margin: 0 10px 10px !important;
    min-height: 36px !important;
    font-size: 12px !important;
  }
}

/* =========================================================
   4. CART PAGE (/gio-hang/) — SINGLE CARD, CALM HIERARCHY & FULL RESPONSIVE STACK
   ========================================================= */
html body.yhn-redesign-40.woocommerce-cart,
html body.yhn-redesign-40.woocommerce-cart #main {
  background: var(--yhn-surface) !important;
}

html body.yhn-redesign-40.woocommerce-cart .cart-container {
  max-width: var(--yhn-container) !important;
  width: 100% !important;
  margin-inline: auto !important;
  padding-inline: 16px !important;
  box-sizing: border-box !important;
}

/* Clean Cart heading (removes legacy pink gradient card from phase1e) */
html body.yhn-redesign-40.woocommerce-cart .yhn-cart-heading {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid var(--yhn-line) !important;
  border-radius: 0 !important;
  padding: 0 0 14px !important;
  margin: 0 0 18px !important;
  box-shadow: none !important;
}

html body.yhn-redesign-40.woocommerce-cart .yhn-cart-heading h1 {
  color: var(--yhn-ink) !important;
  font-size: clamp(24px, 2.4vw, 30px) !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
}

html body.yhn-redesign-40.woocommerce-cart .yhn-cart-heading p {
  color: var(--yhn-muted) !important;
  font-size: 13.5px !important;
}

/* Desktop 2-column grid */
@media (min-width: 960px) {
  html body.yhn-redesign-40.woocommerce-cart .woocommerce > .row.row-large.row-divided,
  html body.yhn-redesign-40.woocommerce-cart .cart-container > .woocommerce.row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 360px !important;
    gap: 24px !important;
    align-items: start !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  html body.yhn-redesign-40.woocommerce-cart .woocommerce > .row.row-large.row-divided > .large-7.col,
  html body.yhn-redesign-40.woocommerce-cart .woocommerce > .row.row-large.row-divided > .large-5.col,
  html body.yhn-redesign-40.woocommerce-cart .woocommerce > .row.row-large.row-divided > .cart-collaterals,
  html body.yhn-redesign-40.woocommerce-cart .cart-container > .woocommerce.row > .col {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* Tablet + Mobile clean 1-column full-width stack (fixes 880px right-orphan & 343px vs 309px mismatch) */
@media (max-width: 959px) {
  html body.yhn-redesign-40.woocommerce-cart .woocommerce > .row.row-large.row-divided,
  html body.yhn-redesign-40.woocommerce-cart .cart-container > .woocommerce.row {
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
    margin: 0 !important;
    width: 100% !important;
  }

  html body.yhn-redesign-40.woocommerce-cart .woocommerce > .row.row-large.row-divided > .large-7.col,
  html body.yhn-redesign-40.woocommerce-cart .woocommerce > .row.row-large.row-divided > .large-5.col,
  html body.yhn-redesign-40.woocommerce-cart .woocommerce > .row.row-large.row-divided > .cart-collaterals,
  html body.yhn-redesign-40.woocommerce-cart .cart-container > .woocommerce.row > .col {
    flex: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* Harmonized single white card for Cart table & Cart Totals (eliminates nested double border) */
html body.yhn-redesign-40.woocommerce-cart .woocommerce-cart-form .cart-wrapper {
  background: var(--yhn-bg) !important;
  border: 1px solid var(--yhn-line) !important;
  border-radius: var(--yhn-radius-lg) !important;
  box-shadow: var(--yhn-shadow-sm) !important;
}

html body.yhn-redesign-40.woocommerce-cart .cart-sidebar {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

html body.yhn-redesign-40.woocommerce-cart .cart_totals {
  background: var(--yhn-bg) !important;
  border: 1px solid var(--yhn-line) !important;
  border-radius: var(--yhn-radius-lg) !important;
  padding: 20px !important;
  box-shadow: var(--yhn-shadow-sm) !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
}

html body.yhn-redesign-40.woocommerce-cart .cart_totals > h2 {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid var(--yhn-line) !important;
  border-radius: 0 !important;
  margin: 0 0 12px !important;
  padding: 0 0 12px !important;
  color: var(--yhn-ink) !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
}

html body.yhn-redesign-40.woocommerce-cart .cart_totals > table.shop_table {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  margin: 0 !important;
}

html body.yhn-redesign-40.woocommerce-cart .cart_totals > table.shop_table > tbody > tr > th,
html body.yhn-redesign-40.woocommerce-cart .cart_totals > table.shop_table > tbody > tr > td {
  background: transparent !important;
  border-color: var(--yhn-line) !important;
  padding: 12px 0 !important;
  color: var(--yhn-ink) !important;
}

html body.yhn-redesign-40.woocommerce-cart .cart_totals > table.shop_table > tbody > tr > th {
  color: var(--yhn-muted) !important;
  font-weight: 600 !important;
}

html body.yhn-redesign-40.woocommerce-cart table.shop_table.cart thead th {
  background: var(--yhn-surface) !important;
  color: var(--yhn-ink) !important;
  border-color: var(--yhn-line) !important;
}

html body.yhn-redesign-40.woocommerce-cart table.shop_table.cart tbody td {
  border-bottom-color: var(--yhn-line) !important;
}

html body.yhn-redesign-40.woocommerce-cart table.shop_table.cart td.product-remove a.remove {
  border-color: var(--yhn-line) !important;
  color: var(--yhn-muted) !important;
}

html body.yhn-redesign-40.woocommerce-cart table.shop_table.cart td.product-remove a.remove:hover {
  border-color: var(--yhn-brand) !important;
  color: var(--yhn-brand) !important;
  background: var(--yhn-brand-soft) !important;
}

html body.yhn-redesign-40.woocommerce-cart table.shop_table.cart td.product-name a {
  color: var(--yhn-ink) !important;
}

html body.yhn-redesign-40.woocommerce-cart table.shop_table.cart td.product-name a:hover {
  color: var(--yhn-brand) !important;
}

/* Calm Price Hierarchy: dark ink for unit/subtotal, Quiet Ruby for row subtotal & Grand Total */
html body.yhn-redesign-40.woocommerce-cart td.product-price .amount,
html body.yhn-redesign-40.woocommerce-cart .cart_totals .cart-subtotal .amount {
  color: var(--yhn-ink) !important;
  font-weight: 600 !important;
}

html body.yhn-redesign-40.woocommerce-cart td.product-subtotal .amount,
html body.yhn-redesign-40.woocommerce-cart .cart_totals .order-total .amount,
html body.yhn-redesign-40.woocommerce-cart .cart_totals > table.shop_table > tbody > tr.order-total > td,
html body.yhn-redesign-40.woocommerce-cart .cart_totals > table.shop_table > tbody > tr.order-total .amount {
  color: var(--yhn-brand) !important;
  font-weight: 800 !important;
}

html body.yhn-redesign-40.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
  background: var(--yhn-brand) !important;
  border-color: var(--yhn-brand) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-radius: var(--yhn-radius-md) !important;
  min-height: 48px !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em !important;
  box-shadow: var(--yhn-shadow-brand) !important;
}

html body.yhn-redesign-40.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
  background: var(--yhn-brand-hover) !important;
  border-color: var(--yhn-brand-hover) !important;
}

/* Hide floating contact (.yhn-contact) on Cart & whenever ANY Off-Canvas Drawer / Side Cart is open */
html body.yhn-redesign-40.woocommerce-cart .yhn-contact,
html body.yhn-redesign-40.cfw-side-cart-open .yhn-contact,
html.mfp-helper body.yhn-redesign-40 .yhn-contact,
html.mfp-zoom-out-cur .yhn-contact,
html:has(.mfp-wrap.off-canvas) .yhn-contact,
body:has(.mfp-wrap) .yhn-contact {
  display: none !important;
}

@media (max-width: 849px) {
  /* Collapse entire checkout-page-title wrapper on mobile (kills ~90px top gap & redundant "Giỏ hàng") */
  html body.yhn-redesign-40.woocommerce-cart .checkout-page-title,
  html body.yhn-redesign-40.woocommerce-cart .checkout-breadcrumbs {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html body.yhn-redesign-40.woocommerce-cart #content.content-area.page-wrapper {
    padding-top: 12px !important;
    padding-bottom: 28px !important;
  }

  /* Avoid duplicate item price on mobile cart cards (keep crisp subtotal only) */
  html body.yhn-redesign-40.woocommerce-cart table.shop_table.cart td.product-price,
  html body.yhn-redesign-40.woocommerce-cart table.shop_table.cart .mobile-product-price {
    display: none !important;
  }

  html body.yhn-redesign-40.woocommerce-cart .cart_totals {
    padding: 16px !important;
  }
}

/* =========================================================
   5. ORDER TRACKING (/theo-doi-don-hang/) & MY ACCOUNT (/tai-khoan-cua-toi/)
   ========================================================= */
.yhn-track-page {
  background: var(--yhn-surface);
  padding: 28px 0 56px;
}

.yhn-track-shell {
  width: min(760px, calc(100% - 28px));
  margin-inline: auto;
}

.yhn-track-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--yhn-muted);
  margin-bottom: 16px;
}

.yhn-track-breadcrumb a {
  color: var(--yhn-muted) !important;
}

.yhn-track-breadcrumb a:hover {
  color: var(--yhn-brand) !important;
}

.yhn-account-page-head {
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--yhn-line);
}

.yhn-account-page-head h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 700;
  color: var(--yhn-ink);
}

.yhn-account-page-head p {
  margin: 0;
  font-size: 13.5px;
  color: var(--yhn-muted);
}

.yhn-track-card,
.yhn-account-guest-track {
  background: var(--yhn-bg);
  border: 1px solid var(--yhn-line);
  border-radius: var(--yhn-radius-lg);
  padding: clamp(20px, 3vw, 34px);
  box-shadow: var(--yhn-shadow-sm);
}

.yhn-account-guest-track {
  margin-top: 28px;
}

.yhn-track-eyebrow {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--yhn-brand);
}

.yhn-track-card h1,
.yhn-account-guest-track h2 {
  margin: 0 0 8px;
  font-size: clamp(21px, 2.2vw, 26px);
  font-weight: 700;
  color: var(--yhn-ink);
}

.yhn-track-lead,
.yhn-account-guest-track__head p {
  margin: 0 0 20px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--yhn-muted);
}

/* Full-width Order Tracking inputs (fixes clipped placeholder text on Desktop & Mobile) */
.yhn-track-form-wrap form.woocommerce-form-track-order {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 14px !important;
  margin: 0 !important;
  width: 100% !important;
}

.yhn-track-form-wrap form.woocommerce-form-track-order > p,
.yhn-track-form-wrap form.woocommerce-form-track-order .form-row,
.yhn-track-form-wrap form.woocommerce-form-track-order .form-row-first,
.yhn-track-form-wrap form.woocommerce-form-track-order .form-row-last {
  float: none !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.yhn-track-form-wrap form.woocommerce-form-track-order .clear {
  display: none !important;
}

.yhn-track-form-wrap form.woocommerce-form-track-order label {
  display: block !important;
  margin-bottom: 6px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--yhn-ink) !important;
}

.yhn-track-form-wrap input[type="text"],
.yhn-track-form-wrap input[type="email"],
html body.yhn-redesign-40.woocommerce-account input[type="text"],
html body.yhn-redesign-40.woocommerce-account input[type="email"],
html body.yhn-redesign-40.woocommerce-account input[type="password"] {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  border-radius: var(--yhn-radius-md) !important;
  border: 1px solid var(--yhn-line) !important;
  background: var(--yhn-surface) !important;
  min-height: 44px !important;
  padding: 0 14px !important;
}

.yhn-track-form-wrap input:focus,
html body.yhn-redesign-40.woocommerce-account input:focus {
  border-color: var(--yhn-brand) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px var(--yhn-brand-soft) !important;
}

.yhn-track-form-wrap button[type="submit"],
html body.yhn-redesign-40.woocommerce-account button.woocommerce-form-login__submit,
html body.yhn-redesign-40.woocommerce-account button.woocommerce-Button {
  background: var(--yhn-brand) !important;
  border-color: var(--yhn-brand) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-radius: var(--yhn-radius-md) !important;
  min-height: 44px !important;
  padding-inline: 24px !important;
  font-weight: 700 !important;
  box-shadow: var(--yhn-shadow-brand) !important;
}

.yhn-track-form-wrap button[type="submit"]:hover,
html body.yhn-redesign-40.woocommerce-account button.woocommerce-form-login__submit:hover,
html body.yhn-redesign-40.woocommerce-account button.woocommerce-Button:hover {
  background: var(--yhn-brand-hover) !important;
}

html body.yhn-redesign-40.woocommerce-account .lost_password a,
html body.yhn-redesign-40.woocommerce-account .woocommerce-MyAccount-content a,
html body.yhn-redesign-40 .yhn-account-guest-track a,
html body.yhn-redesign-40 .yhn-track-help a {
  color: var(--yhn-brand) !important;
  font-weight: 600 !important;
}

html body.yhn-redesign-40.woocommerce-account .lost_password a:hover,
html body.yhn-redesign-40 .yhn-account-guest-track a:hover,
html body.yhn-redesign-40 .yhn-track-help a:hover {
  color: var(--yhn-brand-hover) !important;
}

.yhn-track-help {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--yhn-line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--yhn-muted);
}
