/* ─── Reset & Temel ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
  touch-action: manipulation;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
  min-width: 320px;
  touch-action: manipulation;
}

img { max-width: 100%; height: auto; }

/* ─── Tailwind primary renk yardımcıları ─────────────────────── */
.bg-primary-50  { background-color: #f0fdf4; }
.text-primary   { color: #16a34a; }
.bg-primary     { background-color: #16a34a; }
.bg-primary-dark{ background-color: #15803d; }
.border-primary { border-color: #16a34a; }
.hover\:bg-primary-dark:hover { background-color: #15803d; }
.bg-accent      { background-color: #25D366; }
.bg-accent-dark { background-color: #128C7E; }
.hover\:bg-accent-dark:hover { background-color: #128C7E; }
.text-accent    { color: #25D366; }

/* ─── Ürün Kartı ─────────────────────────────────────────────── */
.urun-kart {
  transition: transform .25s ease, box-shadow .25s ease;
  will-change: transform;
  display: flex;
  flex-direction: column;
}
.urun-kart:hover { transform: translateY(-4px); }

.urun-kart .urun-overlay {
  opacity: 0;
  transform: translateY(100%);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.urun-kart:hover .urun-overlay {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.urun-kart img {
  transition: transform .4s ease;
}
.urun-kart:hover img { transform: scale(1.04); }

/* Kart resim alanı oranı sabit */
.urun-kart [style*="aspect-ratio"],
.urun-kart .aspect-square {
  aspect-ratio: 1 / 1;
}

/* ─── Hero ───────────────────────────────────────────────────── */
.hero-gradient {
  background: linear-gradient(135deg, #15803d 0%, #16a34a 55%, #22c55e 100%);
}

/* ─── Rozetler ───────────────────────────────────────────────── */
.rozet-indirim {
  animation: rozetSal .8s ease-in-out infinite alternate;
}
@keyframes rozetSal {
  from { transform: rotate(-2deg) scale(1); }
  to   { transform: rotate(2deg) scale(1.05); }
}

/* ─── WhatsApp Sabit Buton (sol alt) ─────────────────────────── */
.wp-btn {
  animation: wpYuz 2.5s ease-in-out infinite;
}
@keyframes wpYuz {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

/* ─── WhatsApp Grup Butonu (sağ kenar) ───────────────────────── */
#wp-grup-btn {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  max-width: 44px;
}
#wp-grup-btn .ic {
  position: relative;
  background: #25D366;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 8px;
  border-radius: 14px 0 0 14px;
  box-shadow: -3px 0 16px rgba(0,0,0,.15);
  transition: background .2s, transform .2s;
  cursor: pointer;
}
#wp-grup-btn .ic:hover {
  background: #128C7E;
  transform: translateX(-3px);
}
#wp-grup-btn .ic svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
#wp-grup-btn .metin {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  margin-top: 6px;
  max-height: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wp-grup-ping {
  position: absolute;
  top: -4px;
  left: 4px;
  width: 10px;
  height: 10px;
}
.wp-grup-ping-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #facc15;
  animation: ping 1.2s cubic-bezier(0,0,.2,1) infinite;
  opacity: .7;
}
.wp-grup-ping-dot {
  position: relative;
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #eab308;
}
@keyframes ping { 75%,100%{transform:scale(2);opacity:0} }

/* Mobilde footer alt boşluk (sabit butonlar için) */
@media (max-width: 767px) {
  footer {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom));
  }
}

/* ─── Animasyonlar ───────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up { animation: fadeInUp .5s ease-out both; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
.animate-float { animation: float 3s ease-in-out infinite; }

/* ─── Header ─────────────────────────────────────────────────── */
#main-header {
  transition: box-shadow .3s;
}
#main-header.scrolled { box-shadow: 0 4px 24px rgba(0,0,0,.08); }

/* Dropdown menü */
.dropdown-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all .2s ease;
}
.dropdown-parent:hover .dropdown-menu,
.dropdown-parent:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ─── Kategori Kartı (eski) ──────────────────────────────────── */
.kat-kart {
  transition: transform .2s ease, box-shadow .2s ease;
}
.kat-kart:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }

/* ─── Shopify Tarzı Kategori Kartı ──────────────────────────── */
.kat-kart-shopify {
  transition: transform .3s ease, box-shadow .3s ease;
  will-change: transform;
  background: #1a1a1a;
}
.kat-kart-shopify:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0,0,0,.2);
}
.kat-kart-shopify img {
  transition: transform .6s cubic-bezier(.25,.46,.45,.94);
}
.kat-kart-shopify:hover img {
  transform: scale(1.08);
}

/* ─── Form Elemanları ────────────────────────────────────────── */
.form-input {
  width: 100%;
  border: 1.5px solid #e5e7eb;
  border-radius: .75rem;
  padding: .6rem .9rem;
  font-size: .875rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  background: #fff;
  color: #374151;
}
.form-input:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22,163,74,.12);
}
.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: .3rem;
}
.btn-primary {
  background: #16a34a;
  color: #fff;
  font-weight: 700;
  padding: .65rem 1.25rem;
  border-radius: .75rem;
  border: none;
  cursor: pointer;
  transition: background .2s, transform .1s;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .875rem;
  text-decoration: none;
}
.btn-primary:hover { background: #15803d; transform: translateY(-1px); }
.btn-danger {
  background: #ef4444;
  color: #fff;
  font-weight: 600;
  padding: .35rem .8rem;
  border-radius: .5rem;
  border: none;
  cursor: pointer;
  transition: background .2s;
  font-size: .75rem;
}
.btn-danger:hover { background: #dc2626; }

/* ─── Admin Sidebar ──────────────────────────────────────────── */
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .9rem;
  border-radius: .625rem;
  font-size: .8rem;
  font-weight: 500;
  color: #9ca3af;
  transition: background .2s, color .2s;
  text-decoration: none;
  white-space: nowrap;
}
.admin-nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav-link.active { background: #16a34a; color: #fff; }

/* ─── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  padding: .8rem 1.25rem;
  border-radius: .875rem;
  font-weight: 600;
  font-size: .875rem;
  color: #fff;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  animation: toastIn .3s ease-out;
}
.toast-success { background: #16a34a; }
.toast-error   { background: #ef4444; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── Galeri thumbnail ───────────────────────────────────────── */
.thumb-active { border-color: #16a34a !important; }

/* ─── Sayfalama ──────────────────────────────────────────────── */
.pager a, .pager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 .5rem;
  border-radius: .5rem;
  font-size: .8rem;
  font-weight: 600;
  border: 1.5px solid #e5e7eb;
  color: #374151;
  text-decoration: none;
  transition: all .15s;
}
.pager a:hover { background: #16a34a; color: #fff; border-color: #16a34a; }
.pager .aktif  { background: #16a34a; color: #fff; border-color: #16a34a; }

/* ─── Scroll to Top ──────────────────────────────────────────── */
#scroll-top {
  position: fixed;
  bottom: 5rem;
  right: 3.5rem;
  z-index: 40;
  width: 2.25rem;
  height: 2.25rem;
  background: #16a34a;
  color: #fff;
  border-radius: .5rem;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(22,163,74,.35);
  transition: opacity .3s, transform .2s;
  border: none;
}
#scroll-top.visible { display: flex; }
#scroll-top:hover   { transform: translateY(-2px); }

/* ─── Mobil özel ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero-gradient { padding-top: 2.5rem; padding-bottom: 2.5rem; }
  #scroll-top { right: 1rem; bottom: 4.5rem; }
  /* Mobilde wp sabit buton sola kaymayacak */
  .wp-btn { left: .75rem !important; bottom: .75rem !important; }
}

/* ─── Varyasyon buton aktif ──────────────────────────────────── */
.vary-btn.secili {
  border-color: #16a34a;
  color: #16a34a;
  background: #f0fdf4;
}

/* ─── line-clamp (eski tarayıcı desteği) ────────────────────── */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Scrollbar gizle (kategori tabları) ─────────────────────── */
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ─── Toptan fiyat tablosu ───────────────────────────────────── */
.fiyat-tablo-aktif { background-color: rgba(22,163,74,.08) !important; }

/* ─── Ürün detay varyasyon buton seçili ─────────────────────── */
.vary-btn.border-primary { border-color: #16a34a !important; outline: 2px solid #16a34a; }

/* ─── Kategori tab overflow ok indicator ────────────────────── */
@media (max-width: 768px) {
  .tab-scroll-wrap::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to right, transparent, #fff);
    pointer-events: none;
  }
}
