:root {
  --ink: #323545;
  --label: #4a4a4a;
  --muted: #7c7c85;
  --border: #dcdce3;
  --border-strong: #c9c9d1;
  --green: #3b6e22;
  --green-hover: #34611e;
  --danger: #c0392b;
  --radius: 6px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.checkout-wrap {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 28px 16px 40px;
}

.checkout-card {
  width: 100%;
  max-width: 390px;
}

/* ---------- לוגו ---------- */
.store-header { text-align: center; margin: 6px 0 22px; }
.store-logo {
  margin: 0;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--ink);
  direction: ltr;
}
.store-logo-img {
  display: block;
  margin: 0 auto;
  max-width: 220px;
  max-height: 64px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ---------- Google Pay ---------- */
.gpay-button {
  width: 100%;
  text-decoration: none;
  box-sizing: border-box;
  height: 46px;
  background: #000;
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .15s ease;
}
.gpay-button { cursor: default; }
.gpay-button.is-linked { cursor: pointer; }
.gpay-button.is-linked:hover { opacity: .88; }
.gpay-button.is-linked:active { transform: translateY(1px); }
.gpay-mark { display: inline-flex; align-items: center; gap: 3px; direction: ltr; }
.gpay-text {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: #fff;
}

/* ---------- מפריד ---------- */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 22px;
  color: var(--muted);
  font-size: 12.5px;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e6e6ec;
}

/* ---------- שדות ---------- */
.field-block { margin-bottom: 16px; }

.field-label {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--label);
  margin-bottom: 7px;
}

.input-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input-shell:focus-within {
  border-color: #9aa4b1;
  box-shadow: 0 0 0 3px rgba(59, 110, 34, .08);
}

.bare-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
}
.bare-input::placeholder { color: #9b9ba6; }
.bare-input[dir='ltr'] { text-align: right; }

.input-icon { display: inline-flex; align-items: center; flex: 0 0 auto; }

/* ---------- קבוצת כרטיס אשראי ---------- */
.card-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  /* לא לחתוך את הילת הפוקוס של השדות הפנימיים */
  overflow: visible;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.card-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 12px;
}
/* gap: 0 — אחרת נשאר פס "מת" של 10px בין MM/YY ל-CVV שלא מודגש עם אף שדה.
   47px — כדי שאחרי border-top של 1px יישארו לתאים 46px, בדיוק כמו שורת מספר הכרטיס. */
.card-row-split { padding: 0; gap: 0; height: 47px; border-top: 1px solid var(--border); }
.card-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  padding: 0 12px;
  flex: 1 1 50%;
  min-width: 0;
}

/* מסגרת נפרדת לכל שדה בקבוצת האשראי — בדיוק כמו שדה "שם בעל הכרטיס", בלי מילוי */
.card-row,
.card-cell {
  position: relative;
  transition: box-shadow .15s ease;
}
.card-row:not(.card-row-split):focus-within,
.card-cell:focus-within {
  z-index: 1;
  box-shadow:
    inset 0 0 0 1px #9aa4b1,            /* המסגרת — אותו צבע כמו .input-shell:focus-within */
    0 0 0 3px rgba(59, 110, 34, .08);   /* אותה הילה עדינה כמו .input-shell:focus-within */
}
/* פינות מעוגלות בהתאם למקום השדה בקבוצה (מודע לכיווניות) */
.card-row:not(.card-row-split):focus-within {
  border-start-start-radius: var(--radius);
  border-start-end-radius: var(--radius);
}
.expiry-cell:focus-within { border-end-start-radius: var(--radius); }
.cvv-cell:focus-within { border-end-end-radius: var(--radius); }
/* כשאחד משדות MM-YY / CVV בפוקוס — הקו המפריד לא נצמד למסגרת הפעילה */
.card-row-split:focus-within .expiry-cell { border-inline-end-color: transparent; }
.expiry-cell { border-inline-end: 1px solid var(--border); }
.cvv-icon { margin-inline-start: auto; }
.card-number-input { text-align: right; letter-spacing: .3px; }
.brand-strip {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 21px;
  margin-inline-start: auto;
}
.brand-img {
  position: absolute;
  inset: 0;
  width: 34px;
  height: 21px;
  object-fit: contain;
  opacity: 0;
  transform: scale(.94);
  transition: opacity .45s ease, transform .45s ease;
  pointer-events: none;
}
.brand-img.is-active { opacity: 1; transform: scale(1); }
.brand-strip.is-detected .brand-img.is-active { transform: scale(1.04); }

@media (prefers-reduced-motion: reduce) {
  .brand-img { transition: none; }
}

/* ---------- באנר כרטיס מתנה ---------- */
.gift-banner {
  margin: 14px 0 2px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #eef7e9;
  border: 1px solid #cbe4bd;
  color: #2f5a1c;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 9px;
}
.gift-banner.is-disabled {
  background: #fdf1f1;
  border-color: #efc9c9;
  color: #8d2b2b;
}
.gift-banner-icon { font-size: 17px; line-height: 1; }
.gift-banner-text { flex: 1 1 auto; }

/* ---------- סה"כ ---------- */
.total-section { margin: 18px 0 14px; text-align: center; }
.total-line {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
}
.money { direction: ltr; unicode-bidi: isolate; display: inline-block; }
/* התווית נשארת רגילה — רק הסכום מודגש */
.total-amount { font-weight: 700; }
.total-amount.struck { text-decoration: line-through; color: var(--muted); font-weight: 500; font-size: 13px; }

.discount-line {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--label);
}
.discount-row { display: flex; justify-content: space-between; }
.discount-row .money { direction: ltr; unicode-bidi: isolate; }
.remain-row { font-weight: 700; color: var(--ink); font-size: 16px; }

/* ---------- כפתור תשלום ---------- */
.pay-button {
  position: relative;
  width: 100%;
  height: 50px;
  background: var(--green);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease;
}
.pay-button:hover { background: var(--green-hover); }
.pay-button:active { transform: translateY(1px); }
.pay-button:disabled { opacity: .75; cursor: progress; }

.spinner {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.pay-button.loading .pay-button-label { visibility: hidden; }
.pay-button.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-error {
  margin: 4px 0 0;
  color: var(--danger);
  font-size: 13.5px;
  text-align: center;
}

/* ---------- פוטר ---------- */
.checkout-footer {
  margin-top: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted);
}
.powered {
  direction: ltr;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #595959;          /* אותו אפור ניטרלי כמו הלוגו */
  font-size: 12px;
  font-weight: 400;
}
.payplus-img {
  display: block;
  height: 18px;
  width: auto;
  vertical-align: middle;
  transform: translateY(1px);
}
.footer-sep { width: 1px; height: 14px; background: #d5d5dd; }
.a11y-link {
  color: #1a6fd4;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-family: inherit;
  cursor: pointer;
}
.a11y-link:hover { text-decoration: underline; }

/* ---------- מודאל הצהרת נגישות ---------- */
.a11y-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 20, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 60;
}
.a11y-box {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 36px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: right;
}
.a11y-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #e6e6ec;
  flex: 0 0 auto;
}
.a11y-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.a11y-close-x {
  background: none;
  border: 0;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
  border-radius: 6px;
}
.a11y-close-x:hover { color: var(--ink); background: #f1f1f5; }
.a11y-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 14px;
  line-height: 1.75;
  color: #33333d;
  flex: 1 1 auto;
}
.a11y-body h3 {
  margin: 18px 0 6px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
}
.a11y-body h3:first-child { margin-top: 0; }
.a11y-body p { margin: 0 0 10px; }
.a11y-body ul {
  margin: 0 0 12px;
  padding-inline-start: 20px;
}
.a11y-body li { margin-bottom: 6px; }
.a11y-body a { color: #1a6fd4; }
.a11y-body .a11y-updated {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #ececf1;
  font-size: 13px;
  color: var(--muted);
}
body.no-scroll { overflow: hidden; }

/* ---------- הצלחה ---------- */
.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 20, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.success-box {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 12px;
  padding: 28px 22px 22px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.success-box h2 { margin: 14px 0 8px; font-size: 20px; color: var(--ink); }
.success-details { margin: 0 0 18px; font-size: 14px; line-height: 1.6; color: var(--label); }
.success-details b { color: var(--ink); }
.success-close { height: 46px; font-size: 16px; }

.hidden-block { display: none !important; }

@media (max-width: 420px) {
  .store-logo { font-size: 30px; }
  .store-logo-img { max-width: 180px; max-height: 54px; }
  .checkout-wrap { padding-top: 20px; }
  .a11y-box { max-height: calc(100vh - 24px); }
  .a11y-body { font-size: 13.5px; }
}

