/* ============================================
   KOBKA · cart.css
   Cart drawer + FAB + Header icon + Payment page
   Theme: Sino-Thai Heritage (oxblood + antique gold + cream)
   Created: 2026-05-01 (Chat #KB003)
   ============================================ */

/* ── Header cart button ── */
.kb-cart-header-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-left: 6px;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(195, 154, 64, 0.35);
  border-radius: 6px;
  color: var(--kb-oxblood, #7A1F1F);
  cursor: pointer;
  transition: all 0.18s ease;
}
.kb-cart-header-btn:hover {
  border-color: var(--kb-gold, #C39A40);
  background: rgba(195, 154, 64, 0.08);
}
.kb-cart-header-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}
.kb-cart-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  background: var(--kb-oxblood, #7A1F1F);
  color: var(--kb-gold-light, #E0C078);
  border: 1.5px solid var(--kb-cream, #F3E9D2);
  border-radius: 999px;
  font-family: 'JetBrains Mono', 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
  display: none;
}
.kb-cart-badge.is-active { display: inline-block; }

/* ── Floating cart FAB ──
   Stacked above existing .kb-fab (contact, bottom:24px right:24px)
   Layout: cart FAB at bottom 96px → above contact FAB with 14px gap
*/
.kb-cart-fab {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: 56px;
  height: 56px;
  background: linear-gradient(140deg, var(--kb-oxblood, #7A1F1F) 0%, var(--kb-oxblood-deep, #5C1818) 100%);
  color: var(--kb-gold-light, #E0C078);
  border: 2px solid var(--kb-gold, #C39A40);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 6px 18px rgba(74, 17, 17, 0.32),
    0 2px 6px rgba(74, 17, 17, 0.18),
    inset 0 1px 0 rgba(243, 233, 210, 0.08);
  z-index: 99;            /* same as .kb-fab so backdrop covers both */
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.22s ease,
              border-color 0.22s ease;
  animation: kbCartFabIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}
.kb-cart-fab:hover {
  transform: translateY(-3px) scale(1.05);
  border-color: var(--kb-gold-light, #E0C078);
  box-shadow:
    0 14px 32px rgba(74, 17, 17, 0.42),
    0 4px 10px rgba(195, 154, 64, 0.3),
    inset 0 1px 0 rgba(243, 233, 210, 0.12);
}
.kb-cart-fab:active { transform: translateY(-1px) scale(1.02); }
.kb-cart-fab svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15));
}
.kb-cart-fab .kb-cart-badge {
  top: -6px;
  right: -6px;
  background: var(--kb-gold, #C39A40);
  color: var(--kb-oxblood-deep, #5C1818);
  border-color: var(--kb-cream, #F3E9D2);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(74, 17, 17, 0.25);
}
/* Pulse ring when cart has items */
.kb-cart-fab:has(.kb-cart-badge.is-active)::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--kb-gold, #C39A40);
  opacity: 0;
  animation: kbCartPulse 2.4s ease-out infinite;
  pointer-events: none;
}

/* Hover tooltip (label) — slides in from right */
.kb-cart-fab[aria-label]::before {
  content: attr(aria-label);
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translate(8px, -50%);
  padding: 7px 13px;
  background: var(--kb-bronze, #4B3A2A);
  color: var(--kb-cream, #F3E9D2);
  border: 1px solid var(--kb-gold, #C39A40);
  border-radius: 6px;
  font-family: 'IBM Plex Sans Thai', 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.kb-cart-fab[aria-label]:hover::before {
  opacity: 1;
  transform: translate(0, -50%);
}

@keyframes kbCartFabIn {
  0%   { opacity: 0; transform: translateX(28px) scale(0.7); }
  60%  { opacity: 1; transform: translateX(-2px) scale(1.04); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes kbCartPulse {
  0%   { transform: scale(1);    opacity: 0.65; }
  70%  { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}
@media (max-width: 768px) {
  /* Contact FAB stays at right:24px bottom:24px size 64px on mobile too,
     so cart must clear it: 24 + 64 + 8gap = 96px from bottom */
  .kb-cart-fab {
    right: 24px;
    bottom: 96px;
    width: 52px;
    height: 52px;
  }
  .kb-cart-fab svg { width: 22px; height: 22px; }
  /* hide tooltip on mobile (no real hover) */
  .kb-cart-fab[aria-label]:hover::before { display: none; }
}

/* When drawer is open, hide both FABs */
body:has(.kb-cart-drawer.is-open) .kb-cart-fab,
body:has(.kb-cart-drawer.is-open) .kb-fab {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

/* ── Drawer + backdrop ── */
.kb-cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.5);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 999;
}
.kb-cart-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.kb-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  background: var(--kb-cream, #F3E9D2);
  box-shadow: -16px 0 48px rgba(74, 17, 17, 0.18);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  font-family: 'IBM Plex Sans Thai', 'Inter', sans-serif;
}
.kb-cart-drawer.is-open { transform: translateX(0); }

.kb-cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  background: var(--kb-oxblood, #7A1F1F);
  color: var(--kb-cream, #F3E9D2);
  border-bottom: 4px solid var(--kb-gold, #C39A40);
}
.kb-cart-drawer-header h3 {
  margin: 0;
  font-family: 'Noto Serif Thai', 'Cormorant Garamond', serif;
  font-size: 19px;
  color: var(--kb-gold-light, #E0C078);
  letter-spacing: 0.5px;
}
.kb-cart-close {
  background: transparent;
  border: 1px solid rgba(243, 233, 210, 0.3);
  color: var(--kb-cream, #F3E9D2);
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: all 0.18s ease;
}
.kb-cart-close:hover {
  background: rgba(243, 233, 210, 0.12);
  border-color: var(--kb-gold, #C39A40);
}

.kb-cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.kb-cart-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--kb-stone, #7A7166);
}
.kb-cart-empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.4;
}
.kb-cart-empty-text {
  font-family: 'Noto Serif Thai', 'Cormorant Garamond', serif;
  font-size: 16px;
  color: var(--kb-bronze, #4B3A2A);
  margin-bottom: 8px;
}
.kb-cart-empty-sub {
  font-size: 13.5px;
  color: var(--kb-stone, #7A7166);
  margin-bottom: 24px;
}
.kb-cart-empty .kb-btn {
  display: inline-block;
  padding: 9px 22px;
  background: var(--kb-oxblood, #7A1F1F);
  color: var(--kb-cream, #F3E9D2);
  border: 1px solid var(--kb-gold, #C39A40);
  border-radius: 6px;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
}

.kb-cart-item {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px dashed rgba(195, 154, 64, 0.4);
  align-items: center;
}
.kb-cart-item:last-child { border-bottom: none; }
.kb-cart-item-emoji {
  width: 50px;
  height: 50px;
  background: var(--kb-cream-soft, #FAF4E5);
  border: 1px solid var(--kb-gold, #C39A40);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}
.kb-cart-item-meta { min-width: 0; }
.kb-cart-item-name {
  font-family: 'Noto Serif Thai', 'Cormorant Garamond', serif;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--kb-oxblood, #7A1F1F);
  margin: 0 0 4px;
  line-height: 1.3;
  word-break: break-word;
}
.kb-cart-item-price {
  font-family: 'JetBrains Mono', 'Inter', sans-serif;
  font-size: 12.5px;
  color: var(--kb-bronze, #4B3A2A);
  margin: 0 0 6px;
}
.kb-cart-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--kb-gold, #C39A40);
  border-radius: 4px;
  background: var(--kb-cream-soft, #FAF4E5);
  overflow: hidden;
}
.kb-cart-qty button {
  width: 26px;
  height: 26px;
  background: transparent;
  border: none;
  color: var(--kb-oxblood, #7A1F1F);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: background 0.15s ease;
}
.kb-cart-qty button:hover { background: rgba(195, 154, 64, 0.18); }
.kb-cart-qty span {
  min-width: 28px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', 'Inter', sans-serif;
  font-size: 13px;
  color: var(--kb-bronze, #4B3A2A);
  border-left: 1px solid rgba(195, 154, 64, 0.35);
  border-right: 1px solid rgba(195, 154, 64, 0.35);
}
.kb-cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.kb-cart-item-subtotal {
  font-family: 'JetBrains Mono', 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--kb-oxblood, #7A1F1F);
  white-space: nowrap;
}
.kb-cart-remove {
  background: transparent;
  border: none;
  color: var(--kb-stone, #7A7166);
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  line-height: 1;
  transition: color 0.15s ease;
}
.kb-cart-remove:hover { color: var(--kb-error, #8B2920); }

.kb-cart-drawer-footer {
  padding: 18px 24px 22px;
  background: var(--kb-cream-soft, #FAF4E5);
  border-top: 2px solid var(--kb-gold, #C39A40);
}
.kb-cart-totals {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}
.kb-cart-totals-label {
  font-family: 'Noto Serif Thai', 'Cormorant Garamond', serif;
  font-size: 14px;
  color: var(--kb-bronze, #4B3A2A);
  letter-spacing: 0.5px;
}
.kb-cart-totals-value {
  font-family: 'JetBrains Mono', 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--kb-oxblood, #7A1F1F);
}
.kb-cart-checkout {
  display: block;
  width: 100%;
  padding: 13px 18px;
  background: var(--kb-oxblood, #7A1F1F);
  color: var(--kb-cream, #F3E9D2);
  border: 2px solid var(--kb-gold, #C39A40);
  border-radius: 6px;
  text-decoration: none;
  text-align: center;
  font-family: 'IBM Plex Sans Thai', 'Inter', sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.kb-cart-checkout:hover:not(:disabled) {
  background: var(--kb-oxblood-deep, #5C1818);
  transform: translateY(-1px);
}
.kb-cart-checkout:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--kb-stone, #7A7166);
  border-color: var(--kb-stone, #7A7166);
}
.kb-cart-clear-link {
  display: block;
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  color: var(--kb-stone, #7A7166);
  text-decoration: underline dotted;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
}

/* ── Add-to-cart inline button (on product cards) ── */
.kb-add-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin-left: 6px;
  background: var(--kb-oxblood, #7A1F1F);
  color: var(--kb-cream, #F3E9D2);
  border: 1px solid var(--kb-gold, #C39A40);
  border-radius: 4px;
  font-family: 'IBM Plex Sans Thai', 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  vertical-align: middle;
}
.kb-add-cart-btn:hover {
  background: var(--kb-oxblood-deep, #5C1818);
  transform: translateY(-1px);
}
.kb-add-cart-btn.is-added {
  background: var(--kb-jade, #2C5F4F);
  border-color: var(--kb-jade, #2C5F4F);
}

/* ── Toast (added confirmation) ──
   Sits above the cart FAB which is at bottom:96px (height 56px + 12px gap = 164px)
*/
.kb-cart-toast {
  position: fixed;
  bottom: 168px;
  right: 24px;
  background: var(--kb-jade, #2C5F4F);
  color: var(--kb-cream, #F3E9D2);
  padding: 11px 18px;
  border-radius: 6px;
  border: 1px solid var(--kb-gold, #C39A40);
  font-family: 'IBM Plex Sans Thai', 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1001;
}
.kb-cart-toast.is-show {
  transform: translateY(0);
  opacity: 1;
}
@media (max-width: 768px) {
  .kb-cart-toast { bottom: 160px; right: 24px; }
}

/* ============================================
   PAYMENT PAGE
   ============================================ */
.kb-pay-section {
  padding: 56px 24px;
  background: var(--kb-cream, #F3E9D2);
  min-height: 60vh;
}
.kb-pay-container {
  max-width: 1080px;
  margin: 0 auto;
}
.kb-pay-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 36px;
  align-items: start;
}
@media (max-width: 900px) {
  .kb-pay-grid { grid-template-columns: 1fr; }
}

.kb-pay-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0 auto 36px;
  max-width: 700px;
}
.kb-pay-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}
.kb-pay-step::after {
  content: "";
  position: absolute;
  top: 17px;
  left: 60%;
  right: -40%;
  height: 1px;
  background: rgba(195, 154, 64, 0.45);
}
.kb-pay-step:last-child::after { display: none; }
.kb-pay-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(195, 154, 64, 0.45);
  background: var(--kb-cream, #F3E9D2);
  color: var(--kb-stone, #7A7166);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  z-index: 1;
  position: relative;
  transition: all 0.18s ease;
}
.kb-pay-step.is-active .kb-pay-step-num {
  border-color: var(--kb-oxblood, #7A1F1F);
  background: var(--kb-oxblood, #7A1F1F);
  color: var(--kb-gold-light, #E0C078);
}
.kb-pay-step.is-done .kb-pay-step-num {
  border-color: var(--kb-jade, #2C5F4F);
  background: var(--kb-jade, #2C5F4F);
  color: var(--kb-cream, #F3E9D2);
}
.kb-pay-step.is-done::after { background: var(--kb-jade, #2C5F4F); }
.kb-pay-step-label {
  margin-top: 8px;
  font-family: 'IBM Plex Sans Thai', 'Inter', sans-serif;
  font-size: 12.5px;
  color: var(--kb-bronze, #4B3A2A);
  letter-spacing: 0.4px;
  text-align: center;
  white-space: nowrap;
}
.kb-pay-step.is-active .kb-pay-step-label { color: var(--kb-oxblood, #7A1F1F); font-weight: 600; }

.kb-pay-card {
  background: #FFF;
  border: 1px solid rgba(195, 154, 64, 0.3);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(74, 58, 42, 0.08);
  padding: 28px;
  margin-bottom: 24px;
}
.kb-pay-card h3 {
  margin: 0 0 18px;
  font-family: 'Noto Serif Thai', 'Cormorant Garamond', serif;
  font-size: 18px;
  color: var(--kb-oxblood, #7A1F1F);
  border-bottom: 1px solid rgba(195, 154, 64, 0.3);
  padding-bottom: 12px;
}

.kb-pay-method-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 600px) {
  .kb-pay-method-list { grid-template-columns: 1fr; }
}
.kb-pay-method {
  position: relative;
  display: block;
  padding: 16px 16px 16px 52px;
  background: var(--kb-cream-soft, #FAF4E5);
  border: 2px solid rgba(195, 154, 64, 0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.kb-pay-method:hover {
  border-color: var(--kb-gold, #C39A40);
  box-shadow: 0 4px 12px rgba(122, 31, 31, 0.08);
  transform: translateY(-1px);
}
.kb-pay-method input[type="radio"] {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  accent-color: var(--kb-oxblood, #7A1F1F);
  cursor: pointer;
}
.kb-pay-method-icon {
  font-size: 22px;
  margin-right: 6px;
}
.kb-pay-method-name {
  font-family: 'Noto Serif Thai', 'Cormorant Garamond', serif;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--kb-oxblood, #7A1F1F);
  display: block;
  margin-bottom: 2px;
}
.kb-pay-method-desc {
  font-family: 'IBM Plex Sans Thai', 'Inter', sans-serif;
  font-size: 12px;
  color: var(--kb-stone, #7A7166);
}
.kb-pay-method-logos {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.kb-pay-method-logos span {
  display: inline-block;
  padding: 2px 7px;
  background: #FFF;
  border: 1px solid rgba(195, 154, 64, 0.4);
  border-radius: 3px;
  font-family: 'JetBrains Mono', 'Inter', sans-serif;
  font-size: 10.5px;
  color: var(--kb-bronze, #4B3A2A);
  letter-spacing: 0.5px;
}
.kb-pay-method input[type="radio"]:checked ~ * { /* placeholder */ }
.kb-pay-method:has(input:checked) {
  border-color: var(--kb-oxblood, #7A1F1F);
  background: #FFF;
  box-shadow: 0 0 0 3px rgba(195, 154, 64, 0.18);
}

.kb-pay-summary-card {
  background: var(--kb-oxblood, #7A1F1F);
  color: var(--kb-cream, #F3E9D2);
  border-radius: 10px;
  border: 2px solid var(--kb-gold, #C39A40);
  padding: 24px;
  position: sticky;
  top: 100px;
}
.kb-pay-summary-card h3 {
  margin: 0 0 16px;
  font-family: 'Noto Serif Thai', 'Cormorant Garamond', serif;
  color: var(--kb-gold-light, #E0C078);
  font-size: 17px;
  border-bottom: 1px solid rgba(243, 233, 210, 0.2);
  padding-bottom: 10px;
}
.kb-pay-summary-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  max-height: 280px;
  overflow-y: auto;
}
.kb-pay-summary-list li {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(243, 233, 210, 0.15);
  font-family: 'IBM Plex Sans Thai', 'Inter', sans-serif;
  font-size: 13px;
  align-items: center;
}
.kb-pay-summary-list li:last-child { border-bottom: none; }
.kb-pay-summary-name {
  color: rgba(243, 233, 210, 0.9);
  line-height: 1.35;
}
.kb-pay-summary-name small {
  display: block;
  color: rgba(243, 233, 210, 0.6);
  font-size: 11px;
}
.kb-pay-summary-price {
  font-family: 'JetBrains Mono', 'Inter', sans-serif;
  font-size: 13px;
  color: var(--kb-gold-light, #E0C078);
  white-space: nowrap;
}
.kb-pay-summary-totals {
  border-top: 1px solid rgba(243, 233, 210, 0.25);
  padding-top: 14px;
}
.kb-pay-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-family: 'IBM Plex Sans Thai', 'Inter', sans-serif;
  font-size: 13px;
  color: rgba(243, 233, 210, 0.85);
}
.kb-pay-summary-row.is-total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(243, 233, 210, 0.25);
  font-family: 'Noto Serif Thai', 'Cormorant Garamond', serif;
  font-size: 17px;
  color: var(--kb-gold-light, #E0C078);
  font-weight: 600;
}
.kb-pay-summary-row.is-total span:last-child {
  font-family: 'JetBrains Mono', 'Inter', sans-serif;
  font-size: 22px;
}
.kb-pay-confirm-btn {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 14px 18px;
  background: var(--kb-gold, #C39A40);
  color: var(--kb-oxblood-deep, #5C1818);
  border: 2px solid var(--kb-gold-light, #E0C078);
  border-radius: 6px;
  font-family: 'IBM Plex Sans Thai', 'Inter', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.kb-pay-confirm-btn:hover:not(:disabled) {
  background: var(--kb-gold-light, #E0C078);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(195, 154, 64, 0.4);
}
.kb-pay-confirm-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(195, 154, 64, 0.4);
}

.kb-pay-trust {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.kb-pay-trust span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  background: rgba(195, 154, 64, 0.1);
  border: 1px solid rgba(195, 154, 64, 0.4);
  border-radius: 999px;
  font-family: 'IBM Plex Sans Thai', 'Inter', sans-serif;
  font-size: 11.5px;
  color: var(--kb-bronze, #4B3A2A);
}

.kb-pay-empty {
  text-align: center;
  padding: 70px 20px;
  background: #FFF;
  border: 1px dashed rgba(195, 154, 64, 0.5);
  border-radius: 10px;
}
.kb-pay-empty-icon { font-size: 64px; opacity: 0.4; margin-bottom: 16px; }
.kb-pay-empty h3 {
  font-family: 'Noto Serif Thai', 'Cormorant Garamond', serif;
  color: var(--kb-oxblood, #7A1F1F);
  font-size: 22px;
  margin: 0 0 8px;
  border: none;
  padding: 0;
}
.kb-pay-empty p {
  color: var(--kb-stone, #7A7166);
  font-size: 14px;
  margin-bottom: 22px;
}
.kb-pay-empty .kb-btn {
  display: inline-block;
  padding: 11px 24px;
  background: var(--kb-oxblood, #7A1F1F);
  color: var(--kb-cream, #F3E9D2);
  border: 2px solid var(--kb-gold, #C39A40);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

/* Demo notice banner */
.kb-pay-demo-notice {
  background: rgba(168, 90, 31, 0.1);
  border: 1px solid var(--kb-lacquer, #A85A1F);
  color: var(--kb-bronze, #4B3A2A);
  padding: 10px 16px;
  border-radius: 6px;
  font-family: 'IBM Plex Sans Thai', 'Inter', sans-serif;
  font-size: 12.5px;
  text-align: center;
  margin-bottom: 24px;
}
.kb-pay-demo-notice strong { color: var(--kb-lacquer, #A85A1F); }

/* Confirmation modal (post-confirm step) */
.kb-pay-success {
  text-align: center;
  padding: 50px 24px;
  background: #FFF;
  border: 2px solid var(--kb-jade, #2C5F4F);
  border-radius: 10px;
}
.kb-pay-success-icon {
  font-size: 60px;
  margin-bottom: 16px;
}
.kb-pay-success h3 {
  font-family: 'Noto Serif Thai', 'Cormorant Garamond', serif;
  color: var(--kb-jade, #2C5F4F);
  font-size: 24px;
  margin: 0 0 8px;
  border: none;
  padding: 0;
}
.kb-pay-success p { color: var(--kb-bronze, #4B3A2A); font-size: 14px; margin-bottom: 6px; }
.kb-pay-success-ref {
  display: inline-block;
  margin-top: 18px;
  padding: 10px 18px;
  background: var(--kb-cream-soft, #FAF4E5);
  border: 1px dashed var(--kb-gold, #C39A40);
  border-radius: 6px;
  font-family: 'JetBrains Mono', 'Inter', sans-serif;
  font-size: 14px;
  color: var(--kb-oxblood, #7A1F1F);
  letter-spacing: 1px;
}


/* ============================================
   ONLINE PAYMENT GATEWAY — Hero Card (KB007)
   ============================================ */
.kb-pay-gateway-hero {
  background: linear-gradient(135deg, #FFF 0%, var(--kb-cream-soft, #FAF4E5) 100%);
  border: 2px solid var(--kb-gold, #C39A40);
  border-radius: 12px;
  padding: 28px 32px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(122, 31, 31, 0.08);
}
.kb-pay-gateway-hero::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 280px; height: 280px;
  background: radial-gradient(circle at top right, rgba(195, 154, 64, 0.08), transparent 60%);
  pointer-events: none;
}
.kb-pay-gateway-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.kb-pay-gateway-icon {
  width: 48px; height: 48px;
  background: var(--kb-oxblood, #7A1F1F);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--kb-gold-light, #E0C078);
  box-shadow: 0 4px 12px rgba(122, 31, 31, 0.2);
}
.kb-pay-gateway-icon svg { width: 26px; height: 26px; }
.kb-pay-gateway-title {
  font-family: 'Noto Serif Thai', 'Cormorant Garamond', serif;
  font-size: 20px;
  color: var(--kb-oxblood, #7A1F1F);
  margin: 0;
  font-weight: 600;
}
.kb-pay-gateway-subtitle {
  font-family: 'IBM Plex Sans Thai', 'Inter', sans-serif;
  font-size: 13px;
  color: var(--kb-stone, #7A7166);
  margin: 2px 0 0;
  letter-spacing: 0.3px;
}
.kb-pay-brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
  margin: 14px 0;
  position: relative;
  z-index: 1;
}
.kb-pay-brand {
  background: #FFF;
  border: 1px solid rgba(195, 154, 64, 0.35);
  border-radius: 6px;
  padding: 10px 8px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.kb-pay-brand:hover {
  border-color: var(--kb-gold, #C39A40);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(122, 31, 31, 0.1);
}
.kb-pay-brand svg { max-width: 100%; max-height: 28px; }
.kb-pay-brand-text {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--kb-bronze, #4B3A2A);
}
.kb-pay-gateway-features {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px dashed rgba(195, 154, 64, 0.4);
  position: relative;
  z-index: 1;
}
.kb-pay-gateway-features span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'IBM Plex Sans Thai', 'Inter', sans-serif;
  font-size: 12.5px;
  color: var(--kb-bronze, #4B3A2A);
}
.kb-pay-gateway-features span::before {
  content: "✓";
  color: var(--kb-jade, #2C5F4F);
  font-weight: 700;
}
.kb-pay-powered-by {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 6px 12px;
  background: rgba(195, 154, 64, 0.1);
  border-radius: 999px;
  font-family: 'JetBrains Mono', 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--kb-stone, #7A7166);
  position: relative;
  z-index: 1;
}
.kb-pay-powered-by strong {
  color: var(--kb-oxblood, #7A1F1F);
  font-weight: 600;
}

/* Method group title */
.kb-pay-method-group {
  margin-top: 24px;
}
.kb-pay-method-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Noto Serif Thai', 'Cormorant Garamond', serif;
  font-size: 14px;
  color: var(--kb-oxblood, #7A1F1F);
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
}
.kb-pay-method-group-title::before {
  content: "";
  width: 32px;
  height: 2px;
  background: var(--kb-gold, #C39A40);
}
.kb-pay-method-group-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(195, 154, 64, 0.3), transparent);
}


/* ============================================
   PREMIUM FAB STACK — KB009 redesign
   Glass cream pill + gold ring + unified dock aesthetic
   Overrides earlier .kb-cart-fab + .kb-fab-main from conversion-tools.css
   ============================================ */

/* ── Wrap both FABs visually with subtle dock background ── */
/* The dock is a CSS-drawn vertical capsule behind both FABs */
.kb-cart-fab {
  /* Override all earlier sizing for unified look */
  position: fixed !important;
  right: 22px !important;
  bottom: 92px !important;
  width: 60px !important;
  height: 60px !important;
  background:
    radial-gradient(circle at 30% 20%, rgba(243, 233, 210, 0.15), transparent 60%),
    linear-gradient(160deg, #8B2424 0%, #7A1F1F 50%, #5C1818 100%) !important;
  color: var(--kb-gold-light, #E0C078) !important;
  border: 1.5px solid var(--kb-gold, #C39A40) !important;
  border-radius: 18px !important;     /* squircle instead of circle */
  z-index: 99 !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 -1px 0 rgba(0, 0, 0, 0.2) inset,
    0 8px 22px rgba(74, 17, 17, 0.32),
    0 2px 6px rgba(74, 17, 17, 0.18),
    0 0 0 4px rgba(195, 154, 64, 0.08) !important;     /* gold halo */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.28s ease,
    border-color 0.28s ease,
    background 0.28s ease !important;
  animation: kbFabIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}
.kb-cart-fab:hover {
  transform: translateY(-4px) scale(1.05) !important;
  border-color: var(--kb-gold-light, #E0C078) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 -1px 0 rgba(0, 0, 0, 0.15) inset,
    0 18px 38px rgba(74, 17, 17, 0.45),
    0 4px 10px rgba(195, 154, 64, 0.4),
    0 0 0 6px rgba(195, 154, 64, 0.18) !important;
}
.kb-cart-fab:active {
  transform: translateY(-1px) scale(1.02) !important;
}
.kb-cart-fab svg {
  width: 24px !important;
  height: 24px !important;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

/* Cart badge — refined */
.kb-cart-fab .kb-cart-badge {
  top: -8px !important;
  right: -8px !important;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: linear-gradient(135deg, #D8B560, var(--kb-gold, #C39A40)) !important;
  color: var(--kb-oxblood-deep, #5C1818) !important;
  border: 2px solid var(--kb-cream, #F3E9D2) !important;
  font-family: 'JetBrains Mono', 'Inter', sans-serif !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 18px !important;
  box-shadow: 0 3px 8px rgba(74, 17, 17, 0.3);
  letter-spacing: 0;
}

/* Pulse halo when cart has items */
.kb-cart-fab:has(.kb-cart-badge.is-active)::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 22px;       /* match squircle */
  border: 2px solid var(--kb-gold, #C39A40);
  opacity: 0;
  animation: kbFabPulse 2.6s ease-out infinite;
  pointer-events: none;
}

/* Tooltip — premium */
.kb-cart-fab[aria-label]::before {
  content: attr(aria-label);
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translate(8px, -50%);
  padding: 8px 14px;
  background: var(--kb-bronze, #4B3A2A);
  color: var(--kb-cream, #F3E9D2);
  border: 1px solid var(--kb-gold, #C39A40);
  border-radius: 8px;
  font-family: 'IBM Plex Sans Thai', 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.3px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
/* Tooltip arrow */
.kb-cart-fab[aria-label][title]:hover::before,
.kb-cart-fab[aria-label]:hover::before {
  opacity: 1;
  transform: translate(0, -50%);
}

/* ── Override Contact FAB main button to match ── */
.kb-fab {
  bottom: 22px !important;
  right: 22px !important;
}
.kb-fab-main {
  width: 60px !important;
  height: 60px !important;
  border-radius: 18px !important;       /* match squircle */
  background:
    radial-gradient(circle at 30% 20%, rgba(243, 233, 210, 0.15), transparent 60%),
    linear-gradient(160deg, #8B2424 0%, #7A1F1F 50%, #5C1818 100%) !important;
  color: var(--kb-gold-light, #E0C078) !important;
  border: 1.5px solid var(--kb-gold, #C39A40) !important;
  font-size: 24px !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 -1px 0 rgba(0, 0, 0, 0.2) inset,
    0 8px 22px rgba(74, 17, 17, 0.32),
    0 2px 6px rgba(74, 17, 17, 0.18),
    0 0 0 4px rgba(195, 154, 64, 0.08) !important;
  transition:
    transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.28s ease,
    border-color 0.28s ease,
    background 0.28s ease !important;
  animation: kbFabIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.05s both;
}
.kb-fab-main:hover {
  transform: translateY(-4px) scale(1.05) rotate(0deg) !important;
  background:
    radial-gradient(circle at 30% 20%, rgba(243, 233, 210, 0.18), transparent 60%),
    linear-gradient(160deg, #9B2C2C 0%, #8B2424 50%, #6E1E1E 100%) !important;
  border-color: var(--kb-gold-light, #E0C078) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 -1px 0 rgba(0, 0, 0, 0.15) inset,
    0 18px 38px rgba(74, 17, 17, 0.45),
    0 4px 10px rgba(195, 154, 64, 0.4),
    0 0 0 6px rgba(195, 154, 64, 0.18) !important;
}

/* Refine the contact menu (kb-fab-menu) */
.kb-fab-menu {
  background: var(--kb-cream, #F3E9D2) !important;
  border: 1.5px solid var(--kb-gold, #C39A40) !important;
  border-radius: 14px !important;
  padding: 10px !important;
  box-shadow: 0 16px 38px rgba(74, 17, 17, 0.32),
              0 0 0 4px rgba(195, 154, 64, 0.1) !important;
  min-width: 220px !important;
  margin-bottom: 14px;
}
.kb-fab-menu a {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 11px 14px !important;
  border-radius: 8px !important;
  color: var(--kb-bronze, #4B3A2A) !important;
  font-family: 'IBM Plex Sans Thai', 'Inter', sans-serif !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  transition: background 0.18s ease, transform 0.18s ease !important;
}
.kb-fab-menu a:hover {
  background: linear-gradient(135deg, var(--kb-oxblood, #7A1F1F), var(--kb-oxblood-deep, #5C1818)) !important;
  color: var(--kb-gold-light, #E0C078) !important;
  transform: translateX(-2px) !important;
}
.kb-fab-menu a .icon {
  font-size: 18px !important;
  width: 24px;
  text-align: center;
}

/* ── Subtle gold connector dot between the two FABs ── */
.kb-fab::before {
  content: "";
  position: fixed;
  right: calc(22px + 30px - 1px);  /* center align with FABs */
  bottom: calc(22px + 60px + 4px); /* between the two */
  width: 2px;
  height: 4px;
  background: var(--kb-gold, #C39A40);
  border-radius: 2px;
  opacity: 0.4;
  pointer-events: none;
  z-index: 98;
}

/* ── Animations ── */
@keyframes kbFabIn {
  0%   { opacity: 0; transform: translateX(36px) scale(0.55); }
  60%  { opacity: 1; transform: translateX(-3px) scale(1.06); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes kbFabPulse {
  0%   { transform: scale(1);    opacity: 0.7; }
  70%  { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}

/* ── Mobile tweaks ── */
@media (max-width: 768px) {
  .kb-cart-fab {
    right: 16px !important;
    bottom: 88px !important;
    width: 54px !important;
    height: 54px !important;
    border-radius: 16px !important;
  }
  .kb-cart-fab svg { width: 22px !important; height: 22px !important; }
  .kb-fab {
    right: 16px !important;
    bottom: 18px !important;
  }
  .kb-fab-main {
    width: 54px !important;
    height: 54px !important;
    border-radius: 16px !important;
    font-size: 22px !important;
  }
  .kb-fab::before {
    right: calc(16px + 27px - 1px);
    bottom: calc(18px + 54px + 3px);
  }
  /* Hide tooltip on mobile (no real hover) */
  .kb-cart-fab[aria-label]:hover::before { display: none; }
}

/* When drawer or fab menu opens, hide both FABs */
body:has(.kb-cart-drawer.is-open) .kb-cart-fab,
body:has(.kb-cart-drawer.is-open) .kb-fab {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}


/* ============================================
   #KB018 — Always-visible cart UI
   - Badge shows "0" even when empty (gives user clear affordance)
   - FAB visible immediately on page load (no opacity-0 start state)
   - Header button visible
   ============================================ */

/* Badge always visible — show count even at 0 */
.kb-cart-badge,
.kb-cart-fab .kb-cart-badge,
.kb-cart-header-btn .kb-cart-badge {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

/* When count is 0, dim the badge slightly (but still visible) */
.kb-cart-badge:not(.is-active) {
  opacity: 0.55;
  background: var(--kb-stone, #7A7166) !important;
  color: var(--kb-cream, #F3E9D2) !important;
  border-color: var(--kb-cream, #F3E9D2) !important;
}

.kb-cart-badge.is-active {
  opacity: 1;
}

/* FAB: ensure always visible — disable starting opacity 0 from animation */
.kb-cart-fab {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Header cart button: extra emphasis to make it clearly clickable */
.kb-cart-header-btn {
  border-color: var(--kb-gold, #C39A40) !important;
  background: rgba(195, 154, 64, 0.08) !important;
  color: var(--kb-oxblood, #7A1F1F) !important;
  font-weight: 600;
}
.kb-cart-header-btn:hover {
  background: rgba(195, 154, 64, 0.18) !important;
  transform: scale(1.05);
}

/* Optional: small "ตะกร้า" / "Cart" text label next to header icon for extra clarity */
.kb-cart-header-btn::after {
  content: attr(aria-label);
  display: none;            /* hidden by default — show on >1024px */
  margin-left: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--kb-bronze, #4B3A2A);
}
@media (min-width: 1100px) {
  .kb-cart-header-btn {
    width: auto !important;
    padding: 0 12px !important;
  }
  .kb-cart-header-btn::after {
    display: inline;
  }
}
