/*
 * checkout.css
 * แยกออกจาก checkout.php
 * สำหรับหน้า Checkout เท่านั้น
 */

.checkout-wrap{max-width:1480px;margin:0 auto}
.checkout-hero{border:1px solid #e5e7eb;border-radius:.5rem;background:radial-gradient(circle at top left,rgba(13,110,253,.12),transparent 34%),linear-gradient(135deg,#fff 0%,#f8fbff 100%);box-shadow:0 .65rem 1.7rem rgba(15,23,42,.055)}
.checkout-title{font-weight:900;color:#0f172a;letter-spacing:-.02em}
.checkout-badge{display:inline-flex;align-items:center;gap:.35rem;color:#0d6efd;background:#eff6ff;border:1px solid #dbeafe;border-radius:.4rem;padding:.35rem .6rem;font-size:.82rem;font-weight:800}
.checkout-card{border:1px solid #e5e7eb;border-radius:.5rem;background:#fff;box-shadow:0 .45rem 1.25rem rgba(15,23,42,.045)}
.checkout-section-title{font-weight:900;color:#0f172a}
.checkout-input-group .input-group-text{width:44px;justify-content:center;background:#f8fbff;color:#0d6efd;border-color:#dbe4f0}
.checkout-input-group .form-control,.checkout-input-group textarea{border-color:#dbe4f0}
.checkout-input-group .form-control:focus,.checkout-input-group textarea:focus{border-color:#86b7fe;box-shadow:0 0 0 .2rem rgba(13,110,253,.12)}
.checkout-item-img{width:66px;height:66px;object-fit:cover;border-radius:.5rem;border:1px solid #e5e7eb;background:#f8fafc;flex:0 0 auto}
.checkout-summary{position:sticky;top:88px}
.checkout-summary-row{display:flex;justify-content:space-between;gap:1rem;padding:.42rem 0;color:#475569}
.checkout-summary-row b{color:#0f172a}
.checkout-total{color:#0d6efd;font-weight:900;font-size:1.45rem}
.checkout-empty{min-height:280px;display:flex;align-items:center;justify-content:center;text-align:center;color:#64748b}
.checkout-empty-icon{width:88px;height:88px;border-radius:.75rem;display:inline-flex;align-items:center;justify-content:center;background:#eaf2ff;color:#0d6efd;font-size:3rem;margin-bottom:1rem}
.checkout-step{display:flex;gap:.75rem;align-items:flex-start}
.checkout-step-no{width:30px;height:30px;border-radius:.5rem;background:#0d6efd;color:#fff;display:inline-flex;align-items:center;justify-content:center;font-weight:900;flex:0 0 auto}
.checkout-soft{background:#f8fbff;border:1px solid #dbeafe;border-radius:.5rem}
.checkout-option-badge{display:inline-flex;align-items:center;gap:.25rem;border:1px solid #dbeafe;background:#eff6ff;color:#0d6efd;border-radius:.35rem;padding:.18rem .45rem;font-size:.78rem;font-weight:800}
.checkout-tax-box{border:1px solid #dbeafe;background:#f8fbff;border-radius:.5rem;padding:.75rem;margin:.55rem 0}.checkout-tax-row{display:flex;justify-content:space-between;gap:1rem;font-size:.92rem;color:#475569;padding:.18rem 0}.checkout-tax-row b{color:#0f172a}.checkout-tax-badge{display:inline-flex;align-items:center;gap:.35rem;background:#eef6ff;color:#0d6efd;border:1px solid #dbeafe;border-radius:.35rem;padding:.25rem .45rem;font-size:.78rem;font-weight:800}
.checkout-mobile-bar{display:none}
@media(max-width:991.98px){.checkout-summary{position:static}}
@media(max-width:767.98px){.checkout-hero{border-radius:.5rem}.checkout-card{border-radius:.5rem}.checkout-item-img{width:58px;height:58px}.checkout-mobile-bar{display:block;position:sticky;bottom:0;z-index:1020;background:rgba(255,255,255,.96);border:1px solid #e5e7eb;border-radius:.75rem .75rem 0 0;box-shadow:0 -.65rem 1.4rem rgba(15,23,42,.08);backdrop-filter:blur(10px);padding:.75rem;margin-top:1rem}}

.checkout-auth-card{
  border:1px solid #dbeafe;
  background:linear-gradient(135deg,#f8fbff 0%,#ffffff 100%);
}
.checkout-auth-icon{
  width:64px;
  height:64px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#eff6ff;
  color:#0d6efd;
  border:1px solid #dbeafe;
  border-radius:.75rem;
  font-size:2rem;
}
.checkout-login-box{
  border:1px dashed #bfdbfe;
  background:#f8fbff;
  border-radius:.75rem;
}


.checkout-address-card{
  border:1px solid #dbeafe;
  background:#f8fbff;
  border-radius:.75rem;
  padding:1rem;
}
.checkout-address-status{
  margin-top:.55rem;
  font-size:.86rem;
  color:#64748b;
}
.checkout-address-status p{
  margin:0;
}
.checkout-captcha-box{
  border:1px dashed #bcd3ff;
  background:#f8fbff;
  border-radius:.75rem;
}


.checkout-my-address{
  border:1px solid #e5e7eb;
  background:#ffffff;
  border-radius:.75rem;
  padding:1rem;
}
.checkout-address-choice{
  display:flex;
  gap:.75rem;
  align-items:flex-start;
  border:1px solid #dbeafe;
  background:#f8fbff;
  border-radius:.75rem;
  padding:.75rem;
}
.checkout-address-choice .form-check-input{
  margin-top:.25rem;
}
.checkout-address-new{
  border:1px dashed #bcd3ff;
  background:#fbfdff;
  border-radius:.75rem;
  padding:1rem;
}


/* ===== Tax branch card responsive fix ===== */
.tax-branch-card{
  border:1px solid #e5e7eb;
  border-radius:.45rem;
  background:#fff;
  padding:.75rem;
  height:100%;
  min-height:78px;
  cursor:pointer;
  transition:.18s ease;
}
.tax-branch-card:hover,
.tax-branch-card.active{
  border-color:#86b7fe;
  background:#eff6ff;
  box-shadow:0 .35rem .9rem rgba(13,110,253,.06);
}
.tax-branch-card input[type="radio"]{
  margin-top:.25rem;
  flex:0 0 auto;
}
.tax-branch-card .fw-bold{
  color:#0f172a;
}
.tax-branch-card.active .fw-bold{
  color:#0d6efd;
}
.checkout-tax-mode{
  min-height:78px;
}
.checkout-tax-invoice-card,
.checkout-tax-address-card{
  border-radius:.5rem!important;
}
.checkout-tax-zip-status{
  line-height:1.55;
}
@media(max-width:767.98px){
  .tax-branch-card,
  .checkout-tax-mode{
    min-height:auto;
  }
}
@media(max-width:575.98px){
  .tax-branch-card,
  .checkout-tax-mode{
    padding:.68rem;
  }
  .checkout-tax-invoice-card .row.g-2,
  .checkout-tax-address-card .row.g-2{
    --bs-gutter-y:.55rem;
  }
}


.checkout-tax-choice{ /* fallback for older markup */
  border:1px solid #e5e7eb;
  border-radius:.45rem;
  background:#fff;
  padding:.72rem;
  height:100%;
  cursor:pointer;
  transition:.18s ease;
}
.checkout-tax-choice:hover,
.checkout-tax-choice.active{
  border-color:#86b7fe;
  background:#eff6ff;
}


/* ===== Tax invoice Bootstrap simple polish ===== */
.checkout-tax-invoice-card{
  border:1px solid #dbeafe!important;
  background:linear-gradient(135deg,#f8fbff 0%,#ffffff 100%)!important;
  border-radius:.5rem!important;
  padding:1rem!important;
}
.checkout-tax-invoice-card.is-active{
  border-color:#93c5fd!important;
  box-shadow:0 .55rem 1.25rem rgba(13,110,253,.08)!important;
}
.checkout-tax-address-card{
  border:1px solid #dbeafe!important;
  background:linear-gradient(135deg,#f8fbff 0%,#ffffff 100%)!important;
  border-radius:.5rem!important;
  padding:1rem!important;
}
.tax-branch-card,
.checkout-tax-mode{
  position:relative;
  display:flex!important;
  align-items:flex-start!important;
  gap:.65rem!important;
  width:100%;
  min-height:86px;
  border:1px solid #e5e7eb!important;
  border-radius:.5rem!important;
  background:#fff!important;
  padding:.8rem .85rem!important;
  cursor:pointer;
  transition:border-color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.tax-branch-card:hover,
.checkout-tax-mode:hover{
  border-color:#bfdbfe!important;
  background:#f8fbff!important;
  box-shadow:0 .35rem .85rem rgba(15,23,42,.05)!important;
  transform:translateY(-1px);
}
.tax-branch-card.active,
.checkout-tax-mode.active{
  border-color:#60a5fa!important;
  background:#eff6ff!important;
  box-shadow:0 .45rem 1rem rgba(13,110,253,.10)!important;
}
.tax-branch-card input[type="radio"],
.checkout-tax-mode input[type="radio"]{
  width:1rem;
  height:1rem;
  margin-top:.22rem!important;
  flex:0 0 auto;
  accent-color:#0d6efd;
}
.tax-choice-content{
  min-width:0;
  flex:1 1 auto;
}
.tax-choice-title{
  color:#0f172a;
  font-weight:900;
  font-size:.96rem;
  line-height:1.25;
}
.tax-choice-desc{
  color:#64748b;
  font-size:.82rem;
  line-height:1.35;
  margin-top:.18rem;
}
.tax-branch-card.active .tax-choice-title,
.checkout-tax-mode.active .tax-choice-title{
  color:#0d6efd;
}
.tax-soft-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.3rem;
  border-radius:.35rem;
  padding:.35rem .6rem;
  font-size:.78rem;
  line-height:1.1;
  font-weight:900;
  border:1px solid transparent;
  white-space:nowrap;
}
.tax-soft-badge-optional{
  background:#eef2ff;
  color:#4f46e5;
  border-color:#c7d2fe;
}
.tax-soft-badge-auto{
  background:#f5f3ff;
  color:#6d28d9;
  border-color:#ddd6fe;
}
.checkout-tax-info-box{
  border:1px solid #dbeafe!important;
  background:#f8fbff!important;
  border-radius:.5rem!important;
  padding:.75rem!important;
  color:#475569!important;
  font-size:.88rem!important;
}
.checkout-tax-zip-status{
  border:1px dashed #bfdbfe;
  background:#f8fbff;
  border-radius:.45rem;
  padding:.55rem .7rem;
  margin-top:.65rem!important;
}
@media(max-width:767.98px){
  .tax-branch-card,
  .checkout-tax-mode{
    min-height:auto;
  }
}
@media(max-width:575.98px){
  .checkout-tax-invoice-card,
  .checkout-tax-address-card{
    padding:.75rem!important;
  }
  .tax-branch-card,
  .checkout-tax-mode{
    padding:.7rem!important;
    border-radius:.45rem!important;
  }
  .tax-choice-title{
    font-size:.92rem;
  }
  .tax-choice-desc{
    font-size:.78rem;
  }
  .tax-soft-badge{
    white-space:normal;
    text-align:center;
  }
}


/* ===== Address default pastel badge/colors ===== */
.checkout-address-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.28rem;
  width:max-content;
  max-width:100%;
  border-radius:999px;
  padding:.34rem .62rem;
  font-size:.78rem;
  font-weight:900;
  line-height:1.15;
  border:1px solid transparent;
  box-shadow:0 .25rem .65rem rgba(15,23,42,.04);
}
.checkout-address-badge-default,
.checkout-pastel-default{
  background:#ecfdf5!important;
  color:#047857!important;
  border-color:#a7f3d0!important;
}
.checkout-address-badge-default i,
.checkout-pastel-default i{
  color:#059669!important;
}
.checkout-address-card input[type="radio"]:checked ~ span .checkout-address-badge-default,
.checkout-address-item input[type="radio"]:checked ~ span .checkout-address-badge-default{
  background:#dcfce7!important;
  border-color:#86efac!important;
  color:#047857!important;
}
.checkout-address-card:has(input[type="radio"]:checked),
.checkout-address-item:has(input[type="radio"]:checked){
  border-color:#bfdbfe!important;
  background:linear-gradient(135deg,#eff6ff 0%,#f8fbff 100%)!important;
}
@supports not selector(:has(*)){
  .checkout-address-card.active,
  .checkout-address-item.active{
    border-color:#bfdbfe!important;
    background:#eff6ff!important;
  }
}
@media(max-width:575.98px){
  .checkout-address-badge{
    font-size:.76rem;
    padding:.32rem .55rem;
  }
}


/* ===== SSKRO Checkout rounded-1 + Pastel Badges + Pastel Buttons ===== */
:root{
  --co-primary:#0d6efd;
  --co-primary-soft:#eff6ff;
  --co-primary-border:#bfdbfe;

  --co-success:#047857;
  --co-success-soft:#ecfdf5;
  --co-success-border:#a7f3d0;

  --co-warning:#b45309;
  --co-warning-soft:#fff7ed;
  --co-warning-border:#fed7aa;

  --co-danger:#b91c1c;
  --co-danger-soft:#fef2f2;
  --co-danger-border:#fecaca;

  --co-purple:#6d28d9;
  --co-purple-soft:#f5f3ff;
  --co-purple-border:#ddd6fe;

  --co-muted:#64748b;
  --co-muted-soft:#f8fafc;
  --co-muted-border:#e5e7eb;
}

.checkout-wrap .rounded,
.checkout-wrap .rounded-1,
.checkout-wrap .checkout-hero,
.checkout-wrap .checkout-card,
.checkout-wrap .checkout-auth-card,
.checkout-wrap .checkout-summary,
.checkout-wrap .checkout-address-card,
.checkout-wrap .checkout-tax-invoice-card,
.checkout-wrap .checkout-tax-address-card,
.checkout-wrap .checkout-tax-choice,
.checkout-wrap .checkout-tax-mode,
.checkout-wrap .checkout-tax-box,
.checkout-wrap .checkout-captcha-box,
.checkout-wrap .checkout-mobile-bar,
.checkout-wrap .checkout-item-img,
.checkout-wrap .form-control,
.checkout-wrap .form-select,
.checkout-wrap .input-group-text,
.checkout-wrap .btn,
.checkout-wrap .badge,
.checkout-wrap .alert,
.checkout-wrap .checkout-badge,
.checkout-wrap .checkout-option-badge,
.checkout-wrap .checkout-tax-badge,
.checkout-wrap .checkout-pastel-badge,
.checkout-wrap .tax-soft-badge,
.checkout-wrap .checkout-address-badge,
.checkout-wrap .checkout-soft {
  border-radius:.25rem!important;
}

.checkout-wrap .btn{
  min-height:34px;
  padding:.38rem .62rem;
  font-size:.86rem;
  font-weight:900!important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.18rem;
  border-radius:.25rem!important;
  box-shadow:0 .18rem .55rem rgba(15,23,42,.035);
}

.checkout-wrap .btn-sm{
  min-height:30px;
  padding:.28rem .52rem;
  font-size:.78rem;
}

.checkout-wrap .btn-lg{
  min-height:40px;
  padding:.48rem .75rem;
  font-size:.92rem;
}

.checkout-wrap .btn-primary{
  background:var(--co-primary-soft)!important;
  color:var(--co-primary)!important;
  border-color:var(--co-primary-border)!important;
}

.checkout-wrap .btn-primary:hover,
.checkout-wrap .btn-outline-primary:hover{
  background:#dbeafe!important;
  color:#0b5ed7!important;
  border-color:#93c5fd!important;
}

.checkout-wrap .btn-outline-primary{
  background:#ffffff!important;
  color:var(--co-primary)!important;
  border-color:var(--co-primary-border)!important;
}

.checkout-wrap .btn-outline-success,
.checkout-wrap .btn-success{
  background:var(--co-success-soft)!important;
  color:var(--co-success)!important;
  border-color:var(--co-success-border)!important;
}

.checkout-wrap .btn-outline-danger,
.checkout-wrap .btn-danger{
  background:var(--co-danger-soft)!important;
  color:var(--co-danger)!important;
  border-color:var(--co-danger-border)!important;
}

.checkout-wrap .btn-warning,
.checkout-wrap .btn-outline-warning{
  background:var(--co-warning-soft)!important;
  color:var(--co-warning)!important;
  border-color:var(--co-warning-border)!important;
}

.checkout-wrap .btn-light,
.checkout-wrap .btn-outline-secondary{
  background:var(--co-muted-soft)!important;
  color:#475569!important;
  border-color:var(--co-muted-border)!important;
}

.checkout-wrap .checkout-submit-btn{
  min-height:38px!important;
  font-size:.9rem!important;
}

.checkout-wrap .badge,
.checkout-badge,
.checkout-option-badge,
.checkout-tax-badge,
.checkout-pastel-badge,
.tax-soft-badge,
.checkout-address-badge,
.checkout-price-badge{
  min-height:24px;
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  gap:.25rem;
  border-radius:.25rem!important;
  padding:.22rem .5rem!important;
  font-size:.74rem!important;
  font-weight:900!important;
  line-height:1!important;
  white-space:nowrap;
  box-shadow:0 .16rem .45rem rgba(15,23,42,.03);
}

.checkout-badge,
.checkout-option-badge,
.checkout-tax-badge,
.checkout-pastel-badge,
.checkout-price-badge.is-sale{
  color:var(--co-primary)!important;
  background:var(--co-primary-soft)!important;
  border:1px solid var(--co-primary-border)!important;
}

.checkout-pastel-tax,
.checkout-tax-badge{
  color:var(--co-purple)!important;
  background:var(--co-purple-soft)!important;
  border-color:var(--co-purple-border)!important;
}

.checkout-pastel-default,
.tax-soft-badge-auto,
.checkout-address-badge-default{
  color:var(--co-success)!important;
  background:var(--co-success-soft)!important;
  border-color:var(--co-success-border)!important;
}

.checkout-price-badge.is-flash,
.checkout-wrap .text-bg-danger{
  color:var(--co-danger)!important;
  background:var(--co-danger-soft)!important;
  border:1px solid var(--co-danger-border)!important;
}

.checkout-price-badge.is-wholesale{
  color:var(--co-success)!important;
  background:var(--co-success-soft)!important;
  border:1px solid var(--co-success-border)!important;
}

.checkout-price-badge.is-sale{
  color:var(--co-warning)!important;
  background:var(--co-warning-soft)!important;
  border-color:var(--co-warning-border)!important;
}

.checkout-wrap .checkout-card,
.checkout-wrap .checkout-hero{
  border-color:#dbeafe!important;
}

.checkout-wrap .checkout-card{
  box-shadow:0 .45rem 1.25rem rgba(15,23,42,.045);
}

.checkout-wrap .checkout-item-img{
  border-radius:.25rem!important;
}

.checkout-wrap .badge .bi,
.checkout-badge .bi,
.checkout-option-badge .bi,
.checkout-tax-badge .bi,
.checkout-pastel-badge .bi,
.tax-soft-badge .bi,
.checkout-address-badge .bi,
.checkout-price-badge .bi{
  font-size:.82em;
  line-height:1;
}

.checkout-action-row .btn,
.checkout-normal-btn{
  min-height:32px!important;
  padding:.32rem .56rem!important;
  font-size:.8rem!important;
  max-width:220px;
}

.checkout-mobile-bar .btn{
  min-height:32px!important;
  padding:.32rem .56rem!important;
  font-size:.8rem!important;
  width:auto!important;
  min-width:112px;
  max-width:148px;
}

@media(max-width:575.98px){
  .checkout-wrap .btn{
    min-height:32px;
    padding:.34rem .52rem;
    font-size:.8rem;
  }

  .checkout-wrap .btn-sm{
    min-height:28px;
    font-size:.74rem;
  }

  .checkout-wrap .badge,
  .checkout-badge,
  .checkout-option-badge,
  .checkout-tax-badge,
  .checkout-pastel-badge,
  .tax-soft-badge,
  .checkout-address-badge,
  .checkout-price-badge{
    min-height:22px;
    font-size:.68rem!important;
    padding:.18rem .42rem!important;
  }

  .checkout-submit-btn{
    min-height:36px!important;
  }
}


.checkout-option-badge.is-sku-variant {
  color: var(--co-primary) !important;
  background: var(--co-primary-soft) !important;
  border-color: var(--co-primary-border) !important;
}


/* ===== Checkout item pastel badges ===== */
.checkout-item-card {
  background: #fff;
  border-color: #dbeafe !important;
  box-shadow: 0 .18rem .65rem rgba(15,23,42,.035);
}

.checkout-item-badges {
  gap: .35rem !important;
}

.checkout-item-badge {
  min-height: 23px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  border-radius: .25rem !important;
  padding: .18rem .46rem !important;
  font-size: .72rem !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  white-space: nowrap;
  border: 1px solid #dbeafe;
  box-shadow: 0 .16rem .42rem rgba(15,23,42,.028);
}

.checkout-item-badge .bi {
  font-size: .82em;
  line-height: 1;
}

.checkout-item-badge.is-option-name {
  color: #0d6efd !important;
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
}

.checkout-item-badge.is-option-value {
  color: #6d28d9 !important;
  background: #f5f3ff !important;
  border-color: #ddd6fe !important;
}

.checkout-item-badge.is-sku-variant {
  color: #475569 !important;
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

.checkout-item-badge.is-qty {
  color: #047857 !important;
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
}

.checkout-item-badge.is-warranty {
  color: #b45309 !important;
  background: #fff7ed !important;
  border-color: #fed7aa !important;
}

.checkout-item-price-detail {
  color: #64748b;
  font-size: .76rem;
  margin-top: .35rem;
}

@media(max-width:575.98px){
  .checkout-item-badge{
    min-height: 22px;
    font-size: .68rem !important;
    padding: .17rem .38rem !important;
  }
  .checkout-item-badges{
    gap: .28rem !important;
  }
}


/* ===== Checkout items responsive polish: mobile / tablet / desktop ===== */
.checkout-items-list {
  display: grid;
  gap: .65rem;
}

.checkout-item-card {
  align-items: center;
}

.checkout-item-main {
  min-width: 0;
  flex: 1 1 auto;
}

.checkout-item-price-box {
  min-width: 120px;
  text-align: right;
  flex: 0 0 auto;
}

.checkout-item-total-price {
  color: #0d6efd;
  font-weight: 950;
  white-space: nowrap;
}

.checkout-item-title {
  color: #0f172a;
  line-height: 1.35;
  word-break: break-word;
}

@media (max-width: 991.98px) {
  .checkout-item-price-box {
    min-width: 105px;
  }

  .checkout-item-img {
    width: 58px !important;
    height: 58px !important;
  }
}

@media (max-width: 767.98px) {
  .checkout-item-card {
    align-items: flex-start !important;
    gap: .65rem !important;
  }

  .checkout-item-price-box {
    min-width: auto;
    text-align: left;
    width: 100%;
    padding-top: .55rem;
    border-top: 1px dashed #e5e7eb;
    margin-top: .15rem;
  }

  .checkout-item-total-price {
    font-size: 1rem;
  }

  .checkout-item-price-box .checkout-item-price-detail {
    margin-top: .18rem;
  }
}

@media (max-width: 575.98px) {
  .checkout-card .d-flex.justify-content-between.align-items-center.mb-3 {
    align-items: flex-start !important;
    gap: .65rem;
  }

  .checkout-card .d-flex.justify-content-between.align-items-center.mb-3 .btn {
    width: auto !important;
    min-width: 118px;
    max-width: 150px;
    min-height: 32px;
    padding: .32rem .55rem !important;
    font-size: .76rem !important;
  }

  .checkout-item-card {
    padding: .65rem !important;
    flex-wrap: wrap;
  }

  .checkout-item-img {
    width: 54px !important;
    height: 54px !important;
    flex: 0 0 54px;
  }

  .checkout-item-main {
    width: calc(100% - 64px);
  }

  .checkout-item-title {
    font-size: .92rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .checkout-item-badges {
    gap: .25rem !important;
  }

  .checkout-item-badge,
  .checkout-price-badge {
    max-width: 100%;
    white-space: normal !important;
    line-height: 1.15 !important;
  }

  .checkout-item-price-box {
    margin-left: 64px;
    width: calc(100% - 64px);
  }
}

@media (max-width: 380px) {
  .checkout-item-card {
    display: block !important;
  }

  .checkout-item-img {
    float: left;
    margin-right: .6rem;
    margin-bottom: .35rem;
  }

  .checkout-item-main {
    width: auto;
    min-width: 0;
  }

  .checkout-item-price-box {
    clear: both;
    width: 100%;
    margin-left: 0;
  }
}


/* ===== Checkout mobile item card compact fix ===== */
@media (max-width: 575.98px) {
  .checkout-wrap .checkout-card {
    padding: .85rem !important;
  }

  .checkout-wrap .checkout-section-title {
    font-size: 1.05rem;
  }

  .checkout-wrap .checkout-card .d-flex.justify-content-between.align-items-center.mb-3 {
    flex-direction: column;
    align-items: flex-start !important;
    gap: .45rem !important;
    margin-bottom: .75rem !important;
  }

  .checkout-wrap .checkout-card .d-flex.justify-content-between.align-items-center.mb-3 .btn {
    min-width: 118px !important;
    max-width: 145px !important;
    width: auto !important;
    min-height: 31px !important;
    padding: .3rem .55rem !important;
    font-size: .76rem !important;
  }

  .checkout-items-list {
    gap: .55rem !important;
  }

  .checkout-item-card {
    display: block !important;
    padding: .7rem !important;
  }

  .checkout-item-img {
    width: 58px !important;
    height: 58px !important;
    float: left;
    margin-right: .65rem;
    margin-bottom: .35rem;
  }

  .checkout-item-main {
    width: auto !important;
    min-width: 0 !important;
  }

  .checkout-item-title {
    font-size: .95rem !important;
    line-height: 1.35 !important;
    margin-bottom: .35rem;
    display: block !important;
    overflow: visible !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
  }

  .checkout-item-badges {
    clear: both;
    padding-top: .15rem;
    gap: .28rem !important;
  }

  .checkout-item-badge,
  .checkout-price-badge {
    min-height: 22px !important;
    font-size: .68rem !important;
    padding: .17rem .4rem !important;
  }

  .checkout-item-price-detail {
    clear: both;
    font-size: .75rem !important;
    margin-top: .45rem !important;
    color: #64748b;
  }

  .checkout-item-price-box {
    clear: both;
    width: 100% !important;
    margin-left: 0 !important;
    margin-top: .55rem !important;
    padding-top: .55rem !important;
    border-top: 1px dashed #e5e7eb;
    text-align: center !important;
  }

  .checkout-item-total-price {
    font-size: 1.05rem !important;
    line-height: 1.15 !important;
  }
}

@media (max-width: 380px) {
  .checkout-item-img {
    width: 54px !important;
    height: 54px !important;
  }

  .checkout-item-title {
    font-size: .9rem !important;
  }

  .checkout-item-price-box {
    text-align: center !important;
  }
}


.checkout-items-head {
  gap: .75rem;
}

@media (max-width: 575.98px) {
  .checkout-items-head {
    flex-direction: column;
    align-items: flex-start !important;
    gap: .5rem;
  }

  .checkout-edit-cart-btn {
    width: auto !important;
    min-width: 118px !important;
    max-width: 145px !important;
  }
}


/* ===== Checkout saved address mode: hide manual fields until adding new address ===== */
.checkout-manual-address-fields.is-opening {
  animation: checkoutManualFieldsIn .18s ease both;
}

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

.checkout-address-choice.active,
.checkout-address-choice:has(.my-address-radio:checked) {
  border-color: #86b7fe !important;
  background: #eff6ff !important;
  box-shadow: 0 .25rem .9rem rgba(13,110,253,.06);
}

.checkout-new-address-note {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}


/* ===== Checkout email notification readonly/disabled look ===== */
.checkout-email-disabled,
.checkout-email-disabled:focus {
  background: #f8fafc !important;
  color: #475569 !important;
  cursor: not-allowed;
  box-shadow: none !important;
}

.checkout-email-disabled + .invalid-feedback,
.checkout-email-disabled ~ .invalid-feedback {
  display: none !important;
}


/* ===== Checkout saved address: hide address inputs only, keep CAPTCHA visible ===== */
.checkout-manual-address-fields.is-saved-address-mode .checkout-manual-field {
  display: none !important;
}

.checkout-captcha-box {
  display: block !important;
  position: relative;
  z-index: 2;
}

.checkout-captcha-box .form-control {
  background: #ffffff !important;
}

.checkout-captcha-box.captcha-focus {
  border-color: #86b7fe !important;
  box-shadow: 0 .25rem .9rem rgba(13,110,253,.08);
}


/* ===== Checkout separated CAPTCHA card ===== */
.checkout-captcha-section {
  border-color: #bfdbfe !important;
  background: linear-gradient(135deg,#ffffff 0%,#f8fbff 100%);
}

.checkout-captcha-section .checkout-captcha-box {
  border: 1px dashed #93c5fd !important;
  background: #eff6ff !important;
}

.checkout-captcha-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: .25rem;
  background: #ffffff;
  color: #0d6efd;
  border: 1px solid #bfdbfe;
  flex: 0 0 auto;
}

.checkout-captcha-section .form-control {
  min-height: 38px;
  font-size: 1rem;
}

@media(max-width:575.98px){
  .checkout-captcha-section {
    padding: .8rem !important;
  }

  .checkout-captcha-section .checkout-captcha-box {
    padding: .8rem !important;
  }

  .checkout-captcha-section .form-control {
    min-height: 36px;
  }
}


/* ===== Checkout stock after qty auto ===== */
.checkout-item-badge.is-stock-after {
  color: #047857 !important;
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
}

.checkout-item-badge.is-stock-out {
  color: #b91c1c !important;
  background: #fef2f2 !important;
  border-color: #fecaca !important;
}

.checkout-item-badge.is-stock-unknown {
  color: #475569 !important;
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}


/* SSKRO_PRIMARY_PASTEL_VOUCHER_MODAL_2026 */
.checkout-coupon-select-btn{
  width:100%;
  min-height:36px;
  background:#eef6ff!important;
  color:#0d6efd!important;
  border:1px solid #b9d7ff!important;
  box-shadow:0 .25rem .75rem rgba(13,110,253,.06);
}
.checkout-coupon-select-btn:hover{
  background:#dfeeff!important;
  border-color:#8bbcff!important;
  color:#0b5ed7!important;
}

.checkout-voucher-shopee-modal .modal-content{
  border-radius:.5rem!important;
  overflow:hidden;
  border:0;
}
.checkout-voucher-shopee-modal .modal-header{
  border-bottom:1px solid #e8f1ff!important;
  background:linear-gradient(135deg,#f8fbff 0%,#ffffff 100%);
}
.checkout-voucher-shopee-modal .modal-title{
  color:#0f172a;
}
.checkout-voucher-search{
  border-bottom:1px solid #edf4ff;
  background:#fbfdff;
  padding:.85rem;
}
.checkout-voucher-search .form-control{
  height:42px;
  border-color:#cfe2ff!important;
  border-radius:.35rem 0 0 .35rem!important;
}
.checkout-voucher-search .btn{
  border-radius:0 .35rem .35rem 0!important;
  min-width:92px;
  background:#0d6efd!important;
  border-color:#0d6efd!important;
  color:#fff!important;
}

.checkout-voucher-list{
  max-height:58vh;
  overflow:auto;
  background:#f8fbff;
  padding:.85rem;
}
.checkout-voucher-card{
  position:relative;
  display:grid;
  grid-template-columns:132px 1fr 48px;
  background:#fff;
  border:1px solid #dbeafe;
  border-radius:.45rem;
  margin-bottom:.7rem;
  box-shadow:0 .25rem .75rem rgba(15,23,42,.035);
  overflow:hidden;
  cursor:pointer;
  transition:.15s ease;
}
.checkout-voucher-card:hover{
  border-color:#9ec5fe;
  box-shadow:0 .35rem 1rem rgba(13,110,253,.08);
}
.checkout-voucher-card.is-selected{
  border-color:#0d6efd;
  background:#fbfdff;
  box-shadow:0 .4rem 1rem rgba(13,110,253,.12);
}
.checkout-voucher-left{
  background:linear-gradient(135deg,#eaf4ff 0%,#d7eaff 100%);
  color:#0d6efd;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  gap:.3rem;
  min-height:126px;
  padding:.75rem;
  position:relative;
  border-right:1px dashed #b9d7ff;
}
.checkout-voucher-left:before,
.checkout-voucher-left:after{
  content:"";
  position:absolute;
  right:-7px;
  width:14px;
  height:14px;
  background:#f8fbff;
  border-radius:50%;
  z-index:2;
}
.checkout-voucher-left:before{top:-7px}
.checkout-voucher-left:after{bottom:-7px}
.checkout-voucher-left i{
  font-size:2.2rem;
  line-height:1;
}
.checkout-voucher-left .voucher-left-label{
  font-size:.86rem;
  font-weight:900;
}
.checkout-voucher-content{
  padding:.9rem 1rem;
  min-width:0;
}
.checkout-voucher-title{
  font-weight:900;
  color:#0f172a;
  font-size:1.03rem;
  line-height:1.35;
  margin-bottom:.18rem;
}
.checkout-voucher-min{
  color:#475569;
  font-size:.9rem;
  margin-bottom:.3rem;
}
.checkout-voucher-shop{
  display:inline-flex;
  width:max-content;
  max-width:100%;
  border:1px solid #9ec5fe;
  color:#0d6efd;
  background:#eff6ff;
  border-radius:.2rem;
  padding:.1rem .38rem;
  font-size:.78rem;
  font-weight:800;
  margin-bottom:.32rem;
}
.checkout-voucher-exp{
  color:#64748b;
  font-size:.82rem;
  line-height:1.35;
}
.checkout-voucher-exp a{
  color:#0d6efd;
  text-decoration:none;
  margin-left:.25rem;
}
.checkout-voucher-progress{
  height:6px;
  background:#eef2f7;
  border-radius:999px;
  overflow:hidden;
  margin-top:.55rem;
  max-width:70%;
}
.checkout-voucher-progress span{
  display:block;
  height:100%;
  background:#86b7fe;
}
.checkout-voucher-radio-wrap{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:.65rem;
}
.checkout-voucher-radio{
  width:22px;
  height:22px;
  accent-color:#0d6efd;
  cursor:pointer;
}
.checkout-voucher-recommend{
  position:absolute;
  right:0;
  top:0;
  background:#0d6efd;
  color:#fff;
  border-radius:0 0 0 .45rem;
  padding:.16rem .52rem;
  font-size:.72rem;
  font-weight:900;
}
.checkout-voucher-bottom{
  border-top:1px solid #e8f1ff;
  background:#fff;
  padding:.85rem;
}
.checkout-voucher-summary{
  font-size:.95rem;
  color:#334155;
}
.checkout-voucher-discount-text{
  color:#0d6efd;
  font-weight:900;
}
.checkout-voucher-ok-btn{
  background:#0d6efd!important;
  color:#fff!important;
  border-color:#0d6efd!important;
  min-height:42px;
  font-weight:900!important;
}
.checkout-voucher-ok-btn:hover{
  background:#0b5ed7!important;
  border-color:#0b5ed7!important;
  color:#fff!important;
}

@media(max-width:991.98px){
  .checkout-voucher-shopee-modal .modal-dialog{
    max-width:760px;
  }
  .checkout-voucher-list{
    max-height:62vh;
  }
}
@media(max-width:575.98px){
  .checkout-voucher-shopee-modal .modal-dialog{
    margin:0;
  }
  .checkout-voucher-card{
    grid-template-columns:98px 1fr 38px;
    margin-bottom:.55rem;
  }
  .checkout-voucher-left{
    min-height:114px;
    padding:.55rem;
  }
  .checkout-voucher-left i{
    font-size:1.65rem;
  }
  .checkout-voucher-left .voucher-left-label{
    font-size:.74rem;
  }
  .checkout-voucher-title{
    font-size:.9rem;
  }
  .checkout-voucher-min{
    font-size:.8rem;
  }
  .checkout-voucher-exp{
    font-size:.74rem;
  }
  .checkout-voucher-list{
    max-height:62vh;
    padding:.55rem;
  }
  .checkout-voucher-content{
    padding:.7rem;
  }
  .checkout-voucher-progress{
    max-width:100%;
  }
  .checkout-voucher-search{
    padding:.65rem;
  }
}


/* SSKRO_AUTO_COUPON_TOTAL_FIX_2026 */
.checkout-coupon-box{
  border-color:#dbeafe!important;
  background:#f8fbff!important;
}
.checkout-coupon-box .input-group .form-control{
  border-color:#cfe2ff!important;
}
.checkout-coupon-box .input-group .btn{
  white-space:nowrap;
}


.checkout-voucher-summary {
  font-size: .875rem;
  color: #64748b;
}

.checkout-voucher-discount-text {
  font-size: .875rem;
  font-weight: 700;
  color: #16a34a;
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  .checkout-voucher-discount-text {
    width: 100%;
    text-align: left !important;
    margin-top: .15rem;
  }
}


/* css/checkout.css
   ใช้คู่กับ checkout.php วางไฟล์นี้ที่ C:\xampp2\htdocs\ecommerce-sskro\css\checkout.css
*/
.checkout-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding-top: 1.25rem;
  padding-bottom: 4.5rem;
}

.checkout-hero {
  background: linear-gradient(135deg, #f8fbff 0%, #ffffff 58%, #eff6ff 100%);
  border: 1px solid #dbeafe;
  box-shadow: 0 .55rem 1.4rem rgba(15, 23, 42, .045);
}

.checkout-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-weight: 900;
  color: #0f172a;
}

.checkout-title {
  font-weight: 900;
  color: #0f172a;
}

.checkout-card {
  border: 1px solid #dbe4f0;
  background: #fff;
  box-shadow: 0 .35rem 1.15rem rgba(15, 23, 42, .045);
}

.checkout-section-title {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-weight: 900;
  color: #0f172a;
}

.checkout-soft {
  border: 1px solid #bae6fd;
  background: #ecfeff;
  border-radius: .35rem;
}

.checkout-input-group .input-group-text {
  background: #f8fbff;
  color: #0d6efd;
  border-color: #dbe4f0;
}

.checkout-input-group .form-control,
.checkout-input-group .form-select {
  border-color: #dbe4f0;
}

.checkout-input-group .form-control:focus,
.checkout-input-group .form-select:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .12);
}

.checkout-address-card,
.checkout-tax-invoice-card {
  border: 1px solid #dbeafe;
  background: linear-gradient(135deg, #f8fbff 0%, #ffffff 100%);
  border-radius: .45rem;
  padding: 1rem;
}

.checkout-address-choice {
  border: 1px solid #e5e7eb;
  border-radius: .45rem;
  background: #fff;
  padding: .85rem;
  height: 100%;
  cursor: pointer;
  transition: .18s ease;
}

.checkout-address-choice:hover,
.checkout-address-choice.is-active {
  border-color: #86b7fe;
  background: #eff6ff;
}

.checkout-address-choice input[type="radio"] {
  transform: translateY(2px);
}

.checkout-summary-card {
  position: sticky;
  top: 1rem;
}

.checkout-total {
  font-size: 1.15rem;
  font-weight: 900;
  color: #0d6efd;
}

.checkout-submit-btn {
  min-height: 46px;
  font-weight: 900;
}

.checkout-back-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.checkout-mobile-bar {
  display: none;
}

.checkout-empty {
  text-align: center;
}

.checkout-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  color: #0d6efd;
  font-size: 2rem;
  margin-bottom: .75rem;
}

.checkout-pastel-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  border-radius: .35rem;
  padding: .28rem .55rem;
  font-size: .76rem;
  font-weight: 900;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
  white-space: nowrap;
}

.checkout-pastel-tax {
  border-color: #ddd6fe;
  background: #f5f3ff;
  color: #6d28d9;
}

.checkout-pastel-default {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.checkout-tax-choice,
.checkout-tax-mode {
  border: 1px solid #e5e7eb;
  border-radius: .45rem;
  background: #fff;
  padding: .72rem;
  height: 100%;
  cursor: pointer;
  transition: .18s ease;
}

.checkout-tax-choice:hover,
.checkout-tax-mode:hover,
.checkout-tax-choice.active,
.checkout-tax-mode.active {
  border-color: #86b7fe;
  background: #eff6ff;
}

.checkout-tax-info-box,
.checkout-tax-address-card {
  border: 1px solid #e5e7eb;
  background: #fbfdff;
  border-radius: .45rem;
  padding: .75rem;
}

.checkout-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
}

.checkout-action-row .btn,
.checkout-normal-btn {
  width: auto !important;
  min-width: 140px;
  max-width: 240px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  border-radius: .35rem !important;
  font-weight: 900;
}

@media (max-width: 991.98px) {
  .checkout-summary-card {
    position: static;
  }

  .checkout-wrap {
    padding-left: .75rem !important;
    padding-right: .75rem !important;
  }
}

@media (max-width: 575.98px) {
  .checkout-wrap {
    padding-bottom: 6rem;
  }

  .checkout-hero {
    padding: 1rem !important;
  }

  .checkout-card {
    border-radius: .35rem !important;
  }

  .checkout-address-card,
  .checkout-tax-invoice-card,
  .checkout-tax-address-card {
    padding: .75rem;
  }

  .checkout-pastel-badge {
    white-space: normal;
    text-align: center;
  }

  .checkout-action-row .btn,
  .checkout-normal-btn {
    min-width: 145px;
    max-width: calc(50% - .3rem);
    flex: 1 1 145px;
  }

  .checkout-mobile-bar {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    background: #fff;
    border-top: 1px solid #dbe4f0;
    padding: .65rem .85rem;
    box-shadow: 0 -.35rem 1.1rem rgba(15, 23, 42, .09);
  }
}

@media (max-width: 380px) {
  .checkout-action-row .btn,
  .checkout-normal-btn {
    min-width: 100%;
    max-width: 100%;
  }
}
