/* customer.css — shared phone-first styles for the customer web mock. */
* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #eef0f3;
  color: #222;
  line-height: 1.5;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
  background: #fff;
}

/* Round 43: the header is the shared one (web/shared/header.css — brand
   bar, language menu, cart badge, account link, same as the catalog).
   Only its placement lives here: it sticks to the top of the page column
   and bleeds to the column's edges. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  margin: -16px -16px 12px;
  border-radius: 0 0 12px 12px;
}

h1 { font-size: 1.4rem; margin: 12px 0; }
h2 { font-size: 1.1rem; margin: 0 0 4px; }

label {
  display: block;
  margin-top: 14px;
  font-weight: 600;
  font-size: 0.95rem;
}

input {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  font-size: 1rem;
  border: 1px solid #bbb;
  border-radius: 8px;
}

input.error { border-color: #d32f2f; }

button.primary, a.btn.primary {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  color: #fff;
  background: #1a73e8;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
}

button.secondary {
  margin-top: 10px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1a2230;
  background: #eef1f5;
  border: 1px solid #c9d2dd;
  border-radius: 999px;
  cursor: pointer;
}

.error-box {
  margin: 16px 0;
  padding: 16px;
  background: #fff;
  border: 1px solid #f0c6c2;
  border-radius: 10px;
  text-align: center;
}

.error-box .error-banner {
  margin: 0 0 12px;
}

.error-box .primary {
  margin-top: 0;
}

/* Visible keyboard focus for all interactive elements. */
:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 2px;
}

.mock-hint {
  margin-top: 16px;
  padding: 10px 12px;
  font-size: 0.85rem;
  background: #fff8e1;
  border: 1px dashed #f0b429;
  border-radius: 8px;
}

.mock-code {
  font-size: 1.05rem;
  text-align: center;
  background: #f6f6f6;
  border-radius: 8px;
  padding: 10px;
}

.mock-code strong {
  font-size: 1.6rem;
  letter-spacing: 0.35em;
}

.success {
  margin-top: 24px;
  padding: 14px;
  text-align: center;
  font-weight: 700;
  color: #1b7a2e;
  background: #e6f4ea;
  border-radius: 8px;
}

.customer-card {
  padding: 12px;
  background: #f6f8fb;
  border-radius: 10px;
  margin-bottom: 12px;
}

.customer-card .phone { margin: 0; color: #555; }

.balance-card {
  text-align: center;
  padding: 20px 12px;
  background: #1a73e8;
  color: #fff;
  border-radius: 12px;
  margin-bottom: 12px;
}

.balance-label, .balance-unit {
  display: block;
  font-size: 0.85rem;
  /* no opacity: white at 90% on #1a73e8 drops to 3.95:1; solid white is 4.51:1 */
}

.balance-number {
  display: block;
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
}

.online-note {
  font-size: 0.85rem;
  color: #666;
  background: #f6f6f6;
  border-radius: 8px;
  padding: 8px 12px;
}

.ledger {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.ledger-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid #eee;
}

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-earn   { background: #e6f4ea; color: #1b7a2e; }
.badge-redeem { background: #fdecea; color: #b3261e; }
.badge-expire { background: #eeeeee; color: #616161; }
.badge-adjust { background: #e8f0fe; color: #174ea6; }

.points { font-weight: 700; margin-inline-start: auto; }
.points.pos { color: #1b7a2e; }
.points.neg { color: #b3261e; }

.ledger-item .meta {
  display: block;
  width: 100%;
  font-size: 0.8rem;
  color: #767676; /* #777 is 4.48:1 on white; #767676 is 4.54:1 */
}

.error-banner {
  padding: 12px;
  background: #fdecea;
  color: #b3261e;
  border-radius: 8px;
  font-weight: 600;
}

.empty { color: #767676; text-align: center; padding: 16px 0; }

#otp-error { margin-top: 10px; }

/* RTL adjustments: base direction comes from <html dir>, these fine-tune layout.
   NOTE: no flex-direction override on header rows — in RTL, plain row already
   lays items out in DOM reading order; row-reverse would reverse it. */
[dir="rtl"] input { text-align: right; }
[dir="rtl"] .mock-code strong { letter-spacing: 0.35em; }

/* ---------- Header sign out + account link form (round 27) ---------- */
.signout-btn {
  background: none;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 4px 12px;
  min-height: 44px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

#link-section {
  margin-top: 20px;
}

#link-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;
}

#link-form input {
  padding: 8px 10px;
  border-radius: 8px;
  font: inherit;
}

/* ---------- Cart line thumbnails (round 35) ---------- */
.cart-thumb-wrap {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 40px;
  vertical-align: middle;
}

.cart-thumb-ph {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: #dfe7ef;
  color: #5b6b7f;
  font-weight: 700;
  border-radius: 6px;
  vertical-align: middle;
}

.cart-thumb-wrap .cart-thumb-ph {
  width: 100%;
  height: 100%;
}

.cart-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  vertical-align: middle;
}

.cart-thumb-wrap .cart-thumb {
  position: absolute;
  inset: 0;
}
