/* TamirSet checkout remediation v20: authoritative shipping totals + stable completion layout. */
.tmset-commerce-row[data-commerce-shipping-row]{display:grid;grid-template-columns:minmax(0,1fr) max-content;align-items:start;column-gap:14px;row-gap:5px}
.tmset-commerce-row[data-commerce-shipping-row] .tmset-checkout-shipping-note{grid-column:1/-1;color:#64748b;font-size:.74rem;line-height:1.75;font-weight:500;text-align:right;overflow-wrap:break-word;word-break:normal}
html[data-tmset-checkout-quote-state="pending"] .tmset-commerce-summary{box-shadow:0 0 0 3px rgba(13,148,136,.08),var(--tmset-shadow-card,0 20px 50px rgba(15,23,42,.08))}
html[data-tmset-checkout-quote-state="pending"] [data-commerce-order-total],html[data-tmset-checkout-quote-state="pending"] [data-commerce-mobile-total]{opacity:.72}
html[data-tmset-checkout-quote-state="confirmed"] [data-commerce-shipping-total]{color:#047857}
body.tmset-checkout-complete .tmset-commerce-grid{display:block!important;max-width:min(1180px,calc(100% - 32px));margin-inline:auto}
body.tmset-checkout-complete .tmset-commerce-mobile-bar{display:none!important}
body.tmset-checkout-complete .tmset-commerce-progress .tmset-commerce-step{opacity:.72}
body.tmset-checkout-complete .tmset-commerce-progress .tmset-commerce-step:last-child{opacity:1;border-color:#10b981;background:#ecfdf5}
body.tmset-checkout-complete .tmset-commerce-progress .tmset-commerce-step:last-child .tmset-commerce-step__num{background:#059669;color:#fff}
.tmset-checkout-success{width:100%;min-width:0;box-sizing:border-box;border:1px solid #a7f3d0;border-radius:30px;background:linear-gradient(145deg,#f0fdf4 0%,#ffffff 58%,#ecfeff 100%);box-shadow:0 28px 80px rgba(15,118,110,.12);padding:clamp(24px,4vw,52px);display:grid;gap:24px;overflow:hidden;position:relative;isolation:isolate;color:#0f172a}
.tmset-checkout-success::before{content:"";position:absolute;inset:auto -120px -170px auto;width:380px;height:380px;border-radius:50%;background:radial-gradient(circle,rgba(16,185,129,.18),rgba(16,185,129,0) 68%);z-index:-1;pointer-events:none}
.tmset-checkout-success__hero{display:grid;grid-template-columns:auto minmax(0,1fr);gap:18px;align-items:center;min-width:0}
.tmset-checkout-success__icon{width:72px;height:72px;border-radius:24px;display:grid;place-items:center;background:linear-gradient(145deg,#10b981,#0f766e);color:#fff;font-size:2.35rem;font-weight:900;box-shadow:0 15px 35px rgba(5,150,105,.25)}
.tmset-checkout-success__eyebrow{display:block;color:#047857;font-size:.82rem;font-weight:900;margin-bottom:5px}
.tmset-checkout-success h2{margin:0;font-size:clamp(1.45rem,3vw,2.2rem);line-height:1.45;color:#064e3b;word-break:normal;overflow-wrap:break-word}
.tmset-checkout-success__message{margin:7px 0 0;color:#334155;line-height:2;font-size:clamp(.9rem,1.5vw,1.02rem);word-break:normal;overflow-wrap:break-word;max-width:850px}
.tmset-checkout-success__facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:0}
.tmset-checkout-success__fact{min-width:0;border:1px solid #d1fae5;border-radius:18px;background:rgba(255,255,255,.82);padding:15px 17px;display:grid;gap:6px}
.tmset-checkout-success__fact dt{color:#64748b;font-size:.78rem;font-weight:700}
.tmset-checkout-success__fact dd{margin:0;color:#0f172a;font-weight:900;font-size:clamp(.92rem,1.4vw,1.08rem);line-height:1.7;word-break:normal;overflow-wrap:break-word}
.tmset-checkout-success__fact dd[dir="ltr"]{text-align:right;unicode-bidi:plaintext}
.tmset-checkout-success__tracking{border:1px solid #bae6fd;border-radius:20px;background:#f0f9ff;padding:17px;display:grid;gap:10px;min-width:0}
.tmset-checkout-success__tracking strong{color:#0c4a6e}
.tmset-checkout-success__tracking p{margin:0;color:#475569;line-height:1.85;font-size:.86rem}
.tmset-checkout-success__token{display:flex;align-items:center;gap:10px;min-width:0}
.tmset-checkout-success__token code{direction:ltr;text-align:left;flex:1;min-width:0;display:block;border:1px dashed #7dd3fc;border-radius:12px;background:#fff;padding:11px 13px;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.78rem;white-space:normal;word-break:break-all;color:#0f172a}
.tmset-checkout-success__token button{flex:0 0 auto;border:1px solid #0e7490;border-radius:11px;background:#fff;color:#0e7490;padding:10px 14px;font:inherit;font-weight:800;cursor:pointer}
.tmset-checkout-success__token button.is-copied{background:#ecfdf5;border-color:#059669;color:#047857}
.tmset-checkout-success__actions{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.tmset-checkout-success__actions a{min-height:48px;display:inline-flex;align-items:center;justify-content:center;border-radius:14px;padding:10px 20px;text-decoration:none;font-weight:900;line-height:1.6}
.tmset-checkout-success__actions .is-primary{background:linear-gradient(135deg,#059669,#0f766e);color:#fff;box-shadow:0 12px 25px rgba(5,150,105,.2)}
.tmset-checkout-success__actions .is-secondary{border:1px solid #cbd5e1;background:#fff;color:#0f3b5e}
.tmset-checkout-success__notice{margin:0;border-right:4px solid #f59e0b;border-radius:12px;background:#fffbeb;color:#854d0e;padding:12px 14px;line-height:1.85;font-size:.82rem;word-break:normal;overflow-wrap:break-word}
@media(max-width:820px){
 body.tmset-checkout-complete .tmset-commerce-grid{max-width:calc(100% - 20px)}
 .tmset-checkout-success{border-radius:24px;padding:22px 18px;gap:19px}
 .tmset-checkout-success__facts{grid-template-columns:1fr 1fr}
 .tmset-checkout-success__fact:first-child{grid-column:1/-1}
}
@media(max-width:520px){
 .tmset-checkout-success__hero{grid-template-columns:1fr;text-align:center;justify-items:center}
 .tmset-checkout-success__message{text-align:right}
 .tmset-checkout-success__icon{width:62px;height:62px;border-radius:20px;font-size:2rem}
 .tmset-checkout-success__facts{grid-template-columns:1fr}
 .tmset-checkout-success__fact:first-child{grid-column:auto}
 .tmset-checkout-success__token{align-items:stretch;flex-direction:column}
 .tmset-checkout-success__token button{width:100%}
 .tmset-checkout-success__actions{display:grid;grid-template-columns:1fr}
 .tmset-checkout-success__actions a{width:100%;box-sizing:border-box}
}


/* ============================================================
   TamirSet checkout remediation extension (v20.1 + v20.2)
   Compatible with original v20 – no overrides of core logic
   ============================================================ */

/* Hide empty ARIA live region so it does not reserve space */
.tmset-ui-form-status:empty,
.tmset-commerce-message:empty,
[data-commerce-live-status]:empty,
[data-form-message]:empty {
  display: none !important;
  padding: 0 !important;
  margin: 0 !important;
  height: 0 !important;
  border: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

/* Strong, visible feedback when a status message is present */
.tmset-ui-form-status:not(:empty),
.tmset-commerce-message:not(:empty),
[data-commerce-live-status]:not(:empty) {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin-block: 14px 8px !important;
  padding: 14px 16px !important;
  border: 1px solid #f0c8c4 !important;
  border-radius: 16px !important;
  background: #fff8f7 !important;
  color: #b42318 !important;
  font-weight: 700 !important;
  font-size: 0.92rem !important;
  line-height: 1.7 !important;
  box-shadow: 0 8px 22px rgba(180, 35, 24, 0.08) !important;
  visibility: visible !important;
  height: auto !important;
  min-height: 0;
  overflow: visible;
  position: relative;
  z-index: 5;
}

.tmset-ui-form-status.is-success:not(:empty),
.tmset-commerce-message.is-success:not(:empty),
[data-commerce-live-status].is-success:not(:empty) {
  border-color: #a7f3d0 !important;
  background: #f0fdf4 !important;
  color: #047857 !important;
  box-shadow: 0 8px 22px rgba(5, 150, 105, 0.08) !important;
}

/* Highlight shipping / payment blocks until a choice is made */
.tmset-checkout-options:not(:has(input[type="radio"]:checked)) {
  outline: 2px dashed #f59e0b;
  outline-offset: 4px;
  border-radius: 16px;
  background: rgba(255, 251, 235, 0.55);
}

.tmset-checkout-options:not(:has(input[type="radio"]:checked)) .tmset-checkout-options__placeholder {
  color: #92400e;
  font-weight: 600;
}

/* Force mobile bottom bar visible on small screens (single source of truth) */
@media (max-width: 900px) {
  body.tmset-has-commerce-page .tmset-commerce-mobile-bar,
  body.tmset-checkout-page .tmset-commerce-mobile-bar,
  body[data-tmset-page="checkout_page"] .tmset-commerce-mobile-bar,
  .tmset-checkout-page .tmset-commerce-mobile-bar {
    display: grid !important;
    position: fixed !important;
    inset-inline: 0;
    inset-block-end: 0;
    z-index: 7020 !important;
    width: 100%;
    max-width: 100vw;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: #0b2239;
    color: #fff;
    box-shadow: 0 -6px 24px rgba(11, 34, 57, 0.25);
  }

  body.tmset-has-commerce-page .tmset-commerce-mobile-bar [data-commerce-submit],
  body.tmset-checkout-page .tmset-commerce-mobile-bar [data-commerce-submit],
  .tmset-checkout-page .tmset-commerce-mobile-bar button[data-commerce-submit] {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-inline-size: 140px;
    min-block-size: 48px;
    padding: 0 16px;
    border: 0;
    border-radius: 12px;
    background: #16a34a;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
  }

  /* Keep the in-summary CTA. Sticky bar is complementary; shell CSS
     previously hid the bar after this file loaded. */
  .tmset-checkout-page .tmset-commerce-summary .tmset-commerce-primary-btn {
    display: flex !important;
    width: 100%;
    min-block-size: 48px;
  }
}

@media (max-width: 420px) {
  body.tmset-has-commerce-page .tmset-commerce-mobile-bar,
  .tmset-checkout-page .tmset-commerce-mobile-bar {
    min-block-size: 52px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
  }

  body.tmset-has-commerce-page .tmset-commerce-mobile-bar [data-commerce-submit],
  .tmset-checkout-page .tmset-commerce-mobile-bar button[data-commerce-submit] {
    min-inline-size: 112px;
    min-block-size: 44px;
    font-size: 12px;
  }
}

/* Busy state while order is being placed */
.tmset-commerce-mobile-bar [data-commerce-submit].is-busy,
.tmset-commerce-summary [data-commerce-submit].is-busy {
  opacity: 0.65;
  pointer-events: none;
  cursor: wait;
}
