/*
 * Pink Zebra Moving — Zip Router Modal Styles
 * Impakt Digital — v1.0.0
 *
 * CUSTOMIZATION:
 * Edit the CSS variables in :root to match your Avada theme.
 * Everything else inherits automatically.
 * The font, border-radius, and colors are the only things you should need to touch.
 */

:root {
  /* ── Brand — match to Avada theme settings ───────────────────────────── */
  --pz-accent:         #E8127D;               /* Pink Zebra primary pink    */
  --pz-accent-light:   rgba(232, 18, 125, 0.08);
  --pz-accent-border:  rgba(232, 18, 125, 0.30);

  /* ── Neutrals ─────────────────────────────────────────────────────────── */
  --pz-bg:             #ffffff;
  --pz-bg-secondary:   #f6f6f6;
  --pz-border:         rgba(0, 0, 0, 0.11);
  --pz-text:           #111111;
  --pz-text-muted:     #666666;
  --pz-text-hint:      #aaaaaa;

  /* ── Layout ────────────────────────────────────────────────────────────── */
  --pz-radius:         10px;
  --pz-font:           inherit;               /* inherits Avada body font    */
  --pz-overlay-z:      99999;                 /* sit above Avada's nav/menu  */
}

/* ─────────────────────────────────────────────────────────────────────────────
   OVERLAY
───────────────────────────────────────────────────────────────────────────── */

#pz-overlay {
  display:         none;
  position:        fixed;
  inset:           0;
  background:      rgba(0, 0, 0, 0.55);
  z-index:         var(--pz-overlay-z);
  align-items:     flex-start;
  justify-content: center;
  padding:         64px 16px 24px;
}

#pz-overlay.pz-visible {
  display: flex;
}

/* ─────────────────────────────────────────────────────────────────────────────
   MODAL BOX
───────────────────────────────────────────────────────────────────────────── */

#pz-modal {
  background:    var(--pz-bg);
  border-radius: var(--pz-radius);
  border:        1px solid var(--pz-border);
  width:         100%;
  max-width:     400px;
  padding:       24px;
  font-family:   var(--pz-font);
  font-size:     15px;
  line-height:   1.5;
}

/* ── Header ── */

#pz-modal-header {
  display:         flex;
  justify-content: space-between;
  align-items:     flex-start;
  margin-bottom:   18px;
  gap:             8px;
}

/* Zebra stripe decoration */
.pz-stripe {
  height:        3px;
  margin-bottom: 11px;
  background:    repeating-linear-gradient(
    to right,
    var(--pz-accent)        0px,
    var(--pz-accent)        10px,
    var(--pz-border)        10px,
    var(--pz-border)        20px
  );
  border-radius: 2px;
}

#pz-modal-title {
  font-size:   17px;
  font-weight: 600;
  color:       var(--pz-text);
  margin:      0 0 3px;
}

#pz-modal-subtitle {
  font-size: 13px;
  color:     var(--pz-text-muted);
  margin:    0;
}

#pz-close {
  background:  none;
  border:      none;
  font-size:   22px;
  line-height: 1;
  color:       var(--pz-text-hint);
  cursor:      pointer;
  padding:     2px 6px;
  flex-shrink: 0;
  transition:  color 0.15s;
}

#pz-close:hover { color: var(--pz-text); }

/* ─────────────────────────────────────────────────────────────────────────────
   INPUT ROW
───────────────────────────────────────────────────────────────────────────── */

#pz-input-row {
  display:       flex;
  gap:           8px;
  margin-bottom: 0;
}

#pz-zip-input {
  flex:        1;
  font-size:   16px;               /* 16px prevents iOS auto-zoom */
  padding:     10px 14px;
  border:      1px solid var(--pz-border);
  border-radius: 8px;
  background:  var(--pz-bg-secondary);
  color:       var(--pz-text);
  outline:     none;
  font-family: var(--pz-font);
  transition:  border-color 0.15s, box-shadow 0.15s;
}

#pz-zip-input:focus {
  border-color: var(--pz-accent);
  box-shadow:   0 0 0 3px var(--pz-accent-light);
}

#pz-check-btn {
  background:    var(--pz-accent);
  color:         #ffffff;
  border:        none;
  border-radius: 8px;
  padding:       10px 20px;
  font-size:     14px;
  font-weight:   600;
  cursor:        pointer;
  font-family:   var(--pz-font);
  transition:    opacity 0.15s, background 0.15s;
  white-space:   nowrap;
}

#pz-check-btn:disabled {
  background: var(--pz-bg-secondary);
  color:      var(--pz-text-hint);
  cursor:     not-allowed;
}

#pz-check-btn:not(:disabled):hover { opacity: 0.87; }

/* ─────────────────────────────────────────────────────────────────────────────
   LOADING SPINNER
───────────────────────────────────────────────────────────────────────────── */

#pz-loading {
  display:     none;
  align-items: center;
  gap:         10px;
  font-size:   13px;
  color:       var(--pz-text-muted);
  margin-top:  14px;
}

.pz-spinner {
  width:         16px;
  height:        16px;
  border:        2px solid var(--pz-border);
  border-top-color: var(--pz-accent);
  border-radius: 50%;
  flex-shrink:   0;
  animation:     pz-spin 0.7s linear infinite;
}

@keyframes pz-spin {
  to { transform: rotate(360deg); }
}

/* ─────────────────────────────────────────────────────────────────────────────
   RESULT AREA
───────────────────────────────────────────────────────────────────────────── */

#pz-result {
  display:    none;
  margin-top: 14px;
}

/* Status line */
.pz-status {
  display:       flex;
  align-items:   center;
  gap:           8px;
  font-size:     13px;
  font-weight:   600;
  margin-bottom: 11px;
}

.pz-status--success { color: #059669; }
.pz-status--warning { color: #d97706; }
.pz-status--neutral { color: var(--pz-text-muted); }

.pz-dot {
  width:        9px;
  height:       9px;
  border-radius: 50%;
  flex-shrink:  0;
}

.pz-dot--green { background: #10b981; }
.pz-dot--amber { background: #f59e0b; }
.pz-dot--gray  { background: #d1d5db; }

/* Territory card */
.pz-territory-card {
  background:    var(--pz-bg-secondary);
  border:        1px solid var(--pz-border);
  border-radius: var(--pz-radius);
  padding:       13px;
  margin-bottom: 12px;
}

.pz-territory-card--pink {
  background:    var(--pz-accent-light);
  border-color:  var(--pz-accent-border);
}

.pz-territory-card strong {
  display:       block;
  font-size:     14px;
  color:         var(--pz-text);
  margin-bottom: 3px;
}

.pz-territory-card--pink strong { color: var(--pz-accent); }

.pz-territory-info {
  display:     flex;
  align-items: flex-start;
  gap:         10px;
}

/* Avatar circle */
.pz-avatar {
  width:         38px;
  height:        38px;
  border-radius: 50%;
  background:    var(--pz-accent-light);
  border:        1.5px solid var(--pz-accent);
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-size:     12px;
  font-weight:   700;
  color:         var(--pz-accent);
  flex-shrink:   0;
  font-family:   var(--pz-font);
}

.pz-meta {
  font-size:  12px;
  color:      var(--pz-text-muted);
  margin-top: 2px;
}

.pz-nearby-note {
  font-size:    12px;
  color:        var(--pz-text-muted);
  margin:       0 0 10px;
  line-height:  1.55;
}

/* ─────────────────────────────────────────────────────────────────────────────
   BUTTONS
───────────────────────────────────────────────────────────────────────────── */

.pz-btn {
  display:       block;
  width:         100%;
  padding:       10px 16px;
  border-radius: 8px;
  font-size:     14px;
  font-weight:   600;
  cursor:        pointer;
  text-align:    center;
  font-family:   var(--pz-font);
  border:        none;
  margin-bottom: 6px;
  transition:    opacity 0.15s;
}

.pz-btn--primary {
  background: var(--pz-accent);
  color:      #ffffff;
}

.pz-btn--primary:hover { opacity: 0.87; }

.pz-btn--ghost {
  background:      none;
  color:           var(--pz-text-muted);
  text-decoration: underline;
  font-size:       13px;
  padding:         6px 0;
  font-weight:     400;
}

.pz-btn--ghost:hover { color: var(--pz-text); }

/* Error state */
.pz-error {
  font-size:  13px;
  color:      #dc2626;
  text-align: center;
  padding:    12px 0;
  margin:     0;
}

/* ─────────────────────────────────────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  #pz-overlay { padding: 40px 12px 20px; }
  #pz-modal   { padding: 18px; }
}
