/*
Theme Name: DealstackPro (ReHub Child)
Theme URI: https://dealstackpro.com
Description: DealstackPro homepage + store page redesign, implementing the "cashback platform" design system (Work Sans / Lora, teal + gold palette). Built on top of the Rehub theme. Pulls stores/offers from the dealstore taxonomy + real post meta.
Author: OntoWeb
Template: rehub-theme
Version: 2.0.0
Text Domain: dealstackpro-child
*/

:root {
  /* --- Core palette, ported 1:1 from the approved design tokens --- */
  --dsp-navy: oklch(0.24 0.04 175);          /* deep teal-navy — header, CTAs, hero */
  --dsp-navy-soft: oklch(0.32 0.06 175 / 0.5);
  --dsp-teal: oklch(0.58 0.1 165);           /* verified / accent teal */
  --dsp-teal-deep: oklch(0.32 0.05 175);     /* link color */
  --dsp-bg: oklch(0.985 0.005 95);           /* page background, warm off-white */
  --dsp-card: oklch(0.99 0.004 90);          /* card surface */
  --dsp-border: oklch(0.91 0.01 95);
  --dsp-border-soft: oklch(0.9 0.01 95);
  --dsp-text: oklch(0.22 0.03 175);
  --dsp-text-muted: oklch(0.5 0.02 175);
  --dsp-text-mute-2: oklch(0.55 0.02 175);
  --dsp-text-mute-3: oklch(0.4 0.02 175);

  /* Badge pairs — cashback (teal) vs coupon (gold) */
  --dsp-badge-cash-bg: oklch(0.9 0.05 165);
  --dsp-badge-cash-text: oklch(0.32 0.08 165);
  --dsp-badge-coupon-bg: oklch(0.9 0.05 85);
  --dsp-badge-coupon-text: oklch(0.35 0.08 85);

  /* Trust panel */
  --dsp-trust-bg: oklch(0.96 0.01 165 / 0.5);
  --dsp-trust-border: oklch(0.88 0.02 165);

  /* Legacy variable names kept so every existing render function keeps
     working without individually touching each one — just repointed
     at the new palette. */
  --dsp-purple-dark: var(--dsp-navy);
  --dsp-purple: var(--dsp-teal-deep);
  --dsp-purple-light: var(--dsp-teal);
  --dsp-blue: var(--dsp-teal);
  --dsp-gold: oklch(0.78 0.1 85);
  --dsp-gold-text: oklch(0.3 0.06 85);

  --dsp-font-heading: 'Work Sans', sans-serif;
  --dsp-font-body: 'Work Sans', sans-serif;
  --dsp-font-serif: 'Lora', serif;

  --dsp-radius-lg: 20px;
  --dsp-radius-md: 16px;
  --dsp-radius-sm: 10px;
}

body.dsp-home,
body.dsp-store,
body.dsp-page-shell {
  margin: 0;
  background: var(--dsp-bg);
  font-family: var(--dsp-font-body);
  color: var(--dsp-text);
}
body.dsp-home a, body.dsp-store a, body.dsp-page-shell a { color: var(--dsp-teal-deep); text-decoration: none; }
body.dsp-home a:hover, body.dsp-store a:hover, body.dsp-page-shell a:hover { color: var(--dsp-teal); }
body.dsp-home ::selection, body.dsp-store ::selection { background: oklch(0.58 0.1 165 / 0.25); }
body.dsp-home *, body.dsp-store *, body.dsp-page-shell * { box-sizing: border-box; }

@keyframes dspFloat { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-10px); } }
@keyframes dspStampPop { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes dspCodeReveal { 0% { filter: blur(10px); opacity: 0.3; letter-spacing: 0.3em; } 100% { filter: blur(0); opacity: 1; letter-spacing: 0.12em; } }

.dsp-card { transition: transform .18s, box-shadow .18s; }
.dsp-pill-btn:hover { background: var(--dsp-navy) !important; border-color: var(--dsp-navy) !important; color: #fff !important; }

/* Scroll-reveal */
.dsp-reveal { opacity: 0; transform: translateY(30px); transition: opacity .7s cubic-bezier(0.16,1,0.3,1), transform .7s cubic-bezier(0.16,1,0.3,1); }
.dsp-reveal.dsp-in-view { opacity: 1; transform: translateY(0); }

.dsp-hero-arrow:hover { background: rgba(255,255,255,0.35) !important; }

/* Nav dropdown (unchanged behavior, new hover color) */
.dsp-nav-dropdown:hover .dsp-nav-dropdown-panel, .dsp-nav-dropdown:hover > a { color: var(--dsp-navy); }
.dsp-nav-dropdown:hover .dsp-nav-dropdown-panel { display: block !important; }
.dsp-nav-dropdown-panel a:hover { background: var(--dsp-bg); color: var(--dsp-navy) !important; }
nav li.menu-item-has-children { position: relative; }
nav ul.sub-menu { display: none; position: absolute; top: 100%; left: 0; background: #fff; min-width: 220px; box-shadow: 0 16px 32px oklch(0.2 0.03 175 / 0.18); border-radius: 0 0 12px 12px; padding: 10px 0; z-index: 50; list-style: none; margin: 0; }
nav li.menu-item-has-children:hover ul.sub-menu { display: block; }
nav ul.sub-menu a { display: block; padding: 11px 22px; font-size: 14.5px; font-weight: 500; color: var(--dsp-text); text-decoration: none; }
nav ul.sub-menu a:hover { background: var(--dsp-bg); color: var(--dsp-navy); }

@media (max-width: 900px) { .dsp-two-col { grid-template-columns: 1fr !important; } }

/* ================================================================
   NEW: Category icon grid
   ================================================================ */
.dsp-cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; }
.dsp-cat-item { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 8px; border-radius: 14px; cursor: pointer; text-decoration: none; color: inherit; transition: background .15s; }
.dsp-cat-item:hover { background: oklch(0.96 0.006 95); }
.dsp-cat-icon {
  width: 104px; height: 104px; border-radius: 50% !important; overflow: hidden !important;
  background: oklch(0.94 0.008 95); display: flex; align-items: center; justify-content: center; color: var(--dsp-navy);
  border: 2px solid var(--dsp-border); box-shadow: 0 2px 10px oklch(0.3 0.04 175 / 0.06);
  transition: transform .25s cubic-bezier(0.16,1,0.3,1), border-color .25s ease, box-shadow .25s ease;
}
.dsp-cat-item:hover .dsp-cat-icon {
  transform: scale(1.06) translateY(-4px);
  border-color: var(--dsp-teal);
  box-shadow: 0 12px 28px oklch(0.3 0.04 175 / 0.16);
}
.dsp-cat-icon img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50% !important; }
.dsp-cat-label { font-size: 12.5px; font-weight: 600; text-align: center; line-height: 1.25; color: var(--dsp-text); }

/* ================================================================
   NEW: Store grid + store card ("Shop by store")
   ================================================================ */
.dsp-store-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.dsp-store-card {
  background: var(--dsp-card); border: 1px solid var(--dsp-border); border-radius: var(--dsp-radius-md);
  padding: 20px; display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: inherit;
  max-width: 340px; width: 100%;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.dsp-store-card:hover { border-color: oklch(0.75 0.03 175); box-shadow: 0 4px 18px oklch(0.3 0.04 175 / 0.08); transform: translateY(-2px); }
.dsp-store-avatar {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0; overflow: hidden;
  background: repeating-linear-gradient(135deg, oklch(0.93 0.008 95), oklch(0.93 0.008 95) 4px, oklch(0.965 0.006 95) 4px, oklch(0.965 0.006 95) 8px);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; font-family: monospace; color: var(--dsp-navy);
}
.dsp-store-avatar img { width: 100%; height: 100%; object-fit: contain; }
.dsp-store-name { font-weight: 700; font-size: 15.5px; color: var(--dsp-text); }
.dsp-store-cat { font-size: 12px; color: var(--dsp-text-muted); }
.dsp-badge { display: inline-flex; align-self: flex-start; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 700; }
.dsp-badge.is-cash { background: var(--dsp-badge-cash-bg); color: var(--dsp-badge-cash-text); }
.dsp-badge.is-coupon { background: var(--dsp-badge-coupon-bg); color: var(--dsp-badge-coupon-text); }
.dsp-verified-line { font-size: 11.5px; color: var(--dsp-text-mute-2); display: flex; align-items: center; gap: 5px; }
.dsp-store-cta, .dsp-offer-cta {
  margin-top: 2px; background: var(--dsp-navy); color: var(--dsp-bg); border: none; padding: 10px 14px; border-radius: 9px;
  font-weight: 700; font-size: 13.5px; cursor: pointer; font-family: var(--dsp-font-body); text-align: center; text-decoration: none; display: inline-block;
}

/* ================================================================
   NEW: Hero card (compact rotating spotlight)
   ================================================================ */
.dsp-hero-wrap { width: 70%; max-width: 1600px; margin-left: 15%; margin-right: 15%; padding: 32px 20px 8px; }
.dsp-hero-row { display: flex; gap: 20px; align-items: stretch; }
.dsp-hero-row .dsp-hero-card { flex: 1 1 auto; min-width: 0; }
.dsp-hero-card {
  background: var(--dsp-navy); border-radius: var(--dsp-radius-lg); padding: 44px 48px; position: relative;
  overflow: hidden; aspect-ratio: 21 / 9; max-height: 420px; display: flex; flex-direction: column; justify-content: center;
}
.dsp-hero-circle { position: absolute; right: -40px; top: -40px; width: 220px; height: 220px; border-radius: 50%; background: var(--dsp-navy-soft); animation: dspFloat 7s ease-in-out infinite; }
.dsp-hero-inner { position: relative; max-width: 560px; }
.dsp-hero-eyebrow { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: oklch(0.75 0.06 165); font-weight: 600; margin-bottom: 14px; }
.dsp-hero-headline { font-family: var(--dsp-font-serif); font-size: 32px; line-height: 1.2; color: var(--dsp-bg); font-style: italic; margin: 0 0 12px; }
.dsp-hero-sub { font-size: 15px; color: oklch(0.85 0.02 175); margin: 0 0 22px; }
.dsp-hero-cta {
  background: var(--dsp-bg); color: var(--dsp-navy); border: none; padding: 12px 22px; border-radius: var(--dsp-radius-sm);
  font-weight: 700; font-size: 14px; cursor: pointer; font-family: var(--dsp-font-body); text-decoration: none; display: inline-block;
}

/* ================================================================
   NEW: Standalone banner section, sitting beside the hero (dsp-hero-row)
   ================================================================ */
.dsp-banner-section { flex: 0 0 300px; background: var(--dsp-navy); border-radius: var(--dsp-radius-lg); overflow: hidden; display: flex; align-items: center; justify-content: center; aspect-ratio: 21 / 9; max-height: 420px; }
.dsp-hero-banner-slider { position: relative; width: 100%; height: 100%; }
.dsp-hero-banner-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; }
.dsp-hero-banner-slide.is-active { opacity: 1; }
.dsp-hero-banner-slide img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.dsp-hero-banner-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.dsp-hero-banner-dot { width: 7px; height: 7px; border-radius: 50%; background: oklch(0.98 0.005 95 / 0.45); cursor: pointer; transition: background .2s, width .2s; }
.dsp-hero-banner-dot.is-active { background: #fff; width: 18px; border-radius: 4px; }
@media (max-width: 720px) { .dsp-banner-section { flex-basis: auto; aspect-ratio: 16 / 9; max-height: 220px; } }

/* ================================================================
   NEW: Coupons slider (homepage, cross-store)
   ================================================================ */
.dsp-slider-arrow {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--dsp-border); background: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--dsp-navy);
  transition: background .15s, border-color .15s;
}
.dsp-slider-arrow:hover { background: var(--dsp-bg); border-color: var(--dsp-navy); }
.dsp-coupon-track {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.dsp-coupon-track::-webkit-scrollbar { display: none; }
.dsp-coupon-slide {
  flex: 0 0 240px; scroll-snap-align: start; background: var(--dsp-card); border: 1px solid var(--dsp-border);
  border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 8px; min-height: 190px;
}
.dsp-coupon-slide-title { font-weight: 700; font-size: 14.5px; color: var(--dsp-text); line-height: 1.3; }
.dsp-coupon-slide-store { font-size: 12px; color: var(--dsp-text-muted); }
@media (max-width: 720px) { .dsp-coupon-slide { flex-basis: 200px; } }

/* ================================================================
   NEW: Trust section
   ================================================================ */
.dsp-trust-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; }
.dsp-trust-money { background: var(--dsp-trust-bg); border: 1px solid var(--dsp-trust-border); border-radius: var(--dsp-radius-md); padding: 26px; }
.dsp-trust-team { background: var(--dsp-card); border: 1px solid var(--dsp-border); border-radius: var(--dsp-radius-md); padding: 26px; display: flex; gap: 16px; align-items: flex-start; }
.dsp-trust-avatar { width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; background: repeating-linear-gradient(135deg, oklch(0.93 0.008 95), oklch(0.93 0.008 95) 4px, oklch(0.965 0.006 95) 4px, oklch(0.965 0.006 95) 8px); overflow: hidden; }
.dsp-trust-avatar img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) { .dsp-trust-grid { grid-template-columns: 1fr !important; } }

/* ================================================================
   NEW: Store detail page (taxonomy-dealstore.php)
   ================================================================ */
.dsp-store-page { max-width: 860px; margin: 0 auto; width: 100%; padding: 28px 20px 60px; }
.dsp-back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; cursor: pointer; margin-bottom: 22px; color: var(--dsp-text); text-decoration: none; }
.dsp-store-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.dsp-store-head-avatar { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: repeating-linear-gradient(135deg, oklch(0.93 0.008 95), oklch(0.93 0.008 95) 4px, oklch(0.965 0.006 95) 4px, oklch(0.965 0.006 95) 8px); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; font-family: monospace; color: var(--dsp-navy); flex-shrink: 0; }
.dsp-store-head-avatar img { width: 100%; height: 100%; object-fit: contain; }
.dsp-store-head-title { font-weight: 800; font-size: 23px; color: var(--dsp-text); }
.dsp-store-head-meta { font-size: 13px; color: var(--dsp-text-muted); display: flex; align-items: center; gap: 6px; margin-top: 4px; }

.dsp-filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; align-items: center; }
.dsp-filter-chip { padding: 8px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; cursor: pointer; border: 1px solid var(--dsp-border-soft); background: transparent; color: oklch(0.35 0.02 175); font-family: var(--dsp-font-body); }
.dsp-filter-chip.is-active { border-color: var(--dsp-navy); background: var(--dsp-navy); color: var(--dsp-bg); }
.dsp-filter-sep { width: 1px; align-self: stretch; background: var(--dsp-border-soft); margin: 4px 4px; }

.dsp-offer-list { display: flex; flex-direction: column; gap: 12px; }
.dsp-offer-card { background: var(--dsp-card); border: 1px solid var(--dsp-border); border-radius: 14px; padding: 18px 20px; }
.dsp-offer-top { display: flex; gap: 14px; align-items: flex-start; }
.dsp-offer-badge { padding: 7px 11px; border-radius: 9px; font-weight: 800; font-size: 13.5px; white-space: nowrap; flex-shrink: 0; }
.dsp-offer-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; color: var(--dsp-text); }
.dsp-offer-meta { font-size: 12px; color: var(--dsp-text-mute-2); }
.dsp-offer-terms-toggle { font-size: 12.5px; font-weight: 600; color: var(--dsp-text-muted); margin-top: 12px; cursor: pointer; display: flex; align-items: center; gap: 4px; user-select: none; }
.dsp-offer-terms-toggle svg { transition: transform .15s; }
.dsp-offer-terms-toggle.is-open svg { transform: rotate(180deg); }
.dsp-offer-terms-body { display: none; font-size: 12.5px; line-height: 1.55; color: var(--dsp-text-mute-3); margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--dsp-border-soft); }
.dsp-offer-terms-toggle.is-open + .dsp-offer-terms-body { display: block; }
.dsp-empty-state { text-align: center; padding: 60px 20px; color: var(--dsp-text-muted); font-size: 14.5px; }

/* ================================================================
   NEW: Code-reveal modal
   ================================================================ */
.dsp-modal-overlay { position: fixed; inset: 0; background: oklch(0.15 0.02 175 / 0.55); display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.dsp-modal-overlay.is-open { display: flex; }
.dsp-modal-box { background: oklch(0.995 0.003 90); border-radius: 20px; padding: 30px; max-width: 380px; width: 100%; position: relative; }
.dsp-modal-close { position: absolute; top: 16px; right: 16px; width: 28px; height: 28px; border-radius: 50%; background: oklch(0.95 0.006 95); display: flex; align-items: center; justify-content: center; cursor: pointer; border: none; }
.dsp-modal-title { font-weight: 700; font-size: 16px; margin-bottom: 4px; color: var(--dsp-text); }
.dsp-modal-store { font-size: 12.5px; color: var(--dsp-text-muted); margin-bottom: 20px; }
.dsp-modal-code-box { border: 2px dashed oklch(0.6 0.06 175); border-radius: 12px; padding: 18px; text-align: center; margin-bottom: 16px; background: oklch(0.97 0.008 95); }
.dsp-modal-code { font-family: monospace; font-size: 22px; font-weight: 700; letter-spacing: 0.12em; animation: dspCodeReveal 0.5s ease-out; }
.dsp-modal-copy, .dsp-modal-activate { width: 100%; box-sizing: border-box; background: var(--dsp-navy); color: var(--dsp-bg); border: none; padding: 13px; border-radius: 10px; font-weight: 700; font-size: 14.5px; cursor: pointer; margin-bottom: 14px; font-family: var(--dsp-font-body); text-align: center; text-decoration: none; display: block; }
.dsp-modal-deal-note { background: oklch(0.97 0.008 95); border-radius: 12px; padding: 16px; text-align: center; margin-bottom: 16px; font-size: 13.5px; color: var(--dsp-text-mute-3); }
.dsp-modal-verified { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: oklch(0.5 0.1 165); animation: dspStampPop 0.4s ease-out; }
.dsp-modal-disclosure { font-size: 11px; color: oklch(0.6 0.02 175); text-align: center; margin-top: 12px; line-height: 1.5; }

/* Typography for real post/page content rendered via the_content() */
.dsp-post-content { font-family: var(--dsp-font-body); font-size: 17px; line-height: 1.75; color: oklch(0.28 0.02 175); }
.dsp-post-content h1, .dsp-post-content h2, .dsp-post-content h3, .dsp-post-content h4 { font-family: var(--dsp-font-heading); color: var(--dsp-navy); font-weight: 700; line-height: 1.3; margin: 1.6em 0 0.6em; }
.dsp-post-content h2 { font-size: 26px; }
.dsp-post-content h3 { font-size: 21px; }
.dsp-post-content h4 { font-size: 18px; }
.dsp-post-content p { margin: 0 0 1.2em; }
.dsp-post-content a { color: var(--dsp-navy); text-decoration: underline; }
.dsp-post-content ul, .dsp-post-content ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.dsp-post-content li { margin-bottom: 0.5em; }
.dsp-post-content img { max-width: 100%; height: auto; border-radius: 14px; margin: 1.6em 0; display: block; }
.dsp-post-content blockquote { border-left: 4px solid var(--dsp-navy); padding: 4px 0 4px 20px; margin: 1.6em 0; font-style: italic; color: oklch(0.4 0.02 175); }

.dsp-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px; border-radius: 10px; background: #fff; color: var(--dsp-text); font-weight: 600; font-size: 14px; text-decoration: none; border: 1px solid var(--dsp-border); }
.dsp-pagination .page-numbers.current { background: var(--dsp-navy); color: #fff; border-color: var(--dsp-navy); }
.dsp-pagination .page-numbers:hover { border-color: var(--dsp-navy); color: var(--dsp-navy); }

.dsp-nav-item { border-bottom: 3px solid transparent; }
.dsp-nav-item:hover { color: var(--dsp-navy) !important; border-bottom-color: var(--dsp-navy) !important; }
.dsp-primary-nav a:hover { color: var(--dsp-teal-deep) !important; }
@media (max-width: 900px) { .dsp-primary-nav { display: none !important; } }
.dsp-cat-pill:hover { transform: translateY(-3px); }
.dsp-footer-link:hover { color: #fff !important; }

@media (max-width: 720px) {
  .dsp-hero-title, .dsp-hero-headline { font-size: 26px !important; }
  .dsp-cat-icon { width: 60px !important; height: 60px !important; }
  .dsp-hero-card { aspect-ratio: 4 / 5 !important; max-height: 460px !important; padding: 40px 28px !important; }
  .dsp-hero-row { flex-direction: column !important; }
  .dsp-header { padding: 16px 20px !important; }
  .dsp-section { padding-left: 20px !important; padding-right: 20px !important; }
  .dsp-trust-grid { grid-template-columns: 1fr; }
  .dsp-offer-top { flex-wrap: wrap; }
  .dsp-offer-cta { width: 100%; text-align: center; }
}
