/*
 * Deal tile refresh (2026-11). Loaded after each page's own styles on /deals and the city pages.
 * Sizes are in rem/em so tiles grow with the visitor's text-size setting.
 */
article.deal-card {
  background: #FFFDF8;
  border: 1px solid rgba(229, 221, 210, 0.85);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(15, 36, 25, 0.08);
  cursor: pointer;
}
article.deal-card.trending { box-shadow: 0 0 0 1.5px rgba(196, 92, 38, 0.35), 0 6px 24px rgba(15, 36, 25, 0.08); }

/* ---------- photo and its corner labels ---------- */
article.deal-card .deal-card-img { position: relative; height: 180px; overflow: hidden; }
article.deal-card .deal-card-img > img { width: 100%; height: 100%; object-fit: cover; display: block; }
article.deal-card .deal-type-pill,
article.deal-card .deal-card-img .badge-trending,
article.deal-card .deal-card-img .deal-discount {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(15, 36, 25, 0.25);
}
article.deal-card .deal-type-pill {
  left: 10px;
  top: 10px;
  font-size: min(0.6875rem, 13.75px);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.45em 0.9em;
}
.deal-type-dotw { background: #1A3A2A; color: #FFFFFF; }
.deal-type-daily { background: #C9A84C; color: #0F2419; }
.deal-type-weekly { background: #FFFDF8; color: #1A3A2A; box-shadow: inset 0 0 0 1.5px #1A3A2A, 0 2px 8px rgba(15, 36, 25, 0.25) !important; }
.deal-type-ongoing { background: #0F2419; color: #E8CF7E; box-shadow: inset 0 0 0 1.5px #C9A84C, 0 2px 8px rgba(15, 36, 25, 0.25) !important; }
article.deal-card .deal-card-img .badge-trending {
  right: 10px;
  top: 10px;
  display: inline-flex;
  gap: 0.35em;
  align-items: center;
  margin: 0;
  border: 1px solid rgba(196, 92, 38, 0.4);
  color: #7A3418;
  background: #FBEEE6;
  font-size: min(0.75rem, 15px);
  font-weight: 700;
  padding: 0.4em 0.8em;
}
article.deal-card .deal-card-img .deal-discount {
  right: 10px;
  bottom: 10px;
  top: auto;
  background: #C9A84C;
  color: #0F2419;
  font-size: min(1.125rem, 22.5px);
  font-weight: 700;
  padding: 0.5em 0.9em;
  box-shadow: 0 2px 10px rgba(15, 36, 25, 0.3);
}
/* Very large text: keep the photo labels from colliding. */
@media (max-width: 420px) {
  html.cc-text-xl article.deal-card .badge-trending-word { display: none; }
}

/* ---------- body ---------- */
article.deal-card .deal-card-body { padding: 1rem; display: flex; flex-direction: column; gap: 0.625rem; flex: 1; }
article.deal-card .deal-badges { display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; margin: 0; min-height: 1.5rem; }
article.deal-card .deal-card-category {
  color: #8A6D1F;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
}
article.deal-card .deal-chip {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: rgba(26, 58, 42, 0.1);
  color: #1A3A2A;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  line-height: 1;
  padding: 0;
  border: 0;
}
article.deal-card .deal-chip svg { width: 0.95em; height: auto; }
article.deal-card .deal-chip.badge-pet svg { width: 0.875rem; height: 0.875rem; }
article.deal-card .chip-veteran svg { width: 0.95rem; height: 0.65rem; border-radius: 1.5px; }

article.deal-card .deal-head { display: flex; flex-direction: column; gap: 0.25rem; }
article.deal-card h3 {
  margin: 0;
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.3;
  color: #1A3A2A;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
article.deal-card h3 a { color: inherit; text-decoration: none; }
article.deal-card h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
article.deal-card h3 a:focus-visible { outline: 2px solid #C9A84C; outline-offset: 2px; border-radius: 4px; }
article.deal-card .deal-hours { margin: 0; font-size: 0.8125rem; line-height: 1.5; color: #6B7068; }
article.deal-card .deal-hours .open-now,
article.deal-card .deal-hours .open-badge {
  display: inline-block;
  padding: 0.1em 0.55em;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #E3EFE6;
  color: #1A3A2A;
  margin-right: 0.35em;
}
article.deal-card .deal-hours .open-badge:empty { display: none; }
article.deal-card .deal-hours .open-closed { background: rgba(0, 0, 0, 0.06); color: #5C635A; }
article.deal-card .deal-hours .open-now + .deal-next::before { content: "· "; }
/* No hours known: "Closed" alone, never a dangling "·". */
article.deal-card .deal-hours .open-now + .deal-next:empty::before { content: none; }

/* Always two lines tall (so tiles line up); a one-line deal sits vertically centered, still left-aligned. */
article.deal-card .deal-offer {
  padding: 0.625rem 0.75rem;
  background: #F6F1E4;
  border-radius: 10px;
  box-sizing: border-box;
  min-height: calc(2 * 1.4 * 0.9375rem + 1.25rem);
  display: flex;
  align-items: center;
}
article.deal-card .deal-offer p {
  margin: 0;
  width: 100%;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  color: #1A3A2A;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

article.deal-card .deal-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.375rem;
  row-gap: 0.125rem;
  font-size: 0.85rem;
  color: #0F2419;
  margin: 0;
  padding: 0;
  border: 0;
  justify-content: flex-start;
}
article.deal-card .deal-sep { color: #8A8F86; }
article.deal-card .near-distance { font-weight: 600; margin-right: 0.25rem; }
article.deal-card .deal-countdown {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
  font-size: 1em;
  font-weight: 600;
  color: #5C635A;
}
article.deal-card .deal-countdown[hidden] { display: none; }
article.deal-card .deal-countdown .cd-dot { width: 6px; height: 6px; border-radius: 999px; background: #C9A84C; flex: 0 0 6px; animation: none; }
article.deal-card .deal-countdown.urgent .cd-dot { background: #C45C26; }
article.deal-card .deal-countdown.ongoing .cd-dot { background: #2E7D4F; }
article.deal-card .deal-countdown.expired { color: #8A8F86; }

/* ---------- actions ---------- */
article.deal-card .deal-card-actions { display: flex; gap: 0.5rem; align-items: center; margin-top: auto; padding-top: 0.25rem; }
article.deal-card .deal-card-actions .btn { flex: 1 1 auto; min-height: 2.75rem; font-size: 0.95rem; justify-content: center; }
article.deal-card .icon-btn {
  position: relative;
  flex: 0 0 2.75rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1.5px solid #CFC7B6;
  background: #FFFDF8;
  font-size: 0;
  color: transparent;
  cursor: pointer;
}
article.deal-card .icon-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.3rem;
  height: 1.3rem;
  background: #1A3A2A;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20s-7-4.4-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.6-7 10-7 10z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20s-7-4.4-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.6-7 10-7 10z'/%3E%3C/svg%3E") center / contain no-repeat;
}
article.deal-card .icon-btn:hover { border-color: #C9A84C; }
article.deal-card .icon-btn.saved { background: #FBF3DC; border-color: #C9A84C; }
article.deal-card .icon-btn.saved::before {
  background: #C9A84C;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black' stroke='black' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M12 20s-7-4.4-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.6-7 10-7 10z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black' stroke='black' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M12 20s-7-4.4-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.6-7 10-7 10z'/%3E%3C/svg%3E");
}
article.deal-card .icon-btn:focus-visible { outline: 2px solid #C9A84C; outline-offset: 2px; }

@media (max-width: 600px) {
  article.deal-card .deal-card-img { height: 200px; }
  article.deal-card .deal-card-actions .btn { min-height: 3rem; font-size: 1rem; }
  article.deal-card .icon-btn { flex-basis: 3rem; width: 3rem; height: 3rem; }
}

/* ---------- compact list view (deals page) ---------- */
body.deals-compact article.deal-card .deal-type-pill,
body.deals-compact article.deal-card .deal-card-img .badge-trending,
.deals-grid.deals-compact article.deal-card .deal-type-pill,
.deals-grid.deals-compact article.deal-card .deal-card-img .badge-trending { display: none; }
body.deals-compact article.deal-card .deal-card-img,
.deals-grid.deals-compact article.deal-card .deal-card-img { height: 88px; }
body.deals-compact article.deal-card .deal-card-img .deal-discount,
.deals-grid.deals-compact article.deal-card .deal-card-img .deal-discount {
  position: absolute;
  left: 50%;
  right: auto;
  top: auto;
  bottom: -8px;
  transform: translateX(-50%);
  z-index: 3;
  height: auto;
  background: #C9A84C;
  color: #0F2419;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 0.2em 0.55em;
  box-shadow: 0 1px 4px rgba(15, 36, 25, 0.25);
}
body.deals-compact article.deal-card .deal-offer,
.deals-grid.deals-compact article.deal-card .deal-offer { padding: 0; background: none; min-height: 0; display: block; }
body.deals-compact article.deal-card .deal-offer p,
.deals-grid.deals-compact article.deal-card .deal-offer p {
  min-height: 0;
  font-size: 0.82rem;
  font-weight: 400;
  color: #5C635A;
  -webkit-line-clamp: 1;
}
body.deals-compact article.deal-card .deal-head,
.deals-grid.deals-compact article.deal-card .deal-head { gap: 0; }
body.deals-compact article.deal-card h3,
.deals-grid.deals-compact article.deal-card h3 { -webkit-line-clamp: 1; }
body.deals-compact article.deal-card .deal-card-actions .btn,
.deals-grid.deals-compact article.deal-card .deal-card-actions .btn { display: none !important; }
body.deals-compact article.deal-card .icon-btn,
.deals-grid.deals-compact article.deal-card .icon-btn { border: none; background: transparent; }
body.deals-compact article.deal-card .deal-card-body,
.deals-grid.deals-compact article.deal-card .deal-card-body { padding: 0; gap: 0.15rem; }
body.deals-compact article.deal-card,
.deals-grid.deals-compact article.deal-card { border-radius: 0; box-shadow: none; background: transparent; border: none; border-bottom: 1px solid #DCD6CA; }

/* ---------- deals page filter bar (Saved, deal type, highlights, active chips) ---------- */
.saved-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1.5px solid #C9A84C;
  background: #FBF3DC;
  color: #1A3A2A;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
}
.saved-toggle.active { background: #1A3A2A; color: #FFFDF8; border-color: #1A3A2A; }
.saved-toggle .saved-heart {
  width: 1.1rem;
  height: 1.1rem;
  background: #C9A84C;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 20s-7-4.4-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.6-7 10-7 10z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 20s-7-4.4-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.6-7 10-7 10z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.saved-toggle .saved-count {
  min-width: 1.4em;
  padding: 0 0.45em;
  border-radius: 999px;
  background: #FFFDF8;
  border: 1px solid #C9A84C;
  color: #1A3A2A;
  font-size: 0.75rem;
  line-height: 1.4;
  text-align: center;
}
.saved-toggle .saved-count:empty { display: none; }
.filters-toggle .filter-count.has-count {
  background: #C9A84C;
  color: #0F2419;
  border-radius: 999px;
  padding: 0 0.5em;
  font-size: 0.75rem;
  font-weight: 700;
}
.type-btn, .hl-btn { display: inline-flex; align-items: center; gap: 0.4rem; }
.type-dot { width: 10px; height: 10px; border-radius: 999px; flex: 0 0 10px; }
.type-dot-dotw { background: #1A3A2A; box-shadow: 0 0 0 1.5px #FFFDF8; }
.type-dot-daily { background: #C9A84C; }
.type-dot-weekly { background: #FFFDF8; box-shadow: inset 0 0 0 1.5px #1A3A2A; }
.type-dot-ongoing { background: #0F2419; box-shadow: inset 0 0 0 1.5px #C9A84C; }
.filters-panel .filter-btn.type-btn.active,
.filters-panel .filter-btn.hl-btn.active { background: #1A3A2A; color: #FFFDF8; border-color: #1A3A2A; opacity: 1; filter: none; }
.hl-flag { border-radius: 1.5px; }
.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0 0.25rem;
  font-size: 0.875rem;
  color: #5C635A;
}
.active-filters[hidden] { display: none; }
.active-filters-count { font-weight: 600; color: #1A3A2A; }
.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #FFFDF8;
  border: 1px solid #DCD6CA;
  border-radius: 999px;
  padding: 0.2rem 0.25rem 0.2rem 0.75rem;
  color: #1A3A2A;
  font-weight: 600;
}
.active-chip button {
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  background: transparent;
  color: #5C635A;
  font-size: 1rem;
  line-height: 1;
  border-radius: 999px;
  cursor: pointer;
}
.active-chip button:hover { background: rgba(26, 58, 42, 0.08); }
.active-clear { border: 0; background: none; color: #1A3A2A; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 0.25rem; }

/* Side gap so tiles never touch the screen edge (deals page and city pages). */
@media (max-width: 1240px) {
  .container.deals-layout { padding-left: 16px; padding-right: 16px; box-sizing: border-box; }
}

/* Members-only tiles: "Members only" for visitors, "View deal" once a member is signed in (body.is-member). */
article.deal-card .btn-member-view { display: none; }
body.is-member article.deal-card .btn-member-view { display: inline-flex; align-items: center; }

/* City page with no deals for the city yet (src/legacy/pages.ts cityDeals). */
.city-deals .city-empty { grid-column: 1 / -1; margin: 0.5rem 0 1rem; color: #5C635A; }
