/* ── Mobil & dokunmatik optimizasyonları ───────────────── */

:root {
  --header-height: 4.5rem;
  --mobile-bar-height: 3.75rem;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

html {
  scroll-padding-top: calc(var(--header-height) + var(--safe-top) + 0.5rem);
  -webkit-text-size-adjust: 100%;
}

body {
  padding-bottom: calc(var(--mobile-bar-height) + var(--safe-bottom));
}

@media (min-width: 1024px) {
  body {
    padding-bottom: 0;
  }
}

/* Dokunmatik hedefler — min 44px */
@media (max-width: 1023px) {
  .btn-primary,
  .btn-hero,
  .category-filter__btn,
  .project-filters__btn,
  .product-card__btn,
  .mobile-nav-link,
  #menu-toggle {
    min-height: 44px;
  }

  .mobile-nav-link {
    display: flex;
    align-items: center;
    padding: 0.85rem 0;
  }

  #menu-toggle {
    min-width: 44px;
  }

  /* iOS odak zoom'unu engelle */
  .contact-form__field input,
  .contact-form__field textarea,
  .contact-form__field select {
    font-size: 16px;
  }

  .contact-form {
    padding: 1.25rem;
  }

  .contact-form__field input,
  .contact-form__field textarea,
  .contact-form__field select {
    padding: 0.95rem 1rem;
  }

  /* Header — çentikli ekranlar */
  #site-header {
    padding-top: var(--safe-top);
  }

  #site-header > div {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  /* Hero — üst menü altında kalsın */
  #hero .relative.z-10 {
    padding-top: calc(var(--header-height) + 1rem);
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  #hero-title {
    font-size: clamp(1.85rem, 8vw, 2.75rem);
    line-height: 1.15;
  }

  #hero-eyebrow {
    letter-spacing: 0.35em;
    font-size: 0.65rem;
  }

  .btn-hero {
    width: 100%;
    max-width: 20rem;
    justify-content: center;
    padding: 1rem 1.5rem;
  }

  /* İstatistik şeridi */
  .stats-bar .grid {
    gap: 1.5rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .stats-bar__value {
    font-size: 1.75rem;
  }

  .stats-bar__label {
    font-size: 0.58rem;
    line-height: 1.4;
  }

  /* Atölye görseli — mobilde dikey geçiş */
  .workshop-grid__fade {
    background: linear-gradient(
      180deg,
      rgba(250, 248, 245, 0) 0%,
      rgba(250, 248, 245, 0.15) 55%,
      rgba(255, 255, 255, 0.55) 100%
    );
  }

  .workshop-section {
    padding: 3.5rem 0;
  }

  /* Kategori filtreleri — yatay kaydırma */
  .category-filter {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    margin: 0 -1.25rem;
    padding: 0.25rem 1.25rem 0.75rem;
    max-width: 100vw;
  }

  .category-filter::-webkit-scrollbar {
    display: none;
  }

  .category-filter__btn {
    flex-shrink: 0;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  /* Proje filtreleri */
  .project-filters {
    padding: 1rem;
    margin-bottom: 2rem;
  }

  .project-filters__group {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
  }

  .project-filters__group::-webkit-scrollbar {
    display: none;
  }

  .project-filters__btn {
    flex-shrink: 0;
    white-space: nowrap;
    min-height: 40px;
  }

  .project-filters__label {
    flex-shrink: 0;
    width: auto;
    margin-right: 0.5rem;
    margin-bottom: 0;
    align-self: center;
  }

  /* Tanınırlık */
  .recognition-section {
    padding: 2.5rem 0;
  }

  .recognition-grid {
    gap: 1.5rem;
  }

  .recognition-item__title {
    font-size: 1.2rem;
  }

  .recognition-item__text {
    font-size: 0.78rem;
  }

  /* Hub — küçük ekranlarda daha ferah */
  .hub-section {
    padding: 3rem 0 2rem;
  }

  .hub-cards .grid {
    gap: 1rem;
  }

  .hub-card {
    padding: 1.25rem;
  }

  /* Footer */
  footer {
    padding-bottom: calc(1.5rem + var(--safe-bottom));
  }

  /* Vitrin / showcase — mobil dokunma ve boşluk */
  body[data-page='vitrin'] {
    --header-height: 3.85rem;
  }

  .vitrine-piece__play {
    min-height: 2.65rem;
    padding: 0.55rem 1rem;
    font-size: 0.68rem;
  }

  .vitrine-piece__cta {
    min-height: 2.85rem;
    width: 100%;
    justify-content: center;
  }

  .vitrine-concepts__track {
    animation-duration: 90s;
  }

  .contact-section {
    padding-bottom: calc(3rem + var(--mobile-bar-height) + var(--safe-bottom));
  }

  .contact-whatsapp-btn {
    min-height: 3rem;
    width: 100%;
    justify-content: center;
  }
}

/* ── Mobil menü (tam ekran) ───────────────────────────── */
.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--fog-faint);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-menu-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 1023px) {
  .mobile-menu {
    position: fixed;
    top: calc(var(--header-height) + var(--safe-top));
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  .mobile-menu.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu:not(.hidden) {
    display: block;
  }

  body.menu-open {
    overflow: hidden;
    touch-action: none;
  }
}

/* ── Alt sabit iletişim çubuğu (mobil) ─────────────────── */
.mobile-action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 48;
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 0;
  padding-bottom: var(--safe-bottom);
  background: rgba(18, 16, 14, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.35);
}

.mobile-action-bar__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: var(--mobile-bar-height);
  padding: 0.5rem 0.25rem;
  font-size: 0.58rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fog-muted);
  background: transparent;
  border: none;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease, background 0.2s ease;
}

.mobile-action-bar__btn:active {
  background: rgba(184, 149, 107, 0.08);
}

.mobile-action-bar__btn--primary {
  color: #f3ede4;
  background: #1a2744;
  font-weight: 500;
  letter-spacing: 0.12em;
  border-left: 1px solid rgba(212, 175, 122, 0.22);
  border-right: 1px solid rgba(212, 175, 122, 0.22);
}

.mobile-action-bar__btn--primary:active {
  background: #243556;
}

.mobile-action-bar__icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.mobile-action-bar__icon--wa {
  color: #25D366;
}

/* Dokunmatik cihazlarda hover taklidi yok */
@media (hover: none) {
  .product-card:hover,
  .hub-card:hover,
  .btn-primary:hover,
  .btn-hero:hover {
    transform: none;
  }
}

@media (max-width: 1023px) {
  .product-card--story {
    gap: 1.25rem;
  }

  .product-card__title {
    font-size: clamp(1.45rem, 6vw, 1.85rem);
  }

  .product-card__text {
    font-size: 0.92rem;
    line-height: 1.75;
  }

  .product-card__image-wrap {
    min-height: 14rem;
    aspect-ratio: 4 / 3;
  }

  .page-main {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
}
