/* ============================================================
   PDPLUS marketplace — shared visual system overlay
   Load AFTER your existing stylesheets. Works with premium.js.
   Palette: route cobalt · action orange · cool white surfaces
   Type: Manrope across display and interface roles
   ============================================================ */

:root {
  --pd-ink: #07143c;
  --pd-ink-soft: #223056;
  --pd-muted: #596786;
  --pd-paper: #f7f9ff;
  --pd-card: #FFFFFF;
  --pd-hairline: #dce3f0;
  --pd-amber: #ff5a0a;
  --pd-amber-deep: #df4500;
  --pd-amber-tint: #fff1e8;
  --pd-green: #0b8f47;
  --pd-wa: #16a34a;
  --pd-blue: #0637c5;
  --pd-blue-dark: #042ca6;
  --pd-blue-soft: #edf3ff;
  --pd-radius: 13px;
  --pd-radius-sm: 10px;
  --pd-shadow-1: 0 1px 2px rgba(7,20,60,.04);
  --pd-shadow-2: 0 14px 26px rgba(7,20,60,.09);
  --pd-display: "Manrope", "Segoe UI", Arial, sans-serif;
  --pd-body: "Manrope", "Segoe UI", Arial, sans-serif;
  --pd-ease: cubic-bezier(.22,.8,.3,1);
}

/* Cross-page view transitions (progressive enhancement) */
@view-transition { navigation: auto; }

/* ---------- Base repaint ---------- */
html { background: #fff; }
body {
  background: #fff !important;
  color: var(--pd-ink) !important;
  font-family: var(--pd-body) !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, .pd-display {
  font-family: var(--pd-display) !important;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--pd-ink) !important;
}
h1 { line-height: 1.06; }
h2 { line-height: 1.1; }

p, li, td, label, input, select, textarea { font-family: var(--pd-body); }
::selection { background: var(--pd-amber-tint); color: var(--pd-amber-deep); }

a { transition: color .18s var(--pd-ease); }
a:not(.pd-btn):hover { color: var(--pd-blue); }

:focus-visible {
  outline: 2px solid var(--pd-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Keep controls on the same geometry and border system. */
[class*="btn"], button, .badge, [class*="tag"] { border-color: var(--pd-hairline); }

/* Legacy texture is intentionally disabled in the PDPLUS commerce world. */
.pd-grain { display: none !important; }

/* ---------- Header / nav ---------- */
.pd-header, header, nav {
  background: #fff !important;
  backdrop-filter: none;
  border-bottom: 1px solid var(--pd-hairline);
  box-shadow: none !important;
}
nav a, header a { color: var(--pd-ink-soft) !important; font-weight: 500; }
nav a:hover, header a:hover { color: var(--pd-blue) !important; }

/* Solar gets a quiet flame of priority */
.pd-nav-solar {
  color: var(--pd-blue) !important;
  font-weight: 750 !important;
  position: relative;
}
.pd-nav-solar::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -4px; height: 2px;
  background: var(--pd-amber);
  border-radius: 2px;
  transform-origin: left;
  animation: pd-underline .6s var(--pd-ease) .3s backwards;
}
@keyframes pd-underline { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Buttons ---------- */
.pd-btn, [class*="btn-primary"], button[type="submit"] {
  background: var(--pd-amber) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 12px !important;
  font-family: var(--pd-body) !important;
  font-weight: 600;
  letter-spacing: .01em;
  transition: transform .16s var(--pd-ease), box-shadow .16s var(--pd-ease), background .16s;
}
.pd-btn:hover, [class*="btn-primary"]:hover, button[type="submit"]:hover {
  background: var(--pd-amber-deep) !important;
  transform: translateY(-1px);
  box-shadow: var(--pd-shadow-2);
}
.pd-btn:active { transform: translateY(0) scale(.99); }

/* WhatsApp buttons keep their recognition color, refined */
a[href*="wa.me"], a[href*="whatsapp"] {
  background: var(--pd-wa) !important;
  color: #fff !important;
  border-radius: 999px !important;
  border: none !important;
  font-weight: 600;
  transition: transform .16s var(--pd-ease), filter .16s;
}
a[href*="wa.me"]:hover { filter: brightness(1.06); transform: translateY(-1px); }

/* ---------- Catalogue pagination ---------- */
.pd-pagination {
  width: 100%;
  margin: 38px auto 0;
  padding: 8px 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  border: 0 !important;
  background: transparent !important;
  backdrop-filter: none;
}
.pd-pagination__btn,
.pd-pagination__gap {
  min-width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border-radius: var(--pd-radius-sm);
  font-family: var(--pd-body);
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pd-pagination__btn {
  border: 1px solid var(--pd-hairline);
  background: var(--pd-card);
  color: var(--pd-ink-soft) !important;
  transition: border-color .16s var(--pd-ease), background .16s var(--pd-ease), color .16s var(--pd-ease), transform .16s var(--pd-ease);
}
.pd-pagination__btn:hover {
  border-color: #cbd8ff;
  background: var(--pd-blue-soft);
  color: var(--pd-blue) !important;
  transform: translateY(-1px);
}
.pd-pagination__btn:active { transform: translateY(0); }
.pd-pagination__btn.is-current {
  border-color: var(--pd-blue);
  background: var(--pd-blue);
  color: #fff !important;
}
.pd-pagination__gap {
  min-width: 28px;
  padding: 0 4px;
  color: var(--pd-muted);
}
.pd-pagination__btn:last-child {
  min-width: 94px;
  border-color: #ffd4bf;
  background: var(--pd-amber-tint);
  color: var(--pd-amber-deep) !important;
}

/* ---------- Footer navigation ---------- */
.site-footer {
  margin-top: 60px;
  padding: 32px max(20px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  border-top: 1px solid var(--pd-hairline);
  background: var(--pd-card);
  color: var(--pd-muted);
  text-align: center;
}
.site-footer__inner {
  width: min(100%, 1120px);
  margin: 0 auto;
  display: grid;
  justify-items: center;
  gap: 18px;
}
.site-footer .site-footer__links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 22px;
  border: 0;
  background: transparent !important;
  backdrop-filter: none;
}
.site-footer__link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  color: var(--pd-ink-soft) !important;
  font-size: 14px;
  font-weight: 550 !important;
}
.site-footer__link:hover { color: var(--pd-blue) !important; }
.site-footer .site-footer__whatsapp {
  min-height: 44px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--pd-wa) !important;
  color: #fff !important;
  border-radius: 999px !important;
  box-shadow: 0 8px 20px -10px rgba(31,175,84,.58);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.site-footer__whatsapp .bi { font-size: 17px; }
.site-footer .site-footer__whatsapp:hover {
  background: #178D45 !important;
  color: #fff !important;
  filter: none;
  transform: translateY(-1px);
}
.site-footer__copyright {
  margin: 0;
  color: var(--pd-muted);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .pd-pagination { margin-top: 30px; gap: 6px; }
  .pd-pagination__btn,
  .pd-pagination__gap { min-width: 42px; height: 42px; padding: 0 10px; }
  .pd-pagination__btn:last-child { min-width: 88px; }
  .site-footer { margin-top: 42px; padding-top: 26px; }
  .site-footer .site-footer__links { width: 100%; align-items: stretch; flex-direction: column; gap: 3px; }
  .site-footer__link { width: 100%; justify-content: center; }
  .site-footer .site-footer__whatsapp { width: min(100%, 320px); margin-top: 8px; }
}

/* ---------- Cards ---------- */
.pd-card-hook {
  background: var(--pd-card) !important;
  border: 1px solid var(--pd-hairline) !important;
  border-radius: var(--pd-radius) !important;
  box-shadow: var(--pd-shadow-1) !important;
  overflow: hidden;
  transition: transform .22s var(--pd-ease), box-shadow .22s var(--pd-ease), border-color .22s;
}
.pd-card-hook:hover {
  transform: translateY(-3px);
  border-color: #cbd8ff !important;
  box-shadow: var(--pd-shadow-2) !important;
}
.pd-card-hook img { transition: transform .5s var(--pd-ease); }
.pd-card-hook:hover .pd-img img { transform: scale(1.035); }

/* Prices */
.pd-price, [class*="price"] {
  font-family: var(--pd-body);
  font-weight: 700;
  color: var(--pd-ink) !important;
  font-variant-numeric: tabular-nums;
}

/* ---------- Blur-up image system ---------- */
.pd-img {
  position: relative;
  overflow: hidden;
  background-color: var(--pd-blue-soft);
  background-size: cover;
  background-position: center;
}
.pd-img::before { /* skeleton shimmer until loaded */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: pd-shimmer 1.4s ease infinite;
}
.pd-img.pd-loaded::before, .pd-img.pd-missing::before { display: none; }
@keyframes pd-shimmer { from { background-position: 130% 0; } to { background-position: -90% 0; } }

.pd-img > img {
  display: block; width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: blur(14px) saturate(1.05);
  transform: scale(1.04);
  transition: opacity .45s ease, filter .7s var(--pd-ease), transform .7s var(--pd-ease);
}
.pd-img.pd-loaded > img { opacity: 1; filter: blur(0) saturate(1); transform: scale(1); }

/* Branded tile when a photo genuinely doesn't exist */
.pd-img.pd-missing > img { display: none; }
.pd-img.pd-missing::after {
  content: "Photo being checked";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--pd-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--pd-blue);
  background: var(--pd-blue-soft);
  letter-spacing: 0;
}

/* ---------- Scroll reveal ---------- */
.pd-reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s var(--pd-ease); }
.pd-reveal.pd-in { opacity: 1; transform: none; }
.pd-reveal:nth-child(2) { transition-delay: .06s; }
.pd-reveal:nth-child(3) { transition-delay: .12s; }
.pd-reveal:nth-child(4) { transition-delay: .18s; }

/* ---------- Sticky WhatsApp bar (mobile product pages) ---------- */
.pd-wa-bar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 9999;
  display: none;
  background: var(--pd-wa); color: #fff;
  border-radius: 999px;
  padding: 14px 22px;
  text-align: center; font-weight: 700; font-family: var(--pd-body);
  box-shadow: 0 10px 30px -8px rgba(31,175,84,.5);
  text-decoration: none;
}
@media (max-width: 768px) {
  .pd-wa-bar { display: block; animation: pd-rise .5s var(--pd-ease); }
  body.pd-has-wa-bar { padding-bottom: 76px; }
}
@keyframes pd-rise { from { transform: translateY(80px); opacity: 0; } }

/* ---------- Quality floor ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .pd-reveal { opacity: 1; transform: none; }
}
