/* Category + tabs + gallery + products */

.cat-hero {
  position: relative;
  min-height: 92vh;
  min-height: 92dvh;
  display: grid;
  align-items: end;
  overflow: hidden;
  padding: calc(var(--header-h) + 2rem) var(--gutter) var(--space-6);
}

@media (max-width: 900px) {
  /* Stable viewport: avoid jump when mobile browser chrome shows/hides */
  .cat-hero {
    min-height: 92vh;
    min-height: 92svh;
  }
}

.cat-hero--has-children {
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 34vw);
  grid-template-rows: 1fr;
  column-gap: clamp(1.5rem, 3vw, 3rem);
}

.cat-hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.cat-hero__media img,
.cat-hero__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.05);
}

.cat-hero__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(18, 16, 14, 0.25) 0%, rgba(18, 16, 14, 0.45) 45%, rgba(18, 16, 14, 0.94) 100%),
    linear-gradient(90deg, rgba(18, 16, 14, 0.55) 0%, rgba(18, 16, 14, 0.2) 42%, rgba(18, 16, 14, 0.72) 100%);
  pointer-events: none;
}

.cat-hero--has-dekupe .cat-hero__veil {
  background:
    linear-gradient(180deg, rgba(18, 16, 14, 0.22) 0%, rgba(18, 16, 14, 0.4) 45%, rgba(18, 16, 14, 0.92) 100%),
    linear-gradient(90deg, rgba(18, 16, 14, 0.58) 0%, rgba(18, 16, 14, 0.12) 48%, rgba(18, 16, 14, 0.28) 100%);
}

.cat-hero__content {
  position: relative;
  z-index: 2;
  max-width: 20ch;
  align-self: end;
}

.cat-hero--has-children .cat-hero__content {
  grid-column: 1;
  grid-row: 1;
  padding-bottom: 0.25rem;
}

.cat-hero__content .display {
  margin-bottom: 0.35em;
}

.cat-hero__title-image {
  margin: 0 0 0.85rem;
  max-width: min(22rem, 85%);
}

.cat-hero__title-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 7.5rem;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.45));
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-muted);
  margin-bottom: 1.25rem;
}

.breadcrumb a:hover {
  color: var(--brass-soft);
}

.breadcrumb span {
  opacity: 0.4;
}

/* Children — inside hero veil, desktop right */
.cat-children {
  position: relative;
  z-index: 3;
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 420px;
  margin: 0 0 0 auto;
  padding: 0.15rem 0 0;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

.cat-children__head {
  flex: 0 0 auto;
  margin-bottom: 0.65rem;
}

.cat-children__title {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1.8vw, 1.65rem);
  font-weight: 400;
  color: var(--paper);
  line-height: 1.15;
}

.cat-children__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.2rem;
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
  align-content: start;
}

/* Alt kategori dekupe — sağ kolon (alt menü yerine) */
.cat-dekupe {
  position: relative;
  z-index: 4;
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  justify-self: end;
  width: 100%;
  max-width: min(440px, 38vw);
  margin: 0;
  padding: 0 0 0.25rem;
  pointer-events: none;
}

.cat-dekupe img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(82vh, 860px);
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 22px 48px rgba(0, 0, 0, 0.55));
}

.cat-child-card {
  position: relative;
  display: grid;
  grid-template-columns: 4.75rem 1fr;
  grid-template-rows: 4.75rem;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: rgba(22, 18, 14, 0.82);
  backdrop-filter: blur(8px);
  color: inherit;
  text-decoration: none;
  isolation: isolate;
  transition:
    border-color 0.35s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.45s ease;
}

.cat-child-card:hover,
.cat-child-card:focus-visible {
  border-color: rgba(184, 149, 90, 0.55);
  transform: translateX(-4px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
  outline: none;
}

.cat-child-card.is-active {
  border-color: rgba(184, 149, 90, 0.72);
  box-shadow: 0 0 0 1px rgba(184, 149, 90, 0.25);
}

.cat-child-card__media {
  position: relative;
  overflow: hidden;
  background: #1a1612;
  height: 100%;
  min-height: 0;
  color: inherit;
  text-decoration: none;
  display: block;
}

.cat-child-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, transparent 40%, rgba(18, 16, 14, 0.35) 100%);
  pointer-events: none;
}

.cat-child-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  transform: scale(1.04);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  filter: saturate(0.88) contrast(1.04);
}

.cat-child-card:hover .cat-child-card__media img,
.cat-child-card:focus-visible .cat-child-card__media img {
  transform: scale(1.12);
}

.cat-child-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.55rem 0.7rem;
  min-height: 0;
}

.cat-child-card__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 1.15;
  color: var(--paper);
  text-decoration: none;
}

a.cat-child-card__title:hover,
a.cat-child-card__title:focus-visible {
  color: var(--brass-soft);
  outline: none;
}

.cat-child-card__text {
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--paper-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cat-child-card__cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass-soft);
}

.cat-child-card__links {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  align-items: center;
}

.cat-child-card__links a {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.cat-child-card__links a:hover,
.cat-child-card__links a:focus-visible {
  color: var(--paper);
  border-bottom-color: rgba(184, 149, 90, 0.65);
  outline: none;
}

.cat-child-card__cta em {
  font-style: normal;
  display: inline-block;
  transition: transform 0.35s ease;
}

.cat-child-card:hover .cat-child-card__cta em,
.cat-child-card:focus-visible .cat-child-card__cta em {
  transform: translateX(5px);
}

.cat-child-card--overview:hover .cat-child-card__cta em,
.cat-child-card--overview:focus-visible .cat-child-card__cta em {
  transform: translateX(-5px);
}

.cat-child-card--overview {
  border-style: dashed;
  border-color: rgba(243, 238, 230, 0.22);
}

@media (max-width: 960px) {
  .cat-hero--has-children {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-items: end;
    row-gap: 1.5rem;
  }

  .cat-hero--has-children .cat-hero__content {
    grid-column: 1;
    grid-row: 1;
  }

  .cat-children {
    grid-column: 1;
    grid-row: 2;
    max-width: none;
    max-height: none;
    margin: 0;
    overflow: visible;
    display: block;
    align-self: auto;
  }

  .cat-dekupe {
    grid-column: 1;
    grid-row: 2;
    max-width: min(280px, 70vw);
    margin: 0 auto;
    justify-self: center;
    align-self: end;
    padding-bottom: 0;
  }

  .cat-dekupe img {
    max-height: min(42vh, 360px);
  }

  .cat-children__grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    overflow: visible;
    flex: none;
    padding: 0;
  }

  .cat-child-card {
    grid-template-columns: 1fr;
    grid-template-rows: 9rem auto;
  }

  .cat-child-card:hover,
  .cat-child-card:focus-visible {
    transform: translateY(-4px);
  }

  .cat-child-card__media {
    height: 9rem;
    min-height: 9rem;
    max-height: 9rem;
  }

  .cat-child-card__media::after {
    background: linear-gradient(180deg, transparent 45%, rgba(18, 16, 14, 0.35) 100%);
  }

  .cat-child-card__body {
    min-height: 6.5rem;
    padding: 0.9rem 1rem 1rem;
  }
}

@media (max-width: 700px) {
  .cat-children__grid {
    grid-template-columns: 1fr;
  }

  .cat-child-card {
    grid-template-columns: 7.5rem 1fr;
    grid-template-rows: 5.75rem;
  }

  .cat-child-card__media {
    height: 100%;
    min-height: 0;
    max-height: none;
  }

  .cat-child-card__media::after {
    background: linear-gradient(90deg, transparent 40%, rgba(18, 16, 14, 0.35) 100%);
  }

  .cat-child-card__body {
    min-height: 0;
  }
}

/* Tabs */
.cat-tabs {
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  background: rgba(18, 16, 14, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: center;
  gap: clamp(1.5rem, 6vw, 4rem);
  padding: 0 var(--gutter);
}

.cat-tabs a {
  position: relative;
  padding: 1.15rem 0.25rem;
  font-size: var(--text-xs);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--paper-muted);
  transition: color 0.3s;
}

.cat-tabs a:hover {
  color: var(--paper);
}

.cat-tabs a.is-active {
  color: var(--paper);
}

.cat-tabs a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--brass);
}

.cat-panel {
  padding: var(--space-6) var(--gutter) var(--space-7);
  min-height: 60vh;
}

.cat-panel[hidden] {
  display: none !important;
}

/* Bilgi editorial */
.editorial {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
  max-width: var(--max);
  margin-inline: auto;
}

.editorial__aside {
  position: sticky;
  top: calc(var(--header-h) + 4rem);
}

.editorial__aside .eyebrow {
  margin-bottom: 1rem;
}

.editorial__body {
  font-size: var(--text-base);
  color: var(--paper-muted);
}

.editorial__body * {
  color: inherit;
}

.editorial__body h2 {
  color: var(--paper);
  font-size: var(--text-xl);
  margin-top: 2rem;
}

.editorial__body h3 {
  color: var(--paper);
  font-size: var(--text-lg);
  margin-top: 1.5rem;
}

.editorial__body a {
  color: var(--brass-soft);
  border-bottom: 1px solid rgba(184, 149, 90, 0.35);
}

.editorial__body strong,
.editorial__body b {
  color: var(--paper);
}

.editorial__body p {
  margin: 0 0 1rem;
}

.editorial__figure {
  margin-top: 2rem;
  overflow: hidden;
}

.editorial__figure img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
}

.editorial__figure figcaption {
  margin-top: 0.75rem;
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper-muted);
}

/* Gallery */
.gallery-head {
  max-width: var(--max);
  margin: 0 auto var(--space-5);
}

.gallery-grid {
  max-width: var(--max);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.15rem 0.85rem;
  align-items: stretch;
}

.gallery-item {
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--ink-elevated);
  border: 1px solid var(--line);
}

.gallery-item__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #1a1612;
}

.gallery-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.9s var(--ease-out), filter 0.5s;
  filter: saturate(0.9);
}

.gallery-item:hover img {
  transform: scale(1.04);
  filter: saturate(1);
}

.gallery-item figcaption {
  flex: 0 0 auto;
  padding: 0.7rem 0.8rem 0.85rem;
  font-size: var(--text-xs);
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: var(--paper-muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
  height: calc(1.45em * 3 + 0.7rem + 0.85rem);
  word-break: break-word;
}

/* Horizontal gallery variant */
.gallery-rail {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.gallery-rail .gallery-item {
  flex: 0 0 min(70vw, 420px);
  margin: 0;
  scroll-snap-align: start;
}

.gallery-rail .gallery-item__media {
  aspect-ratio: 4 / 5;
  height: min(70vh, 560px);
}

.gallery-rail .gallery-item img {
  object-fit: cover;
}

/* Products grid */
.products-head {
  max-width: var(--max);
  margin: 0 auto var(--space-5);
}

.products-grid {
  max-width: var(--max);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(1rem, 2vw, 1.75rem);
}

.product-card {
  grid-column: span 4;
  display: block;
}

.product-card:nth-child(4n + 1) {
  grid-column: span 7;
}

.product-card:nth-child(4n + 2) {
  grid-column: span 5;
}

.product-card:nth-child(4n + 3) {
  grid-column: span 5;
}

.product-card:nth-child(4n + 4) {
  grid-column: span 7;
}

.product-card__media {
  overflow: hidden;
  background: var(--ink-soft);
  aspect-ratio: 4/5;
}

.product-card:nth-child(4n + 1) .product-card__media,
.product-card:nth-child(4n + 4) .product-card__media {
  aspect-ratio: 16/11;
}

.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease-out), filter 0.5s;
  filter: saturate(0.88);
}

.product-card:hover .product-card__media img {
  transform: scale(1.05);
  filter: saturate(1);
}

.product-card__meta {
  padding: 1rem 0.15rem 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.product-card__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
}

.product-card__period {
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-muted);
  white-space: nowrap;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 6, 5, 0.94);
  display: grid;
  place-items: center;
  padding: var(--gutter);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0.4s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-height: min(85vh, 900px);
  max-width: min(92vw, 1100px);
  object-fit: contain;
}

.lightbox__caption {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-muted);
}

.lightbox__close {
  position: absolute;
  top: 1.25rem;
  right: var(--gutter);
  font-size: var(--text-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .editorial {
    grid-template-columns: 1fr;
  }

  .editorial__aside {
    position: static;
  }

  .cat-panel[data-panel="galeri"] {
    padding-inline: 0.85rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 0.55rem;
    max-width: 26rem;
    margin-inline: auto;
  }

  .gallery-item {
    margin: 0;
  }

  .product-card,
  .product-card:nth-child(4n + 1),
  .product-card:nth-child(4n + 2),
  .product-card:nth-child(4n + 3),
  .product-card:nth-child(4n + 4) {
    grid-column: span 6;
  }

  .product-card__media,
  .product-card:nth-child(4n + 1) .product-card__media,
  .product-card:nth-child(4n + 4) .product-card__media {
    aspect-ratio: 4/5;
  }
}

@media (max-width: 560px) {
  .cat-panel[data-panel="galeri"] {
    padding-inline: 0.65rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 0.45rem;
    max-width: 22rem;
    margin-inline: auto;
  }

  .gallery-item {
    margin: 0;
  }

  .product-card,
  .product-card:nth-child(n) {
    grid-column: span 12;
  }

  .cat-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    gap: 1.5rem;
  }
}
