/* XHG eBay listing template styles.
   Linked from the listing description template (app/utils/ebay-template.ts) and
   served at https://xhg.com.au/ebay/listing.css — eBay descriptions
   allow external stylesheets but no JavaScript, so the gallery and tabs are
   pure-CSS (radio inputs + :checked). All rules are scoped under .xhg so they
   cannot leak into eBay's own page chrome. The Jost font is loaded via a
   Google Fonts <link> in the template itself. */

.xhg {
  max-width: 1100px;
  margin: 0 auto;
  font-family: 'Jost', Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  background: #fff;
}
.xhg a { color: #141414; text-decoration: none; }
.xhg img { border: 0; }

/* --- Header -------------------------------------------------------------- */
.xhg-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #eee;
}
.xhg-logo img { height: 60px; display: block; }
.xhg-nav a {
  display: inline-block;
  margin-left: 22px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: #2f4f3d;
}
.xhg-nav a:hover { color: #3b634c; }
/* Burger toggle: hidden on desktop; on mobile a checkbox opens the nav. */
.xhg-menu-cb { position: absolute; left: -9999px; }
.xhg-burger { display: none; }

/* --- Hero: gallery + title/price/trust ----------------------------------- */
.xhg-hero { display: flex; gap: 28px; padding: 24px 0; }
.xhg-hero-g { flex: 0 0 46%; max-width: 46%; }
.xhg-hero-i { flex: 1; }
.xhg-hero-i h1 {
  font-size: 24px;
  line-height: 1.25;
  font-weight: 600;
  text-transform: uppercase;
  color: #141414;
  margin: 0 0 10px;
}
.xhg-price { font-size: 22px; font-weight: 600; color: #141414; margin-bottom: 16px; }
.xhg-price span { font-size: 12px; font-weight: 400; color: #666; }
.xhg-trust { display: flex; border-top: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5; }
.xhg-trust > div { flex: 1; text-align: center; padding: 12px 6px; font-size: 12.5px; color: #2f4f3d; }
.xhg-trust > div + div { border-left: 1px solid #e5e5e5; }
.xhg-trust b { color: #3b634c; margin-right: 4px; }

/* --- Gallery (pure CSS: radios swap the main image) ---------------------- */
.xhg-g input { position: absolute; left: -9999px; }
.xhg-g-main { border: 1px solid #eee; padding: 8px; }
.xhg-g-main img { display: none; width: 100%; height: auto; }
#xhg-g1:checked ~ .xhg-g-main .g1,
#xhg-g2:checked ~ .xhg-g-main .g2,
#xhg-g3:checked ~ .xhg-g-main .g3,
#xhg-g4:checked ~ .xhg-g-main .g4,
#xhg-g5:checked ~ .xhg-g-main .g5,
#xhg-g6:checked ~ .xhg-g-main .g6,
#xhg-g7:checked ~ .xhg-g-main .g7,
#xhg-g8:checked ~ .xhg-g-main .g8,
#xhg-g9:checked ~ .xhg-g-main .g9,
#xhg-g10:checked ~ .xhg-g-main .g10,
#xhg-g11:checked ~ .xhg-g-main .g11,
#xhg-g12:checked ~ .xhg-g-main .g12 { display: block; }
.xhg-g-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.xhg-g-thumbs label {
  display: block;
  width: 64px;
  height: 64px;
  border: 1px solid #ddd;
  overflow: hidden;
  cursor: pointer;
}
.xhg-g-thumbs label img { width: 100%; height: 100%; object-fit: cover; display: block; }
#xhg-g1:checked ~ .xhg-g-thumbs label[for="xhg-g1"],
#xhg-g2:checked ~ .xhg-g-thumbs label[for="xhg-g2"],
#xhg-g3:checked ~ .xhg-g-thumbs label[for="xhg-g3"],
#xhg-g4:checked ~ .xhg-g-thumbs label[for="xhg-g4"],
#xhg-g5:checked ~ .xhg-g-thumbs label[for="xhg-g5"],
#xhg-g6:checked ~ .xhg-g-thumbs label[for="xhg-g6"],
#xhg-g7:checked ~ .xhg-g-thumbs label[for="xhg-g7"],
#xhg-g8:checked ~ .xhg-g-thumbs label[for="xhg-g8"],
#xhg-g9:checked ~ .xhg-g-thumbs label[for="xhg-g9"],
#xhg-g10:checked ~ .xhg-g-thumbs label[for="xhg-g10"],
#xhg-g11:checked ~ .xhg-g-thumbs label[for="xhg-g11"],
#xhg-g12:checked ~ .xhg-g-thumbs label[for="xhg-g12"] { border-color: #3b634c; border-width: 2px; }

/* --- Tabs (pure CSS: radios show one section) ----------------------------- */
.xhg-tabs { margin: 10px 0 24px; }
.xhg-tabs input { position: absolute; left: -9999px; }
.xhg-tabnav { display: flex; flex-wrap: wrap; border-bottom: 2px solid #141414; }
.xhg-tabnav label {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #777;
  cursor: pointer;
}
#xhg-t1:checked ~ .xhg-tabnav label[for="xhg-t1"],
#xhg-t2:checked ~ .xhg-tabnav label[for="xhg-t2"],
#xhg-t3:checked ~ .xhg-tabnav label[for="xhg-t3"],
#xhg-t4:checked ~ .xhg-tabnav label[for="xhg-t4"] { color: #141414; box-shadow: inset 0 -2px 0 #3b634c; }
.xhg-c { display: none; padding: 18px 2px; font-size: 14px; color: #444; }
#xhg-t1:checked ~ .xhg-c1,
#xhg-t2:checked ~ .xhg-c2,
#xhg-t3:checked ~ .xhg-c3,
#xhg-t4:checked ~ .xhg-c4 { display: block; }
.xhg-c h4 { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; color: #141414; }
.xhg-c p { margin: 0 0 10px; }
.xhg-c ul { margin: 0 0 10px; padding-left: 18px; }
/* Description & Specification tab: 50/50 split (description | specs). The
   description column grows to full width when the spec table is absent. */
.xhg-c1-cols { display: flex; gap: 24px; align-items: flex-start; }
.xhg-desc { flex: 1 1 50%; min-width: 0; }
.xhg-specs {
  flex: 1 1 50%;
  min-width: 0;
  background: #f9fafb;
  border-radius: 12px;
  padding: 10px 14px;
}

/* --- Related products (upsell carousel, links to our other eBay items) ----- */
/* Pure-CSS horizontal scroll-snap strip (no JS allowed in eBay descriptions):
   ~4 cards visible, the rest scroll/swipe across like eBay's own carousel. */
.xhg-rel { border-top: 1px solid #eee; padding: 22px 0; }
.xhg-rel h2 {
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #141414;
  margin: 0 0 14px;
}
.xhg-rel-g {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}
.xhg-rel-i {
  flex: 0 0 calc(25% - 11px);
  min-width: 150px;
  scroll-snap-align: start;
  display: block;
}
.xhg-rel-i img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
  background: #f5f5f5;
  border-radius: 8px;
}
.xhg-rel-i span {
  display: block;
  padding-top: 8px;
  font-size: 13px;
  line-height: 1.35;
  color: #333;
  height: 37px;
  overflow: hidden;
}
.xhg-rel-i b { display: block; padding-top: 4px; font-size: 15px; color: #141414; }

/* --- Footer ---------------------------------------------------------------- */
.xhg-ft { background: #1f3329; color: #979797; text-align: center; padding: 18px 12px; font-size: 12px; }
.xhg-ft-links a { color: #fff; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; margin: 0 12px; }
.xhg-ft p { margin: 10px 0 0; }

/* --- Mobile ---------------------------------------------------------------- */
@media (max-width: 768px) {
  .xhg { font-size: 15px; }
  .xhg-hd, .xhg-hero, .xhg-tabs, .xhg-rel { padding-left: 12px; padding-right: 12px; }

  /* Header: logo left, burger right; the nav drops down full width. */
  .xhg-hd { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .xhg-logo img { height: 46px; }
  .xhg-burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0 11px;
    box-sizing: border-box;
    border: 1px solid #dde3df;
    border-radius: 8px;
    cursor: pointer;
  }
  .xhg-burger span {
    display: block;
    height: 2px;
    background: #2f4f3d;
    border-radius: 2px;
    transition: transform .2s, opacity .2s;
  }
  .xhg-menu-cb:checked + .xhg-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .xhg-menu-cb:checked + .xhg-burger span:nth-child(2) { opacity: 0; }
  .xhg-menu-cb:checked + .xhg-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .xhg-nav { flex-basis: 100%; margin-top: 10px; border-top: 1px solid #eee; }
  /* Only collapse when the burger markup exists (older saved templates lack it). */
  .xhg-menu-cb ~ .xhg-nav { display: none; }
  .xhg-menu-cb:checked ~ .xhg-nav { display: block; }
  .xhg-nav a {
    display: block;
    margin: 0;
    padding: 13px 4px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #eee;
  }

  /* Hero: stacked gallery, then title/price; trust points as a list. */
  .xhg-hero { flex-direction: column; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
  .xhg-hero-g { flex: none; max-width: none; }
  .xhg-g-main { padding: 4px; }
  .xhg-g-thumbs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .xhg-g-thumbs label { flex: 0 0 60px; width: 60px; height: 60px; }
  .xhg-hero-i h1 { font-size: 20px; }
  .xhg-trust { flex-direction: column; }
  .xhg-trust > div { text-align: left; font-size: 13px; padding: 9px 4px; }
  .xhg-trust > div + div { border-left: 0; border-top: 1px solid #e5e5e5; }

  /* Tabs: 2 x 2 grid of buttons instead of a wrapping underline row. */
  .xhg-tabnav { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; border-bottom: 0; }
  .xhg-tabnav label {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 44px;
    padding: 8px 6px;
    font-size: 11.5px;
    letter-spacing: 0.5px;
    line-height: 1.3;
    background: #f3f5f4;
    border-radius: 8px;
  }
  #xhg-t1:checked ~ .xhg-tabnav label[for="xhg-t1"],
  #xhg-t2:checked ~ .xhg-tabnav label[for="xhg-t2"],
  #xhg-t3:checked ~ .xhg-tabnav label[for="xhg-t3"],
  #xhg-t4:checked ~ .xhg-tabnav label[for="xhg-t4"] { color: #fff; background: #3b634c; box-shadow: none; }
  .xhg-c { padding: 16px 0; font-size: 15px; }
  .xhg-c1-cols { flex-direction: column; }
  .xhg-desc, .xhg-specs { flex: none; width: 100%; box-sizing: border-box; }
  .xhg-desc img, .xhg-c img { max-width: 100%; height: auto; }
  .xhg-desc table, .xhg-specs table { width: 100%; }
  .xhg-specs { overflow-x: auto; }

  .xhg-rel-i { flex-basis: calc(50% - 7px); min-width: 0; }

  /* Footer: links stack as tap-sized rows. */
  .xhg-ft-links a { display: block; margin: 0; padding: 10px 0; }
}
