/* ══ GPDStore Downloads library (page-gpd-downloads.php) ═════════════════
   Page chrome only — hero, search, filter chips, device-group headings,
   result count, pagination, trust footnote. `.drx-*` rows/panels are the
   plugin's own (dx-plugins/droix-kb-resource-mngr), styled by its
   woo-bridge.css + gpd-dark skin; this file never restyles their internals,
   only the vertical rhythm between them.
   Loaded only on the Downloads page (see inc/downloads-page.php). The base
   theme's "white panel" transitional block (gpd-theme.css) is not in the
   .gpd-downloads exclusion chain, so backgrounds/headings below use
   !important the same way body.error404 (gpd-404.css) and
   body.woocommerce-account (gpd-account.css) already do. */

body.gpd-downloads #content,
body.gpd-downloads #content.site-content { background: var(--bg-2) !important; }
body.gpd-downloads #content > .shoptimizer-archive > .col-full,
body.gpd-downloads #content > .col-full { max-width: none; width: 100%; margin: 0; padding: 0; background: transparent; }
body.gpd-downloads #primary { float: none; width: 100%; margin: 0; padding: 0; }
body.gpd-downloads .site-main { margin: 0; padding: 0; }

.gpd-dl-wrap { max-width: 1240px; margin: 0 auto; padding: 0 36px; }

/* ── Hero ──────────────────────────────────────────────────────────── */
.gpd-dl-hero { position: relative; padding: 50px 0 30px; text-align: center; overflow: visible; }
.gpd-dl-hero::before {
  content: ""; position: absolute; inset: -120px 0 0; pointer-events: none;
  background: radial-gradient(560px 260px at 50% 0%, rgba(211,255,95,.08), transparent 70%);
}
body.gpd-downloads .gpd-dl-hero h1 {
  position: relative; margin: 0 0 10px; font-size: 44px; font-weight: 800;
  letter-spacing: -1.2px; line-height: 1.05; color: var(--fg-0) !important;
}
.gpd-dl-intro {
  position: relative; margin: 0 auto 26px; max-width: 560px; font-size: 15.5px;
  line-height: 1.6; color: var(--fg-secondary); text-wrap: pretty;
}

.gpd-dl-search {
  position: relative; display: flex; align-items: center; gap: 11px;
  width: 100%; max-width: 620px; margin: 0 auto; height: 56px; padding: 0 9px 0 19px;
  border-radius: var(--r-full); background: var(--surface-glass); border: 1px solid var(--line-1);
  transition: border-color var(--dur-normal) var(--ease);
}
.gpd-dl-search:focus-within { border-color: rgba(211,255,95,.5); }
.gpd-dl-search > svg { width: 19px; height: 19px; color: var(--fg-tertiary); flex: 0 0 auto; }
body.gpd-downloads .gpd-dl-search input[type="search"] {
  flex: 1; min-width: 0; background: none !important; border: 0 !important; box-shadow: none !important;
  outline: 0; height: auto; padding: 0; margin: 0; color: var(--fg-0) !important; font-size: 15px;
}
.gpd-dl-search input[type="search"]::placeholder { color: var(--fg-tertiary); }
.gpd-dl-search button {
  height: 42px; padding: 0 20px; border: 0; border-radius: var(--r-full); background: var(--lime-500);
  color: #0A0D0F; font: 700 13.5px var(--font-sans); cursor: pointer; white-space: nowrap;
  transition: box-shadow var(--dur-normal) var(--ease);
}
.gpd-dl-search button:hover { box-shadow: var(--shadow-glow); }

/* ── Filter chips ──────────────────────────────────────────────────── */
.gpd-dl-filter { margin: 0 0 18px; }
.gpd-dl-filter__label {
  display: block; margin: 0 0 10px; font: 700 11px var(--font-sans); letter-spacing: .1em;
  text-transform: uppercase; color: var(--fg-tertiary);
}
.gpd-dl-chips { display: flex; gap: 10px; flex-wrap: wrap; }
a.gpd-dl-chip {
  padding: 9px 18px; border-radius: var(--r-full); cursor: pointer; text-decoration: none;
  background: var(--surface-glass); border: 1px solid var(--line-1); color: var(--fg-1) !important;
  font: 600 13.5px var(--font-sans); transition: all var(--dur-normal) var(--ease);
}
a.gpd-dl-chip:hover { border-color: rgba(255,255,255,.22); transform: translateY(-1px); }
a.gpd-dl-chip.is-active { background: var(--lime-500); border-color: var(--lime-500); color: #0A0D0F !important; }

.gpd-dl-count { margin: 22px 0 16px; font: 600 13px var(--font-sans); color: var(--fg-tertiary); }

/* ── Jump-to-device nav (grouped view) ────────────────────────────────── */
.gpd-dl-jump { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin: 0 0 30px; }
.gpd-dl-jump__label { font: 700 11px var(--font-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-tertiary); }
.gpd-dl-jump a { font: 600 13px var(--font-sans); color: var(--fg-secondary) !important; text-decoration: none; }
.gpd-dl-jump a:hover { color: var(--lime-500) !important; }

/* ── Device groups ─────────────────────────────────────────────────── */
.gpd-dl-group { margin: 0 0 44px; scroll-margin-top: 90px; }
body.gpd-downloads .gpd-dl-group h2 {
  margin: 0 0 16px; font-size: 22px; font-weight: 800; letter-spacing: -.4px; color: var(--fg-0) !important;
}

/* ── Flat rows ─────────────────────────────────────────────────────── */
.gpd-dl-rows { margin: 0 0 30px; }
.gpd-dl-empty { padding: 30px 0; font: 500 14.5px var(--font-sans); color: var(--fg-secondary); }
.gpd-dl-empty a { color: var(--lime-500); font-weight: 700; text-decoration: none; }
.gpd-dl-empty a:hover { text-decoration: underline; }

/* Pagination — reuse core .page-numbers markup from paginate_links(). */
.gpd-dl-wrap .page-numbers {
  display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px;
  margin: 0 4px 4px 0; padding: 0 10px; border-radius: var(--r-md); background: var(--surface-glass);
  border: 1px solid var(--line-1); color: var(--fg-1) !important; font: 600 13px var(--font-sans);
  text-decoration: none; transition: all var(--dur-normal) var(--ease);
}
.gpd-dl-wrap .page-numbers:hover { border-color: rgba(255,255,255,.22); }
.gpd-dl-wrap .page-numbers.current { background: var(--lime-500); border-color: var(--lime-500); color: #0A0D0F !important; }
.gpd-dl-wrap .page-numbers.dots { background: none; border: 0; }

/* ── Trust footnote ────────────────────────────────────────────────── */
.gpd-dl-trust {
  margin: 10px 0 60px; padding: 16px 20px; border-radius: var(--r-lg); background: var(--surface-glass);
  border: 1px solid var(--line-1); color: var(--fg-secondary); font-size: 13px; line-height: 1.6;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .gpd-dl-wrap { padding: 0 20px; }
  body.gpd-downloads .gpd-dl-hero h1 { font-size: 32px; }
  .gpd-dl-search { height: auto; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--r-xl); }
  .gpd-dl-search button { width: 100%; height: 44px; }
  body.gpd-downloads .gpd-dl-group h2 { font-size: 19px; }

  /* Root cause of the mobile row collapse: the plugin's gpd-dark skin gives the grouped
     view's "device hub" panel (.drx-files--panel) 32px/36px of its own card padding
     (dx-plugins/droix-kb-resource-mngr/assets/css/skins/gpd-dark.css), and its
     .drx-res__row is a plain `display:flex` with no flex-wrap/media query at any width
     (woo-bridge.css has none). Stacked with this page's own gutter, that leaves so little
     row width at ≤768px that the flexible .drx-res__info column (badge/CTA are
     flex:0 0 auto and never shrink) gets squeezed to a few px, wrapping every word onto
     its own line. Fix stays theme-side only: shrink the extra panel/card padding this
     page adds on top of, and let the row wrap so the badge + CTA/guide sit on their own
     line above the full-width title — never touching drx-* colours/behaviour. */
  body.gpd-downloads .drx-files--panel { padding: 18px 16px; border-radius: var(--r-xl); }
  body.gpd-downloads .drx-res { padding: 12px 14px; }
  body.gpd-downloads .drx-res__row { flex-wrap: wrap; row-gap: 10px; }
  body.gpd-downloads .drx-res__info { order: 2; flex-basis: 100%; }
}

@media (max-width: 480px) {
  .gpd-dl-wrap { padding: 0 16px; }
  .gpd-dl-hero { padding: 34px 0 22px; }
  body.gpd-downloads .gpd-dl-hero h1 { font-size: 26px; }
  .gpd-dl-intro { font-size: 14px; }
  .gpd-dl-chips { gap: 8px; }
  a.gpd-dl-chip { padding: 8px 14px; font-size: 12.5px; }
  .gpd-dl-jump { gap: 6px 10px; }
  body.gpd-downloads .drx-files--panel { padding: 16px 14px; }
}
