/* ===================================================================
   PixlFits v5 — Shared Components
   Loaded by every page. Cached aggressively via CloudFront.
   =================================================================== */

/* ── Mobile Bottom Nav ─────────────────────────────────────────── */
.pf-mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(12, 12, 14, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid #2A2A32;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
}
.pf-mobile-nav-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  max-width: 540px;
  margin: 0 auto;
  padding: 0 4px;
}
.pf-mobile-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  color: #9B9AA3;
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2px;
  border-radius: 10px;
  transition: color 0.15s, background 0.15s;
  font-family: 'Sora', system-ui, sans-serif;
}
.pf-mobile-nav a svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}
.pf-mobile-nav a:hover { color: #F0EEE8; }
.pf-mobile-nav a.is-active {
  color: #C4FF47;
  background: rgba(196, 255, 71, 0.08);
}
.pf-mobile-nav a.is-active svg {
  filter: drop-shadow(0 0 8px rgba(196, 255, 71, 0.4));
}

@media (max-width: 768px) {
  .pf-mobile-nav { display: block; }
  body { padding-bottom: 72px; } /* room for nav */
  footer { margin-bottom: 0; }
}

/* ── Trust Bar ─────────────────────────────────────────────────── */
.pf-trust-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 28px;
  padding: 18px 24px;
  margin: 32px auto 0;
  max-width: 1000px;
  background: linear-gradient(180deg, rgba(196, 255, 71, 0.04) 0%, rgba(196, 255, 71, 0) 100%);
  border-top: 1px solid rgba(196, 255, 71, 0.12);
  border-bottom: 1px solid rgba(196, 255, 71, 0.12);
  position: relative;
  z-index: 1;
}
.pf-trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.3px;
  color: #9B9AA3;
  font-family: 'Space Mono', monospace;
  text-transform: uppercase;
  font-weight: 400;
}
.pf-trust-item svg {
  width: 14px;
  height: 14px;
  color: #C4FF47;
  flex-shrink: 0;
}
.pf-trust-item strong {
  color: #F0EEE8;
  font-weight: 700;
}
@media (max-width: 640px) {
  .pf-trust-bar { gap: 14px; padding: 14px 16px; }
  .pf-trust-item { font-size: 11px; gap: 6px; }
}

/* ── Session Counter ───────────────────────────────────────────── */
.pf-session-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(196, 255, 71, 0.06);
  border: 1px solid rgba(196, 255, 71, 0.2);
  border-radius: 999px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: #C4FF47;
  letter-spacing: 0.5px;
}
.pf-session-pill .pf-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #C4FF47;
  animation: pf-pulse 1.8s ease-in-out infinite;
}
@keyframes pf-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* ── Cross-Tool Promo Banner ───────────────────────────────────── */
.pf-cross-promo {
  max-width: 980px;
  margin: 40px auto;
  padding: 0 24px;
}
.pf-cross-promo-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.pf-cross-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: #131316;
  border: 1px solid #2A2A32;
  border-radius: 16px;
  text-decoration: none;
  transition: 0.18s ease;
  color: inherit;
}
.pf-cross-card:hover {
  border-color: rgba(196, 255, 71, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  text-decoration: none;
}
.pf-cross-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(196, 255, 71, 0.1);
  color: #C4FF47;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pf-cross-icon svg { width: 22px; height: 22px; }
.pf-cross-body { flex: 1; min-width: 0; }
.pf-cross-label {
  font-size: 11px;
  font-family: 'Space Mono', monospace;
  color: #5C5B65;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.pf-cross-title {
  font-size: 15px;
  font-weight: 600;
  color: #F0EEE8;
  margin-bottom: 2px;
  line-height: 1.3;
}
.pf-cross-desc {
  font-size: 13px;
  color: #9B9AA3;
  line-height: 1.4;
}
.pf-cross-arrow {
  color: #5C5B65;
  flex-shrink: 0;
  transition: 0.18s ease;
}
.pf-cross-arrow svg { width: 18px; height: 18px; }
.pf-cross-card:hover .pf-cross-arrow {
  color: #C4FF47;
  transform: translateX(4px);
}
@media (max-width: 640px) {
  .pf-cross-promo-inner { grid-template-columns: 1fr; }
}

/* ── Before/After Slider ───────────────────────────────────────── */
.pf-ba-wrap {
  position: relative;
  max-width: 720px;
  margin: 24px auto;
  background: #131316;
  border: 1px solid #2A2A32;
  border-radius: 16px;
  overflow: hidden;
  user-select: none;
}
.pf-ba-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #0C0C0E;
  overflow: hidden;
  cursor: ew-resize;
}
.pf-ba-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}
.pf-ba-after-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: inset(0 0 0 50%);
  transition: clip-path 0.05s linear;
  will-change: clip-path;
}
.pf-ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #C4FF47;
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 0 16px rgba(196, 255, 71, 0.5);
  will-change: left;
}
.pf-ba-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #C4FF47;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0A0A0A;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  cursor: ew-resize;
}
.pf-ba-knob svg { width: 18px; height: 18px; }
.pf-ba-tag {
  position: absolute;
  top: 12px;
  padding: 4px 10px;
  background: rgba(12, 12, 14, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: #F0EEE8;
  letter-spacing: 1px;
  text-transform: uppercase;
  pointer-events: none;
}
.pf-ba-tag.before { left: 12px; }
.pf-ba-tag.after  { right: 12px; color: #C4FF47; border-color: rgba(196, 255, 71, 0.3); }
.pf-ba-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: #2A2A32;
  border-top: 1px solid #2A2A32;
}
.pf-ba-stat {
  background: #131316;
  padding: 12px 16px;
  text-align: center;
}
.pf-ba-stat-label {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #5C5B65;
  font-family: 'Space Mono', monospace;
  margin-bottom: 2px;
}
.pf-ba-stat-value {
  font-size: 14px;
  color: #F0EEE8;
  font-weight: 600;
}
.pf-ba-stat-value.win {
  color: #C4FF47;
}

/* ── Batch Processing Table ────────────────────────────────────── */
.pf-batch-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13px;
  font-family: 'Sora', system-ui, sans-serif;
}
.pf-batch-table thead th {
  background: #1A1A1F;
  color: #9B9AA3;
  padding: 10px 12px;
  text-align: left;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 400;
  border-bottom: 1px solid #2A2A32;
}
.pf-batch-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #2A2A32;
  color: #F0EEE8;
}
.pf-batch-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.pf-batch-table tbody tr.done td { color: #C4FF47; }
.pf-batch-table tbody tr.done td:first-child::before {
  content: '✓ ';
  color: #C4FF47;
}
.pf-batch-table .pf-fname {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pf-batch-table .pf-savings {
  color: #C4FF47;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
}
.pf-batch-bar {
  height: 4px;
  background: #2A2A32;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}
.pf-batch-bar-fill {
  height: 100%;
  background: #C4FF47;
  width: 0%;
  transition: width 0.2s ease;
}

/* ── New Page Hero Variants (for new SEO pages) ────────────────── */
.pf-coming-soon {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(196, 255, 71, 0.1);
  border: 1px solid rgba(196, 255, 71, 0.25);
  color: #C4FF47;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 999px;
  margin-bottom: 12px;
}
/* v6: shared component CSS (extends v5) */

/* v6.3 fix B4: native <select> dropdowns inherit OS theme by default,
   which makes dark-themed pages render options as unreadable white-on-white.
   Force option background/color to match dark theme. */
select option {
  background: #1A1A1F;
  color: #F0EEE8;
}
select optgroup {
  background: #131316;
  color: #9B9AA3;
  font-weight: 700;
}

/* v6.4.4 fix: bulletproof mobile — never allow horizontal scroll.
   Some long content (long words, tables, wide grids) can push past viewport.
   These rules clamp everything to viewport width and let content wrap. */
html, body { overflow-x: hidden; max-width: 100%; }
img, video, canvas, iframe { max-width: 100%; height: auto; }
pre, code { overflow-x: auto; max-width: 100%; word-break: break-word; }
table { max-width: 100%; }

/* v6.4.4: explicit safety on common content containers */
@media (max-width: 720px) {
  .container, .wrap, main, section, article, footer, header { max-width: 100vw; box-sizing: border-box; }
  /* Long strings (URLs, code) shouldn't push the layout */
  p, li, td, th, dd, dt, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; word-wrap: break-word; }
}

/* ═══ v6.4.6 Smart Tools Dropdown ═══════════════════════════════
   Desktop: hover-anchored panel below the trigger.
   Mobile : tap → bottom-sheet (lighter than full-screen overlay).
   No backdrop on desktop — the page stays visible behind. */
.pf-tools-dd {
  position: absolute;
  display: none;
  z-index: 200;
  background: #131316;
  border: 1px solid #2A2A32;
  border-radius: 14px;
  box-shadow: 0 24px 56px rgba(0,0,0,.45), 0 4px 12px rgba(0,0,0,.25);
  padding: 18px 18px 14px;
  width: max-content;
  max-width: min(880px, calc(100vw - 32px));
  animation: pfDdFade .15s ease-out;
}
.pf-tools-dd.is-open { display: block; }

@keyframes pfDdFade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pf-tools-dd-arrow {
  position: absolute;
  top: -7px;
  width: 12px; height: 12px;
  background: #131316;
  border-top: 1px solid #2A2A32;
  border-left: 1px solid #2A2A32;
  transform: rotate(45deg) translateX(-50%);
  transform-origin: top left;
  border-radius: 2px 0 0 0;
}

.pf-tools-dd-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 8px 22px;
}
.pf-tools-dd-col-title {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #5C5B65;
  padding: 0 8px 8px;
  border-bottom: 1px solid #1F1F25;
  margin-bottom: 6px;
}
.pf-tools-dd-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 8px;
  border-radius: 8px;
  text-decoration: none;
  color: #F0EEE8;
  transition: background .15s ease;
}
.pf-tools-dd-item:hover {
  background: #1A1A1F;
  text-decoration: none;
}
.pf-tools-dd-icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--icon-color, #C4FF47) 14%, transparent);
  color: var(--icon-color, #C4FF47);
}
.pf-tools-dd-icon svg { width: 17px; height: 17px; }
.pf-tools-dd-text { display: flex; flex-direction: column; line-height: 1.2; }
.pf-tools-dd-name { font-size: 13px; font-weight: 600; color: #F0EEE8; }
.pf-tools-dd-desc {
  font-size: 11px;
  color: #9B9AA3;
  font-family: 'Space Mono', ui-monospace, monospace;
  margin-top: 2px;
}

/* Fewer columns on narrower screens */
@media (max-width: 880px) {
  .pf-tools-dd-grid { grid-template-columns: repeat(2, 1fr); gap: 6px 16px; }
}

/* ── Mobile bottom-sheet variant ── */
.pf-tools-dd.is-mobile {
  position: fixed;
  inset: auto 0 0 0;
  top: auto;
  left: 0 !important;
  right: 0;
  width: 100%;
  max-width: 100%;
  border-radius: 18px 18px 0 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
  max-height: 75vh;
  overflow-y: auto;
  padding: 22px 18px calc(90px + env(safe-area-inset-bottom, 0px));
  animation: pfDdSlideUp .22s ease-out;
}
.pf-tools-dd.is-mobile .pf-tools-dd-arrow { display: none; }
.pf-tools-dd.is-mobile::before {
  /* Drag handle */
  content: '';
  display: block;
  width: 40px; height: 4px;
  background: #38383F;
  border-radius: 2px;
  margin: 0 auto 14px;
}
.pf-tools-dd.is-mobile .pf-tools-dd-grid {
  grid-template-columns: 1fr;
  gap: 4px 0;
}
.pf-tools-dd.is-mobile .pf-tools-dd-col-title { margin-top: 14px; }
.pf-tools-dd.is-mobile .pf-tools-dd-col:first-child .pf-tools-dd-col-title { margin-top: 0; }

@keyframes pfDdSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
