/*
 * Rewards widget — compact loyalty popup modelled on tustinvapor.com.
 * Loaded after the theme stylesheet, scoped entirely under .hp-rewards.
 */
.hp-rewards {
  --hp-rewards-accent: #c7470b;
  --hp-rewards-accent-dark: #a83a08;
  --hp-rewards-ink: #1c2733;
  --hp-rewards-line: #ececec;
  --hp-rewards-muted: #6b747d;
}

/* Floating launcher — bottom left, matching the reference widget. */
.hp-rewards__launcher {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 9001;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--hp-radius-pill, 999px);
  background: var(--hp-rewards-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(28, 39, 51, .22);
  transition: background var(--hp-t-fast, .16s ease), transform var(--hp-t-fast, .16s ease), box-shadow var(--hp-t-fast, .16s ease);
}
.hp-rewards__launcher:hover { background: var(--hp-rewards-accent-dark); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(28, 39, 51, .26); }
.hp-rewards__launcher:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 4px var(--hp-rewards-accent); }
.hp-rewards__launcher-icon { display: grid; place-items: center; }
.hp-rewards__launcher-arrow { font-size: 16px; line-height: 1; opacity: .9; }
/* Keep the launcher available while the popup is open. */
.hp-rewards.is-open .hp-rewards__launcher { background: var(--hp-rewards-accent-dark); }

/* Click-outside layer: invisible so the popup still looks like a floating card. */
.hp-rewards__backdrop {
  position: fixed;
  inset: 0;
  z-index: 8999;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--hp-t-fast, .16s ease), visibility var(--hp-t-fast, .16s ease);
}
.hp-rewards.is-open .hp-rewards__backdrop { opacity: 1; visibility: visible; }

/* The popup card. */
.hp-rewards__popup {
  position: fixed;
  left: 20px;
  bottom: 72px;
  z-index: 9000;
  width: 388px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding: 20px 20px 22px;
  border: 1px solid rgba(28, 39, 51, .08);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(16, 24, 40, .2), 0 4px 14px rgba(16, 24, 40, .08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.98);
  transform-origin: bottom left;
  transition: opacity var(--hp-t-base, .28s ease), transform var(--hp-t-base, .28s ease), visibility var(--hp-t-base, .28s ease);
}
.hp-rewards.is-open .hp-rewards__popup { opacity: 1; visibility: visible; transform: none; }
.hp-rewards__popup:focus { outline: none; }

/* Header: orange marker + title, circular close button on the right. */
.hp-rewards__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.hp-rewards__title { display: flex; align-items: center; gap: 9px; }
.hp-rewards__mark { width: 4px; height: 22px; border-radius: 4px; background: var(--hp-rewards-accent); }
.hp-rewards__title h2 { margin: 0; color: var(--hp-rewards-ink); font-size: 21px; font-weight: 800; letter-spacing: -.015em; line-height: 1.2; }
.hp-rewards__close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #e6e8eb;
  border-radius: 50%;
  background: #fff;
  color: #4a5560;
  cursor: pointer;
  transition: background var(--hp-t-fast, .16s ease), border-color var(--hp-t-fast, .16s ease), color var(--hp-t-fast, .16s ease);
}
.hp-rewards__close:hover { background: var(--hp-soft, #f7f9fa); border-color: #cfd5db; color: var(--hp-rewards-ink); }
.hp-rewards__close:focus-visible { outline: 2px solid var(--hp-rewards-accent); outline-offset: 2px; }

/* Earns / Redeem tabs. */
.hp-rewards__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: #f4f5f6;
}
.hp-rewards__tab {
  min-height: 38px;
  padding: 6px 10px;
  border: 2px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--hp-rewards-ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--hp-t-fast, .16s ease), border-color var(--hp-t-fast, .16s ease), box-shadow var(--hp-t-fast, .16s ease);
}
.hp-rewards__tab:hover:not(.is-active) { background: rgba(255, 255, 255, .6); }
.hp-rewards__tab.is-active { background: #fff; border-color: var(--hp-rewards-ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .08); }
.hp-rewards__tab:focus-visible { outline: 2px solid var(--hp-rewards-accent); outline-offset: 2px; }

/* Points rows. */
.hp-rewards__panel { margin: 0; padding: 0; list-style: none; }
.hp-rewards__panel[hidden] { display: none; }
.hp-rewards__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--hp-rewards-line);
}
.hp-rewards__row:last-child { border-bottom: 0; }
.hp-rewards__row-label { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--hp-rewards-ink); font-size: 14px; font-weight: 600; }
.hp-rewards__dot { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: var(--hp-rewards-accent); }
.hp-rewards__row-points { flex: 0 0 auto; color: var(--hp-rewards-accent); font-size: 14px; font-weight: 800; white-space: nowrap; }

/* Primary CTA. */
.hp-rewards__foot { margin-top: 18px; }
.hp-rewards__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--hp-rewards-accent);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .01em;
  text-align: center;
  text-decoration: none;
  transition: background var(--hp-t-fast, .16s ease), transform var(--hp-t-fast, .16s ease);
}
.hp-rewards__cta:hover { background: var(--hp-rewards-accent-dark); color: #fff; transform: translateY(-1px); }
.hp-rewards__cta:focus-visible { outline: 2px solid var(--hp-rewards-ink); outline-offset: 3px; }

@media (max-width: 600px) {
  .hp-rewards__launcher { left: 12px; bottom: 12px; }
  .hp-rewards__popup {
    left: 12px;
    bottom: 64px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 84px);
    padding: 18px 16px 18px;
    border-radius: 16px;
  }
  .hp-rewards__title h2 { font-size: 19px; }
  .hp-rewards__row { min-height: 48px; }
  .hp-rewards__row-label, .hp-rewards__row-points { font-size: 13px; }
  .hp-rewards__cta { font-size: 15px; min-height: 48px; }
}
