/* ===== Deals list: “Top Deals Today” style ===== */
body {
  background-color: rgba(0,0,0);
  font-family: verdana;
  color: white;

  margin: 0;
  padding: 0;
  width: 100%;
}
.container {
  font-family: verdana;
  color: rgba(255,255,255);

  /* ADD THESE LINES */
  /* max-width: 1200px; Optional: Keeps content from getting too wide on large screens */
  /* margin: 0 auto;    Optional: Centers the container */
  padding: 0 15px;   /*Adds space on Left and Right*/
}
/* ===== Today Header ===== */
.todayHeader {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.todayLabel {
  font-size: 28px;
  font-weight: 900;
}

.todayDate {
  font-size: 16px;
  font-weight: 400;
  opacity: 0.85;
}
.sectionTitle {
  margin: 18px 0 10px;
  font-size: 22px;
  font-weight: 800;
}

.dealRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: #2f6f4a;
  color: #fff;
  margin-bottom: 5px;
}

/* Tone overrides for categories */
.dealRow--previous {
  background: #555 !important;
}

.dealRow--future {
  background: orange !important;
  color: #111 !important;
}

.dealRow--future .dealChip {
  background: rgba(0,0,0,0.75) !important;
}

.dealRow:active { transform: scale(0.99); }

.dealLeft {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dealIcon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,0.15);
  object-fit: cover;
  flex: 0 0 auto;
}

.dealTextCol { min-width: 0; }

.dealName {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dealPriceSmall {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.95;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dealChip {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 999px;
  background: #2f83ff;
  color: #fff;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
}

/* ===== Detail overlay ===== */
.detailOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.detailBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}

.detailSheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #2f6f4a;
  color: #fff;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  max-height: 92vh;
  overflow: auto;
}

.detailClose {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 0;
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-size: 22px;
  line-height: 36px;
  text-align: center;
}

.detailHero {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.detailIconWrap {
  width: 92px;
  height: 92px;
  border-radius: 22px;
  background: rgba(255,255,255,0.16);
  display: grid;
  place-items: center;
}

.detailIcon {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  object-fit: cover;
}

.detailTimer {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
  font-weight: 900;
  letter-spacing: 0.5px;
}

.detailHeaderRow {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detailTitle {
  font-size: 24px;
  font-weight: 900;
}

.detailPriceLine {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 800;
  opacity: 0.95;
}

.detailCTA {
  flex: 0 0 auto;
  padding: 12px 16px;
  border-radius: 999px;
  background: #2f83ff;
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  text-decoration: none;
}

.detailBody {
  margin-top: 14px;
}

.detailHeadline {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 10px;
}

.detailText {
  font-size: 18px;
  line-height: 1.55;
  opacity: 0.98;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.detailFooter {
  margin-top: 16px;
}

.detailStore {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.18);
  text-decoration: none;
  color: #fff;
}

.detailStoreIcon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255,255,255,0.15);
}

.detailStoreLabel {
  font-size: 14px;
  font-weight: 800;
  opacity: 0.9;
}

.detailStoreSub {
  font-size: 16px;
  font-weight: 900;
}

.ptr {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: env(safe-area-inset-top);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  z-index: 99999;
}

.ptrSpinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.15);
  border-top-color: rgba(0,0,0,0.65);
  animation: ptrspin 0.9s linear infinite;
}

@keyframes ptrspin {
  to { transform: rotate(360deg); }
}

.ptrText {
  font-size: 14px;
  font-weight: 700;
  color: #222;
}

/* ===== Detail page layout (separate page) ===== */
.detailBody {
  margin: 0;
  background: #2f6f4a;
  color: #fff;
  overscroll-behavior-y: contain;
}

/* Fixed top bar */
.detailTopBar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(52px + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  background: rgba(47, 111, 74, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.detailCloseFixed {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 0;
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-size: 22px;
  line-height: 38px;
  text-align: center;
}

/* Fixed bottom bar */
.detailBottomBar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(86px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 9999;
  background: rgba(47, 111, 74, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.detailStoreFixed {
  width: 100%;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.18);
  text-decoration: none;
  color: #fff;
}

/* Scroll view in the middle (not under top/bottom bars) */
.detailScroll {
  padding-top: calc(52px + env(safe-area-inset-top) + 12px);
  padding-bottom: calc(86px + env(safe-area-inset-bottom) + 16px);
  padding-left: 16px;
  padding-right: 16px;
  max-width: 720px;
  margin: 0 auto;
}

/* Reuse your existing detail components */
.detailBodyContent { margin-top: 14px; }

.dealsSection {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

/* Prevent underline from the anchor row, but allow <s>/<strike> inside */
.dealRow {
  text-decoration: none;
}

.dealName,
.dealPriceSmall,
.dealChip {
  text-decoration: none;
}

/* Ensure old prices render with strikethrough */
.dealRow s,
.dealRow strike {
  text-decoration: line-through !important;
}

/* ================================ */
/* Featured Deals Horizontal Scroll */
/* ================================ */

.dealsSection--featured {
  margin-left: -16px; /* full-bleed */
  margin-right: -16px;
}

.dealsSection--featured .sectionTitle {
  padding-left: 16px;
}

.featuredScroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 12px 16px 16px;
  height: 250px;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 16px;
}

.featuredScroll::-webkit-scrollbar {
  display: none;
}

/* Featured deal card: near full-width carousel */
.featuredScroll .dealRow {
  flex: 0 0 calc(100vw - 56px); /* full width with a small peek */
  height: 100%;
  border-radius: 16px;
  padding: 16px;
  position: relative;
  display: block; /* we'll position content manually */
  scroll-snap-align: start;
  margin-bottom: 0; /* override list spacing */
}

/* Place main content at the bottom with padding */
.featuredScroll .dealRow:not(.featuredCard) .dealLeft {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 62px; /* leaves room for the chip */
  display: flex;
  align-items: center;
  gap: 12px;
}

.featuredScroll .dealTextCol {
  min-width: 0;
}

/* Chip pinned to bottom-left */
.featuredScroll .dealRow:not(.featuredCard) .dealChip {
  position: absolute;
  left: 16px;
  bottom: 16px;
}

/* Ensure icon stays the same size and is crisp */
.featuredScroll .dealIcon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

/* Slightly larger title in featured cards */
.featuredScroll .dealName {
  font-size: 15px;
}

/* Keep price line readable, allow strike-through */
.featuredScroll .dealPriceSmall {
  font-size: 12px;
}

/* ===== New Featured background + bottom bar overlay ===== */
.featuredScroll .dealRow.featuredCard {
  height: 250px;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  overflow: hidden;
}

.featuredScroll .dealRow.featuredCard::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.15) 55%, rgba(0,0,0,0.65) 100%);
  pointer-events: none;
}

.featuredScroll .dealRow.featuredCard > * {
  z-index: 1;
}

.featuredBadge {
  position: absolute;
  top: 0px;
  left: 0px;
  padding: 8px 10px;
  background: rgba(255, 120, 60, 0.95);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
}

/* UPDATED featured bottom bar */
.featuredBottomBar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(0,0,0,0.58);
  border: 1px solid rgba(255,255,255,0.14);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 28px rgba(0,0,0,0.35);
}

/* NEW: Featured readability tweaks */
.featuredScroll .dealRow.featuredCard .dealName,
.featuredScroll .dealRow.featuredCard .dealPriceSmall {
  text-shadow: 0 2px 8px rgba(0,0,0,0.55);
  overflow: hidden;
  text-overflow: ellipsis;
}

.featuredScroll .dealRow.featuredCard .dealChip {
  padding: 10px 16px;
  font-size: 14px;
}

.featuredScroll .dealRow.featuredCard .dealLeft {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.featuredScroll .dealRow.featuredCard .dealChip {
  position: static;
  left: auto;
  bottom: auto;
}

/* ================================ */
/* Fullscreen Overlay (#myOverlay)  */
/* ================================ */

/* ---- Overlay background variants ---- */
#myOverlay.overlay--green {
  background: #2f6f4a; /* same green as top deals banner */
}

#myOverlay.overlay--grey {
  background: #2f2f2f; /* same grey as previous deals banner */
}

/* ---- Fullscreen overlay ---- */
#myOverlay {
  border: none;
  padding: 0;
  margin: 0;
  position: fixed;
  inset: 0;
  width: 100dvw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  background: rgba(0, 0, 0, 1);
  color: #fff;
  display: none;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  z-index: 99999;
}

#myOverlay[open] {
  display: flex;
}

#myOverlay::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.close-x {
  z-index: 3;
  pointer-events: auto;
  position: absolute;
  top: calc(env(safe-area-inset-top) + 16px);
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}

.overlayBottomBar {
  z-index: 2;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(86px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

/* Bottom bar tint follows overlay type */
#myOverlay.overlay--green .overlayBottomBar {
  background: rgba(47, 111, 74, 0.95);
  border-top: 1px solid rgba(255,255,255,0.10);
}

#myOverlay.overlay--grey .overlayBottomBar {
  background: rgba(47, 47, 47, 0.95);
  border-top: 1px solid rgba(255,255,255,0.10);
}

.overlayStoreFixed {
  width: 100%;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
  color: #fff;
}

.overlayStoreIcon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
}

.overlayStoreLabel {
  font-size: 14px;
  font-weight: 800;
  opacity: 0.9;
}

.overlayStoreSub {
  font-size: 16px;
  font-weight: 900;
}

.overlayScrollArea {
  z-index: 1;
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-left: 20px;
  padding-right: 20px;
  padding-top: calc(env(safe-area-inset-top) + 70px);
  padding-bottom: calc(86px + env(safe-area-inset-bottom) + 16px);
}

/* Center hero icon above title */
.overlayHero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
}

.overlayHeroIconWrap {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
}

.overlayHeroIcon {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  object-fit: cover;
  display: block;
}

/* Countdown pill under the hero icon */
.overlayTimer {
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 900;
  letter-spacing: 0.6px;
  font-size: 16px;
  line-height: 1;
  text-align: center;
}

/* Deal banner inside overlay (reuses home dealRow styles) */
.overlayDealBanner {
  width: 100%;
  max-width: 560px;
  margin-top: 10px;
  cursor: pointer;
}

/* .overlayDealBanner .dealRow { pointer-events: none; } -- removed to allow clicks */

.overlayScrollArea h2 {
  margin: 0 0 12px 0;
  font-size: 24px;
  font-weight: 900;
  text-align: center;
}

.overlayScrollArea p {
  margin: 0 0 14px 0;
  line-height: 1.55;
  font-size: 16px;
  opacity: 0.95;
}

.overlayScrollArea a,
.overlayScrollArea a:visited {
  color: orange;
}

.overlayScrollArea a:hover {
  color: darkorange;
}

.dealChip--request::after {
  content: " ✉️"; /* or " 📩" */
  margin-left: 6px;
}

/* ================================ */
/* Refresh button (Today header)     */
/* ================================ */

.refreshDealsBtn {
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
}

.refreshDealsBtn:hover {
  background: rgba(255,255,255,0.18);
}

.refreshDealsBtn:active {
  transform: scale(0.96);
  background: rgba(255,255,255,0.22);
}

.refreshDealsBtn:focus {
  outline: none;
}

.refreshDealsBtn:focus-visible {
  outline: 2px solid rgba(255,255,255,0.55);
  outline-offset: 2px;
}