:root{
  --bg:#0f1111;
  --accent:#ff9900;
  --line:#e5e7eb;
  --muted:#6b7280;
  --shadow: 0 12px 30px rgba(0,0,0,.20);
  --r:18px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background:#f7f8fa;
  color: #131A22;
}

.topbar{
  position: fixed;
  top:0;
  left:0;
  right:0;
  z-index: 20;
  background: #232F3E;
  padding: 10px 12px 12px;
  color:#fff;
}
.brand{ height:38px; display:block; }
.brandWrap{ margin-bottom:10px; }

.searchWrap{
  display:flex;
  align-items:center;
  gap:8px;
  background:#f2f2f2;
  border-radius: 999px;
  padding: 10px 12px;
}
.search{ width:100%; border:none; outline:none; font-size:14px; }
.searchIcon{ opacity:.75; }

.cartBtn{
  position:absolute;
  right:12px;
  top:10px;
  border:1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08);
  color:#fff;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight:800;
}
.cartCount{
  display:inline-block;
  margin-left:6px;
  background: var(--accent);
  color:#111;
  border-radius: 999px;
  padding: 2px 8px;
  font-weight:900;
}

.chipRow{
  display:flex;
  gap:8px;
  overflow:auto;
  padding-top:10px;
  padding-bottom:10px;
  scrollbar-width:none;
}
.chipRow::-webkit-scrollbar{ display:none; }
.chip{
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.10);
  color:#fff;
  border-radius: 999px;
  padding: 8px 10px;
  font-size:12px;
  white-space:nowrap;
}
.chip.active{
  background: rgba(255,153,0,.22);
  border-color: rgba(255,153,0,.45);
}

.budgetBar{
  position: fixed;
  left:0;
  right:0;
  top: var(--topbar-h, 112px);
  z-index: 15;
  background:#f2f2f2;
  border-bottom:1px solid var(--line);
  padding: 10px 12px 12px;
}
.budgetTop{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:8px;
}
.budgetTitle{ font-weight:900; font-size:20px; line-height:1.2; }
.budgetSub{ color:var(--muted); font-size:13px; margin-top:3px; }
.budgetNums{ text-align:right; flex-shrink:0; white-space:nowrap; }
.spent{ font-weight:900; font-size:22px; line-height:1.1; }
.left{ color:#cc7a00; font-size:13px; font-weight:900; margin-top:2px; white-space:nowrap; }
.progress{
  margin-top:10px;
  height:14px;
  background:#eef0f2;
  border-radius:999px;
  overflow:hidden;
}
.progressFill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, var(--accent), #ffd18a);
}

.main{ padding: calc(var(--topbar-h,112px) + var(--budget-h,86px) + 10px) 10px 90px; }

.shelf{
  display:flex;
  gap:10px;
  overflow:auto;
  padding: 6px 2px 12px;
  scrollbar-width:none;
}
.shelf::-webkit-scrollbar{ display:none; }
.shelfCard{
  min-width: 220px;
  background:#f2f2f2;
  border:1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 4px 12px rgba(0,0,0,.05);
  overflow:hidden;
}
.shelfCard img{ width:100%; height:140px; object-fit:contain; background:#f2f2f2; }
.shelfCard .p{ padding:10px; }
.badge{
  display:inline-block;
  font-size:11px;
  font-weight:900;
  background:#fff3e0;
  color:#7a4b00;
  border:1px solid #ffd7a6;
  padding:4px 8px;
  border-radius:999px;
}
.title{ font-size:13px; font-weight:900; line-height:1.3; margin-top:6px; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
.row{ display:flex; gap:6px; align-items:baseline; margin-top:8px; }
.price{ font-weight:1000; color:#007600; font-size:16px; }
.msrp{ color:var(--muted); font-size:12px; text-decoration:line-through; }
.small{ color:var(--muted); font-size:12px; }

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
.card{
  background:#ffffff;
  border:1px solid var(--line);
  border-radius: var(--r);
  overflow:hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,.07);
  transition: transform .12s ease, box-shadow .12s ease;
  display:flex;
  flex-direction:column;
}
.card:active{ transform: scale(.99); }
.card img{ width:100%; height:185px; object-fit:contain; background:transparent; border-radius:14px; }

.card .imgwrap{
  background: linear-gradient(180deg,#ffffff 0%, #f8fafc 100%);
  padding: 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  height: 185px;
}
.card img{
  width:100%;
  height:165px;
  object-fit:contain;
  background: transparent;
  border-radius: 14px;
}

.tagrow{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
  flex-wrap: wrap;
}
.tag{
  font-size:11px;
  font-weight:900;
  padding:6px 10px;
  border-radius:999px;
  line-height:1;
  border:1px solid var(--line);
  background:#f3f4f6;
  color:#111;
  white-space:nowrap;
}
.tag.free{
  background:#eef2ff;
  border-color:#c7d2fe;
}
.tag.cat{
  background:#f8fafc;
  border-color:#e5e7eb;
  color:#111;
}
.tag.earn{
  background:#ecfdf5;
  border-color:#bbf7d0;
  color:#065f46;
}
.cash{ font-weight:1000; }

.muted{ color:#6b7280; }

.testerline{
  display:flex;
  align-items:baseline;
  gap:10px;
  margin-top:8px;
}

/* New card meta/value lines */
.metaLine{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-top:8px;
}
.starsRow{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:4px;
  margin-top:8px;
  font-size:12px;
}
.starsRow .muted{
  font-size:11px;
  color:var(--muted);
  white-space:nowrap;
}
.pickPill{
  font-size:10px;
  font-weight:900;
  background:#f3f4f6;
  border:1px solid var(--line);
  padding:4px 8px;
  border-radius:999px;
  white-space:nowrap;
  flex-shrink:0;
}
.valueLine{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:10px;
  margin-top:10px;
}
.valueLine .msrp{
  text-decoration:none;
  color:#c0392b;
  font-size:12px;
}
.valueLine .msrp strong{
  font-size:13px;
  color:#c0392b;
}

.afterbtn{
  margin-top:8px;
  font-size:12px;
  color:#111;
  background:#f0faf0;
  border:1px solid rgba(0,118,0,.2);
  border-radius:12px;
  padding:8px 10px;
  font-weight:700;
}

.card .b{ padding:10px; display:flex; flex-direction:column; flex:1; }
.cardBottom{ margin-top:auto; }
.afterbtn{ margin-top:8px; }
.actions{ display:flex; gap:8px; margin-top:10px; }

.btn{
  border:none;
  border-radius: 999px;
  padding: 12px 14px;
  font-weight:1000;
  background:#f3f4f6;
}
.btn.primary{ background: var(--accent); color:#111; }
.btn.ghost{ background:#f3f4f6; }
.btn.full{ width:100%; display:block; text-align:center; text-decoration:none; }

/* spacing between stacked full-width buttons */
.sheet .btn.full + .btn.full{ margin-top:10px; }

.loadMoreWrap{ display:flex; justify-content:center; padding: 14px 0; }

/* ===== Modals (CENTERED on mobile + desktop) ===== */
.modal, .drawer{
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}
.modal[aria-hidden="false"], .drawer[aria-hidden="false"]{
  display: flex;
}
.modal{
  align-items: center;
  justify-content: center;
}
.drawer{
  align-items: flex-end;
  justify-content: center;
}

.backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.35);
}
.sheet{
  position: relative;
  z-index: 1;
  width: calc(100vw - 24px);
  max-width: 560px;
  max-height: 80vh;
  overflow: auto;
  background:#f2f2f2;
  border-radius: 22px;
  padding: 16px 14px 18px;
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}
.sheet > *:first-child{ margin-top: 0; }
.h1{ font-weight:1100; font-size:18px; letter-spacing:-.2px; }
.sub{ color:var(--muted); font-size:16px; margin-top:6px; line-height:1.4; }
.fine{ color:var(--muted); font-size:12px; margin-top:12px; }

.interestGrid{
  margin-top:14px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
.pick{
  border:1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background:#ffffff;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.pick[aria-pressed="true"]{
  border-color: rgba(255,153,0,.75);
  box-shadow: 0 0 0 3px rgba(255,153,0,.18);
}
.pick small{ color:var(--muted); font-weight:800; }

.previewRow{
  display:flex;
  gap:10px;
  overflow:auto;
  padding: 12px 2px 2px;
  scrollbar-width:none;
}
.previewRow::-webkit-scrollbar{ display:none; }
.preview{
  min-width: 140px;
  flex:1;
  border:1px solid var(--line);
  border-radius: 16px;
  overflow:hidden;
  background:#fff;
}
.preview img{ width:100%; height:110px; object-fit:contain; background:#f7f8fa; }
.preview .pt{ padding:8px; font-size:12px; font-weight:900; line-height:1.3; }
.editCartLink{
  background:none;
  border:none;
  color:var(--muted);
  font-size:13px;
  font-weight:700;
  text-decoration:underline;
  cursor:pointer;
  padding:4px;
}

.steps{
  margin-top:14px;
  border:1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
}
.step{ display:flex; gap:12px; padding: 10px 0; align-items:flex-start; }
.step + .step{ border-top:1px solid var(--line); }
.dot{ width:10px; height:10px; border-radius:999px; background:#146eb4; margin-top:4px; }
.stepNum{
  min-width:26px;
  height:26px;
  border-radius:999px;
  background:#146eb4;
  color:#fff;
  font-size:13px;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  margin-top:1px;
}
.muted{ color:var(--muted); font-size:13px; margin-top:2px; }

/* Drawer */
.drawerSheet{
  position: relative;
  z-index: 1;
  width: calc(100vw - 24px);
  max-width: 560px;
  height: 78vh;
  margin: 12px;
  background:#f2f2f2;
  border-radius: 22px;
  box-shadow: var(--shadow);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.drawerHead{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 12px 12px 10px;
  border-bottom:1px solid var(--line);
}
.drawerTitle{ font-weight:1100; font-size:18px; }
.drawerSub{ color:var(--muted); font-size:12px; margin-top:2px; }
.iconBtn{
  border:none;
  background:#f3f4f6;
  width:40px; height:40px;
  border-radius: 12px;
  font-size:18px;
}
.cartItems{
  padding: 8px 12px;
  overflow:auto;
  flex:1;
}
.cartItem{
  display:grid;
  grid-template-columns: 64px 1fr auto;
  gap:10px;
  padding:10px 0;
  border-bottom:1px solid var(--line);
}
.cartItem img{
  width:64px; height:64px;
  object-fit:contain;
  background:#f2f2f2;
  border:1px solid var(--line);
  border-radius: 14px;
}
.cartItem .ct{ font-weight:900; font-size:13px; line-height:1.2; }
.cartItem .cp{ font-weight:1100; margin-top:6px; }
.qty{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:6px;
}
.qrow{ display:flex; gap:6px; align-items:center; }
.qbtn{
  width:34px; height:34px;
  border-radius: 12px;
  border:1px solid var(--line);
  background:#f2f2f2;
  font-weight:1100;
}
.qval{ min-width:18px; text-align:center; font-weight:1100; }
.drawerFoot{
  padding: 10px 12px 12px;
  border-top:1px solid var(--line);
}
.totalRow{ display:flex; justify-content:space-between; font-weight:1100; margin-bottom:10px; }

@media (max-width: 360px){
  .grid{ grid-template-columns: 1fr; }
}

/* budgetBarShadow */
.budgetBar{ box-shadow: 0 6px 16px rgba(0,0,0,.06); }

.payout{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:11px;
  font-weight:1000;
  background:#ecfdf3;
  color:#065f46;
  border:1px solid #b7f7cf;
  padding:4px 8px;
  border-radius:999px;
  white-space:nowrap;
}
.payout .cash{ font-weight:1100; }

/* --- Align payout pill consistently --- */
.meta{
  align-items: flex-start;
}
.payout{
  margin-left: auto;
  flex: 0 0 auto;
}
@media (max-width: 420px){
  /* on small screens, move payout under stars to avoid misalignment */
  .meta{
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .payout{
    margin-left: 0;
  }
}

/* Category pick progress (modal) */
.catProg{ margin: 10px 0 6px; padding: 10px 12px; border: 1px solid rgba(0,0,0,.08); border-radius: 12px; background: rgba(255,255,255,.92); }
.catProgRow{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.catProgTxt{ font-weight: 800; letter-spacing: .2px; }
.catProgHint{ font-size: 12px; font-weight: 700; color: rgba(0,0,0,.55); }
.catProgBar{ height: 10px; border-radius: 999px; background: rgba(0,0,0,.10); overflow:hidden; margin-top: 8px; }
.catProgFill{ height: 100%; border-radius: 999px; background: #22c55e; width: 0%; transition: width .18s ease; }

/* Show feed behind interest modal but block interaction */
body.modalOpen header, body.modalOpen main, body.modalOpen #cartDrawer { pointer-events:none !important; }
body.modalOpen #interestModal, body.modalOpen #interestModal * { pointer-events:auto !important; }

/* small feedback when user tries to continue without 3 */
@keyframes shakeX { 0%{transform:translateX(0)} 25%{transform:translateX(-6px)} 50%{transform:translateX(6px)} 75%{transform:translateX(-4px)} 100%{transform:translateX(0)} }
.catProg.shake{ animation: shakeX .32s ease; }


/* Shelf cards now reuse the main card layout */
.shelf{ padding-top: 10px; padding-bottom: 12px; }
.shelfCardCard{ min-width: 240px; max-width: 240px; }
.shelfCardCard .imgwrap{ height: 140px; }
.shelfCardCard .afterbtn{ margin-top: 8px; }

.meta .muted{ font-size:11px; }

/* Slight hover lift on desktop */
@media (hover:hover){
  .card:hover{ transform: translateY(-1px); box-shadow: 0 10px 22px rgba(0,0,0,.08); }
}


/* Mobile-first fixes: prevent any card/pill overflow */
@media (max-width: 520px){
  .wrap{ padding: 0 10px; }
  .grid{ grid-template-columns: 1fr 1fr; gap: 12px; }
  .card{ max-width: 100%; }
  .imgwrap{ height: 150px; }

  /* Shelf should behave like normal grid on mobile (no horizontal overflow) */
  .shelf{ display: none; } /* simplest: remove shelf row on mobile */
  .shelfSep{ display:none; }

  /* Pills: allow wrapping + shrinking */
  .tagrow{ flex-wrap: wrap; gap: 6px; }
  .tag{ max-width: 100%; }
  .tag.earn{ white-space: nowrap; }
  .tag.earn .cash{ font-size: 12px; }
  .tag.free{ white-space: nowrap; }

  /* Titles: clamp a bit more to avoid pushing layout */
  .title{ -webkit-line-clamp: 2; line-clamp: 2; }
}



/* Register modal: add breathing room above primary CTA */
#registerModal .btn.primary.full{
  margin-top: 14px;
}


/* Add spacing under cart pill so it doesn't touch chips/buttons */
.topbar .cartWrap, .topbar .cart, #cartBtn, .cartBtn {
  margin-bottom: 10px;
}


/* Space between cart button row and filter pills */
header .chipRow{ margin-top: 10px; }
header .cartBtn{ margin-bottom: 6px; }


  .topbar{
    padding-bottom: 16px;
  }
}














/* Mobile header: guaranteed gap between cart and pills (no overlap) */
@media (max-width: 520px){
  .topbar{
    display:flex !important;
    flex-wrap:wrap;
    align-items:center;
    gap:16px;
    padding-bottom: 14px;
  }
  .topbar .brand{
    flex: 1 1 auto;
    min-width: 0;
  }
  .topbar .cartBtn{
    position: static !important;
    flex: 0 0 auto;
    margin-left: auto;
  }
  .topbar .chipRow{
    flex: 1 0 100%;
    margin-top: 18px !important; /* <-- hard gap */
    padding-top: 0 !important;
  }
}


/* Brand logo sizing */
.brand img{height:28px;width:auto;display:block;}



/* Product card pills: keep FREE / category / Earn inline + clean on mobile */
.card .tags, .card .tagRow, .tagRow{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
}
.tag{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
  line-height:1;
}
.tag.earn{
  margin-left:auto; /* push earn to the right when space allows */
}
@media (max-width: 520px){
  .card .tags, .card .tagRow, .tagRow{
    flex-wrap:nowrap;            /* keep in one line */
    gap:6px;
    overflow:hidden;
  }
  .tag{
    font-size:11px;
    padding:6px 9px;
    border-radius:999px;
  }
  .tag.earn{
    margin-left:0;               /* don't force weird spacing/wrap */
  }
}


/* Hide category pill (no longer needed) */
.tag.cat{display:none !important;}



/* Ensure spacing in Earn pill (Earn $250) across browsers */
.tag.earn .cash{ margin-left: 4px; }



/* Centered logo at top of first modal */
.modalLogoWrap{
  display:flex;
  justify-content:center;
  align-items:center;
  padding: 10px 0 6px;
}
.modalLogo{
  height: 34px;
  width: auto;
  display:block;
}



/* Interest modal: give logo area a dark gray header so white logo is visible */
#interestModal .modalLogoWrap{
  background: #232F3E;
  margin: -14px -14px 10px; /* stretch to sheet edges */
  padding: 14px 14px 12px;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}

/* Amazon text color */
:root{--ink:#131A22;}



/* Interest modal: remove top inset so header strip covers the very top */
#interestModal .sheet{ padding-top: 0 !important; }
#interestModal .modalLogoWrap{
  margin: 0 -14px 10px !important;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}



/* Bigger headline on product page */
.pageTitle, .progressTitle, .titleMain, .pickTitle{
  font-size: 20px;
  font-weight: 900;
}
@media (max-width:520px){
  .pageTitle, .progressTitle, .titleMain, .pickTitle{ font-size:22px; }
}

/* Interest modal hero + carousel */
#interestModal .modalHero{
  margin: 10px 0 12px;
  padding: 12px 12px;
  border-radius: 16px;
  background: rgba(35,47,62,.06);
  border: 1px solid rgba(35,47,62,.10);
}
#interestModal .heroTitle{
  font-size: 16px;
  font-weight: 900;
  color: #131A22;
}
#interestModal .freeWord{
  color:#0a7a3a;
}
#interestModal .heroSub{
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.35;
  opacity: .9;
}
#interestModal .modalCarousel{
  margin-top: 10px;
  overflow: hidden;
}
#interestModal .carItem{
  flex: 0 0 auto;
  width: 92px;
}
#interestModal .carImgWrap{
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.10);
  background:#f2f2f2;
}
#interestModal .carImg{
  width:100%;
  height: 92px;
  object-fit: cover;
  display:block;
}
#interestModal .carBadge{
  position:absolute;
  left:8px;
  top:8px;
  background:#fff;
  color:#131A22;
  font-weight: 900;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
}
#interestModal .carCap{
  margin-top:6px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}



/* Product catalog area background white (cards grid section) */
.catalog, #catalog, .gridWrap, .productsWrap, .productGrid{
  background: #ffffff;
}



/* Carousel — clean single rule set */
#interestModal .modalCarousel{
  margin-top: 10px;
  overflow: hidden;
  min-height: 120px;
}
#interestModal .carouselMarquee{
  display: flex;
  flex-wrap: nowrap;
  width: max-content;
  gap: 10px;
  padding: 0 2px 2px;
  will-change: transform;
  animation: carouselScroll 600s linear forwards;
}
@keyframes carouselScroll{
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-13200px, 0, 0); }
}
@media (prefers-reduced-motion: reduce){
  #interestModal .carouselMarquee{ animation: none; }
}

#finishBtn{ font-size:17px; padding:14px; }
.preview .freePill{
  display:inline-block;
  background:#007600;
  color:#fff;
  font-size:10px;
  font-weight:900;
  padding:3px 7px;
  border-radius:999px;
  margin:6px 8px 2px;
}
