/*
Theme Name: Flatsome Child
Theme URI: https://uxthemes.com/
Description: This is a child theme for Flatsome Theme, customized for NDR B2B Pharmacy.
Author: UX-Themes / NDR
Author URI: https://ndr.co.th/
Template: flatsome
Version: 3.0
*/

/* ===================================================
   1. โค้ดเดิม: ดึงกล่องให้ลอยทับแบนเนอร์
   =================================================== */
.overlap-box {
  margin-top: -60px;
  position: relative;
  z-index: 10;
}

@media (max-width: 849px) {
  .overlap-box {
    margin-top: -30px;
  }
}

/* ===================================================
   2. โค้ดเดิม: ปลดล็อกหน้าหมวดหมู่และค้นหาให้กว้าง 95%
   =================================================== */
.woocommerce-page .category-page-row,
.woocommerce-page .category-page-row .products.row {
  max-width: 95% !important;
  width: 95% !important;
}

.woocommerce-page .shop-page-title .page-title-inner {
  max-width: 95% !important;
  width: 95% !important;
}

/* ===================================================
   3. โค้ดเดิม: บังคับ 4 จุดเด่น (คอม 4 ช่อง / มือถือ 2x2)
   =================================================== */
.b2b-trust-wrapper {
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  padding-top: 25px;
  margin-top: 30px;
  width: 100%;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

/* บังคับซ่อนกล่องล่องหนที่ WordPress แอบแทรกเข้ามา */
.b2b-trust-grid > p {
  display: none !important;
}

/* 1. จอมือถือ: ล็อก 2 คอลัมน์ (2x2) */
.b2b-trust-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 16px 12px;
  text-align: left;
}

/* 2. จอคอมพิวเตอร์: เรียง 4 คอลัมน์แถวเดียวเต็มจอ */
@media (min-width: 768px) {
  .b2b-trust-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px;
  }
}

.b2b-trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.b2b-trust-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.b2b-trust-title {
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
}

.b2b-trust-desc {
  color: #bae6fd;
  font-size: 11px;
  margin-top: 3px;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .b2b-trust-icon { font-size: 28px; }
  .b2b-trust-title { font-size: 14px; }
  .b2b-trust-desc { font-size: 12px; }
  .b2b-trust-item { gap: 12px; }
}

/* ===================================================
   4. โค้ดเดิม: ล็อกปุ่ม Flatsome ในแบนเนอร์ ไม่ให้ไอคอนหลุดตกบรรทัด
   =================================================== */
.banner .button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
}

/* เมื่อดูในจอมือถือ: ให้ปุ่มเรียงบน-ล่าง ยืดเต็มจอ ไม่เบียดกัน */
@media (max-width: 549px) {
  .banner .button {
    display: flex !important;
    width: 100% !important;
    max-width: 320px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-bottom: 10px !important;
    font-size: 14px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

/* สั่งซ่อนการตัดบรรทัดบนจอคอมและแท็บเล็ต */
.mobile-break {
  display: none;
}

/* ให้ตัดบรรทัดเฉพาะบนจอมือถือเท่านั้น (จอต่ำกว่า 549px) */
@media (max-width: 549px) {
  .mobile-break {
    display: inline;
  }
}

/* ===================================================
   5. โค้ดเดิม: ขยายความกว้าง Top Bar และ Header ให้กว้าง 95%
   =================================================== */
@media (min-width: 850px) {
  #top-bar .flex-row.container,
  .header-main .header-inner,
  .header-bottom .flex-row.container {
    width: 95% !important;
    max-width: 1440px !important;
  }

  .header-nav {
    flex-wrap: nowrap !important;
  }

  /* ล็อกแถบซ้ายของ Top Bar ให้อยู่แถวเดียวเสมอ ไม่ตกบรรทัด */
  .html_topbar_left div {
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
  }
}

/* ===================================================
   6. โค้ดเดิม: เมนูย่อย 3 คอลัมน์ แนวนอน (Desktop Mega Menu)
   =================================================== */
@media (min-width: 850px) {
  /* 1. จัดลำดับเลเยอร์ (Stacking Context): แถวบน (#masthead) ต้องอยู่สูงกว่าแถวล่าง (#wide-nav) */
  #masthead,
  .header-main {
    z-index: 1000 !important;
    position: relative !important;
  }

  #wide-nav,
  .header-bottom {
    z-index: 900 !important;
    position: relative !important;
  }

  /* ล็อกพื้นหลังขาวทึบ 100% */
  .header-main,
  .header-wrapper.stuck .header-main {
    background-color: #ffffff !important;
  }

  /* 2. กำหนดโครงสร้าง 3 คอลัมน์ + ปลดล็อกเพดานความสูง */
  .header-nav #menu-item-8709 > .nav-dropdown,
  .header-nav #menu-item-8712 > .nav-dropdown,
  .header-nav .mega-menu-3col > .nav-dropdown {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(200px, 225px)) !important;
    gap: 0 16px !important;
    width: 690px !important;
    max-width: 90vw !important;
    padding: 16px 20px !important;
    background-color: #ffffff !important;
    inset: auto !important;
    top: 100% !important;
    bottom: auto !important;
    height: auto !important;
    max-height: none !important;
    border-radius: 8px !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.22) !important;
    border: 1px solid #e2e8f0 !important;
    z-index: 99999 !important;
  }

  /* 3. ล็อกตำแหน่งตอนชี้เมาส์ (Hover) */
  .header-nav #menu-item-8709:hover > .nav-dropdown,
  .header-nav #menu-item-8709.current-dropdown > .nav-dropdown,
  .header-nav #menu-item-8712:hover > .nav-dropdown,
  .header-nav #menu-item-8712.current-dropdown > .nav-dropdown,
  .header-nav .mega-menu-3col:hover > .nav-dropdown,
  .header-nav .mega-menu-3col.current-dropdown > .nav-dropdown {
    inset: auto !important;
    top: 100% !important;
    bottom: auto !important;
    left: 0 !important;
    margin-left: 0 !important;
  }

  /* 4. เส้นคั่นแถว */
  .header-nav #menu-item-8709 > .nav-dropdown > li,
  .header-nav #menu-item-8712 > .nav-dropdown > li,
  .header-nav .mega-menu-3col > .nav-dropdown > li {
    border-bottom: 1px dashed #e2e8f0 !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 2px 0 !important;
    display: flex !important;
  }

  /* 5. สไตล์ตัวหนังสือ */
  .header-nav #menu-item-8709 > .nav-dropdown > li > a,
  .header-nav #menu-item-8712 > .nav-dropdown > li > a,
  .header-nav .mega-menu-3col > .nav-dropdown > li > a {
    border-bottom: 0 !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    font-size: 13.5px !important;
    color: #1e293b !important;
    line-height: 1.4 !important;
    white-space: normal !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
  }

  /* 6. ไฮไลต์เมื่อเลื่อนเมาส์ชี้ (Hover) */
  .header-nav #menu-item-8709 > .nav-dropdown > li > a:hover,
  .header-nav #menu-item-8712 > .nav-dropdown > li > a:hover,
  .header-nav .mega-menu-3col > .nav-dropdown > li > a:hover {
    background-color: #f1f5f9 !important;
    color: #0284c7 !important;
    padding-left: 14px !important;
  }
}

/* ===================================================
   7. B2B Header Suite: 3 ปุ่มขวาบน (ฉัน, รายการโปรด, ตะกร้า), กล่องค้นหา และ Menu Bar
      โทน ขาว ฟ้า น้ำเงิน สไตล์ Nextgen (Medical B2B Modern)
   =================================================== */

/* --- 7.0 ปรับขนาดตัวหนังสือ Menu Bar ให้อ่านง่าย คมชัด สบายตา --- */
.header-bottom .nav > li > a,
#wide-nav .nav > li > a {
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
}

/* --- 7.1 กล่องและปุ่มค้นหาขนาดใหญ่ (Modern Search Box 44px) --- */
.header-search-form .searchform-wrapper {
  border: 2px solid #0284c7 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  overflow: hidden !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.08) !important;
  transition: all 0.25s ease !important;
}

.header-search-form .searchform-wrapper:focus-within {
  border-color: #0369a1 !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.2) !important;
}

.header-search-form input[type="search"] {
  height: 44px !important;
  font-size: 15px !important;
  padding: 0 16px !important;
  color: #0f172a !important;
  border: none !important;
  background: transparent !important;
}

.header-search-form input[type="search"]::placeholder {
  color: #94a3b8 !important;
  font-size: 14.5px !important;
}

.header-search-form .ux-search-submit {
  height: 44px !important;
  width: 48px !important;
  background-color: #0284c7 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background-color 0.2s ease !important;
}

.header-search-form .ux-search-submit i {
  font-size: 18px !important;
  color: #ffffff !important;
}

.header-search-form .ux-search-submit:hover {
  background-color: #0369a1 !important;
}

/* --- 7.2 ชุด 3 ปุ่มมุมขวาบน (ฉัน, รายการโปรด, ตะกร้าสินค้า) โทน ขาว ฟ้า น้ำเงิน --- */
.header-main .nav-right {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.header-main .nav-right > li {
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
}

.header-main .nav-right .header-divider {
  display: none !important;
}

/* ปุ่ม 1: ฉัน (Account Button) */
.header-main .account-item > a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  background-color: #f0f9ff !important;
  color: #0369a1 !important;
  border: 1.5px solid #0284c7 !important;
  padding: 8px 16px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  height: 42px !important;
  text-decoration: none !important;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.1) !important;
  transition: all 0.25s ease !important;
  box-sizing: border-box !important;
}

.header-main .account-item > a::before,
.nav:hover > li.account-item:not(:hover) > a::before,
.header-nav:hover > li.account-item:not(:hover) > a::before {
  content: "\e901" !important;
  font-family: "fl-icons" !important;
  font-size: 16px !important;
  color: #0284c7 !important;
  line-height: 1 !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: inline-block !important;
}

.header-main .account-item > a:hover {
  background-color: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25) !important;
}

.header-main .account-item > a:hover::before {
  color: #ffffff !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* ปุ่ม 2: รายการโปรด (Wishlist Button) */
.header-nav .header-wishlist-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  background-color: #f0f9ff !important;
  color: #0369a1 !important;
  border: 1.5px solid #0284c7 !important;
  padding: 8px 16px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  height: 42px !important;
  text-decoration: none !important;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.1) !important;
  transition: all 0.25s ease !important;
  box-sizing: border-box !important;
}

.header-nav .header-wishlist-btn i {
  font-size: 16px !important;
  color: #ef4444 !important;
  line-height: 1 !important;
  transition: transform 0.2s ease !important;
}

.header-nav .header-wishlist-btn:hover {
  background-color: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25) !important;
}

.header-nav .header-wishlist-btn:hover i {
  color: #ffffff !important;
  transform: scale(1.15) !important;
}

/* ปุ่ม 3: ตะกร้าสินค้า (Cart Button - Primary Action จัดกึ่งกลางแนวตั้ง 100%) */
.header-main .cart-item > a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  background-color: #0284c7 !important;
  color: #ffffff !important;
  border: 1.5px solid #0284c7 !important;
  padding: 0 18px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  height: 42px !important;
  text-decoration: none !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3) !important;
  transition: all 0.25s ease !important;
  box-sizing: border-box !important;
}

.header-main .cart-item > a .header-cart-title {
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
}

.header-main .cart-item > a .cart-price {
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1 !important;
  color: #e0f2fe !important;
  margin-left: 4px !important;
}

.header-main .cart-item > a .cart-icon.image-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: auto !important;
  line-height: 1 !important;
  margin: 0 0 0 6px !important;
  padding: 0 !important;
}

.header-main .cart-item > a .cart-icon.image-icon strong {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background-color: #ffffff !important;
  color: #0284c7 !important;
  font-weight: 800 !important;
  border: 1px solid #0284c7 !important;
  height: 20px !important;
  width: 20px !important;
  min-width: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  font-size: 11px !important;
  border-radius: 50% !important;
  box-sizing: border-box !important;
}

.header-main .cart-item > a:hover {
  background-color: #0369a1 !important;
  border-color: #0369a1 !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4) !important;
}

/* --- 7.2.1 Dropdown จัดตำแหน่งให้อยู่ใต้ปุ่ม 100% ไม่บังปุ่ม (ฉัน & Cart) --- */
.header-main .account-item > .nav-dropdown,
.header-main .cart-item > .nav-dropdown {
  top: 100% !important;
  bottom: auto !important;
  margin-top: 10px !important;
  left: auto !important;
  right: 0 !important;
  border-radius: 12px !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.06) !important;
  border: 1px solid #e2e8f0 !important;
  z-index: 9999 !important;
}

/* Hover bridge ป้องกันเมาส์หลุดตอนเลื่อนข้ามช่องว่าง 10px */
.header-main .account-item > .nav-dropdown::before,
.header-main .cart-item > .nav-dropdown::before {
  content: "" !important;
  position: absolute !important;
  top: -12px !important;
  left: 0 !important;
  right: 0 !important;
  height: 14px !important;
  background: transparent !important;
  display: block !important;
}

/* สไตล์เมนูบัญชีของฉัน (ฉัน) ให้สวยงาม คมชัด สไตล์โมเดิร์น */
.header-main .account-item > .nav-dropdown {
  min-width: 230px !important;
  padding: 8px 0 !important;
  background-color: #ffffff !important;
}

.header-main .account-item > .nav-dropdown li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.header-main .account-item > .nav-dropdown li a {
  display: flex !important;
  align-items: center !important;
  padding: 9px 18px !important;
  color: #334155 !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  text-decoration: none !important;
  transition: all 0.15s ease !important;
}

.header-main .account-item > .nav-dropdown li a:hover {
  background-color: #f0f9ff !important;
  color: #0284c7 !important;
  padding-left: 22px !important;
}

.header-main .account-item > .nav-dropdown li.woocommerce-MyAccount-navigation-link--customer-logout a {
  color: #ef4444 !important;
  border-top: 1px solid #f1f5f9 !important;
  margin-top: 4px !important;
  padding-top: 10px !important;
}

.header-main .account-item > .nav-dropdown li.woocommerce-MyAccount-navigation-link--customer-logout a:hover {
  background-color: #fef2f2 !important;
  color: #dc2626 !important;
}

/* --- 7.3 ปุ่มหัวใจในการ์ดสินค้า (Shop Grid) & สินค้า Out of Stock --- */

/* 1. ซ่อนข้อความทุกชนิดในปุ่มหัวใจ 100% ทั้งแบบ span, feedback, tooltip, popup message */
.product-small .yith-wcwl-add-to-wishlist a span,
.product-small .yith-wcwl-add-to-wishlist .feedback,
.product-small .yith-wcwl-add-to-wishlist .separator,
.product-small .yith-wcwl-add-to-wishlist a.delete_item span,
.yith-wcwl-add-to-wishlist a span,
.yith-wcwl-add-to-wishlist .feedback,
.yith-wcwl-add-to-wishlist .separator,
.yith-wcwl-add-to-wishlist a.delete_item span,
.yith-wcwl-tooltip,
#yith-wcwl-popup-message,
.b2b-cart-action-row .yith-wcwl-add-to-wishlist .ajax-loading,
.b2b-cart-action-row .yith-wcwl-add-to-wishlist .blockUI,
.b2b-cart-action-row .yith-wcwl-add-to-wishlist .blockOverlay,
.product-small .yith-wcwl-add-to-wishlist .ajax-loading,
.product-small .yith-wcwl-add-to-wishlist .blockUI {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
}

/* 2. บังคับ font-size: 0 และ text-indent เพื่อตัด raw text ทุกคำ */
.product-small .yith-wcwl-add-to-wishlist a,
.b2b-cart-action-row .yith-wcwl-add-to-wishlist a,
.yith-wcwl-add-to-wishlist a {
  font-size: 0 !important;
  color: transparent !important;
  line-height: 0 !important;
  text-indent: -9999px !important;
}

/* คืนค่า text-indent ให้ไอคอนหัวใจ SVG / i แสดงผลตรงกลางปุ่มเสมอ */
.product-small .yith-wcwl-add-to-wishlist a svg,
.b2b-cart-action-row .yith-wcwl-add-to-wishlist a svg,
.yith-wcwl-add-to-wishlist a svg,
.product-small .yith-wcwl-add-to-wishlist a i,
.b2b-cart-action-row .yith-wcwl-add-to-wishlist a i,
.yith-wcwl-add-to-wishlist a i {
  text-indent: 0 !important;
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  margin: 0 auto !important;
  pointer-events: none !important;
}

/* 3. จัดแถวปุ่มสั่งซื้อ หรือ แถวสินค้าหมด (Out of Stock) คู่กับปุ่มหัวใจ */
.b2b-cart-action-row,
.b2b-out-of-stock-row {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  margin-top: auto !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100% !important;
  align-self: center !important;
}

/* จัดข้อความ Out of Stock (สินค้าหมด) ให้เป็นปุ่มขนาดกะทัดรัด 35px คู่กับปุ่มหัวใจ */
.product-small .stock.out-of-stock,
.product-small p.out-of-stock {
  height: 35px !important;
  line-height: 35px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #dc2626 !important;
  background-color: #fef2f2 !important;
  border: 1px solid #fecaca !important;
  border-radius: 4px !important;
  padding: 0 16px !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
  flex: none !important;
}

/* 4. ล็อกขนาดปุ่มหัวใจ 35x35px สี่เหลี่ยมมน ไม่เบี้ยว ไม่ยืด ทุกกรณี */
.product-small .yith-wcwl-add-to-wishlist,
.b2b-cart-action-row .yith-wcwl-add-to-wishlist,
.yith-wcwl-add-to-wishlist {
  margin: 0 !important;
  padding: 0 !important;
  width: 35px !important;
  min-width: 35px !important;
  max-width: 35px !important;
  height: 35px !important;
  min-height: 35px !important;
  max-height: 35px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.product-small .yith-wcwl-add-to-wishlist .yith-wcwl-add-button,
.product-small .yith-wcwl-add-to-wishlist .yith-wcwl-wishlistaddedbrowse,
.product-small .yith-wcwl-add-to-wishlist .yith-wcwl-wishlistexistsbrowse,
.b2b-cart-action-row .yith-wcwl-add-to-wishlist .yith-wcwl-add-button,
.b2b-cart-action-row .yith-wcwl-add-to-wishlist .yith-wcwl-wishlistaddedbrowse,
.b2b-cart-action-row .yith-wcwl-add-to-wishlist .yith-wcwl-wishlistexistsbrowse {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 35px !important;
  height: 35px !important;
  flex-shrink: 0 !important;
}

.product-small .yith-wcwl-add-to-wishlist a,
.b2b-cart-action-row .yith-wcwl-add-to-wishlist a,
.yith-wcwl-add-to-wishlist a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 35px !important;
  height: 35px !important;
  min-width: 35px !important;
  max-width: 35px !important;
  min-height: 35px !important;
  max-height: 35px !important;
  border-radius: 4px !important;
  border: 1px solid #d1d5db !important;
  background-color: #ffffff !important;
  color: #ef4444 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  line-height: 1 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

.product-small .yith-wcwl-add-to-wishlist a:hover,
.b2b-cart-action-row .yith-wcwl-add-to-wishlist a:hover {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
  transform: scale(1.05);
}

/* ขนาดและเส้นไอคอนหัวใจ (ตอนยังไม่กด: รูปหัวใจโปร่งสีแดง) */
.product-small .yith-wcwl-add-to-wishlist a svg,
.product-small .yith-wcwl-add-to-wishlist a i,
.b2b-cart-action-row .yith-wcwl-add-to-wishlist a svg,
.b2b-cart-action-row .yith-wcwl-add-to-wishlist a i,
.yith-wcwl-add-to-wishlist a svg,
.yith-wcwl-add-to-wishlist a i {
  width: 18px !important;
  height: 18px !important;
  font-size: 18px !important;
  margin: 0 !important;
  fill: none !important;
  stroke: #ef4444 !important;
  stroke-width: 2 !important;
  color: #ef4444 !important;
}

/* 5. เมื่อกดหัวใจแล้ว (Active / Added / Exists / delete_item): เปลี่ยนปุ่มเป็นพื้นชมพูแดงอ่อน + ขอบแดง + ถมหัวใจแดงทึบ ❤️ */
.product-small .yith-wcwl-wishlistaddedbrowse a,
.product-small .yith-wcwl-wishlistexistsbrowse a,
.product-small .yith-wcwl-add-to-wishlist a.delete_item,
.b2b-cart-action-row .yith-wcwl-wishlistaddedbrowse a,
.b2b-cart-action-row .yith-wcwl-wishlistexistsbrowse a,
.b2b-cart-action-row .yith-wcwl-add-to-wishlist a.delete_item,
.yith-wcwl-wishlistaddedbrowse a,
.yith-wcwl-wishlistexistsbrowse a {
  background-color: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #ef4444 !important;
}

.product-small .yith-wcwl-wishlistaddedbrowse a svg,
.product-small .yith-wcwl-wishlistexistsbrowse a svg,
.product-small .yith-wcwl-add-to-wishlist a.delete_item svg,
.b2b-cart-action-row .yith-wcwl-wishlistaddedbrowse a svg,
.b2b-cart-action-row .yith-wcwl-wishlistexistsbrowse a svg,
.b2b-cart-action-row .yith-wcwl-add-to-wishlist a.delete_item svg,
.yith-wcwl-wishlistaddedbrowse a svg,
.yith-wcwl-wishlistexistsbrowse a svg {
  fill: #ef4444 !important;
  stroke: #ef4444 !important;
}

.product-small .yith-wcwl-wishlistaddedbrowse a i,
.product-small .yith-wcwl-wishlistexistsbrowse a i,
.product-small .yith-wcwl-add-to-wishlist a.delete_item i,
.b2b-cart-action-row .yith-wcwl-wishlistaddedbrowse a i,
.b2b-cart-action-row .yith-wcwl-wishlistexistsbrowse a i,
.b2b-cart-action-row .yith-wcwl-add-to-wishlist a.delete_item i,
.yith-wcwl-wishlistaddedbrowse a i,
.yith-wcwl-wishlistexistsbrowse a i {
  color: #ef4444 !important;
}

/* ===================================================
   8. โค้ดเดิม: สไตล์กล่องเปรียบเทียบ B2B และ 6 หมวดหมู่สินค้า
   =================================================== */

/* ปรับระยะดึงลอยของกล่องเปรียบเทียบบนมือถือ */
@media (max-width: 849px) {
  .wholesale-compare-card {
    margin-top: -20px !important;
    border-radius: 12px !important;
  }
}

/* เอฟเฟกต์ยกการ์ดลอยขึ้น + เปลี่ยนสีกรอบ เมื่อเลื่อนเมาส์ชี้กล่อง 6 หมวดหมู่ */
.category-box:hover {
  transform: translateY(-4px);
  border-color: #0284c7 !important;
  box-shadow: 0 10px 20px -3px rgba(2, 132, 199, 0.15) !important;
}

/* ===================================================
   9. สไตล์หน้าสมัครสมาชิก B2B + ปรับสัดส่วน Login/Register
   =================================================== */

/* 9.1 ปรับสัดส่วน: Login 35% และ Register 65% */
@media (min-width: 850px) {
  #customer_login .col-1,
  .woocommerce-account #customer_login .col-1,
  #customer_login > .large-6:first-child,
  .account-login-inner #customer_login > .col:first-child {
    max-width: 35% !important;
    flex: 0 0 35% !important;
    width: 35% !important;
  }

  #customer_login .col-2,
  .woocommerce-account #customer_login .col-2,
  #customer_login > .large-6:last-child,
  .account-login-inner #customer_login > .col:last-child {
    max-width: 65% !important;
    flex: 0 0 65% !important;
    width: 65% !important;
  }
}

/* 9.2 จัดโครงสร้างฟอร์ม 2 คอลัมน์ฝั่ง Register */
.ndr-b2b-form-wrap {
  margin-top: 20px;
}
.ndr-form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  align-items: flex-start;
}
.ndr-col {
  flex: 1;
  min-width: 0;
}
.ndr-col-full {
  flex: 100%;
}

.ndr-form-row .ndr-col input.input-text {
  height: 42px !important;
  margin-bottom: 0 !important;
  box-sizing: border-box !important;
  border: 1px solid #dcdfe6 !important;
  border-radius: 4px !important;
  width: 100% !important;
}

.ndr-phone-wrapper {
  display: flex !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 42px !important;
  margin-bottom: 0 !important;
  box-sizing: border-box !important;
}

.ndr-flag-prefix {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #f8fafc !important;
  border: 1px solid #dcdfe6 !important;
  border-right: none !important;
  border-radius: 4px 0 0 4px !important;
  padding: 0 10px !important;
  font-size: 13.5px !important;
  white-space: nowrap !important;
  user-select: none !important;
  height: 42px !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
}

.ndr-phone-wrapper input.input-text,
.ndr-phone-wrapper input[type="tel"] {
  flex: 1 1 auto !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 42px !important;
  margin: 0 !important;
  border-radius: 0 4px 4px 0 !important;
  border: 1px solid #dcdfe6 !important;
  border-left: 1px solid #e2e8f0 !important;
  box-sizing: border-box !important;
}

.ndr-upload-group {
  margin: 24px 0;
  border-top: 1px solid #eee;
  padding-top: 20px;
}
.ndr-upload-field {
  margin-bottom: 18px;
}
.ndr-upload-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 14.5px;
}
.red-note {
  color: #e53935;
  font-size: 13px;
  font-weight: normal;
}
.file-hint {
  display: block;
  font-size: 12px;
  color: #718096;
  margin-top: 4px;
}
.ndr-terms-field {
  margin: 24px 0 28px;
  font-size: 14px;
}

.woocommerce-password-strength,
.woocommerce-password-hint,
.woocommerce-form-register .woocommerce-password-strength,
.woocommerce-form-register .woocommerce-password-hint {
  display: none !important;
}

.woocommerce-form-register__submit,
button[name="register"] {
  background-color: #f7941d !important;
  color: #ffffff !important;
  border-radius: 8px !important;
  padding: 10px 48px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  border: none !important;
  display: block !important;
  margin: 0 auto !important;
  box-shadow: 0 2px 6px rgba(247, 148, 29, 0.3) !important;
  transition: background-color 0.2s, transform 0.1s !important;
}
.woocommerce-form-register__submit:hover,
button[name="register"]:hover {
  background-color: #e67e17 !important;
}

@media (max-width: 768px) {
  .ndr-form-row {
    flex-direction: column;
    gap: 12px;
  }
  #customer_login .col-1,
  #customer_login .col-2 {
    max-width: 100% !important;
    flex: 0 0 100% !important;
    width: 100% !important;
  }
}

/* ===================================================
   10. ปรับแต่งการ์ดสินค้าในหน้า Shop Grid สไตล์ B2B SEAMLESS BORDER GRID (Section 10)
   - 1. เส้นตารางเชื่อมติดกันแบบ Table Grid (Vertical & Horizontal lines touch each other)
   - 2. ซ่อนหมวดหมู่สินค้าใต้รูปภาพสินค้า ไม่ต้องแสดงผล
   - 3. จัดตารางและแถวสินค้าให้ขนานตรงกันในแนวนอน 100% ทุกแถว (Horizontal Alignment)
   - 4. ซ่อนสถานะ In stock ไม่ต้องแสดงผล
   - 5. ชื่อการค้า (Trade Name): font-size=16.5px สีส้มสดใส (#ea580c) ล็อกความสูง 52px สวยงามทั้ง 1 และ 2 บรรทัด ไร้การทับซ้อนกับชื่อสามัญ
   - 6. ชื่อสามัญ (Generic Name): font-size=14.5px สีดำเข้ม (#1e293b) ล็อกความสูง 40px
   - 7. สินค้าหมด: แสดงป้าย "สินค้าหมด" ขึ้นกลางรูปภาพตามแบบเดิม + ปุ่มสินค้าหมดข้างล่างระนาบเดียวกับ Add to Cart
   =================================================== */

/* 1. บังคับแถวและคอลัมน์ให้เชื่อมติดกันเป็นตาราง Seamless Table Grid เส้นชนกัน 100% */
.category-page-row .products.row,
.woocommerce-page .products.row,
.products.row {
  display: flex !important;
  flex-wrap: wrap !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  border-top: 1px solid #e2e8f0 !important;
  border-left: 1px solid #e2e8f0 !important;
}

.category-page-row .products.row > .col,
.woocommerce-page .products.row > .col,
.products.row > .col {
  display: flex !important;
  padding: 0 !important;
}

.category-page-row .products.row > .col > .col-inner,
.woocommerce-page .products.row > .col > .col-inner,
.products .product-small.col .col-inner {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100% !important;
  border: 1px solid #e2e8f0 !important;
  border-top: none !important;
  border-left: none !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  padding: 14px 10px 14px 10px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  position: relative !important;
  z-index: 1 !important;
  transition: all 0.2s ease !important;
}

.category-page-row .products.row > .col > .col-inner:hover,
.woocommerce-page .products.row > .col > .col-inner:hover,
.products .product-small.col .col-inner:hover {
  z-index: 10 !important;
  outline: 2px solid #ea580c !important;
  outline-offset: -1px !important;
  box-shadow: 0 4px 16px rgba(234, 88, 12, 0.16) !important;
}

.product-small.box {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  flex: 1 1 100% !important;
  width: 100% !important;
  position: relative !important;
  background-color: transparent !important;
}

/* 2. ดับเบิ้ลล็อก: ซ่อนกล่องปุ่ม Wishlist นอกกล่องสินค้า (.col-inner > .yith-wcwl-add-to-wishlist) */
.col-inner > .yith-wcwl-add-to-wishlist {
  display: none !important;
  height: 0 !important;
  width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* 3. ล็อกกล่องรูปภาพไม่ให้เบี้ยว และรักษาสัดส่วนภาพ 100% */
.product-small .box-image {
  flex-shrink: 0 !important;
  position: relative !important;
  width: 100% !important;
}

/* 3.1 ป้ายสินค้าหมดขึ้นกลางภาพแบบดั้งเดิม (Flatsome Center Ribbon) */
.product-small .box-image .out-of-stock-label {
  display: block !important;
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  top: 40% !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: #1e293b !important;
  font-weight: 700 !important;
  font-size: 13.5px !important;
  padding: 14px 0 !important;
  text-align: center !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  z-index: 5 !important;
  pointer-events: none !important;
  border-radius: 0 !important;
  width: 100% !important;
  height: auto !important;
  line-height: normal !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

/* 4. ซ่อนปุ่มหัวใจวงกลมบนมุมขวาของรูปภาพสินค้าทุกกรณีตั้งแต่ 0ms (ไร้ FOUC) */
.product-small .box-image .image-tools,
.product-small .box-image .wishlist-icon,
.product-small .box-image .wishlist-button,
.product-small .box-image .yith-wcwl-add-to-wishlist {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
  pointer-events: none !important;
}

/* 4.1 ปรับแต่งป้ายเปอร์เซ็นต์ลดราคา (% Sale Badge) เกือบชิดขวาบน (เว้นระยะ 2px) และเอาปุ่ม Sale! ซ้ายบนออก */
.product-small .badge-container,
.col-inner > .badge-container {
  position: absolute !important;
  top: 2px !important;
  right: 2px !important;
  left: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
  height: auto !important;
  z-index: 10 !important;
  pointer-events: none !important;
}

.badge-container .callout.badge,
.badge-container .badge-circle,
.badge-container .badge-inner {
  border-radius: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  transform: none !important;
  display: block !important;
}

/* เอาปุ่ม Sale! ซ้ายบนของรูปสินค้าออกตามคำสั่ง */
.badge-container .onsale {
  display: none !important;
  visibility: hidden !important;
}

/* โชว์ % ที่ลดที่เกือบชิดมุมขวาบนของรูปสินค้า (เว้นระยะลงมา 2px และจากขวา 2px) */
.b2b-sale-badge {
  display: inline-block !important;
  background-color: #dc2626 !important; /* สีแดงสดตามแบบภาพที่ 2 */
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  padding: 4px 6px !important;
  border-radius: 2px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  white-space: nowrap !important;
  letter-spacing: -0.2px !important;
  font-family: inherit !important;
}

/* 5. กล่องเนื้อหา (.box-text) ยืดเต็มพื้นที่ที่เหลือ จัด padding และ Flex Column */
.product-small .box-text {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 10px 0 0 0 !important;
  text-align: center !important;
}

/* 6. ซ่อนหมวดหมู่สินค้า (Category) ใต้รูปภาพ ไม่ต้องแสดงผล */
.product-small .category,
.product-small .product-cat,
.product-small .box-text .category,
.product-small .box-text .product-cat {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* ซ่อนสถานะ In stock ไม่ต้องแสดงผล */
.product-small .stock.in-stock,
.product-small .in-stock,
.product-small .woocommerce-variation-availability {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.product-small .title-wrapper {
  margin-bottom: 4px !important;
}

/* 7. ชื่อการค้า (แถว A): font-size=16.5px สีส้มสดใส ล็อกความสูง 52px ไร้การทับซ้อน 100% */
.products .product-small .box-text .title-wrapper .product-title,
.products .product-small .title-wrapper .product-title,
.products .product-small .product-title,
.product-small .product-title,
.product-small .name,
.product-small .woocommerce-loop-product__title {
  font-size: 16.5px !important;
  color: #ea580c !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  min-height: 52px !important;
  max-height: 52px !important;
  height: 52px !important;
  margin-top: 2px !important;
  margin-bottom: 4px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: center !important;
  text-align: center !important;
  text-decoration: none !important;
  overflow: hidden !important;
  word-break: break-word !important;
}

.products .product-small .box-text .title-wrapper .product-title a,
.products .product-small .title-wrapper .product-title a,
.products .product-small .product-title a,
.product-small .product-title a,
.product-small .name a {
  font-size: 16.5px !important;
  color: #ea580c !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  text-align: center !important;
  text-decoration: none !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  word-break: break-word !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.product-small .product-title a:hover,
.product-small .name a:hover {
  color: #c2410c !important;
}

/* 8. ชื่อสามัญ (แถว B): font-size=14.5px ดึงจาก SKU ตัวหนังสือสีดำ ล็อกความสูง 40px */
.products .product-small .box-text .title-wrapper .b2b-generic-name,
.products .product-small .title-wrapper .b2b-generic-name,
.products .product-small .b2b-generic-name,
.product-small .b2b-generic-name,
.product-small .b2b-generic-name * {
  font-size: 14.5px !important;
  color: #1e293b !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  min-height: 40px !important;
  max-height: 40px !important;
  height: 40px !important;
  margin-top: 4px !important;
  margin-bottom: 6px !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: center !important;
  text-align: center !important;
  width: 100% !important;
  overflow: hidden !important;
  word-break: break-word !important;
}

.products .product-small .b2b-generic-name {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
}

.product-small .b2b-generic-name.b2b-empty-slot {
  visibility: hidden !important;
}

@media (max-width: 849px) {
  .product-small .product-title,
  .product-small .product-title a,
  .product-small .name a {
    font-size: 15px !important;
    min-height: 46px !important;
    height: 46px !important;
  }
  .product-small .b2b-generic-name,
  .product-small .b2b-generic-name * {
    font-size: 13px !important;
    min-height: 36px !important;
    height: 36px !important;
    margin-bottom: 4px !important;
  }
}

@media (max-width: 549px) {
  .product-small .product-title,
  .product-small .product-title a,
  .product-small .name a {
    font-size: 14px !important;
    min-height: 42px !important;
    height: 42px !important;
  }
  .product-small .b2b-generic-name,
  .product-small .b2b-generic-name * {
    font-size: 12px !important;
    min-height: 32px !important;
    height: 32px !important;
    margin-bottom: 3px !important;
  }
}

/* 9. กล่องราคา (แถว C) จัดเรียงแนวตั้งและล็อกความสูงเท่ากันตรงกันทุกสินค้า */
.product-small .price-wrapper {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  margin-bottom: 4px !important;
}

.product-small .price-wrapper .price,
.product-small .price {
  min-height: 24px !important;
  max-height: 24px !important;
  height: 24px !important;
  line-height: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  gap: 4px 6px !important;
  width: 100% !important;
  margin-bottom: 2px !important;
  text-align: center !important;
  overflow: visible !important;
}

/* 10. Exp Date (แถว D) บังคับขึ้นบรรทัดใหม่ใต้ราคาเสมอ ล็อกความสูงเท่ากัน */
.product-small .b2b-exp-date,
.product-small .price-wrapper .b2b-exp-date {
  display: block !important;
  width: 100% !important;
  height: 18px !important;
  min-height: 18px !important;
  max-height: 18px !important;
  line-height: 18px !important;
  font-size: 13px !important;
  color: #475569 !important;
  font-weight: 600 !important;
  text-align: center !important;
  margin-top: 2px !important;
  margin-bottom: 6px !important;
  visibility: visible !important;
  opacity: 1 !important;
  overflow: visible !important;
}

.product-small .b2b-exp-date *,
.product-small .price-wrapper .b2b-exp-date * {
  color: #475569 !important;
  font-size: 13px !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.product-small .b2b-exp-date.b2b-empty-slot {
  visibility: hidden !important;
}

@media (max-width: 849px) {
  .product-small .b2b-exp-date,
  .product-small .price-wrapper .b2b-exp-date {
    font-size: 12px !important;
  }
}

/* 11. จัดฟอร์มสั่งซื้อแบบ Column แถวตั้ง 2 แถวเด็ดขาด (ปุ่มบวกลบอยู่บน, ปุ่มซื้อ+หัวใจอยู่ล่างเสมอ) */
.product-small form.cart,
.product-small .b2b-grid-cart,
form.cart.b2b-grid-cart,
.product-small .cart {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  margin-top: auto !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  width: 100% !important;
}

/* 11.1 แถวปุ่มสั่งซื้อและปุ่มสินค้าหมด (Out of stock) อยู่ในระนาบแนวนอนเดียวกัน 100% */
.product-small .box-text > .b2b-cart-action-row,
.product-small .b2b-cart-action-row {
  margin-top: auto !important;
  margin-bottom: 0 !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
}

.b2b-cart-action-row .stock.out-of-stock,
.b2b-cart-action-row .out-of-stock-label,
.product-small .stock.out-of-stock {
  background: #94a3b8 !important;
  color: #ffffff !important;
  border: none !important;
  padding: 0 14px !important;
  height: 35px !important;
  line-height: 35px !important;
  border-radius: 4px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-shadow: none !important;
  width: auto !important;
  min-width: 95px !important;
}

/* 12. Single variation wrap & Variable Add to Cart Container */
.product-small .single_variation_wrap {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
  overflow: visible !important;
  margin-bottom: 0 !important;
}

.product-small .woocommerce-variation-add-to-cart,
.product-small .woocommerce-variation-add-to-cart-disabled,
.product-small .b2b-grid-cart .woocommerce-variation-add-to-cart,
.product-small .variations_button {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
  overflow: visible !important;
  margin-bottom: 0 !important;
  margin-top: 5px !important;
}

/* ===================================================
   11. [0ms ZERO-FOUC] สไตล์ปุ่ม Add to Cart, ช่องจำนวน (+/-) และแถว Action ใน Shop Grid
   =================================================== */

/* 1. ปุ่ม Add to Cart สีส้มโมเดิร์น (#d26e4b) ความสูง 35px */
.product-small form.cart .single_add_to_cart_button,
.product-small .b2b-grid-cart .single_add_to_cart_button,
.b2b-cart-action-row .single_add_to_cart_button {
  background: #d26e4b !important;
  color: #ffffff !important;
  border: none !important;
  padding: 0 15px !important;
  height: 35px !important;
  line-height: 35px !important;
  border-radius: 4px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  font-size: 13px !important;
  transition: all 0.2s ease !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-shadow: none !important;
}

.product-small form.cart .single_add_to_cart_button:hover,
.product-small .b2b-grid-cart .single_add_to_cart_button:hover,
.b2b-cart-action-row .single_add_to_cart_button:hover {
  background: #b25838 !important;
}

.product-small .b2b-grid-cart .single_add_to_cart_button.b2b-adding {
  opacity: 0.75 !important;
  cursor: wait !important;
}

.product-small .b2b-grid-cart .single_add_to_cart_button.b2b-added {
  background: #1e3a5f !important;
  color: #ffffff !important;
}

.product-small form.cart .screen-reader-text,
.product-small .b2b-grid-cart .screen-reader-text {
  display: none !important;
}

/* 2. แถวที่ 1: ช่องและปุ่มปรับจำนวน Quantity (- 1 +) อยู่แถวบนตรงกลางเดี่ยวๆ */
.product-small form.cart .quantity,
.product-small .b2b-grid-cart .quantity,
.product-small .ux-quantity,
.b2b-grid-cart .quantity,
.b2b-grid-cart .ux-quantity {
  display: inline-flex !important;
  width: auto !important;
  max-width: 102px !important;
  border: 1px solid #d1d5db !important;
  border-radius: 4px !important;
  overflow: hidden !important;
  background: #ffffff !important;
  margin: 0 auto 8px auto !important;
  margin-right: auto !important;
  margin-left: auto !important;
  margin-bottom: 8px !important;
  vertical-align: middle !important;
  float: none !important;
  flex: none !important;
}

.product-small form.cart .quantity input[type="button"],
.product-small .b2b-grid-cart .quantity input[type="button"],
.b2b-grid-cart .quantity input[type="button"] {
  background: #f9f9f9 !important;
  border: none !important;
  width: 30px !important;
  height: 35px !important;
  cursor: pointer !important;
  font-size: 16px !important;
  color: #64748b !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 35px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.product-small form.cart .quantity input[type="button"]:hover,
.product-small .b2b-grid-cart .quantity input[type="button"]:hover,
.b2b-grid-cart .quantity input[type="button"]:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

.product-small form.cart .quantity input[type="number"],
.product-small .b2b-grid-cart .quantity input[type="number"],
.b2b-grid-cart .quantity input[type="number"] {
  width: 40px !important;
  height: 35px !important;
  border: none !important;
  text-align: center !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  -moz-appearance: textfield !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: #ffffff !important;
}

.product-small form.cart .quantity input[type="number"]::-webkit-outer-spin-button,
.product-small form.cart .quantity input[type="number"]::-webkit-inner-spin-button,
.b2b-grid-cart .quantity input[type="number"]::-webkit-outer-spin-button,
.b2b-grid-cart .quantity input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

/* 3. แถวที่ 2: จัดแถวปุ่ม Action Row (Add to Cart + Wishlist 35x35px) อยู่แถวล่างตรงกลางเดี่ยวๆ */
.product-small .b2b-cart-action-row,
.b2b-cart-action-row {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  margin: 0 auto !important;
  margin-top: 0 !important;
  width: 100% !important;
  float: none !important;
  clear: both !important;
}

/* ===================================================
   14. ปรับแต่งหน้าตะกร้าสินค้า (CART PAGE) สไตล์ MODERN B2B CARD
   =================================================== */

/* 14.1 ปรับตารางตะกร้าให้เป็นสไตล์ Card Box แยกแต่ละรายการ */
.woocommerce-cart table.shop_table.cart {
  border: none !important;
  border-collapse: separate !important;
  border-spacing: 0 14px !important;
  background: transparent !important;
  margin-bottom: 25px !important;
}

.woocommerce-cart table.shop_table.cart thead th {
  background: transparent !important;
  border: none !important;
  color: #64748b !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.3px !important;
  padding: 8px 14px !important;
}

@media (min-width: 850px) {
  .woocommerce-cart table.shop_table.cart thead th.product-name {
    padding-left: 149px !important;
    text-align: left !important;
  }
}

.woocommerce-cart table.shop_table.cart tr.cart_item {
  background: #ffffff !important;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.05) !important;
  border: 1px solid #e2e8f0 !important;
  transition: all 0.2s ease !important;
}

.woocommerce-cart table.shop_table.cart tr.cart_item:hover {
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08) !important;
  border-color: #cbd5e1 !important;
}

.woocommerce-cart table.shop_table.cart tr.cart_item td {
  padding: 16px 14px !important;
  vertical-align: middle !important;
  border-top: 1px solid #e2e8f0 !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.woocommerce-cart table.shop_table.cart tr.cart_item td:first-child {
  border-left: 1px solid #e2e8f0 !important;
  border-top-left-radius: 12px !important;
  border-bottom-left-radius: 12px !important;
}

.woocommerce-cart table.shop_table.cart tr.cart_item td:last-child {
  border-right: 1px solid #e2e8f0 !important;
  border-top-right-radius: 12px !important;
  border-bottom-right-radius: 12px !important;
}

.woocommerce-cart table.shop_table.cart td.ndr-cart-select-cell,
.woocommerce-cart table.shop_table.cart th.ndr-th-select {
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  text-align: center !important;
  padding: 16px 8px !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
}

/* 14.2 รูปภาพสินค้าในการ์ด */
.woocommerce-cart table.shop_table.cart td.product-thumbnail {
  width: 125px !important;
  min-width: 125px !important;
  max-width: 125px !important;
  text-align: center !important;
  padding: 16px 8px !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
}

.woocommerce-cart table.shop_table.cart td.product-thumbnail a {
  display: inline-block !important;
  line-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.woocommerce-cart table.shop_table.cart td.product-thumbnail img {
  width: 100px !important;
  max-width: 100px !important;
  height: 100px !important;
  object-fit: contain !important;
  border-radius: 8px !important;
  border: 1px solid #e2e8f0 !important;
  background-color: #f8fafc !important;
  padding: 4px !important;
  box-sizing: border-box !important;
  display: block !important;
  margin: 0 auto !important;
}

/* 14.3 ชื่อสินค้าและราคา */
.woocommerce-cart table.shop_table.cart td.product-name {
  padding-left: 24px !important;
  padding-right: 15px !important;
  text-align: left !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
}

.woocommerce-cart table.shop_table.cart td.product-name a {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  line-height: 1.4 !important;
  display: inline-block !important;
}

.woocommerce-cart table.shop_table.cart td.product-name a:hover {
  color: #ff6b00 !important;
}

.woocommerce-cart table.shop_table.cart td.product-name .variation {
  font-size: 13px !important;
  color: #64748b !important;
  margin-top: 4px !important;
  line-height: 1.4 !important;
}

.woocommerce-cart table.shop_table.cart td.product-price,
.woocommerce-cart table.shop_table.cart td.product-subtotal {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}

/* 14.4 ปุ่มลบสินค้า */
.woocommerce-cart table.shop_table.cart td.product-remove a.remove {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  height: auto !important;
  padding: 5px 12px !important;
  border: 1px solid #ffa39e !important;
  border-radius: 6px !important;
  background-color: #fff1f0 !important;
  color: #cf1322 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  line-height: 1 !important;
  transition: all 0.2s ease !important;
}

.woocommerce-cart table.shop_table.cart td.product-remove a.remove::after {
  content: " ลบ";
  margin-left: 3px;
  font-weight: 500;
  font-family: inherit;
}

.woocommerce-cart table.shop_table.cart td.product-remove a.remove:hover {
  background-color: #ff4d4f !important;
  border-color: #ff4d4f !important;
  color: #ffffff !important;
}

/* 14.5 กล่องและปุ่มปรับจำนวน (+/-) */
.woocommerce-cart table.shop_table.cart .quantity {
  display: inline-flex !important;
  align-items: center !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  background: #ffffff !important;
}

.woocommerce-cart table.shop_table.cart .quantity input.qty {
  width: 48px !important;
  height: 34px !important;
  border: none !important;
  text-align: center !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  color: #0f172a !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

.woocommerce-cart table.shop_table.cart .quantity .button.plus,
.woocommerce-cart table.shop_table.cart .quantity .button.minus {
  width: 30px !important;
  height: 34px !important;
  padding: 0 !important;
  background: #f8fafc !important;
  color: #475569 !important;
  border: none !important;
  font-size: 14px !important;
  line-height: 34px !important;
}

.woocommerce-cart table.shop_table.cart .quantity .button.plus:hover,
.woocommerce-cart table.shop_table.cart .quantity .button.minus:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

/* 14.6 กล่องสรุปยอดขวามือ & ปุ่มชำระเงิน */
.woocommerce-cart .cart-sidebar .cart_totals {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 22px !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04) !important;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
  background-color: #ff6b00 !important;
  border-color: #ff6b00 !important;
  border-radius: 8px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  padding: 14px 20px !important;
  box-shadow: 0 4px 12px rgba(255, 107, 0, 0.25) !important;
  transition: all 0.2s ease !important;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
  background-color: #e05e00 !important;
  border-color: #e05e00 !important;
}

/* 14.7 Responsive การ์ดตะกร้าบนหน้าจอมือถือ */
@media (max-width: 849px) {
  .woocommerce-cart table.shop_table.cart thead {
    display: none !important;
  }
  
  .woocommerce-cart table.shop_table.cart tr.cart_item {
    display: block !important;
    position: relative !important;
    border-radius: 12px !important;
    padding: 16px 14px !important;
    margin-bottom: 14px !important;
  }
  
  .woocommerce-cart table.shop_table.cart tr.cart_item td {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border: none !important;
    padding: 6px 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .woocommerce-cart table.shop_table.cart tr.cart_item td.product-thumbnail {
    justify-content: center !important;
    padding-bottom: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .woocommerce-cart table.shop_table.cart tr.cart_item td.product-name {
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-align: center !important;
    justify-content: center !important;
  }
  
  .woocommerce-cart table.shop_table.cart tr.cart_item td.product-remove {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    padding: 0 !important;
    width: auto !important;
  }

  .woocommerce-cart table.shop_table.cart tr.cart_item td.ndr-cart-select-cell {
    position: absolute !important;
    top: 14px !important;
    left: 14px !important;
    padding: 0 !important;
    width: auto !important;
  }
}

/* 14.8 แถบสรุปยอดด้านล่างแบบกะทัดรัด (Compact Sticky Bottom Bar) */
.ndr-cart-sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.08);
  z-index: 99999;
  padding: 10px 0;
}

.ndr-sticky-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ndr-sticky-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ndr-select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin: 0;
  user-select: none;
}

.ndr-bulk-delete-btn {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  border: 1px solid #fca5a5 !important;
  border-radius: 6px !important;
  padding: 5px 12px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  line-height: 1.2 !important;
  transition: all 0.2s ease !important;
  text-transform: none !important;
}

.ndr-bulk-delete-btn:hover {
  background: #dc2626 !important;
  color: #ffffff !important;
}

.ndr-sticky-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.ndr-sticky-total-info {
  font-size: 14px;
  color: #475569;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.ndr-total-amount {
  color: #dc2626;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.ndr-sticky-checkout-btn {
  background-color: #ff6b00 !important;
  border: none !important;
  color: #ffffff !important;
  padding: 9px 24px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(255, 107, 0, 0.25) !important;
  transition: all 0.2s ease !important;
  text-transform: none !important;
}

.ndr-sticky-checkout-btn:hover {
  background-color: #e05e00 !important;
}

.ndr-cart-item-checkbox,
#ndr-select-all-cart {
  width: 18px !important;
  height: 18px !important;
  accent-color: #ff6b00 !important;
  cursor: pointer !important;
  margin: 0 !important;
}

.woocommerce-cart .cart-wrapper,
.woocommerce-cart form.woocommerce-cart-form {
  padding-bottom: 75px !important;
}

@media (max-width: 849px) {
  .ndr-cart-sticky-bar {
    padding: 8px 12px !important;
  }
  .ndr-sticky-container {
    padding: 0 !important;
    gap: 8px !important;
  }
  .ndr-select-all-label {
    font-size: 12px !important;
  }
  .ndr-bulk-delete-btn {
    padding: 4px 8px !important;
    font-size: 11px !important;
  }
  .ndr-sticky-total-info {
    font-size: 11px !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 0 !important;
    line-height: 1.2 !important;
  }
  .ndr-total-amount {
    font-size: 15px !important;
  }
  .ndr-sticky-checkout-btn {
    padding: 8px 14px !important;
    font-size: 13px !important;
  }
}

/* 14.10 ซ่อนคอลัมน์ Cart Totals ฝั่งขวา และขยายหน้า Cart ให้เต็ม 100% */
.woocommerce-cart .cart-sidebar,
.woocommerce-cart .cart-collaterals {
  display: none !important;
}

@media (min-width: 850px) {
  .woocommerce-cart #content .container,
  .woocommerce-cart .container,
  .woocommerce-cart .cart-container,
  .woocommerce-cart .cart-wrapper {
    width: 95% !important;
    max-width: 1440px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .woocommerce-cart .cart-wrapper .row,
  .woocommerce-cart .woocommerce > .row {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .woocommerce-cart .cart-wrapper .col.large-7,
  .woocommerce-cart .cart-wrapper .large-7,
  .woocommerce-cart .cart-wrapper div[class*="large-7"],
  .woocommerce-cart .cart-wrapper .col:first-child,
  .woocommerce-cart .woocommerce > .row > .col:first-child {
    flex: 0 0 100% !important;
    flex-basis: 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .woocommerce-cart form.woocommerce-cart-form,
  .woocommerce-cart table.shop_table.cart {
    width: 100% !important;
    max-width: 100% !important;
  }

  .ndr-cart-sticky-bar .ndr-sticky-container {
    width: 95% !important;
    max-width: 1440px !important;
  }
}

.woocommerce-cart table.shop_table.cart tr.cart_item td.product-remove {
  text-align: right !important;
  padding-right: 20px !important;
}

/* 14.11 ซ่อนปุ่ม Update Cart, แต่งปุ่มเลือกซื้อต่อ, ซ่อนการแจ้งเตือน Cart Updated และปิดไอคอนหมุนๆ ให้หน้าจอลื่นไหล 100% */
.woocommerce-cart button[name="update_cart"],
.woocommerce-cart input[name="update_cart"],
.woocommerce-cart .cart-actions button[name="update_cart"] {
  display: none !important;
}

.woocommerce-cart .button-continue-shopping {
  display: inline-flex !important;
  align-items: center !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background-color: #ffffff !important;
  color: #475569 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  padding: 8px 18px !important;
  text-decoration: none !important;
  line-height: 1.4 !important;
  transition: all 0.2s ease !important;
  margin-top: 15px !important;
  margin-bottom: 25px !important;
}

.woocommerce-cart .button-continue-shopping:hover {
  background-color: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

.woocommerce-cart .woocommerce-message,
.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-message {
  display: none !important;
}

.woocommerce-cart .blockUI.blockOverlay,
.woocommerce-cart .blockUI.blockMsg,
.woocommerce-cart .loading-spin,
.woocommerce-cart .woocommerce-cart-form .loading-spin,
.woocommerce-cart div.cart-wrapper.processing,
.woocommerce-cart form.woocommerce-cart-form.processing {
  display: none !important;
  opacity: 1 !important;
  background: transparent !important;
  pointer-events: auto !important;
}

.woocommerce-cart table.shop_table.cart.processing,
.woocommerce-cart .cart-wrapper.processing,
.woocommerce-cart form.woocommerce-cart-form {
  opacity: 1 !important;
  filter: none !important;
  transition: none !important;
}

/* ===================================================
   15. แก้ปัญหาหน้ากระตุก/เห็น Dropdown แบบเก่าก่อน (Prevent FOUC on Shop Grid)
   =================================================== */

/* 1. ซ่อน Dropdown และ Label ดั้งเดิมทันทีตั้งแต่เริ่มเรนเดอร์หน้าเว็บ */
.product-small table.variations select,
.product-small table.variations th.label,
.product-small .b2b-hidden-select-wrap,
.single-product table.variations select {
  display: none !important;
}

/* 2. จัดพื้นที่รอไว้ เพื่อให้การ์ดนิ่ง ไม่กระตุกหรือขยับ */
.product-small table.variations {
  margin: 0 auto 10px auto !important;
  width: 100% !important;
  border: none !important;
}

.product-small table.variations td {
  border: none !important;
  display: block !important;
  padding: 0 !important;
  text-align: center !important;
}

.product-small .reset_variations {
  display: none !important;
}

/* 3. สไตล์กลุ่มปุ่มกด Option (โหลดไว้ใน Head ล่วงหน้า ป้องกันการกระตุก) */
.b2b-btn-group {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin: 4px 0 !important;
  align-items: center !important;
  justify-content: center !important;
}

.product-small .b2b-btn-group {
  justify-content: center !important;
  margin-bottom: 10px !important;
}

.b2b-opt {
  cursor: pointer !important;
  padding: 6px 14px !important;
  border: 1px solid #d1d5db !important;
  border-radius: 4px !important;
  font-size: 14px !important;
  background: #ffffff !important;
  color: #334155 !important;
  text-align: center !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
  user-select: none !important;
  line-height: 1.4 !important;
}

.b2b-opt:hover {
  border-color: #0c4a6e !important;
  color: #0c4a6e !important;
  background: #f0f9ff !important;
}

.b2b-opt.active {
  background: #0c4a6e !important;
  color: #ffffff !important;
  border-color: #0c4a6e !important;
  box-shadow: 0 1px 3px rgba(12, 74, 110, 0.25) !important;
}

@media (max-width: 849px) {
  .b2b-opt {
    font-size: 13px !important;
    padding: 5px 10px !important;
  }
}

/* ===================================================
   16. จัดระเบียบตารางหน้า Wishlist (/wishlist) ให้ตรงแถว สวยหรู ไม่เบี้ยว
   =================================================== */

/* ซ่อนข้อความแจ้งเตือนและเครื่องหมายถูก Product successfully removed ในหน้า Wishlist 100% ทุกกรณี */
.woocommerce-wishlist .woocommerce-notices-wrapper,
.woocommerce-wishlist .woocommerce-message,
.woocommerce-wishlist .woocommerce-info,
.woocommerce-wishlist .woocommerce-error,
.woocommerce-wishlist .yith-wcwl-notice,
.woocommerce-wishlist .yith-wcwl-message,
.woocommerce-wishlist .yith-wcwl-popup-message,
.woocommerce-wishlist #yith-wcwl-message,
.woocommerce-wishlist .message-container,
.wishlist-page .woocommerce-notices-wrapper,
.wishlist-page .woocommerce-message,
.wishlist-page .yith-wcwl-notice,
.wishlist-page .yith-wcwl-message,
#yith-wcwl-message,
.yith-wcwl-popup-message {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: none !important;
}

/* จัดทุกเซลล์ในตารางให้อยู่กึ่งกลางแนวตั้งเสมอ */
.wishlist_table th,
.wishlist_table td {
  vertical-align: middle !important;
}

/* 1. ซ่อนข้อความที่ไม่จำเป็นและส่วนราคา/สต็อกซ้ำซ้อนในตาราง Wishlist 100% ป้องกันดันตกบรรทัด */
.wishlist_table td.product-add-to-cart .stock,
.wishlist_table td.product-add-to-cart p.stock,
.wishlist_table td.product-add-to-cart .screen-reader-text,
.wishlist_table td.product-add-to-cart .woocommerce-variation.single_variation,
.wishlist_table td.product-add-to-cart .single_variation,
.wishlist_table td.product-add-to-cart .woocommerce-variation-price,
.wishlist_table td.product-add-to-cart .woocommerce-variation-availability,
.wishlist_table .reset_variations {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
  position: absolute !important;
  pointer-events: none !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 2. จัดฟอร์มสั่งซื้อในคอลัมน์ Add to cart: Option ชิดซ้าย, ปุ่มสั่งซื้อชิดขวา, ล็อกความกว้างตายตัว 440px */
.wishlist_table td.product-add-to-cart {
  white-space: nowrap !important;
  padding: 10px 15px !important;
  width: 440px !important;
  min-width: 440px !important;
  max-width: 440px !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
}

.wishlist_table td.product-add-to-cart form.cart,
.wishlist_table td.product-add-to-cart form.cart.b2b-grid-cart,
.wishlist_table td.product-add-to-cart .b2b-wishlist-cart-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important; /* จัด Option ชิดซ้าย, จัด Qty+Button ชิดขวา */
  width: 100% !important;
  max-width: 100% !important;
  gap: 12px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex-wrap: nowrap !important;
  box-sizing: border-box !important;
}

/* สำหรับสินค้าเดี่ยว (ไม่มี Option) ให้กล่อง Qty + ปุ่ม Add to cart ชิดขวาสุดด้วย gap 8px */
.wishlist_table td.product-add-to-cart form.cart:not(.variations_form),
.wishlist_table td.product-add-to-cart form.cart.b2b-grid-cart:not(.variations_form),
.wishlist_table td.product-add-to-cart .b2b-wishlist-cart-row:not(:has(.b2b-btn-group)) {
  justify-content: flex-end !important;
  gap: 8px !important;
}

/* Fallback ฉุกเฉิน: หากแถวใดสูญเสียคอนเทนเนอร์ ให้เซลล์ td จัดการลูกตรงๆ เป็น flex แนวนอนทันที ป้องกันดีดสูง */
.wishlist_table td.product-add-to-cart:not(:has(.b2b-wishlist-cart-row)):not(:has(form.cart)) {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  max-width: 100% !important;
  gap: 12px !important;
  margin: 0 !important;
  flex-wrap: nowrap !important;
  box-sizing: border-box !important;
}

/* 3. ตารางตัวเลือก (Variations) ชิดซ้าย และล็อกกึ่งกลางแนวตั้งเสมอ */
.wishlist_table td.product-add-to-cart table.variations {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: auto !important;
  margin: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  flex: 0 1 auto !important;
}

.wishlist_table td.product-add-to-cart table.variations tbody,
.wishlist_table td.product-add-to-cart table.variations tr,
.wishlist_table td.product-add-to-cart table.variations td,
.wishlist_table td.product-add-to-cart table.variations td.value {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  background: transparent !important;
  line-height: 1 !important;
}

.wishlist_table td.product-add-to-cart table.variations th.label {
  display: none !important; /* ซ่อนหัวข้อตัวเลือก เช่น แผง/กล่อง เพื่อความกะทัดรัด */
}

/* 4. ปุ่ม Swatch ตัวเลือกสินค้า ชิดซ้าย (Responsive Smart Swatches) */
.wishlist_table td.product-add-to-cart .b2b-btn-group {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-start !important; /* ชิดซ้ายชัดเจน */
  gap: 6px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.wishlist_table td.product-add-to-cart .b2b-btn-group .b2b-opt {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 30px !important;
  min-height: 30px !important;
  max-height: 30px !important;
  padding: 0 12px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  border: 1px solid #d1d5db !important;
  border-radius: 4px !important;
  background: #ffffff !important;
  color: #334155 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  user-select: none !important;
}

.wishlist_table td.product-add-to-cart .b2b-btn-group .b2b-opt:hover {
  border-color: #d26e4b !important;
  color: #d26e4b !important;
  background: #fff7ed !important;
}

.wishlist_table td.product-add-to-cart .b2b-btn-group .b2b-opt.active {
  background-color: #d26e4b !important;
  border-color: #d26e4b !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 3px rgba(210, 110, 75, 0.3) !important;
}

/* 5. กล่องชุดคำสั่งซื้อ (Qty + Button) ฝั่งขวา ล็อกขนาดตายตัว 208px ชิดขวาสุด ทุกแถวตรงกัน 100% */
.wishlist_table td.product-add-to-cart .single_variation_wrap,
.wishlist_table td.product-add-to-cart .woocommerce-variation-add-to-cart {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  margin: 0 0 0 auto !important; /* ดันชิดขวาสุดเสมอ */
  padding: 0 !important;
  width: 208px !important;
  min-width: 208px !important;
  max-width: 208px !important;
  flex: 0 0 208px !important;
  box-sizing: border-box !important;
}

/* ช่องจำนวน quantity ล็อกขนาดตายตัว 95px เท่ากันทุกแถว ป้องกันเบี้ยว 100% */
.wishlist_table td.product-add-to-cart .quantity,
.wishlist_table td.product-add-to-cart .ux-quantity {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  margin: 0 !important;
  border: 1px solid #d1d5db !important;
  border-radius: 4px !important;
  overflow: hidden !important;
  background: #ffffff !important;
  width: 95px !important;
  min-width: 95px !important;
  max-width: 95px !important;
  height: 35px !important;
  min-height: 35px !important;
  max-height: 35px !important;
  flex: 0 0 95px !important;
  box-sizing: border-box !important;
}

.wishlist_table td.product-add-to-cart .quantity input[type="button"],
.wishlist_table td.product-add-to-cart .ux-quantity input[type="button"],
.wishlist_table td.product-add-to-cart .quantity .button.plus,
.wishlist_table td.product-add-to-cart .quantity .button.minus {
  width: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  height: 33px !important;
  border: none !important;
  background: #f8fafc !important;
  cursor: pointer !important;
  font-size: 16px !important;
  color: #64748b !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 33px !important;
  flex: 0 0 28px !important;
  box-sizing: border-box !important;
}

.wishlist_table td.product-add-to-cart .quantity input[type="number"],
.wishlist_table td.product-add-to-cart .ux-quantity input[type="number"],
.wishlist_table td.product-add-to-cart .quantity input.qty {
  width: 37px !important;
  min-width: 37px !important;
  max-width: 37px !important;
  height: 33px !important;
  border: none !important;
  text-align: center !important;
  font-size: 14px !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  flex: 0 0 37px !important;
  box-sizing: border-box !important;
}

/* ปุ่ม Add to cart ล็อกขนาดตายตัว 105px เท่ากันทุกแถว (95px + 8px gap + 105px = 208px พอดีเป๊ะ) */
.wishlist_table td.product-add-to-cart .single_add_to_cart_button,
.wishlist_table td.product-add-to-cart button.single_add_to_cart_button,
.wishlist_table td.product-add-to-cart a.add_to_cart_button,
.wishlist_table td.product-add-to-cart .button.add_to_cart_button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  background: #d26e4b !important;
  color: #ffffff !important;
  border: none !important;
  height: 35px !important;
  min-height: 35px !important;
  max-height: 35px !important;
  width: 105px !important;
  min-width: 105px !important;
  max-width: 105px !important;
  padding: 0 !important;
  text-align: center !important;
  border-radius: 4px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  cursor: pointer !important;
  margin: 0 !important;
  margin-left: 0 !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  flex: 0 0 105px !important;
  box-sizing: border-box !important;
}

.wishlist_table td.product-add-to-cart .single_add_to_cart_button:hover,
.wishlist_table td.product-add-to-cart button.single_add_to_cart_button:hover,
.wishlist_table td.product-add-to-cart a.add_to_cart_button:hover {
  background: #b25838 !important;
}

.wishlist_table td.product-add-to-cart .single_add_to_cart_button.b2b-adding {
  opacity: 0.7 !important;
  cursor: wait !important;
}

.wishlist_table td.product-add-to-cart .single_add_to_cart_button.b2b-added {
  background-color: #16a34a !important;
  color: #ffffff !important;
}

/* 6. การแสดงราคาในคอลัมน์ UNIT PRICE */
.wishlist_table td.product-price {
  white-space: nowrap !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}

.wishlist_table td.product-price .b2b-unit-note {
  display: block !important;
  font-size: 12px !important;
  color: #64748b !important;
  font-weight: 400 !important;
  margin-top: 2px !important;
}

/* 7. รองรับหน้าจอ Mobile & Tablet (< 768px) */
@media (max-width: 767px) {
  .wishlist_table td.product-add-to-cart form.cart,
  .wishlist_table td.product-add-to-cart .b2b-wishlist-cart-row {
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 8px !important;
  }
  .wishlist_table td.product-add-to-cart .b2b-btn-group {
    max-width: 100% !important;
    margin: 0 0 4px 0 !important;
    justify-content: flex-end !important;
  }
}

/* 8. ล็อกความกว้างหน้า Wishlist ให้สวยงามพอดีที่ 1360px (กว้างกำลังดี ไม่ชิดขอบจอ) */
.woocommerce-wishlist #content,
.woocommerce-wishlist #content .row.row-main,
.woocommerce-wishlist #yith-wcwl-form,
.woocommerce-wishlist .wishlist_table {
  max-width: 1360px !important;
  width: 95% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.woocommerce-wishlist #content .row.row-main {
  width: 100% !important;
}

/* ===================================================
   17. B2B Mini-Cart Redesign: Click-to-Open & Custom UI (ตามแบบภาพที่ 2)
   =================================================== */

/* 17.1 ซ่อน Dropdown ของ Cart ในสภาวะปกติ (ไม่คลิก = ปิดสนิท แม้เมาส์จะชี้) */
.header-nav li.cart-item:not(.b2b-cart-open) > .nav-dropdown,
li.cart-item:not(.b2b-cart-open) > .nav-dropdown,
li.cart-item.has-dropdown:not(.b2b-cart-open) > .nav-dropdown,
.header-nav li.cart-item:not(.b2b-cart-open):hover > .nav-dropdown,
li.cart-item.has-dropdown:not(.b2b-cart-open):hover > .nav-dropdown,
.header-nav li.cart-item.current-dropdown:not(.b2b-cart-open) > .nav-dropdown,
li.cart-item.current-dropdown:not(.b2b-cart-open) > .nav-dropdown,
.header-nav li.cart-item:not(.b2b-cart-open) > a::before,
.header-nav li.cart-item:not(.b2b-cart-open) > a::after,
.header-nav li.cart-item:not(.b2b-cart-open) > .nav-dropdown::before,
.header-nav li.cart-item:not(.b2b-cart-open) > .nav-dropdown::after {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(-8px) !important;
  transition: none !important;
}

/* 17.2 เปิด Dropdown เมื่อมีคลาส .b2b-cart-open จากการคลิกเท่านั้น (100% Click-Only) */
.header-nav li.cart-item.b2b-cart-open > .nav-dropdown,
li.cart-item.b2b-cart-open > .nav-dropdown,
li.cart-item.has-dropdown.b2b-cart-open > .nav-dropdown,
.header-nav li.cart-item.b2b-cart-open:hover > .nav-dropdown,
li.cart-item.b2b-cart-open:hover > .nav-dropdown,
li.cart-item.has-dropdown.b2b-cart-open:hover > .nav-dropdown {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
  top: 100% !important;
  bottom: auto !important;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* ล็อกไม่ให้เนื้อหาภายในกล่องตะกร้าถูกซ่อนหรือยุบตัวเมื่อเมาส์เลื่อนออก */
.header-nav li.cart-item.b2b-cart-open > .nav-dropdown > li,
.header-nav li.cart-item.b2b-cart-open > .nav-dropdown .widget_shopping_cart,
.header-nav li.cart-item.b2b-cart-open > .nav-dropdown .widget_shopping_cart_content,
.header-nav li.cart-item.b2b-cart-open > .nav-dropdown .b2b-mini-cart-wrapper {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* 17.3 โครงสร้างกรอบ Dropdown ตะกร้าสินค้า */
.header-nav li.cart-item .nav-dropdown {
  top: 100% !important;
  bottom: auto !important;
  width: 380px !important;
  max-width: 95vw !important;
  padding: 0 !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
  background-color: #ffffff !important;
  margin-top: 10px !important;
  right: 0 !important;
  left: auto !important;
  height: auto !important;
  max-height: none !important;
}

.header-nav li.cart-item .nav-dropdown .widget_shopping_cart,
.header-nav li.cart-item .nav-dropdown .widget_shopping_cart_content {
  padding: 0 !important;
  margin: 0 !important;
  background: #ffffff !important;
}

/* 17.4 ส่วนหัว Deep Slate Navy เข้ากับ CI โทนสีของ NDR (Nextgen Discover) */
.b2b-mini-cart-header {
  background: linear-gradient(135deg, #1e3a5f 0%, #2c4d75 100%) !important;
  color: #ffffff !important;
  padding: 13px 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.b2b-mini-cart-header-title {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  letter-spacing: 0.3px !important;
}

.b2b-mini-cart-count {
  font-size: 12.5px !important;
  font-weight: 600 !important;
  color: #93c5fd !important;
  background: rgba(255, 255, 255, 0.12) !important;
  padding: 2px 10px !important;
  border-radius: 12px !important;
}

/* 17.5 รายการสินค้าและ Scrollbar */
.b2b-mini-cart-list {
  max-height: 380px !important;
  overflow-y: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  list-style: none !important;
}

.b2b-mini-cart-list::-webkit-scrollbar {
  width: 6px !important;
}
.b2b-mini-cart-list::-webkit-scrollbar-track {
  background: #f8fafc !important;
}
.b2b-mini-cart-list::-webkit-scrollbar-thumb {
  background: #cbd5e1 !important;
  border-radius: 4px !important;
}
.b2b-mini-cart-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8 !important;
}

.b2b-mini-cart-item {
  padding: 14px 16px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  margin: 0 !important;
  position: relative !important;
  transition: background-color 0.2s ease, opacity 0.2s ease !important;
}

.b2b-mini-cart-item:hover {
  background-color: #fafafa !important;
}

/* แถวบน: ชื่อสินค้า + ปุ่มกากบาท (X) */
.b2b-mini-cart-item-top {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 10px !important;
  margin-bottom: 8px !important;
}

.b2b-mini-cart-title-wrap {
  flex: 1 1 auto !important;
}

.b2b-mini-cart-title {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  line-height: 1.35 !important;
  text-decoration: none !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

.b2b-mini-cart-title:hover {
  color: #0284c7 !important;
}

/* ปุ่มกากบาทลบสินค้า (X) - ล้างค่า position: absolute ของ WooCommerce */
.b2b-mini-cart-remove,
.widget_shopping_cart ul.product_list_widget li a.remove.b2b-mini-cart-remove,
.widget_shopping_cart ul.cart_list li a.remove.b2b-mini-cart-remove {
  position: static !important;
  float: none !important;
  font-size: 20px !important;
  line-height: 1 !important;
  color: #94a3b8 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  transition: all 0.2s ease !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.b2b-mini-cart-remove:hover {
  color: #ef4444 !important;
  background-color: #fee2e2 !important;
}

/* แถวล่าง: รูปสินค้า + ข้อมูลราคา/จำนวน/ราคารวม */
.b2b-mini-cart-item-body {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  width: 100% !important;
}

/* กรอบรูปภาพสินค้า (Thumbnail Container) */
.b2b-mini-cart-thumb {
  width: 60px !important;
  min-width: 60px !important;
  max-width: 60px !important;
  height: 60px !important;
  min-height: 60px !important;
  max-height: 60px !important;
  border-radius: 8px !important;
  border: 1px solid #e2e8f0 !important;
  background-color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  padding: 2px !important;
  box-sizing: border-box !important;
  position: relative !important;
}

.b2b-mini-cart-thumb a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  position: static !important;
}

/* ล้างค่า Float / Absolute ของ WooCommerce/Flatsome บนรูปสินค้าเด็ดขาด 100% */
.woocommerce .widget_shopping_cart ul.product_list_widget li .b2b-mini-cart-thumb img,
.woocommerce .widget_shopping_cart ul.cart_list li .b2b-mini-cart-thumb img,
.woocommerce-page .widget_shopping_cart ul.product_list_widget li .b2b-mini-cart-thumb img,
.woocommerce-page .widget_shopping_cart ul.cart_list li .b2b-mini-cart-thumb img,
.widget_shopping_cart ul.product_list_widget li a img,
.widget_shopping_cart ul.cart_list li a img,
.widget_shopping_cart .b2b-mini-cart-item img,
.b2b-mini-cart-thumb a img,
.b2b-mini-cart-thumb img {
  float: none !important;
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  width: auto !important;
  max-width: 54px !important;
  height: auto !important;
  max-height: 54px !important;
  object-fit: contain !important;
  margin: auto !important;
  display: block !important;
  box-shadow: none !important;
}

.b2b-mini-cart-info {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  min-width: 0 !important;
}

/* ราคาต่อหน่วย */
.b2b-mini-cart-unit-price {
  font-size: 12px !important;
  color: #94a3b8 !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}

/* แถวช่องจำนวน [-] [ 1 ] [+] */
.b2b-mini-cart-qty-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 2px 0 !important;
}

.b2b-qty-label {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #334155 !important;
  margin: 0 !important;
}

.b2b-mini-cart-qty-box {
  display: inline-flex !important;
  align-items: center !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px !important;
  overflow: hidden !important;
  background: #ffffff !important;
  height: 28px !important;
  width: 90px !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.b2b-mini-qty-btn {
  width: 26px !important;
  min-width: 26px !important;
  max-width: 26px !important;
  height: 28px !important;
  background: #f8fafc !important;
  border: none !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #475569 !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background-color 0.15s ease !important;
  user-select: none !important;
  line-height: 1 !important;
}

.b2b-mini-qty-btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

.b2b-mini-qty-input {
  width: 38px !important;
  height: 28px !important;
  border: none !important;
  border-left: 1px solid #e2e8f0 !important;
  border-right: 1px solid #e2e8f0 !important;
  text-align: center !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  background: #ffffff !important;
  -moz-appearance: textfield !important;
}

.b2b-mini-qty-input::-webkit-outer-spin-button,
.b2b-mini-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

/* แถวราคารวมของแถวนี้ */
.b2b-mini-cart-total-row {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.b2b-line-total-label {
  color: #334155 !important;
  font-weight: 600 !important;
}

.b2b-line-total-amount {
  color: #0f172a !important;
  font-weight: 800 !important;
}

/* 17.6 ส่วนท้ายตะกร้า (ยอดรวม + ปุ่มสั่งซื้อ) */
.b2b-mini-cart-footer {
  padding: 14px 16px !important;
  background: #ffffff !important;
  border-top: 2px solid #f1f5f9 !important;
}

.b2b-mini-cart-subtotal-box {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 12px !important;
}

.b2b-subtotal-text {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #475569 !important;
}

.b2b-subtotal-price {
  font-size: 17px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
}

.b2b-mini-cart-actions {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.b2b-mini-btn {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  padding: 10px 0 !important;
  border-radius: 6px !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
  box-sizing: border-box !important;
}

/* ปุ่ม: รายการสินค้าทั้งหมด */
.b2b-btn-view-all {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

.b2b-btn-view-all:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

/* ปุ่ม: สั่งซื้อและชำระเงิน (สี Terracotta สัญลักษณ์ปุ่มซื้อหลักของ NDR) */
.b2b-btn-checkout {
  background: #d26e4b !important;
  color: #ffffff !important;
  border: 1px solid #be5935 !important;
  box-shadow: 0 2px 8px rgba(210, 110, 75, 0.25) !important;
}

.b2b-btn-checkout:hover {
  background: #be5935 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(210, 110, 75, 0.35) !important;
}

/* 17.7 สถานะตะกร้าว่าง */
.b2b-mini-cart-empty {
  padding: 30px 20px !important;
  text-align: center !important;
}

.b2b-empty-icon {
  margin-bottom: 12px !important;
}

.b2b-empty-text {
  font-size: 14px !important;
  color: #64748b !important;
  margin-bottom: 16px !important;
}

.b2b-btn-shop-now {
  display: inline-block !important;
  padding: 8px 20px !important;
  background: #1e3a5f !important;
  color: #ffffff !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  text-decoration: none !important;
  transition: background 0.2s ease !important;
}

.b2b-btn-shop-now:hover {
  background: #152a45 !important;
}

/* 17.8 รองรับ Tablet และ Mobile (Off-Canvas Cart Popup) */
#cart-popup .cart-popup-inner {
  padding: 0 !important;
}

#cart-popup .cart-popup-title {
  display: none !important;
}

@media (max-width: 849px) {
  .header-nav li.cart-item .nav-dropdown {
    position: fixed !important;
    top: 65px !important;
    right: 10px !important;
    left: auto !important;
    width: calc(100vw - 20px) !important;
    max-width: 380px !important;
    z-index: 999999 !important;
  }
}

/* =========================================================================
   18. แก้ปัญหากล่องสี่เหลี่ยมเปล่าใต้ปุ่ม Wishlist บนหน้าสินค้าเดี่ยว (Single Product)
   ========================================================================= */

/* 18.1 ซ่อนกล่องปุ่ม Wishlist หรือลิงก์ใดๆ บนหน้าสินค้าเดี่ยวที่ไม่มีไอคอนหัวใจ SVG หรือ <i> ป้องกันกล่องสี่เหลี่ยมเปล่า 100% */
.single-product .yith-wcwl-add-to-wishlist a:empty,
.single-product .yith-wcwl-add-to-wishlist a:not(:has(svg)):not(:has(i)),
.single-product .yith-wcwl-add-to-wishlist:not(:has(svg)):not(:has(i)),
.single-product .wishlist-icon {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/* 18.2 ดับเบิ้ลล็อก: หากล่อง Wishlist ตัวที่สองเป็นต้นไปบนหน้าสินค้าเดี่ยว ให้ซ่อนทันที */
.single-product .product-info .yith-wcwl-add-to-wishlist ~ .yith-wcwl-add-to-wishlist,
.single-product .product-summary .yith-wcwl-add-to-wishlist ~ .yith-wcwl-add-to-wishlist,
.single-product .summary .yith-wcwl-add-to-wishlist ~ .yith-wcwl-add-to-wishlist,
.single-product form.cart ~ .yith-wcwl-add-to-wishlist:not(:has(svg)) {
  display: none !important;
  height: 0 !important;
  width: 0 !important;
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* =========================================================================
   19. NDR B2B 3-Step Gatekeeper Checkout System
   ========================================================================= */

/* 19.1 ตัวแปรสีและโครงสร้างหลักของหน้า Checkout */
:root {
  --b2b-primary: #f97316; /* NDR Orange */
  --b2b-primary-hover: #ea580c;
  --b2b-secondary: #0284c7; /* Sky Blue */
  --b2b-text-main: #1e293b;
  --b2b-text-muted: #64748b;
  --b2b-border: #e2e8f0;
  --b2b-bg-page: #f8fafc;
  --b2b-bg-card: #ffffff;
  --b2b-locked-bg: #f1f5f9;
  --b2b-locked-border: #cbd5e1;
  --b2b-success: #16a34a;
  --b2b-success-bg: #f0fdf4;
}

.woocommerce-checkout {
  font-family: 'Prompt', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--b2b-text-main);
}

/* ซ่อนหัวตารางและกล่องดั้งเดิมที่ไม่จำเป็นของ Flatsome ในหน้า Checkout */
.woocommerce-checkout #order_review_heading,
.woocommerce-checkout .woocommerce-additional-fields,
.woocommerce-checkout .woocommerce-billing-fields > h3,
.woocommerce-checkout .woocommerce-shipping-fields {
  display: none !important;
}

/* 19.2 ขยายหน้า Checkout ให้กว้างเท่าหน้า Cart (1440px / 95%) กึ่งกลางหน้าจออย่างสมบูรณ์ */
@media (min-width: 850px) {
  .woocommerce-checkout #content .container,
  .woocommerce-checkout .container,
  .woocommerce-checkout .cart-container {
    width: 95% !important;
    max-width: 1440px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

.woocommerce-checkout form.checkout,
.woocommerce-checkout form.b2b-checkout-form {
  width: 100% !important;
  max-width: 100% !important;
}

.checkout-container {
  width: 100%;
  max-width: 1440px;
  margin: 24px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 6fr 4fr;
  gap: 28px;
  align-items: start;
}

/* 19.3 Breadcrumbs */
.checkout-breadcrumbs {
  grid-column: 1 / -1;
  font-size: 14px;
  color: var(--b2b-text-muted);
  margin-bottom: -10px;
}
.checkout-breadcrumbs span.active {
  color: var(--b2b-primary);
  font-weight: 600;
}

/* 19.4 Steps Column */
.steps-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 19.5 Step Card Base */
.step-card {
  background: var(--b2b-bg-card);
  border-radius: 12px;
  border: 2px solid var(--b2b-border);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card Header */
.step-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border-bottom: 1px solid transparent;
  user-select: none;
}
.step-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--b2b-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  transition: all 0.3s;
}
.step-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--b2b-text-main);
}
.step-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Card Body */
.step-body {
  padding: 20px;
  transition: all 0.3s;
}

/* STATE 1: LOCKED */
.step-card.locked {
  background: var(--b2b-locked-bg);
  border-color: var(--b2b-locked-border);
  opacity: 0.75;
}
.step-card.locked .step-header {
  background: var(--b2b-locked-bg);
}
.step-card.locked .step-number {
  background: #cbd5e1;
  color: #64748b;
}
.step-card.locked .step-title {
  color: #64748b;
}
.step-card.locked .step-badge {
  background: #e2e8f0;
  color: #64748b;
}
.step-card.locked .step-body {
  display: none;
}
.locked-notice {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #64748b;
  font-size: 13.5px;
  font-weight: 500;
  border-top: 1px dashed var(--b2b-locked-border);
  background: rgba(241, 245, 249, 0.7);
}

/* STATE 2: ACTIVE (High-Visibility Radiant Focus Ring - Thicker & Super Eye-Catching) */
.step-card.active {
  border: 3.5px solid #0284c7 !important;
  box-shadow: 0 0 0 5px rgba(2, 132, 199, 0.22), 0 14px 32px rgba(2, 132, 199, 0.18) !important;
  border-radius: 12px;
  position: relative;
  transition: border 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}
.step-card.active .step-header {
  border-bottom: 2px solid #bae6fd;
  background: #f0f9ff;
}
.step-card.active .step-number {
  background: #0284c7;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}
.step-card.active .step-title {
  color: #0369a1;
  font-weight: 700;
}
.step-card.active .step-badge {
  background: #0284c7;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
}

/* STATE 3: COMPLETED (Soft Settled Normal Border - Faded after payment & tax are both done) */
.step-card.completed {
  border: 1.5px solid #cbd5e1 !important;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  transition: border 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}
.step-card.completed .step-header {
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
}
.step-card.completed .step-number {
  background: var(--b2b-success);
  color: #fff;
}
.step-card.completed .step-badge {
  background: var(--b2b-success-bg);
  color: var(--b2b-success);
}

/* 19.6 ฟอร์มและช่องกรอกข้อมูล Step 1 */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-full {
  grid-column: 1 / -1;
}
.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  margin-bottom: 5px;
}
.input-group label span.req {
  color: #ef4444;
}
.input-group .input-field {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  color: var(--b2b-text-main);
  background: #fff;
  transition: all 0.2s;
  box-sizing: border-box;
}
.input-group .input-field:focus {
  outline: none;
  border-color: var(--b2b-secondary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* Error States */
.input-group .input-field.input-error {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18) !important;
  animation: shake 0.3s ease-in-out;
}
.field-error-msg {
  color: #ef4444;
  font-size: 11.5px;
  font-weight: 500;
  margin-top: 3px;
  display: none;
}
.input-group.has-error .field-error-msg {
  display: block;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.form-alert-banner {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 14px;
  color: #b91c1c;
  font-size: 13.5px;
  font-weight: 500;
  margin-top: 14px;
  align-items: center;
  gap: 8px;
}
.form-alert-banner.show {
  display: flex;
}

/* Saved Address Card */
.saved-address-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  position: relative;
}
.saved-addr-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.saved-store-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}
.saved-btn-edit {
  font-size: 13px;
  color: var(--b2b-secondary);
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.saved-btn-edit:hover {
  color: #0369a1;
}
.saved-addr-text {
  font-size: 14px;
  color: #475569;
  margin-bottom: 10px;
  line-height: 1.6;
}
.saved-tags {
  display: flex;
  gap: 8px;
}
.tag-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
}
.tag-green {
  background: #dcfce7;
  color: #15803d;
}
.tag-blue {
  background: #e0f2fe;
  color: #0369a1;
}

.btn-step-next {
  background: var(--b2b-primary);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  margin-top: 14px;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}
.btn-step-next:hover {
  background: var(--b2b-primary-hover);
  transform: translateY(-1px);
}

/* 19.7 Radio Cards (ขนส่ง & ชำระเงิน) */
.radio-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.radio-card {
  border: 2px solid var(--b2b-border);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
  user-select: none;
}
.radio-card:hover {
  border-color: #94a3b8;
}
.radio-card.selected {
  border-color: var(--b2b-secondary);
  background: #f0f9ff;
}
.rc-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.rc-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.radio-card.selected .rc-radio {
  border-color: var(--b2b-secondary);
}
.radio-card.selected .rc-radio::after {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--b2b-secondary);
  border-radius: 50%;
}
.rc-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--b2b-text-main);
}
.rc-desc {
  font-size: 12.5px;
  color: var(--b2b-text-muted);
}
.rc-tag-free {
  color: var(--b2b-success);
  font-size: 12px;
  font-weight: 600;
}
.rc-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--b2b-text-main);
  white-space: nowrap;
}

/* 19.8 ส่วนเอกสารใบกำกับภาษี (Tax Invoice) */
.tax-box {
  margin-top: 20px;
  padding: 18px;
  background: #fdfefe;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
}
.tax-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tax-radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.tax-option {
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease-in-out;
  background: #fff;
  user-select: none;
}
.tax-option:hover {
  border-color: #0284c7;
  background: #f0f9ff;
}
.tax-option.selected {
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
#taxOptYes.tax-option.selected {
  border-color: #ea580c !important;
  background: #fff7ed !important;
  color: #9a3412 !important;
}
#taxOptNo.tax-option.selected {
  border-color: #64748b !important;
  background: #f8fafc !important;
  color: #334155 !important;
}
.tax-form-wrap {
  display: none;
  animation: fadeIn 0.3s;
  border-top: 1px dashed #cbd5e1;
  padding-top: 14px;
}
.tax-form-wrap.show {
  display: block;
}
.tax-address-mode {
  background: #f1f5f9;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 12px 0;
  font-size: 13.5px;
}
.tax-branch-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  user-select: none;
  transition: all 0.2s ease;
}
.tax-branch-pill:hover {
  border-color: #0284c7;
  background: #f0f9ff;
}
.tax-branch-pill.active {
  border-color: #0284c7 !important;
  background: #f0f9ff !important;
  color: #0369a1 !important;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.15);
}
.tax-addr-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  cursor: pointer;
}
.tax-addr-choice:last-child {
  margin-bottom: 0;
}
#customTaxAddressBox {
  display: none;
  margin-top: 10px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 19.9 คอลัมน์ขวา: กล่องสรุปรายการสั่งซื้อ (Order Summary Card) */
.summary-card {
  background: #fff;
  border: 1px solid var(--b2b-border);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
  position: sticky;
  top: 76px;
}
.summary-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--b2b-border);
}
.item-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
  max-height: 280px;
  overflow-y: auto;
}
.summary-item {
  display: flex;
  gap: 12px;
  align-items: center;
}
.item-info {
  flex: 1;
}
.item-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
  margin-bottom: 2px;
}
.item-meta {
  font-size: 12px;
  color: var(--b2b-text-muted);
}
.item-total {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

/* 19.10 ระบบคูปองส่วนลดทันสมัย (Modern Coupon Component) */
.coupon-section {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--b2b-border);
}
.coupon-input-wrap {
  display: flex;
  gap: 8px;
}
.coupon-input-wrap input {
  flex: 1;
  padding: 9px 12px;
  font-size: 13.5px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  transition: all 0.2s;
  box-sizing: border-box;
}
.coupon-input-wrap input:focus {
  outline: none;
  border-color: var(--b2b-secondary);
}
.btn-apply-coupon {
  padding: 0 16px;
  background: #0f172a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-apply-coupon:hover {
  background: #334155;
}
.btn-browse-coupons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--b2b-primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  transition: all 0.2s;
}
.btn-browse-coupons:hover {
  text-decoration: underline;
  color: var(--b2b-primary-hover);
}
.available-coupons-drawer {
  display: none;
  margin-top: 10px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  animation: fadeIn 0.25s ease-out;
}
.available-coupons-drawer.show {
  display: block;
}
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}
.drawer-close {
  cursor: pointer;
  color: #94a3b8;
  font-size: 16px;
  font-weight: bold;
}
.coupon-card-mini {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 11px 13px;
  margin-bottom: 9px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}
.coupon-card-mini:last-child {
  margin-bottom: 0;
}
.coupon-card-mini:hover:not(.disabled) {
  border-color: #ea580c;
  background: #fffaf5;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.12);
}
.coupon-card-mini.disabled {
  opacity: 0.65;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  cursor: not-allowed;
}
.cc-left {
  flex: 1;
}
.cc-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
.cc-tag {
  font-size: 11px;
  font-weight: 700;
  background: #ffedd5;
  color: #c2410c;
  padding: 2px 6px;
  border-radius: 4px;
}
.cc-tag.disabled {
  background: #e2e8f0;
  color: #64748b;
}
.cc-desc {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.35;
}
.cc-action {
  flex-shrink: 0;
}
.btn-use-coupon {
  padding: 6px 14px;
  background: #ea580c;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  pointer-events: none;
  transition: all 0.2s;
  box-shadow: 0 2px 5px rgba(234, 88, 12, 0.25);
}
.coupon-card-mini:hover:not(.disabled) .btn-use-coupon {
  background: #c2410c;
  box-shadow: 0 3px 8px rgba(234, 88, 12, 0.35);
}
.badge-locked {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  background: #f1f5f9;
  padding: 5px 8px;
  border-radius: 6px;
  display: inline-block;
  border: 1px solid #e2e8f0;
}
.applied-coupon-box {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
  margin-top: 8px;
  animation: fadeIn 0.25s ease-out;
}
.applied-coupon-box.show {
  display: flex;
}
.ac-info {
  font-size: 13px;
  color: #166534;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-remove-coupon {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
.coupon-error-msg {
  color: #ef4444;
  font-size: 12px;
  margin-top: 6px;
  display: none;
  font-weight: 500;
}

/* 19.11 ส่วนคำนวณราคา Totals */
.summary-calc {
  border-top: 1px solid var(--b2b-border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.calc-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  color: #475569;
}
.calc-row.grand-total {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--b2b-border);
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}
.calc-row.grand-total .val {
  color: var(--b2b-primary);
  font-size: 22px;
}

/* 19.12 กล่องสถานะแบบโฟกัสเดียว (Single Focus: Calm Status Bar) */
.summary-status-box {
  margin-top: 20px;
  padding: 16px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  text-align: center;
  transition: all 0.3s;
}
.status-badge-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #0284c7;
  margin-bottom: 8px;
}
.status-progress-track {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}
.status-progress-fill {
  height: 100%;
  background: var(--b2b-secondary);
  border-radius: 10px;
  width: 33%;
  transition: width 0.4s ease, background 0.4s ease;
}
.status-sub-hint {
  font-size: 12px;
  color: #64748b;
  margin-top: 8px;
}

/* 19.13 ปุ่มสั่งซื้อหลัก (Place Order Button) */
.btn-place-order {
  width: 100%;
  margin-top: 20px;
  padding: 15px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s;
  box-sizing: border-box;
}
.btn-place-order.ready {
  background: var(--b2b-primary);
  color: #fff;
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.35);
  animation: pulseBtn 2s infinite;
}
.btn-place-order.ready:hover {
  background: var(--b2b-primary-hover);
  transform: translateY(-1px);
}

@keyframes pulseBtn {
  0% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(249, 115, 22, 0); }
  100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); }
}

/* 19.14 Responsive Mobile & Tablet Layout */
@media (max-width: 900px) {
  .checkout-container {
    grid-template-columns: 1fr;
  }
  .summary-card {
    position: static;
    order: 2;
  }
  .steps-col {
    order: 1;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .tax-radio-group {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   20. B2B Multi-Branch Address Book & Checkout Branch Selector
   ========================================================================== */
.branch-select-drawer {
  display: none;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  margin-top: 14px;
}
.branch-select-drawer.show {
  display: block;
}
.saved-addr-choice-card {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.2s ease;
}
.saved-addr-choice-card:hover {
  border-color: var(--b2b-primary);
  background: #fdfdfd;
}
.saved-addr-choice-card.selected {
  border-color: #16a34a;
  background: #f0fdf4;
  box-shadow: 0 1px 3px rgba(22, 163, 74, 0.1);
}
.branch-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 4px;
}
.branch-pill.default {
  background: #dcfce7;
  color: #15803d;
}
.btn-toggle-branches {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-toggle-branches:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.btn-add-branch-checkout {
  background: #eff6ff;
  border: 1px dashed #3b82f6;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-add-branch-checkout:hover {
  background: #dbeafe;
}

/* My Account Address Book Dashboard */
.b2b-myacc-addresses-wrap {
  margin: 20px 0;
  font-family: 'Prompt', sans-serif;
}
.b2b-btn-add-branch {
  background: var(--b2b-primary);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 13.5px;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.b2b-btn-add-branch:hover {
  background: var(--b2b-primary-hover);
}
.b2b-branch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.b2b-branch-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.2s;
}
.b2b-branch-card.is-default {
  border-color: #16a34a;
  background: #fbfdfb;
}
.b2b-bc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.b2b-bc-title {
  font-weight: 700;
  font-size: 14.5px;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}
.b2b-badge-default {
  background: #dcfce7;
  color: #15803d;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}
.b2b-bc-body {
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 12px;
}
.b2b-bc-store {
  font-weight: 600;
  color: #1e293b;
}
.b2b-bc-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
}
.btn-bc-link {
  background: none;
  border: none;
  padding: 0;
  color: #0284c7;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.btn-bc-link:hover {
  text-decoration: underline;
}
.btn-bc-link.delete {
  color: #ef4444;
  margin-left: auto;
}

/* Modal styles for Add / Edit Branch */
.b2b-addr-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.b2b-addr-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
}
.b2b-addr-modal-dialog {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  width: 90%;
  max-width: 540px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2);
  z-index: 2;
  overflow: hidden;
}
.b2b-addr-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.b2b-modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #64748b;
  cursor: pointer;
}
.b2b-addr-modal-body {
  padding: 20px;
  max-height: 75vh;
  overflow-y: auto;
}
.modal-form-row {
  margin-bottom: 12px;
}
.modal-form-row label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
}
.modal-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13.5px;
  font-family: inherit;
  box-sizing: border-box;
}
.modal-input:focus {
  outline: none;
  border-color: var(--b2b-primary);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}
.modal-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.modal-form-grid.three {
  grid-template-columns: 1fr 1fr 1fr;
}
.b2b-addr-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
}
.btn-modal-cancel {
  background: #fff;
  border: 1px solid #cbd5e1;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
}
.btn-modal-save {
  background: var(--b2b-primary);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-modal-save:hover {
  background: var(--b2b-primary-hover);
}

/* ===================================================
   18. แถบลอยด้านขวา (Fixed Right Dock: ตะกร้าสินค้า & รายการโปรด เลื่อนตามหน้าจอ 100%)
   =================================================== */
.b2b-floating-side-dock {
  position: fixed !important;
  right: 0 !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 99999 !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-right: none !important;
  border-radius: 8px 0 0 8px !important;
  box-shadow: -2px 4px 16px rgba(0, 0, 0, 0.08), -1px 2px 4px rgba(0, 0, 0, 0.04) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: 54px !important;
  padding: 6px 0 !important;
  user-select: none !important;
  box-sizing: border-box !important;
}

.b2b-floating-dock-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  padding: 8px 4px !important;
  text-decoration: none !important;
  color: #334155 !important;
  transition: all 0.2s ease !important;
  position: relative !important;
  box-sizing: border-box !important;
}

.b2b-dock-cart:hover {
  background-color: #f0f9ff !important;
  color: #0284c7 !important;
}
.b2b-dock-cart:hover .b2b-dock-icon {
  stroke: #0284c7 !important;
  transform: scale(1.1) !important;
}

.b2b-dock-wishlist:hover {
  background-color: #fef2f2 !important;
  color: #ef4444 !important;
}
.b2b-dock-wishlist:hover .b2b-dock-icon {
  stroke: #ef4444 !important;
  fill: #ef4444 !important;
  transform: scale(1.1) !important;
}

.b2b-dock-icon-wrap {
  position: relative !important;
  width: 26px !important;
  height: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-bottom: 4px !important;
}

.b2b-dock-icon {
  width: 22px !important;
  height: 22px !important;
  stroke: #1e293b !important;
  transition: all 0.2s ease !important;
}

.b2b-dock-badge {
  position: absolute !important;
  top: -5px !important;
  right: -6px !important;
  background: #ef4444 !important;
  color: #ffffff !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  height: 16px !important;
  min-width: 16px !important;
  line-height: 16px !important;
  border-radius: 50% !important;
  text-align: center !important;
  padding: 0 3px !important;
  box-sizing: border-box !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
  pointer-events: none !important;
}

.b2b-dock-label {
  font-size: 11px !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  text-align: center !important;
  color: inherit !important;
  letter-spacing: -0.2px !important;
}

.b2b-dock-divider {
  width: 36px !important;
  height: 1px !important;
  background: #f1f5f9 !important;
  margin: 4px 0 !important;
}

@media (max-width: 549px) {
  .b2b-floating-side-dock {
    width: 46px !important;
    padding: 4px 0 !important;
  }
  .b2b-dock-icon {
    width: 19px !important;
    height: 19px !important;
  }
  .b2b-dock-label {
    font-size: 9.5px !important;
  }
}