/* UK FREEBIES marketplace system
   Inspired by AppSumo catalog + product detail (structure), UK Freebies brand (color).
   Avoids AppSumo yellow/blue clone and AI-slop chrome.
*/

:root {
  --ink: #111318;
  --muted: #68707D;
  --paper: #FFFFFF;
  --surface: #F7F8FA;
  --line: #E5E8EC;
  --brand: #FF4B20;
  --brand-dark: #D93616;
  --lavender: #F0F1FF;
  --deal-yellow: #FFC400;
  --success: #20A464;
  --success-bg: #DFF7E9;
  --danger-bg: #FDE8E3;
  --link: #326BFF;
  --text: var(--ink);
  --text-secondary: var(--muted);
  --text-muted: #8A929E;
  --text-faint: #A8B0BC;
  --bg: var(--surface);
  --bg-elevated: var(--paper);
  --border: var(--line);
  --border-strong: #D0D5DC;
  --ink-hover: #000;
  --accent: var(--brand);
  --accent-soft: #FFF1ED;
  --gold: var(--brand);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Inter", system-ui, sans-serif;
  --shadow-card: 0 1px 2px rgba(17,19,24,.04), 0 10px 28px rgba(17,19,24,.06);
  --container: 1200px;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
h1,h2,h3,h4 { font-family: var(--font); color: var(--ink); letter-spacing: -.02em; }
a { color: var(--link); }

/* Buttons */
.btn {
  font-weight: 700; font-size: 14px; line-height: 20px;
  padding: 12px 18px; border-radius: 10px;
}
.btn-primary, .btn-fire {
  background: var(--brand); color: #fff; border-color: var(--brand);
}
.btn-primary:hover, .btn-fire:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-ghost {
  background: var(--paper); color: var(--ink); border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--surface); }
.btn-sm { padding: 8px 12px; font-size: 13px; }
.btn-lg { padding: 14px 20px; font-size: 15px; min-height: 48px; }

/* Announcement */
.ukf-announce {
  background: #111318; color: #fff;
  font-size: 13px; font-weight: 500;
  text-align: center; padding: 8px 16px;
}
.ukf-announce a { color: var(--deal-yellow); font-weight: 700; text-decoration: none; }
.ukf-announce a:hover { text-decoration: underline; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 20px;
  height: 72px; max-width: var(--container); margin: 0 auto; padding: 0 24px;
}
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none !important; }
.logo-img { width: 36px; height: 36px; border-radius: 9px; object-fit: contain; background: transparent; box-shadow: none; }
.logo-text {
  font-size: 15px; font-weight: 700; letter-spacing: -.02em;
  color: var(--ink); text-transform: none;
}
.main-nav { display: flex; gap: 2px; margin-left: 8px; }
.nav-link {
  color: var(--ink); font-weight: 600; font-size: 14px;
  padding: 8px 12px; border-radius: 8px; text-decoration: none !important;
}
.nav-link:hover { background: var(--surface); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.search-wrap {
  background: var(--surface); border: 1px solid transparent;
  border-radius: 999px; padding: 10px 14px; min-width: 260px;
}
.search-wrap:focus-within { border-color: var(--line); background: var(--paper); }
.search-wrap input { width: 180px; font-size: 14px; }
.search-wrap kbd { display: none; }

/* Hero */
.hero {
  background: linear-gradient(180deg, var(--lavender) 0%, #fff 88%);
  padding: 48px 0 28px;
}
.hero-grid {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center;
}
.hero-kicker {
  display: inline-block; font-size: 12px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--brand);
  margin-bottom: 12px;
}
.hero h1 {
  font-size: clamp(2rem, 4.2vw, 2.75rem); font-weight: 750;
  line-height: 1.12; letter-spacing: -.03em; max-width: 16ch;
}
.hero-sub {
  color: var(--muted); font-size: 16px; line-height: 1.55;
  margin: 14px 0 22px; max-width: 34rem;
}
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; margin: 0;
  padding: 0;
}
.stat {
  padding: 16px 14px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
}
.stat:last-child { border-right: 0; }
.stat-num {
  font-size: 22px; font-weight: 750; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.stat-label {
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
}

.featured-slot { min-height: 280px; }
.featured-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-card);
  padding: 0;
}
.featured-badge {
  display: inline-block; margin: 16px 20px 0;
  background: var(--ink); color: #fff; border: 0;
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 5px 10px; border-radius: 999px;
}
.featured-media { margin: 0; border: 0; border-radius: 0; aspect-ratio: 16/10; }
.featured-card h3 { font-size: 20px; font-weight: 750; margin: 12px 20px 6px; }
.featured-card .tagline { margin: 0 20px 12px; color: var(--muted); font-size: 14px; }
.featured-card .price-row,
.featured-card .countdown,
.featured-card .modal-cta { margin-left: 20px; margin-right: 20px; }
.featured-card .modal-cta { margin-bottom: 20px; display: flex; gap: 8px; flex-wrap: wrap; }
.price-now { font-size: 28px; font-weight: 750; }
.price-was { color: var(--text-faint); text-decoration: line-through; }
.price-off {
  background: var(--danger-bg); color: var(--brand-dark);
  border: 0; font-weight: 700; font-size: 12px; padding: 4px 8px; border-radius: 999px;
}

/* Trust strip */
.ukf-trust {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  padding: 8px 0 28px;
}
.ukf-trust-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--paper);
}
.ukf-trust-item strong { display: block; font-size: 14px; font-weight: 700; color: var(--ink); }
.ukf-trust-item span { font-size: 13px; color: var(--muted); }
.ukf-trust-ico {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--surface); display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}

/* Feed toolbar */
#deals-feed { padding-top: 8px; }
.feed-toolbar {
  position: sticky; top: 72px; z-index: 40;
  background: rgba(255,255,255,.94); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 14px 0 12px; margin: 0 0 18px;
}
.feed-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title { font-size: 28px; font-weight: 750; letter-spacing: -.03em; }
.filter-bar {
  display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto;
  padding-bottom: 4px; margin-bottom: 8px; scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  background: var(--paper); border: 1px solid var(--line); color: var(--ink);
  font-weight: 600; font-size: 13px; padding: 8px 14px; border-radius: 999px;
}
.chip:hover { border-color: var(--border-strong); }
.chip.active {
  background: var(--brand); border-color: var(--brand); color: #fff;
}
.results-meta { color: var(--muted); font-size: 13px; margin: 0; }
.sort-wrap select {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
  font-weight: 600; background: var(--paper);
}

/* Cards — 4-col marketplace */
.deals-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.deal-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; padding: 0; gap: 0;
  display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  cursor: pointer;
}
.deal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: var(--border-strong);
}
.deal-media-wrap { position: relative; }
.deal-media {
  position: relative; aspect-ratio: 16/10; border: 0; border-radius: 0;
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.deal-media img { width: 100%; height: 100%; object-fit: cover; }
.deal-media--empty {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #FFF1ED, #F0F1FF);
  color: var(--brand); font-size: 2rem; font-weight: 750;
}
.deal-badges {
  position: absolute; left: 10px; top: 10px; right: 10px;
  display: flex; justify-content: space-between; gap: 8px; pointer-events: none;
}
.deal-badges .badge { pointer-events: auto; }
.deal-card > .card-body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.deal-card h3 { font-size: 16px; font-weight: 750; line-height: 1.25; margin: 0; }
.deal-card .tagline {
  color: var(--muted); font-size: 13px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.6em; flex-grow: 1;
}
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stars { color: var(--deal-yellow); font-size: 12px; letter-spacing: 0; }
.stars small { color: var(--muted); margin-left: 4px; font-weight: 600; }
.card-price-row { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 4px; }
.card-price { font-size: 22px; font-weight: 750; letter-spacing: -.02em; }
.card-price.free { color: var(--success); }
.card-was { color: var(--text-faint); text-decoration: line-through; font-size: 13px; }
.card-off { color: var(--brand-dark); font-weight: 700; font-size: 12px; }
.card-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.card-actions .btn { width: 100%; }
.card-actions .btn-ghost { order: 2; }
.hot-meter { display: none; } /* quieter marketplace — votes stay in modal */
.card-top, .badge-row { display: none; } /* badges move onto media */

.badge {
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  padding: 4px 8px; border-radius: 999px; border: 0;
}
.badge-ltd { background: var(--ink); color: #fff; }
.badge-free, .badge-free-forever { background: var(--success-bg); color: var(--success); }
.badge-trial { background: #EEF2FF; color: #4338CA; }
.badge-expiring { background: var(--danger-bg); color: var(--brand-dark); }

/* Freebie strip */
.freebie-strip { margin-top: 48px; }
.freebie-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 14px;
}
.freebie-mini, .free-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--paper);
}
.freebie-mini:hover, .free-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-card); }

/* How / FAQ */
.how-it-works, .faq { margin-top: 56px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.step {
  border: 1px solid var(--line); border-radius: 14px; padding: 20px; background: var(--paper);
}
.step-num {
  width: 28px; height: 28px; border-radius: 8px; background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 750; font-size: 13px; margin-bottom: 10px;
}
.faq details {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  margin-bottom: 10px; background: var(--paper);
}
.faq summary { font-weight: 700; cursor: pointer; }

/* Footer */
.site-footer {
  margin-top: 64px; background: #111318; color: #C8CDD5; border-top: 0;
}
.site-footer a { color: #fff; }
.site-footer .footer-logo, .site-footer .logo-text { color: #fff; }
.footer-grid { padding: 40px 24px; }
.footer-brand p, .affiliate-note { color: #9AA3AF; }
.footer-base { border-top: 1px solid #2A2F38; }
.footer-base p { color: #7A8494; }

/* Claim page — two column */
.claim-page { background: var(--paper); }
.claim-shell {
  max-width: var(--container); margin: 0 auto; padding: 28px 24px 100px;
  display: grid; grid-template-columns: 1.3fr .7fr; gap: 32px; align-items: start;
}
.claim-layout { max-width: none; padding: 0; }
.claim-main { min-width: 0; }
.claim-panel {
  position: sticky; top: 88px;
  border: 1px solid var(--line); border-radius: 16px; padding: 20px;
  background: var(--paper); box-shadow: var(--shadow-card);
}
.claim-crumb { font-size: 13px; color: var(--muted); margin-bottom: 16px; text-transform: none; letter-spacing: 0; }
.claim-crumb a { color: var(--link); }
.claim-media { aspect-ratio: 16/10; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); margin: 0 0 16px; }
.claim-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin-bottom: 20px; }
.claim-gallery img { aspect-ratio: 16/10; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.claim-hero { border-bottom: 0; padding-bottom: 0; margin-bottom: 8px; }
.claim-hero h1 {
  font-size: clamp(1.75rem, 3vw, 2.25rem); font-weight: 750; margin: 10px 0 8px; line-height: 1.15;
}
.claim-tagline { font-size: 15px; color: var(--muted); }
.claim-body { font-size: 15px; line-height: 1.7; color: var(--muted); min-height: 0; }
.claim-body h3 { color: var(--ink); font-size: 18px; font-weight: 750; margin-top: 28px; }
.claim-sticky { display: none; } /* desktop uses side panel */
.claim-panel .card-price { font-size: 28px; }
.claim-panel .btn-primary { width: 100%; margin-top: 12px; }
.claim-panel .guarantee-list {
  list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px;
}
.claim-panel .guarantee-list li {
  font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start;
}
.claim-disclosure {
  margin: 16px 0; padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; border-left: 3px solid var(--brand);
}
.claim-disclosure p { font-size: 12px; color: var(--muted); margin: 0; }

/* Modal */
.modal {
  background: var(--paper); border-radius: 16px; border: 1px solid var(--line);
}
.modal-cta .btn-primary { min-width: 140px; }

/* Ads stay quiet */
.ukf-ad-slot:not([hidden]) {
  border-style: dashed; border-color: var(--line); background: var(--surface);
}

@media (max-width: 1199px) {
  .deals-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .hero-grid, .claim-shell { grid-template-columns: 1fr; }
  .claim-panel { position: static; }
  .deals-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stats, .ukf-trust { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2n) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .freebie-row, .steps { grid-template-columns: 1fr 1fr; }
  .main-nav { display: none; }
  .menu-toggle { display: block; margin-left: auto; }
  .header-actions .btn { display: none; }
  .header-inner { height: 64px; }
  .feed-toolbar { top: 64px; }
  .claim-sticky { display: block; }
}
@media (max-width: 640px) {
  .deals-grid, .freebie-row, .steps, .ukf-trust { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .container, .header-inner, .claim-shell { padding-left: 16px; padding-right: 16px; }
  .search-wrap { min-width: 0; }
  .search-wrap input { width: 110px; }
  .hero h1 { max-width: none; }
  .deal-media-wrap { position: relative; }
.deal-media { aspect-ratio: 16/9; }
}

/* ========== 2026-09 fixes: mobile covers, modal, contrast, featured ========== */

/* Kill hot meter everywhere */
.hot-meter, .temp-badge { display: none !important; }

.badge-featured {
  background: #111318; color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; padding: 4px 8px; border-radius: 999px;
}
.deal-card.is-featured { border-color: #111318; }

/* Modal contrast + responsive */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(17, 19, 24, .55);
  backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 16px; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-overlay[hidden] { display: none !important; }
.modal {
  background: #FFFFFF; color: #111318;
  border: 1px solid #E5E8EC; border-radius: 16px;
  max-width: min(640px, 100%); width: 100%;
  max-height: min(92vh, 900px); overflow-y: auto;
  padding: 28px 24px 24px; position: relative;
  box-shadow: 0 20px 50px rgba(17,19,24,.22);
  margin: auto;
}
.modal h2, .modal #modal-title { color: #111318; font-weight: 750; }
.modal .tagline, .modal .description { color: #4B5563; }
.modal .card-cat {
  color: #111318; background: #F7F8FA; border: 1px solid #E5E8EC;
}
.modal-close {
  position: sticky; float: right; top: 0; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  background: #F7F8FA; border: 1px solid #E5E8EC; color: #111318;
  font-size: 1.25rem; line-height: 1; cursor: pointer;
}
.modal-close:hover { background: #EEF0F3; }
.verdict-box { background: #F7F8FA; border: 1px solid #E5E8EC; color: #111318; }
.verdict-box p, .verdict-box strong { color: #111318; }
.score-ring { color: #111318; border-color: #D0D5DC; background: #fff; }
.price-off--free {
  background: #DFF7E9 !important; color: #15803D !important; border: 0 !important;
}
.modal-fine { color: #6B7280; }
.proscons li { color: #374151; }
body.ukf-modal-open { overflow: hidden; touch-action: none; }

/* Card / button contrast hardening */
.deal-card h3, .featured-card h3, .card-price { color: #111318; }
.deal-card .tagline, .featured-card .tagline { color: #4B5563; }
.card-was, .price-was { color: #6B7280; }
.btn-ghost { color: #111318; background: #fff; border-color: #D0D5DC; }
.btn-primary { color: #fff; }

/* ----- Mobile cover images (critical) -----
   Flex column + height:100% img + global height:auto can collapse
   media to 0 on small viewports. Force a real box + visible img. */
.deal-media-wrap {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
  align-self: stretch;
  min-height: 140px;
  overflow: hidden;
  background: #F7F8FA;
}
.deal-media,
.deal-card .deal-media,
.featured-media,
.modal-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 140px;
  height: auto;
  flex-shrink: 0;
  overflow: hidden;
  background: #F0F1FF;
}
.deal-media img,
.deal-card .deal-media img,
.featured-media img,
.modal-media img,
.claim-media img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
/* Absolute img needs positioned parent — ensure deal-media is positioning context */
.deal-media, .featured-media, .modal-media, .claim-media { position: relative; }

@media (max-width: 640px) {
  .deal-media-wrap,
  .deal-media,
  .deal-card .deal-media {
    min-height: 168px;
    aspect-ratio: 16 / 9;
    height: auto;
  }
  .deal-media img,
  .deal-card .deal-media img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
  .modal {
    padding: 20px 16px 20px;
    max-height: 94vh;
    border-radius: 14px;
  }
  .modal-cta .btn { min-width: 0; flex: 1 1 100%; }
  .proscons { grid-template-columns: 1fr; }
  /* Don't pad the media wrap — full-bleed covers on cards */
  .deal-card > .deal-media-wrap {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0;
  }
  .deal-card > .card-body { padding-left: 14px; padding-right: 14px; padding-bottom: 14px; }
}

/* Override style.css mobile padding that inset media */
.deal-card > .deal-media-wrap {
  padding-left: 0 !important;
  padding-right: 0 !important;
}
