/* Deals module shell — island styles ship with js/bundles/deals.js */

#view-deals {
  min-height: 0;
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

#deals-root {
  min-height: 100%;
}

#deals-root:empty::before {
  content: 'Loading Deals…';
  display: block;
  padding: 32px 20px;
  color: var(--ps, #64748b);
  font-family: Outfit, system-ui, sans-serif;
  font-weight: 600;
}

/* Bundle load failure — shell CSS only (island JS may be missing). */
.deals-bridge-err {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(52vh, 420px);
  padding: 28px 20px calc(28px + var(--bottom-nav-h, 0px) + env(safe-area-inset-bottom, 0px));
  font-family: Outfit, system-ui, sans-serif;
  background:
    radial-gradient(90% 70% at 10% 0%, rgba(37, 99, 235, 0.08), transparent 55%),
    radial-gradient(80% 60% at 100% 20%, rgba(251, 191, 36, 0.12), transparent 50%);
}

.deals-bridge-err-card {
  width: min(100%, 420px);
  padding: 28px 24px 30px;
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92));
  border: 1px solid rgba(30, 58, 138, 0.1);
  box-shadow: 0 16px 48px rgba(30, 58, 138, 0.1);
  text-align: left;
}

.deals-bridge-err-eyebrow {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #2563eb;
}

.deals-bridge-err-title {
  margin: 0 0 10px;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #0f172a;
}

.deals-bridge-err-lead {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.55;
  color: #64748b;
}

.deals-app {
  --deal-radius: 18px;
  --deal-shadow: 0 12px 40px rgba(30, 58, 138, 0.12);
  font-family: Outfit, system-ui, sans-serif;
  color: var(--ps, #334155);
  padding: 0 0 calc(24px + var(--bottom-nav-h, 0px) + env(safe-area-inset-bottom, 0px));
  max-width: 1280px;
  margin: 0 auto;
}

.deals-hero {
  position: relative;
  overflow: hidden;
  border-radius: 0 0 24px 24px;
  padding: 28px 20px 32px;
  margin: 0 0 18px;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(251, 191, 36, 0.28), transparent 55%),
    linear-gradient(135deg, #1e3a8a 0%, #2563eb 48%, #1d4ed8 100%);
  color: #fff;
  box-shadow: var(--deal-shadow);
}

.deals-hero-orb {
  position: absolute;
  right: -40px;
  top: -30px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 70%);
  pointer-events: none;
}

.deals-hero-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.deals-hero-title {
  margin: 0 0 8px;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.deals-hero-lead {
  margin: 0;
  max-width: 36rem;
  font-size: 15px;
  line-height: 1.45;
  opacity: 0.92;
}

.deals-hero-disclaimer {
  margin: 10px 0 0;
  max-width: 40rem;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0.78;
}

.deals-filters {
  position: sticky;
  top: 8px;
  z-index: 5;
  margin: 0 12px 16px;
  padding: 14px;
  border-radius: var(--deal-radius);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(37, 99, 235, 0.12);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

.deals-filters-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.deal-search {
  flex: 1 1 220px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid transparent;
}

.deal-search:focus-within {
  border-color: var(--pg, #2563eb);
  background: #fff;
}

.deal-search i {
  color: var(--pg, #2563eb);
}

.deal-search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  min-width: 0;
}

.deal-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.deal-sort-lbl {
  color: #64748b;
  font-weight: 600;
}

.deal-sort select,
.deal-retailer select {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
}

.deal-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.deal-filter-chip {
  appearance: none;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.deal-filter-chip:hover {
  transform: translateY(-1px);
  border-color: #93c5fd;
}

.deal-filter-chip.on {
  background: linear-gradient(135deg, var(--pg, #2563eb), var(--pgd, #1d4ed8));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}

.deal-filter-chip--soft.on {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
}

.deal-retailer-row {
  display: block;
  margin-top: 4px;
}

.deal-retailer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.deal-sliders-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 12px;
}

@media (min-width: 768px) {
  .deal-sliders-row {
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }
}

.deal-slider-wrap {
  min-width: 0;
}

.deal-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.deal-slider-head strong {
  font-size: 16px;
  color: var(--pg, #2563eb);
  text-transform: none;
  letter-spacing: 0;
}

.deal-slider {
  width: 100%;
  accent-color: var(--pg, #2563eb);
  height: 28px;
  cursor: pointer;
}

.deal-slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.deal-filters-count {
  margin: 12px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

.deals-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 0 12px;
}

@media (min-width: 768px) {
  .deals-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 16px;
  }

  .deals-hero {
    margin: 0 16px 18px;
    border-radius: 24px;
    padding: 36px 32px;
  }

  .deals-filters {
    margin: 0 16px 18px;
  }
}

@media (min-width: 1024px) {
  .deals-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
}

@media (min-width: 1280px) {
  .deals-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.deal-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--deal-radius);
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.deal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.16);
}

.deal-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(160deg, #e2e8f0, #f8fafc);
  overflow: hidden;
}

.deal-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.deal-card-media-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff;
  font-size: 42px;
  font-weight: 800;
}

.deal-card-pct {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1e293b;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
}

.deal-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 14px 16px;
  flex: 1;
}

.deal-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.deal-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.deal-chip--cat {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.deal-chip--retailer {
  background: rgba(30, 58, 138, 0.1);
  color: #1e3a8a;
}

.deal-chip--sport {
  background: rgba(251, 191, 36, 0.22);
  color: #92400e;
}

.deal-card-brand {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.deal-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.deal-card-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
}

.deal-card-price {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.deal-card-was {
  font-size: 14px;
  color: #94a3b8;
  text-decoration: line-through;
}

.deal-card-posted {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
}

.deal-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
}

.deal-card-views {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  user-select: none;
}

.deal-card-views i {
  font-size: 16px;
  stroke-width: 1.75;
}

.deal-card-views-count {
  letter-spacing: 0.01em;
}

.deal-card-votes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.deal-vote {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.deal-vote i {
  font-size: 16px;
}

.deal-vote-count {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  opacity: 0.88;
  letter-spacing: 0;
}

.deal-vote:hover {
  transform: translateY(-1px);
  border-color: #93c5fd;
  background: #fff;
}

.deal-vote--works.on {
  border-color: transparent;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.28);
}

.deal-vote--expired.on {
  border-color: transparent;
  background: linear-gradient(135deg, #64748b, #475569);
  color: #fff;
  box-shadow: 0 6px 16px rgba(71, 85, 105, 0.28);
}

.deal-card--expired {
  opacity: 0.78;
}

.deal-card--expired .deal-card-media img {
  filter: grayscale(0.35);
}

.deal-card-cta {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--pg, #2563eb), var(--pgd, #1d4ed8));
  color: #fff !important;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.deal-card-cta:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.deals-status,
.deals-empty {
  text-align: center;
  padding: 48px 20px;
  color: #64748b;
}

.deals-empty i {
  font-size: 36px;
  color: var(--pg, #2563eb);
  display: block;
  margin-bottom: 10px;
}

.deals-empty p {
  margin: 0 0 14px;
  font-weight: 600;
}

/* Gradient theme ambient */
body.royal-cobalt-gradient .deals-filters {
  background: rgba(255, 255, 255, 0.82);
}

body.royal-cobalt-gradient .deal-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

