/* TrueLoyal Demo Factory — storefront styles.
   Branding comes from CSS variables set at runtime from the prospect config. */
:root {
  --brand-primary: #1a3c6e;
  --brand-secondary: #f4f7fb;
  --brand-accent: #e8632c;
  --ink: #16202e;
  --muted: #66707d;
  --line: #e4e8ee;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(15, 25, 40, 0.08);
  --shadow-lift: 0 16px 40px rgba(15, 25, 40, 0.16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
/* Elements toggled via the `hidden` attribute must stay hidden even when a
   class sets its own display value (e.g. .cart-drawer's display:flex). */
[hidden] { display: none !important; }
body { font-family: var(--font); color: var(--ink); background: #fff; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
code { background: var(--brand-secondary); padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.9em; }

.muted { color: var(--muted); }
.tiny { font-size: 0.78rem; margin-top: 0.75rem; }

/* buttons */
.btn {
  font: inherit; border: none; cursor: pointer; border-radius: 8px;
  padding: 0.6rem 1.1rem; font-weight: 600;
  transition: filter 0.15s, transform 0.12s, box-shadow 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--brand-primary); color: #fff; }
.btn.accent { background: var(--brand-accent); color: #fff; }
.btn.ghost { background: transparent; color: var(--brand-primary); border: 1.5px solid var(--brand-primary); }
.btn.outline { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.65); }
.btn.outline:hover { border-color: #fff; background: rgba(255,255,255,0.1); }
.btn.lg { padding: 0.85rem 1.7rem; font-size: 1.05rem; }
.btn.sm { padding: 0.35rem 0.8rem; font-size: 0.85rem; }
.btn.block { display: block; width: 100%; margin-top: 0.9rem; }
.btn:hover { filter: brightness(1.08); }
.btn.primary:hover, .btn.accent:hover { box-shadow: 0 6px 18px rgba(15,25,40,0.22); transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.icon-btn { background: none; border: none; font-size: 1rem; cursor: pointer; color: var(--muted); }

/* announcement + header */
.announcement {
  background: var(--brand-primary); color: #fff; text-align: center;
  padding: 0.45rem 1rem; font-size: 0.85rem; letter-spacing: 0.02em;
}
.site-header { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(255,255,255,0.94); backdrop-filter: blur(8px); z-index: 40; }
.header-inner {
  max-width: 1120px; margin: 0 auto; padding: 0.8rem 1.25rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.15rem; }
.brand img { height: 34px; width: auto; }
.nav { display: flex; gap: 1.2rem; margin-left: auto; font-weight: 500; }
.nav a { position: relative; padding-bottom: 2px; }
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 2px;
  background: var(--brand-accent); transform: scaleX(0); transform-origin: left; transition: transform 0.2s;
}
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }
.header-actions { display: flex; align-items: center; gap: 0.8rem; }
.cart-btn { position: relative; background: none; border: none; cursor: pointer; color: var(--ink); padding: 0.3rem; transition: transform 0.15s; }
.cart-btn:hover { transform: scale(1.1); }
.cart-count {
  position: absolute; top: -6px; right: -8px; background: var(--brand-accent); color: #fff;
  border-radius: 999px; font-size: 0.68rem; font-weight: 700; padding: 0.1rem 0.4rem;
}
.cart-count.bounce { animation: badge-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes badge-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.7); }
  100% { transform: scale(1); }
}

/* hero */
.hero {
  background: linear-gradient(115deg, var(--brand-primary), color-mix(in srgb, var(--brand-primary) 60%, #000));
  color: #fff; background-size: cover; background-position: center; overflow: hidden;
}
.hero-inner {
  max-width: 1120px; margin: 0 auto; padding: 4.5rem 1.25rem 5rem;
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 2.5rem; align-items: center;
}
@media (max-width: 860px) { .hero-inner { grid-template-columns: 1fr; padding: 3rem 1.25rem; } .hero-visual { display: none; } }
.hero-eyebrow {
  display: inline-block; background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px; padding: 0.3rem 0.9rem; font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.04em; margin-bottom: 1.1rem;
}
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.3rem); max-width: 14em; line-height: 1.1; letter-spacing: -0.01em; }
.hero p { margin: 1rem 0 1.6rem; max-width: 34em; opacity: 0.92; font-size: 1.1rem; line-height: 1.55; }
.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.hero-trust { margin-top: 1.5rem; display: flex; align-items: center; gap: 0.6rem; font-size: 0.88rem; opacity: 0.9; }
.hero-trust .stars { color: #f5c518; letter-spacing: 0.1em; }

/* hero rewards-card mock */
.hero-visual { position: relative; justify-self: center; }
.hero-card {
  width: 300px; border-radius: 18px; padding: 1.4rem;
  background: linear-gradient(150deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.3); backdrop-filter: blur(12px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
  animation: card-float 5s ease-in-out infinite;
}
@keyframes card-float {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-12px) rotate(-1.5deg); }
}
.hc-top { display: flex; align-items: center; gap: 0.55rem; font-weight: 700; font-size: 0.95rem; }
.hc-badge {
  width: 28px; height: 28px; border-radius: 8px; background: var(--brand-accent);
  display: flex; align-items: center; justify-content: center; font-size: 0.9rem;
}
.hc-tierpill {
  margin-left: auto; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.12em;
  background: #f5c518; color: #4a3b00; border-radius: 999px; padding: 0.2rem 0.55rem;
}
.hc-points { margin: 1.2rem 0 0.9rem; display: flex; align-items: baseline; gap: 0.5rem; }
.hc-points span:first-child { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.02em; }
.hc-label { opacity: 0.8; font-size: 0.95rem; }
.hc-bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,0.2); overflow: hidden; }
.hc-bar span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--brand-accent); transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1); }
.hc-row { display: flex; justify-content: space-between; font-size: 0.75rem; opacity: 0.85; margin-top: 0.5rem; }
.hero-chip {
  position: absolute; background: #fff; color: var(--ink); font-size: 0.78rem; font-weight: 700;
  border-radius: 999px; padding: 0.45rem 0.9rem; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.hero-chip.chip-a { top: -14px; right: -26px; animation: chip-float 4s ease-in-out infinite 0.5s; color: #1c7a4d; }
.hero-chip.chip-b { bottom: -10px; left: -30px; animation: chip-float 4.6s ease-in-out infinite 1s; }
@keyframes chip-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* how-it-works steps */
.steps { background: var(--brand-secondary); border-bottom: 1px solid var(--line); }
.steps-inner { max-width: 1120px; margin: 0 auto; padding: 3rem 1.25rem 3.2rem; text-align: center; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-top: 1.8rem; }
@media (max-width: 760px) { .steps-grid { grid-template-columns: 1fr; } }
.step-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem 1.4rem; text-align: left; transition: transform 0.2s, box-shadow 0.2s;
}
.step-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.step-num {
  width: 34px; height: 34px; border-radius: 10px; background: var(--brand-primary); color: #fff;
  font-weight: 800; display: flex; align-items: center; justify-content: center; margin-bottom: 0.9rem;
}
.step-card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.step-card p { font-size: 0.9rem; color: var(--muted); line-height: 1.5; }
.steps-cta { margin-top: 1.8rem; }

/* products */
.shop { max-width: 1120px; margin: 0 auto; padding: 2.8rem 1.25rem 4rem; }
.section-title { font-size: 1.55rem; letter-spacing: -0.01em; }
.shop-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.chips { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.chip {
  font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 999px; padding: 0.4rem 1rem; transition: all 0.18s;
}
.chip:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.chip.active { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.5rem; }
.card {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff;
  box-shadow: var(--shadow); transition: transform 0.22s, box-shadow 0.22s;
  animation: card-in 0.5s ease both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); }
.card-img { aspect-ratio: 1; background: var(--brand-secondary); overflow: hidden; position: relative; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
.card:hover .card-img img { transform: scale(1.07); }
.card-img.img-missing img { display: none; }
.img-badge { position: absolute; top: 10px; right: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.card-body { padding: 1.05rem; }
.card-cat { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.card-body h3 { font-size: 1.04rem; margin: 0.25rem 0 0.35rem; }
.card-blurb { font-size: 0.83rem; color: var(--muted); line-height: 1.45; margin-bottom: 0.6rem; min-height: 2.4em; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.price { font-weight: 700; font-size: 1.08rem; }
.rating { display: flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; }
.rating .stars { color: #f5c518; letter-spacing: 0.05em; }
.rating .stars-off { color: var(--line); }
.rating-num { color: var(--muted); font-weight: 600; }
.pts-badge {
  background: color-mix(in srgb, var(--brand-accent) 14%, #fff); color: var(--brand-accent);
  font-size: 0.78rem; font-weight: 700; padding: 0.25rem 0.6rem; border-radius: 999px;
}
.add-btn { position: relative; overflow: hidden; }
.add-btn.added { background: #22a06b; }

/* fly-to-cart ghost */
.fly-img {
  position: fixed; z-index: 100; object-fit: cover; border-radius: 12px; pointer-events: none;
  transition: all 0.6s cubic-bezier(0.55, 0, 0.55, 1); box-shadow: var(--shadow-lift);
}

/* perks band */
.perks { border-top: 1px solid var(--line); background: #fff; }
.perks-inner {
  max-width: 1120px; margin: 0 auto; padding: 1.8rem 1.25rem;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1.2rem;
}
.perk { display: flex; align-items: center; gap: 0.8rem; }
.perk-icon { font-size: 1.5rem; }
.perk div { display: flex; flex-direction: column; }
.perk strong { font-size: 0.92rem; }
.perk span:not(.perk-icon) { font-size: 0.8rem; color: var(--muted); }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--brand-secondary); }
.footer-cols {
  max-width: 1120px; margin: 0 auto; padding: 2.5rem 1.25rem 1.5rem;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 1.5rem;
}
@media (max-width: 760px) { .footer-cols { grid-template-columns: 1fr 1fr; } }
.footer-brand { font-weight: 800; font-size: 1.1rem; }
.footer-brandcol p { font-size: 0.85rem; margin-top: 0.5rem; max-width: 26em; line-height: 1.5; }
.footer-col { display: flex; flex-direction: column; gap: 0.45rem; font-size: 0.88rem; }
.footer-col strong { margin-bottom: 0.25rem; }
.footer-col a { color: var(--muted); }
.footer-col a:hover { color: var(--brand-primary); }
.footer-fine {
  max-width: 1120px; margin: 0 auto; padding: 1rem 1.25rem 1.6rem;
  display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: space-between;
  color: var(--muted); font-size: 0.82rem; border-top: 1px solid var(--line);
}

/* overlays, drawer, modals */
.overlay { position: fixed; inset: 0; background: rgba(10, 16, 28, 0.45); z-index: 50; animation: fade-in 0.2s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 94vw); background: #fff;
  z-index: 60; display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(0,0,0,0.18);
  animation: drawer-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes drawer-in { from { transform: translateX(60px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--line); }
.cart-items { flex: 1; overflow-y: auto; padding: 0.5rem 1.25rem; }
.cart-line { display: flex; align-items: center; gap: 0.9rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.cart-line img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--brand-secondary); }
.cart-line-info { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; font-size: 0.92rem; }
.qty-ctrl { display: flex; align-items: center; gap: 0.55rem; }
.qty-ctrl button {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 1rem; line-height: 1; transition: all 0.15s;
}
.qty-ctrl button:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.drawer-foot { border-top: 1px solid var(--line); padding: 1.1rem 1.25rem; }
.cart-points { font-size: 0.88rem; color: var(--brand-accent); min-height: 1.2em; }
.cart-subtotal { display: flex; justify-content: space-between; margin-top: 0.6rem; font-size: 1.05rem; }

.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: #fff; z-index: 60; width: min(460px, 94vw); border-radius: var(--radius);
  padding: 1.8rem; box-shadow: 0 24px 80px rgba(0,0,0,0.25); max-height: 90vh; overflow-y: auto;
  animation: modal-in 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modal-in {
  from { transform: translate(-50%, -47%) scale(0.97); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.modal-close { position: absolute; top: 0.9rem; right: 1rem; }
.modal h3 { margin-bottom: 0.4rem; }
.modal form { margin-top: 1rem; }
.modal label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.7rem; }
.modal input {
  display: block; width: 100%; margin-top: 0.3rem; padding: 0.55rem 0.7rem;
  border: 1px solid var(--line); border-radius: 8px; font: inherit;
}
.modal input:focus { outline: 2px solid var(--brand-primary); border-color: transparent; }

.order-summary { margin: 1rem 0 0.6rem; border: 1px solid var(--line); border-radius: 8px; padding: 0.8rem 1rem; }
.sum-line { display: flex; justify-content: space-between; font-size: 0.92rem; padding: 0.2rem 0; }
.sum-line.total { border-top: 1px solid var(--line); margin-top: 0.4rem; padding-top: 0.5rem; font-weight: 700; }
.points-callout {
  background: color-mix(in srgb, var(--brand-accent) 10%, #fff); color: var(--brand-accent);
  border-radius: 8px; padding: 0.6rem 0.9rem; font-size: 0.9rem; margin-bottom: 0.4rem;
}
.success-check {
  width: 58px; height: 58px; border-radius: 50%; background: #22a06b; color: #fff;
  font-size: 1.8rem; display: flex; align-items: center; justify-content: center; margin: 0.4rem auto 1rem;
  animation: check-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes check-pop {
  0% { transform: scale(0); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
#checkoutSuccessView { text-align: center; }
.points-awarded { font-size: 1.05rem; margin: 0.9rem 0 0.4rem; }
.signed-in-panel { margin-top: 1rem; }

/* confetti (spawned by JS on order success) */
.confetti {
  position: absolute; top: 8%; width: 9px; height: 14px; border-radius: 2px; z-index: 70;
  pointer-events: none; opacity: 0;
  animation: confetti-fall 1.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
@keyframes confetti-fall {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--dx, 40px), 340px) rotate(var(--rot, 360deg)); }
}

/* rewards page */
.rewards-page { max-width: 1120px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.rewards-gate {
  border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 3rem 1.5rem;
  text-align: center; display: flex; flex-direction: column; gap: 1rem; align-items: center;
}
.zrl-embed { width: min(800px, 100%); height: 850px; margin: 0 auto; }
@media (max-width: 640px) { .zrl-embed { height: 625px; } }

/* toast + SE panel */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 0.7rem 1.2rem; border-radius: 999px;
  font-size: 0.9rem; z-index: 80; box-shadow: var(--shadow); max-width: 90vw;
  animation: toast-in 0.25s ease;
}
@keyframes toast-in { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
/* Compact centered pill, and z-index BELOW the overlay (50) and drawer/modals (60)
   so it never blocks checkout, and clear of the TL widget launcher in the corner. */
.se-panel {
  position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(16, 24, 39, 0.95); color: #cbd5e1;
  font-size: 0.78rem; padding: 0.45rem 1rem; z-index: 45;
  display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap;
  border-radius: 999px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); max-width: 94vw;
}
.se-panel code { background: #1f2a3d; color: #93c5fd; }
.se-panel button {
  background: #1f2a3d; color: #e2e8f0; border: none; border-radius: 6px;
  padding: 0.25rem 0.6rem; cursor: pointer; font-size: 0.75rem;
}
