/* === Phase 4: Page hero (listing page) === */
.pagehero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line)
}

.pagehero img.bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .4
}

.pagehero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--bg) 10%, rgba(238, 242, 247, .6))
}

.pagehero .wrap {
  position: relative;
  z-index: 2;
  padding: 64px 28px 56px
}

.pagehero h1 {
  font-size: clamp(34px, 5vw, 62px);
  font-weight: 900;
  margin-top: 10px
}

.pagehero p {
  color: #3a4a59;
  font-size: 17px;
  margin-top: 10px;
  max-width: 560px
}

/* === Phase 4: Breadcrumb (used in both .pagehero and .crumbbar) === */
.crumb {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 500
}

.crumb a:hover {
  color: var(--accent)
}

.crumb span {
  color: var(--accent)
}

/* === Phase 4: Listing page classes === */
/* Section padding modifier */
.listing-sect {
  padding: 64px 0 80px
}

/* Toolbar */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px
}

.search {
  display: flex;
  border: 1px solid var(--line);
  background: var(--bg-2);
  min-width: 300px;
  flex: 1;
  max-width: 440px
}

.search input {
  flex: 1;
  border: 0;
  padding: 13px 16px;
  font-family: var(--font-base);
  font-size: 15px;
  background: transparent;
  color: var(--text)
}

.search input:focus {
  outline: 0
}

.search button {
  border: 0;
  background: var(--accent);
  color: #160a00;
  padding: 0 18px;
  cursor: pointer;
  font-size: 17px
}

.toolbar .count {
  font-size: 14px;
  color: var(--muted)
}

.toolbar select {
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 12px 14px;
  font-family: var(--font-base);
  font-size: 14px;
  color: var(--text);
  cursor: pointer
}

/* Layout 2-col */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: start
}

.side {
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 24px;
  position: sticky;
  top: 100px
}

.fgroup {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line)
}

.fgroup:last-child {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 0
}

.fgroup h4 {
  font-size: 14px;
  letter-spacing: .06em;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center
}

.reset {
  font-size: 11px;
  color: var(--steel);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500
}

.reset:hover {
  color: var(--accent)
}

/* Category tree */
.catlist {
  list-style: none;
  display: grid;
  gap: 1px
}

.crow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-width: 0
}

.radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  font-size: 14.5px;
  cursor: pointer;
  flex: 1;
  user-select: none
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  font-size: 14.5px;
  cursor: pointer;
  flex: 1;
  user-select: none
}

.radio input,
.check input {
  position: absolute;
  opacity: 0;
  pointer-events: none
}

.radio .dot {
  width: 18px;
  height: 18px;
  border: 2px solid #c4cedb;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  transition: .18s
}

.radio:hover .dot {
  border-color: var(--accent)
}

.radio input:checked~.dot {
  border-color: var(--accent)
}

.cat-parent > .crow .radio .dot {
  border-radius: 4px
}

.radio input:checked~.dot::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent)
}

.radio input:checked~.txt {
  color: var(--accent)
}

.radio .txt,
.check .txt {
  flex: 1
}

.radio .n,
.check .n {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
  margin-left: auto
}

.check .box {
  width: 18px;
  height: 18px;
  border: 2px solid #c4cedb;
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  transition: .18s
}

.check:hover .box {
  border-color: var(--accent)
}

.check input:checked~.box {
  background: var(--accent);
  border-color: var(--accent)
}

.check input:checked~.box::after {
  content: "";
  display: block;
  width: 5px;
  height: 9px;
  border-right: 2px solid #160a00;
  border-bottom: 2px solid #160a00;
  transform: rotate(45deg) translateY(-1px)
}

.check input:checked~.txt {
  color: var(--accent)
}

/* Collapse caret */
.caret {
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  transition: transform .28s, color .2s
}

.caret:hover {
  color: var(--accent)
}

.caret:active {
  transform: scale(.9)
}

.cat-parent.open .caret {
  transform: rotate(180deg)
}

.cat-children {
  list-style: none;
  display: none;
  padding-left: 22px
}

.cat-parent.open .cat-children {
  display: block
}

/* Toggle expand/collapse */
.ftoggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--steel);
  cursor: pointer;
  user-select: none;
  text-transform: none;
  letter-spacing: 0
}

.ftoggle:hover {
  color: var(--accent)
}

.ftoggle .ch::after {
  content: "\25B4"
}

.ftoggle.is-down .ch::after {
  content: "\25BE"
}

.fgroup.collapsed .catwrap {
  display: none
}

/* Year range */
.yearbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px
}

.yearbox input {
  flex: 1;
  width: 100%;
  text-align: center;
  border: 1px solid var(--line);
  padding: 9px 6px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  background: #fff;
  font-family: var(--font-base)
}

.yearbox input::-webkit-outer-spin-button,
.yearbox input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0
}

.yearbox input:focus {
  border-color: var(--accent);
  outline: 0
}

.yearbox .sep {
  color: var(--muted);
  flex-shrink: 0
}

.range {
  position: relative;
  height: 34px
}

.range .track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--line);
  border-radius: 3px;
  transform: translateY(-50%)
}

.range .track-fill {
  position: absolute;
  top: 50%;
  height: 4px;
  background: var(--accent);
  border-radius: 3px;
  transform: translateY(-50%)
}

.range input[type=range] {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  margin: 0;
  padding: 0;
  cursor: pointer
}

.range input[type=range]::-webkit-slider-thumb {
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(16, 42, 80, .25);
  -webkit-appearance: none
}

.range input[type=range]::-moz-range-thumb {
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(16, 42, 80, .25)
}

/* Product grid — scoped to .prodgrid to avoid overriding homepage .prod .pic { height:280px } */
.prodgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px
}

.prodgrid .prod {
  display: flex;
  flex-direction: column
}

.prodgrid .prod .pic {
  height: 220px
}

.prodgrid .prod .body {
  display: flex;
  flex-direction: column;
  flex: 1
}

.prodgrid .prod .foot {
  margin-top: auto
}

.prodgrid .prod h3 {
  font-size: 21px;
  text-transform: none
}

.prod.hide {
  display: none
}

/* Condition badges */
.cond.new {
  position: absolute;
  top: 10px;
  right: 10px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .04em;
  padding: 5px 11px;
  text-transform: uppercase;
  border-radius: 20px;
  background: #1f9d4d;
  color: #fff
}

.cond.used {
  position: absolute;
  top: 10px;
  right: 10px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .04em;
  padding: 5px 11px;
  text-transform: uppercase;
  border-radius: 20px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line)
}

/* Empty state */
.empty {
  display: none;
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
  background: var(--bg-2);
  border: 1px solid var(--line)
}

.empty.show {
  display: block
}

.empty .e-ic {
  font-size: 48px;
  margin-bottom: 14px
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 48px
}

.pagination a {
  min-width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--bg-2);
  font-weight: 500;
  color: var(--text);
  transition: .2s;
  padding: 0 8px;
  text-decoration: none
}

.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent)
}

.pagination a.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #160a00
}

.pagination a.disabled {
  opacity: .4;
  pointer-events: none
}

/* === Phase 4: Detail page classes === */
/* Section padding modifier */
.detail-sect {
  padding: 56px 0 80px
}

/* Breadcrumb bar (detail page — plain white bar, NOT pagehero) */
.crumbbar {
  background: var(--bg-2);
  border-bottom: 1px solid var(--line)
}

.crumbbar .wrap {
  padding: 16px 28px
}

/* Product detail 2-col grid */
.pd {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: start
}

/* Gallery */
.gallery .main {
  border: 1px solid var(--line);
  background: var(--bg-2);
  overflow: hidden;
  position: relative;
  aspect-ratio: 4/3
}

.gallery .main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in
}

.gallery .main .badge {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  background: var(--accent);
  color: #160a00;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .06em;
  padding: 7px 16px;
  text-transform: uppercase;
  clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%)
}

.gallery .main .cond {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: .04em;
  padding: 6px 13px;
  text-transform: uppercase;
  border-radius: 20px
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 12px
}

.thumbs button {
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
  transition: .2s
}

.thumbs button img {
  width: 100%;
  height: 100%;
  object-fit: cover
}

.thumbs button.on {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(245, 160, 21, .25)
}

/* Product info column */
.pinfo .brand {
  font-size: 14px;
  color: var(--steel);
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 500
}

.pinfo h1 {
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 900;
  text-transform: none;
  margin: 6px 0 12px
}

.pinfo .tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px
}

.pinfo .tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  color: var(--muted)
}

.pinfo .tag.acc {
  background: var(--accent);
  border-color: var(--accent);
  color: #160a00
}

.pinfo .lead {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 22px
}

/* Key specs */
.keyspecs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  margin-bottom: 22px
}

.keyspecs div {
  padding: 18px 12px;
  text-align: center;
  border-right: 1px solid var(--line)
}

.keyspecs div:last-child {
  border-right: 0
}

.keyspecs b {
  font-size: 24px;
  display: block;
  color: var(--text)
}

.keyspecs span {
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em
}

/* Rental options */
.rentopts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 22px
}

.ropt {
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 16px 18px
}

.ropt b {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  text-transform: none;
  margin-bottom: 4px
}

.ropt b .d {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0
}

.ropt span {
  font-size: 13px;
  color: var(--muted)
}

/* CTA row */
.cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap
}

/* Tab system */
.tabwrap {
  margin-top: 64px
}

.tabnav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--line)
}

.tabnav button {
  border: 0;
  background: none;
  padding: 14px 22px;
  font-family: var(--font-base);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: .2s
}

.tabnav button:hover {
  color: var(--accent)
}

.tabnav button.on {
  color: var(--text)
}

.tabnav button.on::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--accent)
}

.tabpane {
  display: none;
  padding: 30px 0
}

.tabpane.on {
  display: block
}

.tabpane p {
  margin-bottom: 14px;
  color: #34465a
}

.tabpane ul {
  margin: 0 0 14px 20px;
  color: #34465a
}

.tabpane ul li {
  margin-bottom: 6px
}

.tabpane figure {
  margin: 22px 0
}

.tabpane figure img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  border: 1px solid var(--line)
}

.tabpane .desc-imgs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 22px 0
}

.tabpane .desc-imgs img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border: 1px solid var(--line)
}

/* Spec table */
.spectable {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line)
}

.spectable tr:nth-child(odd) {
  background: var(--bg-2)
}

.spectable th {
  text-align: left;
  width: 38%;
  padding: 13px 16px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--line);
  text-transform: none;
  font-size: 14.5px
}

.spectable td {
  padding: 13px 16px;
  border: 1px solid var(--line);
  font-size: 14.5px;
  font-weight: 500
}

/* Document list */
.doclist {
  display: grid;
  gap: 12px;
  max-width: 560px
}

.doc {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 14px 18px;
  transition: .2s;
  text-decoration: none;
  color: inherit
}

.doc:hover {
  border-color: var(--accent)
}

.doc .di {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: #fdeede;
  color: #d6361f;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  border-radius: 6px
}

.doc .dn {
  flex: 1
}

.doc .dn b {
  display: block;
  font-size: 14.5px
}

.doc .dn span {
  font-size: 12.5px;
  color: var(--muted)
}

.doc .dl {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--steel)
}

.doc:hover .dl {
  color: var(--accent)
}

/* Lightbox */
.lb {
  position: fixed;
  inset: 0;
  background: rgba(8, 14, 24, .9);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px
}

.lb.open {
  display: flex
}

.lb img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain
}

.lb .x {
  position: absolute;
  top: 20px;
  right: 26px;
  color: #fff;
  font-size: 34px;
  cursor: pointer;
  line-height: 1
}

/* Related section */
.related {
  background: var(--bg-2);
  border-top: 1px solid var(--line)
}

.related .top {
  margin-bottom: 32px
}

.related .prodgrid {
  grid-template-columns: repeat(4, 1fr)
}

.related .prod .pic {
  height: 180px
}

.related .prod h3 {
  font-size: 17px
}

.related .prod .body {
  padding: 18px
}

.related .prod .brand {
  font-size: 12px
}

.related .prod .foot {
  font-size: 13px
}

@media(max-width:960px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch
  }

  .search {
    min-width: 0;
    max-width: none;
    width: 100%
  }

  .toolbar select {
    width: 100%
  }

  .layout {
    grid-template-columns: 1fr
  }

  .side {
    position: static
  }

  .prodgrid {
    grid-template-columns: 1fr 1fr
  }

  .related .prodgrid {
    grid-template-columns: 1fr 1fr
  }

  .pd {
    grid-template-columns: 1fr;
    gap: 32px
  }
}

@media(max-width:576px) {
  .prodgrid {
    grid-template-columns: 1fr
  }

  .related .prodgrid {
    grid-template-columns: 1fr
  }

  .thumbs {
    grid-template-columns: repeat(4, 1fr)
  }

  .keyspecs {
    grid-template-columns: 1fr 1fr 1fr
  }

  .rentopts {
    grid-template-columns: 1fr
  }

  .spectable th {
    width: 46%
  }

  .cta-row {
    flex-direction: column
  }

  .tabpane .desc-imgs {
    grid-template-columns: 1fr
  }
}