/* =============================================================================
   CUSTOMER DISPLAY PWA — Tablet-facing display (Granite Union Auction)
   Self-contained: ported from the Shopify theme's mhv-customer-display.css with
   the needed theme variables inlined (no Shopify CDN dependency). Uses the
   light/plum theme.
   ============================================================================= */

:root {
  --mhv-accent: #2E1C27;
  --mhv-accent-light: #5a3d50;
  --mhv-bg-body: #F7F5F3;
  --mhv-bg-deep: #EDE8E2;
  --mhv-text-primary: #12171D;
  --mhv-text-secondary: #3d2a36;
  --mhv-text-muted: #9A9498;
  --mhv-text-disabled: #d0cccf;
  --mhv-border-subtle: rgba(46, 28, 39, 0.06);
  --mhv-border-light: rgba(46, 28, 39, 0.12);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  background: var(--mhv-bg-body, #F7F5F3);
  color: var(--mhv-text-primary, #12171D);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh; overflow: hidden;
  -webkit-user-select: none; user-select: none;
  overscroll-behavior: none;
}
body { min-height: 100dvh; }

/* ---- SCREENS ---- */
.cd-screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }

/* ---- PAIR SCREEN ---- */
.cd-pair-screen { background: linear-gradient(135deg, var(--mhv-accent, #2E1C27) 0%, var(--mhv-accent-light, #5a3d50) 100%); }
.cd-pair-box { text-align: center; padding: 40px; max-width: 440px; width: 100%; }
.cd-logo-row { margin-bottom: 24px; }
.cd-logo { height: 48px; opacity: 1; filter: drop-shadow(0 0 20px rgba(255,255,255,1)) drop-shadow(0 0 40px rgba(255,255,255,0.8)) drop-shadow(0 0 80px rgba(255,255,255,0.5)) drop-shadow(0 0 120px rgba(255,255,255,0.25)); }
.cd-logo--large { height: 80px; opacity: 1; filter: drop-shadow(0 0 20px rgba(255,255,255,1)) drop-shadow(0 0 40px rgba(255,255,255,0.8)) drop-shadow(0 0 80px rgba(255,255,255,0.5)) drop-shadow(0 0 120px rgba(255,255,255,0.25)); }
.cd-pair-title { font-size: 22px; font-weight: 700; margin: 0 0 8px; color: #F7F5F3; }
.cd-pair-desc { font-size: 14px; color: rgba(247,245,243,0.5); margin: 0 0 24px; }

.cd-pair-code-display {
  font-size: 48px; font-weight: 700; letter-spacing: 14px; text-align: center;
  padding: 20px; margin: 16px 0;
  color: #F7F5F3;
  font-variant-numeric: tabular-nums;
}
.cd-pair-hint {
  font-size: 13px; color: rgba(247,245,243,0.4); text-align: center; margin: 0;
}

/* ---- IDLE SCREEN ---- */
.cd-idle-screen { background: var(--mhv-accent, #2E1C27); }
.cd-idle-box { text-align: center; }
.cd-idle-status {
  margin-top: 24px; font-size: 14px; color: rgba(247,245,243,0.35);
  letter-spacing: 2px; text-transform: uppercase;
}

/* ---- ORDER SCREEN ---- */
.cd-order-screen { flex-direction: column; align-items: stretch; justify-content: flex-start; overflow: hidden; }

.cd-order-header {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 24px;
  background: var(--mhv-accent, #2E1C27);
  border-bottom: none;
}
.cd-header-logo { height: 32px; opacity: 1; filter: drop-shadow(0 0 10px rgba(255,255,255,1)) drop-shadow(0 0 20px rgba(255,255,255,1)) drop-shadow(0 0 40px rgba(255,255,255,0.9)) drop-shadow(0 0 80px rgba(255,255,255,0.6)); }
.cd-customer-info { margin-left: auto; text-align: right; }
.cd-customer-name { font-size: 24px; font-weight: 600; color: #F7F5F3; line-height: 1.1; }
.cd-customer-id { font-size: 15px; color: rgba(247,245,243,0.5); margin-top: 1px; }

.cd-items-list {
  flex: 1; min-height: 0; overflow-y: auto; padding: 12px 24px;
  scrollbar-width: thin; scrollbar-color: var(--mhv-border-light) transparent;
}

.cd-item {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--mhv-border-subtle);
}
.cd-item:last-child { border-bottom: none; }

.cd-item-img {
  width: 64px; height: 64px; border-radius: 6px;
  object-fit: contain; background: var(--mhv-bg-deep);
  flex-shrink: 0; image-rendering: -webkit-optimize-contrast;
  border: 1px solid rgba(46,28,39,0.1);
}
.cd-item-img--placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 6px;
  background: var(--mhv-bg-deep); flex-shrink: 0;
  color: var(--mhv-text-disabled); font-size: 24px;
}

.cd-item-info { flex: 1; min-width: 0; }
.cd-item-title { font-size: 15px; font-weight: 500; color: var(--mhv-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-item-lot { font-size: 12px; color: var(--mhv-text-muted); margin-top: 2px; }

.cd-item-price { font-size: 17px; font-weight: 700; color: var(--mhv-accent); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---- FOOTER / TOTALS ---- */
.cd-order-footer {
  padding: 16px 24px;
  padding-bottom: calc(16px + var(--safe-bottom));
  background: var(--mhv-accent, #2E1C27);
  border-top: none;
}
.cd-totals { max-width: 400px; margin-left: auto; }
.cd-total-row {
  display: flex; justify-content: space-between; padding: 4px 0;
  font-size: 15px; color: rgba(247,245,243,0.65);
}
.cd-total-row--bp { font-size: 13px; color: rgba(247,245,243,0.35); }
.cd-total-row--grand {
  font-size: 24px; font-weight: 700; color: #F7F5F3;
  padding-top: 8px; margin-top: 4px;
  border-top: 1px solid rgba(247,245,243,0.15);
}

/* ---- FULLSCREEN BUTTON ---- */
.cd-fullscreen-btn {
  position: fixed; bottom: 12px; right: 12px; z-index: 200;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,0.15); border: 1px solid rgba(0,0,0,0.08);
  color: var(--mhv-text-muted); font-size: 16px; line-height: 1;
  cursor: pointer; opacity: 0.4; transition: opacity 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.cd-fullscreen-btn:hover { opacity: 0.7; }

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  .cd-item-img, .cd-item-img--placeholder { width: 48px; height: 48px; }
  .cd-item-title { font-size: 13px; }
  .cd-item-price { font-size: 15px; }
  .cd-total-row--grand { font-size: 20px; }
  .cd-order-header { padding: 12px 16px; }
  .cd-items-list { padding: 8px 16px; }
  .cd-order-footer { padding: 12px 16px; padding-bottom: calc(12px + var(--safe-bottom)); }
}

/* =============================================================================
   WELCOME SCREEN — flashed on customer create (~3s)
   ============================================================================= */
.cd-welcome-screen { background: var(--mhv-accent, #2E1C27); animation: cd-fade-in 0.4s ease-out; }
.cd-welcome-box { text-align: center; padding: 40px; }
.cd-logo--xlarge { height: 120px; opacity: 1; filter: drop-shadow(0 0 24px rgba(255,255,255,1)) drop-shadow(0 0 60px rgba(255,255,255,0.8)) drop-shadow(0 0 120px rgba(255,255,255,0.5)); animation: cd-welcome-logo 1.2s ease-out; }
.cd-welcome-title { font-family: Lora, Georgia, serif; font-size: 64px; font-weight: 600; color: #F7F5F3; margin: 28px 0 8px; letter-spacing: 1px; animation: cd-fade-in-up 0.7s ease-out 0.3s both; }
.cd-welcome-sub { font-size: 18px; color: rgba(247,245,243,0.7); margin: 0; letter-spacing: 4px; text-transform: uppercase; animation: cd-fade-in-up 0.7s ease-out 0.5s both; }

@keyframes cd-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cd-fade-in-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cd-welcome-logo {
  0% { opacity: 0; transform: scale(0.92); filter: drop-shadow(0 0 0 transparent); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: scale(1); filter: drop-shadow(0 0 24px rgba(255,255,255,1)) drop-shadow(0 0 60px rgba(255,255,255,0.8)) drop-shadow(0 0 120px rgba(255,255,255,0.5)); }
}

/* =============================================================================
   PADDLE FLASH SCREEN — shown 5s after paddle assigned
   ============================================================================= */
.cd-paddle-screen { background: var(--mhv-accent, #2E1C27); animation: cd-fade-in 0.4s ease-out; }
.cd-paddle-box { text-align: center; padding: 40px; }
.cd-paddle-label { font-size: 16px; color: rgba(247,245,243,0.55); letter-spacing: 6px; text-transform: uppercase; margin-bottom: 18px; animation: cd-fade-in-up 0.5s ease-out; }
.cd-paddle-number { font-family: Lora, Georgia, serif; font-size: 30vw; line-height: 1; font-weight: 700; color: #F7F5F3; margin: 0; text-shadow: 0 0 60px rgba(255,255,255,0.4), 0 0 120px rgba(255,255,255,0.2); animation: cd-paddle-pop 0.6s cubic-bezier(.34,1.56,.64,1); }
.cd-paddle-name { font-size: 26px; color: rgba(247,245,243,0.8); margin-top: 24px; animation: cd-fade-in-up 0.6s ease-out 0.3s both; }
.cd-paddle-hint { font-size: 14px; color: rgba(247,245,243,0.45); margin-top: 12px; letter-spacing: 1px; animation: cd-fade-in-up 0.6s ease-out 0.5s both; }

@keyframes cd-paddle-pop {
  0% { opacity: 0; transform: scale(0.4); }
  60% { transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

/* =============================================================================
   THANKS SCREEN — 3s on staff modal close
   ============================================================================= */
.cd-thanks-screen { background: var(--mhv-accent, #2E1C27); animation: cd-fade-in 0.4s ease-out; }
.cd-thanks-box { text-align: center; }
.cd-thanks-check { font-size: 120px; line-height: 1; color: #4caf7a; text-shadow: 0 0 30px rgba(76,175,122,0.5); animation: cd-thanks-check 0.5s cubic-bezier(.34,1.56,.64,1); }
.cd-thanks-title { font-size: 32px; color: #F7F5F3; margin-top: 18px; font-weight: 500; animation: cd-fade-in-up 0.5s ease-out 0.15s both; }
@keyframes cd-thanks-check {
  0% { opacity: 0; transform: scale(0.4) rotate(-12deg); }
  60% { transform: scale(1.1) rotate(0deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* =============================================================================
   CUSTOMER DETAIL SCREEN — verification + marketing self-service
   ============================================================================= */
.cd-customer-screen { flex-direction: column; align-items: stretch; justify-content: flex-start; overflow: hidden; background: var(--mhv-bg-body, #F7F5F3); }

.cd-customer-header {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 24px;
  background: var(--mhv-accent, #2E1C27);
  flex-shrink: 0;
}
.cd-customer-greeting { margin-left: auto; font-size: 18px; color: rgba(247,245,243,0.85); font-weight: 500; }

.cd-customer-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 24px 32px;
  padding-bottom: calc(24px + var(--safe-bottom));
  scrollbar-width: thin; scrollbar-color: var(--mhv-border-light) transparent;
}

.cd-customer-name-row {
  font-family: Lora, Georgia, serif; font-size: 34px; font-weight: 600;
  color: var(--mhv-text-primary, #12171D); margin-bottom: 20px; line-height: 1.1;
}

.cd-info-block { margin-bottom: 22px; }
.cd-info-label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--mhv-text-muted); margin-bottom: 4px; font-weight: 600; }
.cd-info-value {
  font-size: 22px; color: var(--mhv-text-primary); font-weight: 500;
  font-variant-numeric: tabular-nums; line-height: 1.3;
  word-break: break-all;
}
.cd-info-value--addr { white-space: pre-line; word-break: normal; font-size: 20px; }
/* Vertically-centered asterisks for masked PII */
.cd-mask { display: inline-block; vertical-align: middle; line-height: 0.6; font-weight: 700; letter-spacing: 1px; color: var(--mhv-text-muted); }

/* Marketing row under each contact field */
.cd-marketing-row {
  display: flex; align-items: center; gap: 14px;
  margin-top: 10px; padding: 10px 14px;
  background: rgba(46,28,39,0.04); border-radius: 8px;
  border: 1px solid rgba(46,28,39,0.06);
}
.cd-marketing-status {
  font-size: 13px; font-weight: 600; letter-spacing: 0.5px;
  padding: 4px 10px; border-radius: 999px;
}
.cd-marketing-status--subscribed { background: rgba(76,175,122,0.18); color: #2d6b4f; }
.cd-marketing-status--unsubscribed { background: rgba(150,150,150,0.18); color: #666; }
.cd-marketing-status--not_subscribed { background: rgba(150,150,150,0.18); color: #666; }
.cd-marketing-label {
  font-size: 13px; color: var(--mhv-text-secondary); flex: 1;
}

.cd-subscribe-btn {
  margin-left: auto;
  padding: 12px 24px; border-radius: 999px;
  background: linear-gradient(135deg, var(--mhv-accent, #2E1C27) 0%, var(--mhv-accent-light, #5a3d50) 100%);
  color: #F7F5F3; font-size: 15px; font-weight: 600; letter-spacing: 0.4px;
  border: none; cursor: pointer;
  box-shadow: 0 4px 16px rgba(46,28,39,0.25);
  animation: cd-subscribe-pulse 2.4s ease-in-out infinite;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cd-subscribe-btn:hover, .cd-subscribe-btn:active { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(46,28,39,0.35); }
@keyframes cd-subscribe-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(46,28,39,0.25); }
  50% { box-shadow: 0 4px 16px rgba(46,28,39,0.25), 0 0 0 8px rgba(46,28,39,0.08); }
}

.cd-unsub-btn {
  margin-left: auto;
  padding: 6px 12px; border-radius: 999px;
  background: transparent; color: var(--mhv-text-muted);
  font-size: 12px; font-weight: 500;
  border: 1px solid rgba(46,28,39,0.18);
  cursor: pointer;
}
.cd-unsub-btn:hover { color: var(--mhv-text-primary); border-color: var(--mhv-text-secondary); }

.cd-confirm-btn {
  display: block; width: 100%; max-width: 480px; margin: 32px auto 8px;
  padding: 22px 32px; border-radius: 14px;
  background: linear-gradient(135deg, var(--mhv-accent, #2E1C27) 0%, var(--mhv-accent-light, #5a3d50) 100%);
  color: #F7F5F3; font-size: 22px; font-weight: 600; letter-spacing: 0.4px;
  border: none; cursor: pointer;
  box-shadow: 0 8px 24px rgba(46,28,39,0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cd-confirm-btn:hover, .cd-confirm-btn:active { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(46,28,39,0.35); }
.cd-confirm-btn:disabled { opacity: 0.6; cursor: default; transform: none; }
.cd-confirm-hint { text-align: center; font-size: 12px; color: var(--mhv-text-muted); margin: 4px 0 16px; font-style: italic; }

/* =============================================================================
   TCPA DISCLOSURE MODAL — shown when customer taps SMS subscribe
   ============================================================================= */
.cd-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: cd-fade-in 0.2s ease-out;
}
.cd-disclosure-box {
  background: #F7F5F3; color: var(--mhv-text-primary);
  max-width: 560px; width: 100%;
  padding: 28px; border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}
.cd-disclosure-title { font-family: Lora, Georgia, serif; font-size: 24px; font-weight: 600; margin: 0 0 16px; color: var(--mhv-text-primary); }
.cd-disclosure-body { font-size: 14px; line-height: 1.55; color: var(--mhv-text-secondary); max-height: 50vh; overflow-y: auto; padding-right: 8px; }
.cd-disclosure-body p { margin: 0 0 10px; }
.cd-disclosure-body a { color: var(--mhv-accent); text-decoration: underline; }
.cd-disclosure-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 22px; }
.cd-disclosure-cancel {
  padding: 12px 20px; border-radius: 8px;
  background: transparent; color: var(--mhv-text-secondary);
  border: 1px solid var(--mhv-border-light, #d8d4d0); font-size: 14px; font-weight: 500; cursor: pointer;
}
.cd-disclosure-confirm {
  padding: 12px 22px; border-radius: 8px;
  background: var(--mhv-accent, #2E1C27); color: #F7F5F3;
  border: none; font-size: 14px; font-weight: 600; cursor: pointer;
}
