/*
 * By Koç teması — premium katmanı (style.css'ten SONRA yüklenir).
 * Yapışkan header, arama paneli, mini-sepet çekmecesi, mobil sepet çubuğu,
 * kategori kartları, ürün kartı cilası, erişilebilirlik ve hareket kuralları.
 * Renkler yalnız palette.css değişkenlerinden gelir.
 */

:root {
  --bk-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --bk-section-gap: clamp(56px, 8vw, 104px);
  --bk-header-offset: 0px;
}

body.has-admin-preview-bar {
  --bk-header-offset: var(--bk-admin-preview-bar-height, 56px);
}

/* ---------- Tipografi ---------- */
.bk-product-section__title,
.bk-category-cards__title {
  letter-spacing: -0.015em;
}

.bk-product-section {
  padding: var(--bk-section-gap) 0;
}

.bk-product-section__description {
  font-size: 15px;
  line-height: 1.7;
}

/* ---------- Yapışkan header ---------- */
.bk-header {
  position: sticky;
  top: var(--bk-header-offset);
  z-index: 1040;
  transition: box-shadow 260ms var(--bk-ease), background-color 260ms var(--bk-ease);
}

.bk-header .bk-topbar {
  max-height: 60px;
  overflow: hidden;
  transition: max-height 260ms var(--bk-ease), opacity 200ms var(--bk-ease);
}

.bk-header__main-inner {
  transition: min-height 260ms var(--bk-ease);
}

.bk-header__brand img {
  transition: max-height 260ms var(--bk-ease);
}

.bk-header__nav {
  transition: min-height 260ms var(--bk-ease);
}

.bk-header.is-compact {
  box-shadow: 0 14px 32px -22px rgba(var(--bk-ink-rgb), 0.35);
}

.bk-header.is-compact .bk-topbar {
  max-height: 0;
  opacity: 0;
}

.bk-header.is-compact .bk-header__main-inner {
  min-height: 76px;
}

.bk-header.is-compact .bk-header__brand img {
  max-height: 52px;
}

.bk-header.is-compact .bk-header__nav {
  min-height: 52px;
}

@media (max-width: 991.98px) {
  .bk-header.is-compact .bk-header__main-inner {
    min-height: 64px;
  }

  .bk-header.is-compact .bk-header__brand img {
    max-height: 40px;
  }
}

/* ---------- Arama paneli ---------- */
.bk-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(16px, 8vh, 96px) 16px 16px;
  background: rgba(var(--bk-ink-rgb), 0.56);
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms var(--bk-ease), visibility 220ms var(--bk-ease);
}

.bk-search-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.bk-search-overlay__panel {
  width: min(760px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  border-radius: 6px;
  background: var(--bk-color-white);
  box-shadow: var(--bk-shadow-lg);
  transform: translateY(-12px);
  transition: transform 260ms var(--bk-ease);
}

.bk-search-overlay.is-open .bk-search-overlay__panel {
  transform: translateY(0);
}

.bk-search-overlay__form {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--bk-color-border-softest);
}

.bk-search-overlay__form svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--bk-color-gold-dark);
}

.bk-search-overlay__input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--bk-font-serif);
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 500;
  color: var(--bk-color-ink);
}

.bk-search-overlay__close {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--bk-color-ink);
}

.bk-search-overlay__close:hover {
  background: var(--bk-color-overlay-soft);
}

.bk-search-overlay__close svg {
  width: 18px;
  height: 18px;
  color: currentColor;
}

.bk-search-overlay__body {
  padding: 18px 22px 24px;
}

.bk-search-overlay__label {
  margin: 0 0 12px;
  color: var(--bk-color-gray);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.bk-search-overlay__popular {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bk-search-overlay__popular a {
  padding: 8px 16px;
  border: 1px solid var(--bk-color-border-softest);
  border-radius: 999px;
  font-size: 14px;
}

.bk-search-overlay__popular a:hover {
  border-color: var(--bk-color-gold);
  color: var(--bk-color-gold-dark);
}

.bk-search-overlay__list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bk-search-overlay__item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 8px;
  border-radius: 4px;
}

.bk-search-overlay__item:hover,
.bk-search-overlay__item:focus-visible {
  background: var(--bk-color-cream-soft);
}

.bk-search-overlay__item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 3px;
  background: var(--bk-color-cream-soft);
}

.bk-search-overlay__item-title {
  display: block;
  font-family: var(--bk-font-serif);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.25;
}

.bk-search-overlay__item-meta {
  display: block;
  margin-top: 2px;
  color: var(--bk-color-gray);
  font-size: 12px;
}

.bk-search-overlay__item-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--bk-color-gold-dark);
  white-space: nowrap;
}

.bk-search-overlay__empty,
.bk-search-overlay__all {
  margin: 0;
  color: var(--bk-color-gray);
  font-size: 14px;
}

.bk-search-overlay__all {
  display: inline-block;
  margin-top: 14px;
  color: var(--bk-color-ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

body.is-bk-overlay-open {
  overflow: hidden;
}

/* ---------- Mini-sepet çekmecesi ---------- */
.bk-mini-cart {
  position: fixed;
  inset: 0;
  z-index: 1095;
  visibility: hidden;
  pointer-events: none;
}

.bk-mini-cart.is-open {
  visibility: visible;
  pointer-events: auto;
}

.bk-mini-cart__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(var(--bk-ink-rgb), 0.5);
  opacity: 0;
  transition: opacity 260ms var(--bk-ease);
}

.bk-mini-cart.is-open .bk-mini-cart__backdrop {
  opacity: 1;
}

.bk-mini-cart__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(440px, 100%);
  background: var(--bk-color-white);
  box-shadow: var(--bk-shadow-lg);
  transform: translateX(100%);
  transition: transform 320ms var(--bk-ease);
}

.bk-mini-cart.is-open .bk-mini-cart__panel {
  transform: translateX(0);
}

.bk-mini-cart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--bk-color-border-softest);
}

.bk-mini-cart__title {
  margin: 0;
  font-family: var(--bk-font-serif);
  font-size: 26px;
  font-weight: 500;
}

.bk-mini-cart__count {
  margin-left: 6px;
  color: var(--bk-color-gray);
  font-family: var(--bk-font-sans);
  font-size: 13px;
}

.bk-mini-cart__close {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.bk-mini-cart__close:hover {
  background: var(--bk-color-overlay-soft);
}

.bk-mini-cart__close svg {
  width: 18px;
  height: 18px;
}

.bk-mini-cart__items {
  flex: 1;
  overflow-y: auto;
  padding: 8px 24px;
}

.bk-mini-cart__item {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--bk-color-border-xsoft);
}

.bk-mini-cart__item img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 3px;
  background: var(--bk-color-cream-soft);
}

.bk-mini-cart__item-name {
  margin: 0 0 4px;
  font-family: var(--bk-font-serif);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.25;
}

.bk-mini-cart__item-meta {
  color: var(--bk-color-gray);
  font-size: 12px;
  line-height: 1.5;
}

.bk-mini-cart__item-price {
  font-size: 14px;
  font-weight: 600;
}

.bk-mini-cart__remove {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
  color: var(--bk-color-gray);
}

.bk-mini-cart__remove:hover {
  background: var(--bk-color-overlay-soft);
  color: var(--bk-color-ink);
}

.bk-mini-cart__empty {
  padding: 56px 0;
  text-align: center;
}

.bk-mini-cart__empty p {
  margin: 0 0 18px;
  color: var(--bk-color-gray);
}

.bk-mini-cart__foot {
  display: grid;
  gap: 12px;
  padding: 20px 24px 24px;
  border-top: 1px solid var(--bk-color-border-softest);
  background: var(--bk-color-cream-fresh);
}

.bk-mini-cart__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 14px;
}

.bk-mini-cart__total strong {
  font-family: var(--bk-font-serif);
  font-size: 26px;
  font-weight: 600;
}

.bk-mini-cart__note {
  margin: 0;
  color: var(--bk-color-gray);
  font-size: 12px;
}

body.is-bk-cart-open {
  overflow: hidden;
}

/* ---------- Ana sayfa kategori kartları ---------- */
.bk-category-cards {
  padding: var(--bk-section-gap) 0 0;
}

.bk-category-cards__head {
  margin-bottom: 36px;
  text-align: center;
}

.bk-category-cards__eyebrow {
  margin: 0 0 10px;
  color: var(--bk-color-gold-dark);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.bk-category-cards__title {
  margin: 0;
  font-family: var(--bk-font-serif);
  font-size: clamp(30px, 3.2vw, 46px);
  font-weight: 500;
  line-height: 1.08;
}

.bk-category-cards__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 24px);
}

.bk-category-card {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 4px;
  background: var(--bk-color-cream-muted);
}

.bk-category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms var(--bk-ease);
}

.bk-category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(var(--bk-ink-rgb), 0.62), rgba(var(--bk-ink-rgb), 0) 55%);
}

.bk-category-card__label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 22px 20px;
  color: #fff;
  text-align: center;
}

.bk-category-card__name {
  display: block;
  font-family: var(--bk-font-serif);
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 500;
  line-height: 1.1;
}

.bk-category-card__cta {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.85;
}

@media (hover: hover) {
  .bk-category-card:hover img {
    transform: scale(1.05);
  }
}

@media (max-width: 767.98px) {
  .bk-category-cards__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Ürün kartı cilası ---------- */
.bk-product-card__media img {
  transition: transform 700ms var(--bk-ease), opacity var(--bk-transition-slow);
}

.bk-product-card__body {
  gap: 8px;
  padding-top: 14px;
}

.bk-product-card__price--sale,
.bk-product-card__price--base {
  font-family: var(--bk-font-serif);
  font-size: 19px;
  font-weight: 600;
}

.bk-product-card__installment {
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

.bk-product-card__badge {
  letter-spacing: 0.08em;
}

@media (hover: hover) and (pointer: fine) {
  .bk-product-card:hover .bk-product-card__media {
    box-shadow: 0 24px 48px -28px rgba(var(--bk-ink-rgb), 0.35);
  }
}

.bk-product-card__media {
  transition: box-shadow 360ms var(--bk-ease);
}

/* Hover'da ikinci görsel */
.bk-product-card__media .bk-product-card__hover {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms var(--bk-ease), transform 700ms var(--bk-ease);
}

@media (hover: hover) and (pointer: fine) {
  .bk-product-card:hover .bk-product-card__hover {
    opacity: 1;
  }
}

/* ---------- Yükleniyor (iskelet) ---------- */
.bk-skeleton {
  position: relative;
  overflow: hidden;
  background: var(--bk-color-cream-muted);
  border-radius: 4px;
}

.bk-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: bk-shimmer 1.4s infinite;
}

@keyframes bk-shimmer {
  to {
    transform: translateX(100%);
  }
}

/* ---------- Mobil sabit sepet çubuğu (ürün detay) ---------- */
.bk-sticky-buy {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  display: none;
  align-items: center;
  gap: 14px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--bk-color-border-softest);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  transform: translateY(110%);
  transition: transform 300ms var(--bk-ease);
}

.bk-sticky-buy.is-visible {
  transform: translateY(0);
}

.bk-sticky-buy__info {
  flex: 1;
  min-width: 0;
}

.bk-sticky-buy__name {
  display: block;
  overflow: hidden;
  font-family: var(--bk-font-serif);
  font-size: 16px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bk-sticky-buy__price {
  font-size: 14px;
  font-weight: 600;
  color: var(--bk-color-gold-dark);
}

.bk-sticky-buy .bk-btn {
  min-height: 44px;
  flex: none;
}

@media (max-width: 767.98px) {
  .bk-sticky-buy {
    display: flex;
  }

  body.has-sticky-buy {
    padding-bottom: 76px;
  }
}

/* ---------- Sepet yönlendirmesi: ücretsiz kargo / güven ---------- */
.bk-cart-trust-note {
  margin: 0;
  color: var(--bk-color-gray);
  font-size: 12px;
}

/* ---------- Beliriş animasyonu (JS yoksa içerik görünür kalır) ---------- */
.js-reveal [data-bk-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms var(--bk-ease), transform 700ms var(--bk-ease);
}

.js-reveal [data-bk-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* ---------- Erişilebilirlik ---------- */
:focus-visible {
  outline: 2px solid var(--bk-color-gold);
  outline-offset: 3px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-offset: 1px;
}

.bk-skip-link {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 1100;
  padding: 10px 16px;
  border-radius: 4px;
  background: var(--bk-color-ink);
  color: #fff;
  transition: top 200ms var(--bk-ease);
}

.bk-skip-link:focus {
  top: 12px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .js-reveal [data-bk-reveal] {
    opacity: 1;
    transform: none;
  }
}
