/* ==========================================================================
   BarcodeGeneratorX — bgx.css
   Ad slots (responsive, never hidden), SEO content sections, language bar.
   Plain hand-written CSS: independent of the compiled Tailwind bundle.
   ========================================================================== */

:root {
  --bgx-red:      #dc2626;
  --bgx-red-dark: #b91c1c;
  --bgx-ink:      #0a0a0a;
  --bgx-muted:    #6b7280;
  --bgx-line:     #e5e7eb;
  --bgx-bg:       #f5f5f5;
  --bgx-radius:   6px;
  --bgx-shadow:   0 1px 3px rgba(0,0,0,.08), 0 8px 24px -12px rgba(0,0,0,.18);
}

*, *::before, *::after { box-sizing: border-box; }

img { max-width: 100%; height: auto; }

/* --------------------------------------------------------------------------
   1. HEADER BAR — logo · ad slot · tiny language switch · advertise link
   -------------------------------------------------------------------------- */

html { scroll-padding-top: 120px; }

.bgx-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid var(--bgx-line);
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.bgx-nav-in {
  max-width: 1500px;
  margin: 0 auto;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.bgx-nav-brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  text-decoration: none;
  min-width: 0;
}
.bgx-nav-brand img { height: 64px; width: auto; display: block; }
.bgx-nav-tag {
  margin-left: 14px;
  padding-left: 14px;
  border-left: 2px solid var(--bgx-line);
  font-size: 14px;
  font-weight: 700;
  color: var(--bgx-ink);
  line-height: 1.25;
}
.bgx-nav-right {
  margin-left: auto;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.bgx-nav-cta {
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--bgx-red);
  cursor: pointer;
  white-space: nowrap;
}
.bgx-nav-cta:hover { color: var(--bgx-red-dark); text-decoration: underline; }

/* the header ad lives inside the bar on desktop, in its own strip below it otherwise */
.bgx-nav-ad { display: none; }
.bgx-nav-ad-mobile {
  display: block;
  padding: 12px 18px 14px;
  background: #fff;
  border-bottom: 1px solid var(--bgx-line);
  text-align: center;
}
.bgx-nav-ad-mobile .bgx-ad-label { display: block; margin-bottom: 5px; }
.bgx-nav-ad-mobile .bgx-ad { margin: 0 auto; }

@media (min-width: 1024px) {
  .bgx-nav-ad {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 728px;
  }
  .bgx-nav-ad-mobile { display: none; }
}
@media (max-width: 700px) {
  .bgx-nav-in { padding: 8px 14px; gap: 10px; }
  .bgx-nav-brand img { height: 50px; }
  .bgx-nav-tag { display: none; }
  .bgx-nav-cta { font-size: 13px; }
}

/* --- Language switch: intentionally small; it is mainly a crawl path --- */
.bgx-langbar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #b6bcc5;
  line-height: 1;
}
.bgx-lang {
  color: #9aa1ab;
  text-decoration: none;
  padding: 2px 1px;
  transition: color .15s;
}
.bgx-lang:hover { color: var(--bgx-red); }
.bgx-lang.on { color: var(--bgx-ink); }
.bgx-lang-sep { color: #d7dbe0; }

/* --------------------------------------------------------------------------
   1b. INTRO BLOCK (below the generator)
   -------------------------------------------------------------------------- */

.bgx-intro { padding: 34px 0 26px; background: var(--bgx-bg); }
.bgx-h1 {
  margin: 0 0 12px;
  font-size: clamp(23px, 3.6vw, 34px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.02em;
  color: var(--bgx-ink);
}

/* --- keep the sticky preview clear of the taller header bar --- */
@media (min-width: 768px) { .sticky-preview { top: 7.5rem !important; } }

/* --------------------------------------------------------------------------
   2. AD SLOTS
   Every slot is a <div class="bgx-ad" data-ad-slot="..."> filled by ads.js.
   The empty state is a colourful, clickable "advertise here" placeholder.
   -------------------------------------------------------------------------- */

.bgx-ad {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  overflow: hidden;
  border-radius: var(--bgx-radius);
}

.bgx-ad-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 18px auto;
}
.bgx-ad-label {
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #9ca3af;
  font-weight: 700;
}

/* ---- Live (sold) ad ---- */
.bgx-ad-live {
  display: block;
  width: 100%;
  line-height: 0;
  border-radius: var(--bgx-radius);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--bgx-line);
}
.bgx-ad-live img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ---- Empty placeholder: colourful + animated ---- */
.bgx-ad-empty {
  --c1: #dc2626;
  --c2: #f97316;
  --c3: #7c3aed;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 90px;
  padding: 16px 14px;
  border: 0;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  color: #fff;
  border-radius: var(--bgx-radius);
  background: linear-gradient(125deg, var(--c1) 0%, var(--c2) 45%, var(--c3) 100%);
  background-size: 220% 220%;
  animation: bgxDrift 9s ease-in-out infinite;
  box-shadow: 0 4px 14px -6px rgba(220,38,38,.55);
  transition: transform .18s ease, box-shadow .18s ease;
  overflow: hidden;
}
.bgx-ad-empty::before {
  /* subtle barcode texture */
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(90deg,
      rgba(255,255,255,.16) 0 3px, transparent 3px 9px);
  opacity: .35;
  pointer-events: none;
}
.bgx-ad-empty::after {
  /* sweeping shine */
  content: "";
  position: absolute;
  top: -60%;
  left: -40%;
  width: 45%;
  height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.42), transparent);
  transform: rotate(18deg);
  animation: bgxShine 4.5s ease-in-out infinite;
  pointer-events: none;
}
.bgx-ad-empty:hover  { transform: translateY(-2px); box-shadow: 0 10px 26px -8px rgba(220,38,38,.65); }
.bgx-ad-empty:focus-visible { outline: 3px solid #111; outline-offset: 3px; }

@keyframes bgxDrift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes bgxShine { 0% { left: -45%; } 60%, 100% { left: 130%; } }

.bgx-ad-empty .bgx-ad-kicker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  background: rgba(0,0,0,.28);
  border-radius: 999px;
  z-index: 1;
}
.bgx-ad-empty .bgx-ad-title {
  position: relative;
  z-index: 1;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.bgx-ad-empty .bgx-ad-size {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  opacity: .92;
  font-variant-numeric: tabular-nums;
}
.bgx-ad-empty .bgx-ad-cta {
  position: relative;
  z-index: 1;
  margin-top: 2px;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 800;
  color: #111;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
  white-space: nowrap;
}

/* palette variations so the page does not look monotonous */
.bgx-ad[data-ad-slot="header"]  .bgx-ad-empty { --c1:#dc2626; --c2:#f97316; --c3:#facc15; }
.bgx-ad[data-ad-slot="left"]    .bgx-ad-empty { --c1:#7c3aed; --c2:#db2777; --c3:#f97316; }
.bgx-ad[data-ad-slot="right"]   .bgx-ad-empty { --c1:#0891b2; --c2:#2563eb; --c3:#7c3aed; }
.bgx-ad[data-ad-slot="preview"] .bgx-ad-empty { --c1:#059669; --c2:#0891b2; --c3:#2563eb; }
.bgx-ad[data-ad-slot="inline"]  .bgx-ad-empty { --c1:#dc2626; --c2:#db2777; --c3:#7c3aed; }
.bgx-ad[data-ad-slot="footer"]  .bgx-ad-empty { --c1:#1f2937; --c2:#dc2626; --c3:#f97316; }
.bgx-ad[data-ad-slot="sticky"]  .bgx-ad-empty { --c1:#dc2626; --c2:#7c3aed; --c3:#2563eb; }

/* ---- Slot geometry ---- */

/* --- Leaderboards (header / footer): keep the wide, short 728×90 shape --- */
.bgx-slot-header,
.bgx-slot-footer { min-height: 90px; max-width: 728px; }

.bgx-slot-header .bgx-ad-empty,
.bgx-slot-footer .bgx-ad-empty { min-height: 96px; }

@media (min-width: 640px) {
  /* lay the placeholder out as a real banner rather than a tall stack */
  .bgx-slot-header .bgx-ad-empty,
  .bgx-slot-footer .bgx-ad-empty {
    flex-direction: row;
    justify-content: center;
    gap: 18px;
    min-height: 90px;
    height: 90px;
    padding: 0 22px;
  }
  .bgx-slot-header .bgx-ad-empty .bgx-ad-kicker,
  .bgx-slot-footer .bgx-ad-empty .bgx-ad-kicker { order: -1; }
  .bgx-slot-header .bgx-ad-empty .bgx-ad-title,
  .bgx-slot-footer .bgx-ad-empty .bgx-ad-title { font-size: 19px; }
  .bgx-slot-header .bgx-ad-empty .bgx-ad-cta,
  .bgx-slot-footer .bgx-ad-empty .bgx-ad-cta { margin-top: 0; }
}

/* Skyscrapers: vertical on desktop rails */
.bgx-rail { display: none; }
.bgx-slot-sky { width: 160px; min-height: 600px; }
.bgx-slot-sky .bgx-ad-empty { min-height: 600px; }
.bgx-slot-sky .bgx-ad-title { writing-mode: horizontal-tb; }

/* Rectangle slots */
.bgx-slot-rect      { max-width: 336px; min-height: 280px; }
.bgx-slot-rect .bgx-ad-empty { min-height: 280px; }
.bgx-slot-preview   { max-width: 300px; min-height: 250px; }
.bgx-slot-preview .bgx-ad-empty { min-height: 250px; }

/* --- Barcode-type menu: keep it short on phones so the form stays reachable --- */
@media (max-width: 767px) {
  #left-menu { max-height: 46vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  #left-menu .group-header { position: sticky; top: 0; z-index: 2; }
}

/* --- Mobile / tablet ad strip: the slots that used to disappear --- */
.bgx-ad-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 20px 16px;
  background: #fff;
  border-top: 1px solid var(--bgx-line);
  border-bottom: 1px solid var(--bgx-line);
}
.bgx-ad-strip .bgx-ad-wrap { margin: 0; }
.bgx-ad-strip .bgx-ad-empty { min-height: 120px; }

/* Phones too: the two skyscrapers sit side by side instead of stacking. */
.bgx-ad-strip { grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px 12px; }

/* Sold skyscraper (160×600) in the strip: never stretch it to full width.
   Keep its own proportions, at most 160px wide and a limited height,
   so it no longer covers the whole screen on phones. */
.bgx-ad-strip .bgx-ad-live {
  width: auto;
  max-width: 160px;
  margin: 0 auto;
}
.bgx-ad-strip .bgx-ad-live img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(420px, 55vh);
  margin: 0 auto;
}
@media (min-width: 1280px) {
  .bgx-rail { display: flex; align-items: flex-start; padding: 24px 12px; }
  .bgx-ad-strip { display: none; }
}

/* --- Sticky mobile bar (phones + tablets only) --- */
.bgx-sticky {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--bgx-line);
  box-shadow: 0 -4px 18px -8px rgba(0,0,0,.35);
  transform: translateY(0);
  transition: transform .3s ease;
}
.bgx-sticky[hidden] { display: none !important; }
.bgx-sticky .bgx-ad { min-height: 50px; }
.bgx-sticky .bgx-ad-empty { min-height: 52px; padding: 6px 12px; flex-direction: row; gap: 10px; }
.bgx-sticky .bgx-ad-empty .bgx-ad-title { font-size: 13px; }
.bgx-sticky .bgx-ad-empty .bgx-ad-kicker,
.bgx-sticky .bgx-ad-empty .bgx-ad-size { display: none; }
.bgx-sticky .bgx-ad-empty .bgx-ad-cta { margin-top: 0; padding: 5px 12px; font-size: 11px; }
.bgx-sticky-close {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid var(--bgx-line);
  background: #fff;
  border-radius: 50%;
  color: var(--bgx-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.bgx-sticky-close:hover { color: var(--bgx-ink); border-color: #9ca3af; }

@media (min-width: 1024px) { .bgx-sticky { display: none !important; } }
/* keep the sticky bar from covering the footer text */
@media (max-width: 1023px) { body.bgx-has-sticky { padding-bottom: 68px; } }

@media (prefers-reduced-motion: reduce) {
  .bgx-ad-empty, .bgx-ad-empty::after { animation: none; }
  .bgx-ad-empty:hover { transform: none; }
}

/* --------------------------------------------------------------------------
   3. SEO CONTENT SECTIONS
   -------------------------------------------------------------------------- */

.bgx-section { padding: 56px 0; }
.bgx-section--alt { background: #fff; border-top: 1px solid var(--bgx-line); border-bottom: 1px solid var(--bgx-line); }
.bgx-container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.bgx-eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--bgx-red);
  background: #fef2f2;
  border-radius: 999px;
}
.bgx-h2 {
  margin: 0 0 14px;
  font-size: clamp(22px, 3.4vw, 32px);
  font-weight: 800;
  line-height: 1.2;
  color: var(--bgx-ink);
  letter-spacing: -.01em;
}
.bgx-h3 { margin: 0 0 8px; font-size: 17px; font-weight: 700; color: var(--bgx-ink); }
.bgx-lead { margin: 0 0 28px; max-width: 76ch; font-size: 16px; line-height: 1.75; color: #374151; }
.bgx-p    { margin: 0 0 14px; font-size: 15px; line-height: 1.8; color: #4b5563; }
.bgx-p a  { color: var(--bgx-red); font-weight: 600; text-decoration: none; }
.bgx-p a:hover { text-decoration: underline; }

.bgx-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.bgx-card {
  padding: 22px;
  background: #fff;
  border: 1px solid var(--bgx-line);
  border-radius: var(--bgx-radius);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.bgx-section--alt .bgx-card { background: #fafafa; }
.bgx-card:hover { border-color: #d1d5db; box-shadow: var(--bgx-shadow); transform: translateY(-2px); }
.bgx-card p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--bgx-muted); }
.bgx-card-icon {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--bgx-red), #f97316);
  color: #fff;
}
.bgx-card-icon svg { width: 22px; height: 22px; }

/* numbered how-to steps */
.bgx-steps { counter-reset: bgxstep; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.bgx-step {
  position: relative;
  padding: 22px 22px 22px 60px;
  background: #fff;
  border: 1px solid var(--bgx-line);
  border-radius: var(--bgx-radius);
}
.bgx-section--alt .bgx-step { background: #fafafa; }
.bgx-step::before {
  counter-increment: bgxstep;
  content: counter(bgxstep);
  position: absolute;
  left: 18px; top: 20px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--bgx-ink);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
.bgx-step h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; color: var(--bgx-ink); }
.bgx-step p  { margin: 0; font-size: 14px; line-height: 1.65; color: var(--bgx-muted); }

/* comparison / reference table */
.bgx-table-wrap { overflow-x: auto; border: 1px solid var(--bgx-line); border-radius: var(--bgx-radius); background: #fff; }
.bgx-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
.bgx-table th, .bgx-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--bgx-line); }
.bgx-table thead th { background: #111; color: #fff; font-size: 11px; letter-spacing: .09em; text-transform: uppercase; font-weight: 700; }
.bgx-table tbody tr:last-child td { border-bottom: 0; }
.bgx-table tbody tr:hover { background: #fafafa; }
.bgx-table td:first-child { font-weight: 700; color: var(--bgx-ink); white-space: nowrap; }

/* FAQ */
.bgx-faq { display: grid; gap: 10px; max-width: 860px; }
.bgx-faq details {
  background: #fff;
  border: 1px solid var(--bgx-line);
  border-radius: var(--bgx-radius);
  overflow: hidden;
}
.bgx-section--alt .bgx-faq details { background: #fafafa; }
.bgx-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--bgx-ink);
  list-style: none;
}
.bgx-faq summary::-webkit-details-marker { display: none; }
.bgx-faq summary::after {
  content: "+";
  flex: 0 0 auto;
  font-size: 21px;
  font-weight: 400;
  color: var(--bgx-red);
  transition: transform .2s;
}
.bgx-faq details[open] summary::after { transform: rotate(45deg); }
.bgx-faq details[open] summary { border-bottom: 1px solid var(--bgx-line); }
.bgx-faq-body { padding: 16px 20px; font-size: 14.5px; line-height: 1.8; color: #4b5563; }
.bgx-faq-body p { margin: 0 0 10px; }
.bgx-faq-body p:last-child { margin: 0; }

/* trust strip under the hero */
.bgx-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 26px;
  padding: 14px 20px;
  background: #111;
  color: #e5e7eb;
  font-size: 13px;
  font-weight: 600;
}
.bgx-trust span { display: inline-flex; align-items: center; gap: 7px; }
.bgx-trust svg { width: 15px; height: 15px; color: #34d399; flex: 0 0 auto; }

/* footer contact block */
.bgx-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 14px;
  padding: 14px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--bgx-radius);
}
.bgx-contact-mail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--bgx-red);
  text-decoration: none;
  word-break: break-all;
}
.bgx-contact-mail:hover { color: var(--bgx-red-dark); text-decoration: underline; }
.bgx-contact-mail svg { width: 18px; height: 18px; flex: 0 0 auto; }
.bgx-contact-note { font-size: 12.5px; color: #7f1d1d; }

.bgx-footer-mail {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  color: var(--bgx-red);
  text-decoration: none;
}
.bgx-footer-mail:hover { text-decoration: underline; }

/* toast + misc */
.bgx-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.bgx-breadcrumb { font-size: 12.5px; color: var(--bgx-muted); padding: 10px 0; }
.bgx-breadcrumb a { color: var(--bgx-muted); text-decoration: none; }
.bgx-breadcrumb a:hover { color: var(--bgx-red); }

@media (max-width: 640px) {
  .bgx-section { padding: 40px 0; }
  .bgx-step { padding: 18px 18px 18px 56px; }
}


/* --- Header-bar ad: slimmer placeholder so the sticky bar stays compact --- */
.bgx-nav-ad .bgx-ad-empty {
  min-height: 84px;
  height: 84px;
  gap: 14px;
  padding: 0 16px;
}
.bgx-nav-ad .bgx-ad-empty .bgx-ad-title { font-size: 17px; }
@media (max-width: 1180px) {
  .bgx-nav-ad .bgx-ad-empty .bgx-ad-size { display: none; }
}
