/* =========================================================
   ESCO Elektrik — Catalogue pages (ürünler, kategori, ürün detayı)
   Builds on tokens and components from main.css
   ========================================================= */

/* ---------- Breadcrumb ---------- */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 13px; color: var(--muted); }
.crumbs li { display: inline-flex; align-items: center; }
.crumbs li + li::before { content: "/"; margin: 0 10px; color: #b9bbbf; }
.crumbs a { transition: color .2s; }
.crumbs a:hover { color: var(--red); }
.crumbs [aria-current="page"] { color: var(--graphite); font-weight: 500; }

/* ---------- Page head ---------- */
.page-head { background: var(--off); border-bottom: 1px solid var(--line); padding: var(--s4) 0 var(--s8); }
.page-head__row { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s6); align-items: end; margin-top: var(--s6); }
.page-head__row > div:only-child { grid-column: 1 / -1; }
.page-head__title {
  font-family: var(--font-head); font-weight: 800; text-transform: uppercase; letter-spacing: -.02em;
  font-size: clamp(32px, 4vw, 56px); line-height: 1.05; color: var(--graphite); margin-top: var(--s2); max-width: 20ch;
}
.page-head__lead { margin-top: var(--s3); max-width: 60ch; font-size: 17px; color: var(--muted); }
.page-head__meta { display: inline-block; margin-left: 8px; padding-left: 12px; border-left: 1px solid var(--line); color: var(--graphite); font-weight: 600; }

/* ---------- Catalogue search (products index) ---------- */
.cat-search { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; padding: 0 20px; background: #fff; border: 1px solid var(--line); border-bottom: 2px solid var(--graphite); }
.cat-search > .ico { color: var(--red); }
.cat-search input { min-width: 0; height: 64px; border: 0; outline: 0; background: none; font-family: var(--font-head); font-size: 18px; font-weight: 600; color: var(--graphite); }
.cat-search input::placeholder { color: #a3a6aa; font-weight: 500; }
.cat-search:focus-within { border-bottom-color: var(--red); }
.cat-search .search-results { position: absolute; top: 100%; left: -1px; right: -1px; z-index: 20; margin-top: 0; box-shadow: 0 24px 48px -24px rgba(34, 35, 38, .35); }

/* ---------- Category layout ---------- */
.cat-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--s6); align-items: start; padding-block: var(--s7) var(--s12); }
.cat-aside { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: var(--s3); max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; scrollbar-width: thin; }
.cat-aside__box { border: 1px solid var(--line); background: #fff; }
.cat-aside__title {
  display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; cursor: default; list-style: none;
  font-family: var(--font-head); font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--graphite);
  border-bottom: 1px solid var(--line);
}
.cat-aside__title::-webkit-details-marker { display: none; }
.cat-aside__title .ico { display: none; }
.cat-aside nav { padding: 8px 0; }

.tree a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 20px; font-size: 14px; line-height: 1.4; color: var(--charcoal); transition: color .2s, background-color .2s; }
.tree a small { flex: none; font-size: 12px; color: #a3a6aa; font-variant-numeric: tabular-nums; }
.tree a:hover { color: var(--red); }
.tree a[aria-current="page"] { color: var(--red); font-weight: 600; background: rgba(229, 35, 41, .06); box-shadow: inset 2px 0 0 var(--red); }
.tree--d0 > li > a, .tree--d0 > li > details > summary > a { font-family: var(--font-head); font-weight: 700; color: var(--graphite); }
.tree--d1 a { padding-left: 32px; }
.tree--d2 a { padding-left: 44px; font-size: 13px; }
.tree--d3 a { padding-left: 56px; font-size: 13px; }
.tree summary { position: relative; display: block; list-style: none; cursor: pointer; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary > a { padding-right: 48px; }
.tree__toggle { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); display: grid; place-items: center; width: 28px; height: 28px; color: var(--muted); pointer-events: none; }
.tree details[open] > summary .tree__toggle .ico { transform: rotate(180deg); }
.tree__toggle .ico { transition: transform .25s var(--ease); }

.aside-cta { display: grid; gap: 16px; padding: 24px 20px; background: var(--graphite); color: var(--on-dark-muted); font-size: 14px; }
.aside-cta .contact-line { display: flex; align-items: center; gap: 10px; font-weight: 600; color: #fff; }
.aside-cta .contact-line .ico { color: var(--red); }

.cat-main { min-width: 0; }
.cat-block + .cat-block { margin-top: var(--s8); }
.prod-grid--catalog { grid-template-columns: repeat(3, 1fr); }

/* ---------- Filter box ---------- */
.filter-box { display: flex; align-items: center; gap: 12px; padding: 0 16px; margin-bottom: var(--s6); background: #fff; border: 1px solid var(--line); transition: border-color .2s; }
.filter-box:focus-within { border-color: var(--graphite); }
.filter-box > .ico { color: var(--muted); }
.filter-box input { flex: 1; min-width: 0; height: 52px; border: 0; outline: 0; background: none; font-size: 15px; }
.filter-box__count { flex: none; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.filter-box--sm { margin-bottom: var(--s3); max-width: 480px; }
.filter-box--sm input { height: 44px; }
.filter-empty { padding: 24px; border: 1px dashed var(--line); color: var(--muted); font-size: 15px; }
.filter-empty a { color: var(--red); font-weight: 600; }
[data-filter-item][hidden], [data-filter-group][hidden] { display: none !important; }

/* ---------- Sub-category cards ---------- */
.subcat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s2); }
.subcat {
  position: relative; display: grid; grid-template-rows: auto 1fr; height: 100%;
  background: #fff; border: 1px solid var(--line); transition: border-color .3s, box-shadow .3s;
}
.subcat:hover { border-color: var(--graphite); box-shadow: 0 16px 32px -24px rgba(34, 35, 38, .45); }
.subcat__media { display: block; aspect-ratio: 16 / 10; padding: 12px; border-bottom: 1px solid var(--line); overflow: hidden; }
.subcat__media img { width: 100%; height: 100%; object-fit: contain; transition: transform .6s var(--ease); }
.subcat:hover .subcat__media img { transform: scale(1.05); }
.subcat__body { display: grid; align-content: start; gap: 4px; padding: 16px 56px 18px 18px; }
.subcat__body strong { font-family: var(--font-head); font-size: 16px; line-height: 1.3; color: var(--graphite); }
.subcat__body small { font-size: 13px; color: var(--muted); }
.subcat__arrow { position: absolute; right: 18px; bottom: 20px; width: 20px; height: 20px; color: var(--red); transition: transform .3s var(--ease); }
.subcat:hover .subcat__arrow { transform: translateX(4px); }

/* ---------- Products index ---------- */
.products-index { padding-block: var(--s10) var(--s12); }
.root-block + .root-block { margin-top: var(--s10); padding-top: var(--s10); border-top: 1px solid var(--line); }
.root-block__head { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; margin-bottom: var(--s4); }
.root-block__head > .ico { color: var(--red); }
.root-block__head .h3 { text-transform: uppercase; }
.root-block__head p { margin-top: 4px; }

/* ---------- Product detail ---------- */
.pd-top { padding: var(--s4) 0 var(--s8); background: var(--off); border-bottom: 1px solid var(--line); }
.pd { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--s8); align-items: start; margin-top: var(--s5); }

.gallery { display: grid; gap: 12px; }
.gallery__main { aspect-ratio: 16 / 10; display: grid; place-items: center; padding: var(--s3); background: #fff; border: 1px solid var(--line); overflow: hidden; }
.gallery__img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.gallery__thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.gallery__thumbs button { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 10; padding: 6px; background: #fff; border: 1px solid var(--line); overflow: hidden; transition: border-color .2s; }
.gallery__thumbs button:hover { border-color: var(--muted); }
.gallery__thumbs button[aria-current="true"] { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.gallery__thumbs img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }

.pd__info { display: grid; gap: var(--s3); align-content: start; }
.pd__info > .eyebrow { justify-self: start; }
.pd__info > .eyebrow:hover { color: var(--red-700); }
.pd__title { font-family: var(--font-head); font-weight: 800; font-size: clamp(30px, 3.2vw, 46px); line-height: 1.08; letter-spacing: -.02em; color: var(--graphite); }
.pd__summary { font-size: 17px; line-height: 1.65; color: var(--charcoal); max-width: 56ch; }
.pd__facts { border-top: 1px solid var(--line); }
.pd__facts div { display: grid; grid-template-columns: minmax(120px, 2fr) 3fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pd__facts dt { color: var(--muted); }
.pd__facts dd { color: var(--graphite); font-weight: 600; font-variant-numeric: tabular-nums; }
.pd__facts dd .muted { font-weight: 400; font-size: 13px; margin-left: 4px; }
.pd__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.pd__note { margin-top: -8px; font-size: 13px; }
.pd__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.pd__tags li { padding: 6px 12px; font-size: 12px; font-weight: 500; color: var(--charcoal); background: var(--off); border: 1px solid var(--line); }

.pd-body { padding-block: var(--s10) var(--s12); }
.pd-section + .pd-section { margin-top: var(--s10); }

/* Spec table */
.spec { overflow: auto; max-height: 640px; border: 1px solid var(--line); background: #fff; }
.spec:focus-visible { outline-offset: 2px; }
.spec__table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.spec__table th {
  position: sticky; top: 0; z-index: 1; padding: 14px 16px; text-align: left; white-space: nowrap;
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--graphite);
}
.spec__table td { padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--charcoal); }
.spec__table tbody tr:nth-child(even) td { background: #fbfbfa; }
.spec__table tbody tr:hover td { background: rgba(229, 35, 41, .05); }
.spec__table .is-code { font-weight: 600; color: var(--graphite); }
.spec__act { width: 1%; text-align: right; }
.spec__quote { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 13px; font-weight: 600; color: var(--red); border: 1px solid transparent; transition: border-color .2s, background-color .2s; }
.spec__quote:hover { border-color: var(--red); background: #fff; }

/* Long-form description */
.prose { max-width: 78ch; font-size: 16px; line-height: 1.75; color: var(--charcoal); }
.prose > * + * { margin-top: 1em; }
.prose h2, .prose h3, .prose h4 { font-family: var(--font-head); color: var(--graphite); line-height: 1.3; margin-top: 1.6em; }
.cat-seo { margin-top: var(--s8); padding-top: var(--s6); border-top: 1px solid var(--line); }
.cat-seo .prose { max-width: none; }
.prose h2 { font-size: 28px; font-weight: 800; letter-spacing: -.01em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 22px; }
.prose h4 { font-size: 18px; }
.prose strong { color: var(--graphite); }
.prose a { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .4em; }
.prose table { border-collapse: collapse; font-size: 14px; }
.prose th, .prose td { padding: 8px 14px; border: 1px solid var(--line); text-align: center; }
.prose tr:first-child td, .prose th { background: var(--off); font-weight: 600; color: var(--graphite); }

/* ---------- CTA band ---------- */
.cta-band { background: var(--charcoal); color: var(--on-dark-muted); }
.cta-band__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding-block: var(--s8); flex-wrap: wrap; }
.cta-band .eyebrow { color: var(--on-dark-muted); }
.cta-band__title { margin-top: 12px; font-family: var(--font-head); font-size: clamp(24px, 2.4vw, 34px); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; color: #fff; max-width: 26ch; }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .prod-grid--catalog { grid-template-columns: repeat(2, 1fr); }
  .cat-layout { grid-template-columns: 260px minmax(0, 1fr); gap: var(--s5); }
}

@media (max-width: 1024px) {
  .page-head__row { grid-template-columns: 1fr; gap: var(--s4); margin-top: var(--s4); }
  .cat-layout { grid-template-columns: 1fr; gap: var(--s4); padding-top: var(--s4); }
  .cat-aside { position: static; max-height: none; overflow: visible; }
  .cat-aside__title { cursor: pointer; border-bottom: 0; }
  .cat-aside__box[open] .cat-aside__title { border-bottom: 1px solid var(--line); }
  .cat-aside__title .ico { display: block; transition: transform .25s var(--ease); }
  .cat-aside__box[open] .cat-aside__title .ico { transform: rotate(180deg); }
  .aside-cta { display: none; }
  .pd { grid-template-columns: 1fr; gap: var(--s5); }
  .root-block__head { grid-template-columns: auto 1fr; }
  .root-block__head .btn { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 768px) {
  .page-head { padding-bottom: var(--s6); }
  .page-head__meta { display: block; margin: 8px 0 0; padding: 0; border: 0; }
  .subcat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .subcat__body { padding: 12px 40px 14px 14px; }
  .subcat__body strong { font-size: 14px; }
  .subcat__arrow { right: 12px; bottom: 14px; }
  .cta-band__actions, .cta-band__actions .btn { width: 100%; }
}

@media (max-width: 600px) {
  .prod-grid--catalog { grid-template-columns: 1fr; }
  .root-block__head > .ico { width: 32px; height: 32px; }
  .cat-search { padding: 0 14px; }
  .cat-search input { height: 56px; font-size: 16px; }
  .pd__actions .btn { width: 100%; }
  .pd__facts div { grid-template-columns: 1fr 1fr; }
  .gallery__main { padding: 12px; }
  .spec__table th, .spec__table td { padding: 10px 12px; }
}
