/* ============================================================
   DEKORCUM — KATEGORİ SAYFASI STİLLERİ
   ============================================================ */
.category-page {
  padding: 40px 0 80px;
  background: var(--cream);
}

/* Breadcrumb & Header */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 20px;
}
.breadcrumb a {
  transition: color 0.2s;
}
.breadcrumb a:hover {
  color: var(--wood-deep);
}
.breadcrumb span {
  opacity: 0.5;
}
.category-header {
  margin-bottom: 40px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}
.category-header h1 {
  font-family: var(--ff-display);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--ink);
}

/* Sayfa Grid */
.category-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 1024px) {
  .category-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

/* ============================================================
        SOL SİDEBAR & FİLTRELER
        ============================================================ */
.sidebar-filters {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
  box-shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.05);
  overflow: hidden; /* Taşmaları engelle */
}

/* Sidebar İçi Scroll Alanı */
.sidebar-filters-content {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar-filters-content::-webkit-scrollbar {
  width: 6px;
}
.sidebar-filters-content::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 10px;
}

.filter-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
}
.filter-group-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin: 10px 0;
}
.btn-clear-text {
  font-size: 0.75rem;
  color: #dc2626;
  font-weight: 600;
  text-decoration: underline;
  transition: 0.2s;
}
.btn-clear-text:hover {
  color: #991b1b;
}
/* ============================================================
     AÇ-KAPA (ACCORDION) FİLTRE STİLLERİ
     ============================================================ */
.filter-group {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
.filter-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.filter-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding: 0; /* Tıklama alanını biraz büyütelim */
}

.filter-toggle .chevron {
  width: 18px;
  height: 18px;
  color: var(--ink-soft);
  transition: transform 0.3s var(--ease);
}

/* Kapanma Animasyonu (Grid hilesiyle mükemmel smooth transition) */
.filter-group-content {
  display: grid;
  grid-template-rows: 1fr;
  transition:
    grid-template-rows 0.3s var(--ease),
    margin-top 0.3s var(--ease);
}
.filter-group-inner {
  overflow: hidden;
}

/* Collapsed (Kapalı) Durumu */
.filter-group.collapsed .filter-group-content {
  grid-template-rows: 0fr;
  margin-top: 0;
}
.filter-group.collapsed .filter-toggle .chevron {
  transform: rotate(-180deg);
}
/* Kategori Ağacı Liste */
.category-tree-box {
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}
.cat-tree-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.cat-tree-list li {
  margin-bottom: 8px;
}
.cat-tree-list a {
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-weight: 500;
  transition: 0.2s;
  display: inline-block;
}
.cat-tree-list a:hover {
  color: var(--wood-deep);
}
.cat-count {
  color: #999;
  font-size: 0.75rem;
  margin-left: 4px;
}

/* Checkbox ve Inputlar */
.filter-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 5px 0;
}
.filter-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: 0.2s;
}
.filter-checkbox-label:hover {
  color: var(--ink);
}
.filter-checkbox {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  cursor: pointer;
  position: relative;
}
.filter-checkbox:checked {
  background: var(--wood);
  border-color: var(--wood);
}
.filter-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 4px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.btn-mobile-filter svg {
  width: 24px;
  height: 24px;
}
.price-inputs {
  display: flex;
  gap: 8px;
  align-items: center;
}
.price-inputs input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
}
.price-inputs input:focus {
  border-color: var(--wood);
}
.price-inputs span {
  color: var(--ink-soft);
}

/* FİLTRELERİ UYGULA BUTONU (Sabit Alt Kısım) */
.filter-apply-wrapper {
  padding: 16px 24px;
  background: var(--cream-2);
  border-top: 1px solid var(--line);
}
.btn-apply-filters {
  width: 100%;
  padding: 14px;
  background: var(--ink);
  color: var(--white);
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.btn-apply-filters:hover {
  background: var(--wood-deep);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(143, 95, 44, 0.4);
}

/* ============================================================
        MOBİL FİLTRE MODALI
        ============================================================ */
.mobile-filter-header {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
.mobile-filter-title {
  font-family: var(--ff-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
}
.mobile-filter-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cream);
  display: grid;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--line);
}

@media (max-width: 1024px) {
  .sidebar-filters {
    display: none; /* Mobilde buton ile açılacak */
    position: fixed;
    inset: 0;
    z-index: 9999;
    border-radius: 0;
    max-height: 100vh;
  }
  .sidebar-filters.open {
    display: flex;
    animation: slideInRight 0.3s var(--ease);
  }
  @keyframes slideInRight {
    from {
      transform: translateX(100%);
    }
    to {
      transform: translateX(0);
    }
  }

  .mobile-filter-header {
    display: flex;
  }
  .sidebar-filters-content {
    flex: 1;
    padding: 20px;
  }

  /* Mobilde buton her zaman altta yapışkan kalır */
  .filter-apply-wrapper {
    padding: 15px 20px;
    background: var(--white);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  }
  .btn-apply-filters {
    padding: 16px;
    font-size: 1rem;
  }
}

/* ============================================================
        SAĞ SÜTUN: ARAÇ ÇUBUĞU & AKTİF ROZETLER
        ============================================================ */
.active-filters-area {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--cream-2);
  border: 1px solid var(--wood-light);
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--wood-deep);
}
.active-filter-chip svg {
  width: 14px;
  height: 14px;
  cursor: pointer;
  transition: 0.2s;
  color: var(--ink);
}
.active-filter-chip svg:hover {
  color: #dc2626;
  transform: scale(1.1);
}

.category-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 15px -10px rgba(27, 23, 18, 0.05);
}
.toolbar-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sort-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sort-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}
.sort-select {
  appearance: none;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 35px 10px 15px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  outline: none;
  transition: 0.2s;
}
.sort-select:focus {
  border-color: var(--wood);
}
.sort-select-icon {
  position: absolute;
  right: 12px;
  pointer-events: none;
  width: 14px;
  height: 14px;
  color: var(--ink);
}

.btn-mobile-filter {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}
@media (max-width: 1024px) {
  .btn-mobile-filter {
    display: flex;
  }
}

@media (max-width: 768px) {
  .category-toolbar {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
    padding: 16px;
  }
  .toolbar-count {
    text-align: center;
  }
  .toolbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .btn-mobile-filter {
    justify-content: center;
  }
  .sort-select-wrap {
    width: 100%;
  }
  .sort-label {
    display: none;
  }
  .sort-select {
    width: 100%;
  }
}

/* ============================================================
        ÜRÜN GRİD VE BOŞ DURUM (İndex'ten Çekilen Tasarım)
        ============================================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}
@media (max-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

.category-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.category-empty svg {
  width: 50px;
  height: 50px;
  color: var(--wood-light);
  opacity: 0.5;
  margin-bottom: 16px;
}
.category-empty h3 {
  font-family: var(--ff-display);
  font-size: 1.6rem;
  color: var(--ink);
  margin-bottom: 8px;
}
.category-empty p {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* Product Card (Senin index.css içindeki ürün kartı yapısıyla aynı kalmalı) */
.product-card {
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: 0.3s;
  position: relative;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.1);
  border-color: rgba(181, 127, 66, 0.3);
}
/* Görsel Alanı */
.product-img-wrap {
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: #ffffff; /* Bembeyaz arkaplan */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px; /* Ürünün kenarlara yapışmasını engeller */
  border-bottom: 1px solid var(--line); /* Resim ile yazıyı ayırır */
}
.product-img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Resmi KESMEDEN karenin içine oturtur */
  transition: 0.4s;
}
.product-card:hover .product-img {
  transform: scale(1.08); /* Hover olunca hafifçe yaklaşsın (1.05'i 1.08 yaptım daha tok durur) */
}
.product-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}
.product-badge-item {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 99px;
  color: white;
  text-transform: uppercase;
}
.badge-bestseller {
  background: var(--wood-deep);
}
.badge-shipping {
  background: #065f46;
}
.badge-discount {
  background: #c2410c;
}
.product-info {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.product-card-cat {
  font-size: 0.65rem;
  color: var(--wood);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.product-card-title {
  font-family: var(--ff-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8em;
}
.product-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.product-price-box {
  display: flex;
  flex-direction: column;
}
.product-old-price {
  font-size: 0.75rem;
  text-decoration: line-through;
  color: var(--ink-soft);
  opacity: 0.6;
}
.product-current-price {
  font-family: var(--ff-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
}
.product-card-actions {
  display: flex;
  gap: 6px;
}
.product-action-btn {
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 0.2s;
}
.btn-quickview {
  width: 36px;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink-soft);
}
.btn-quickview:hover {
  background: var(--cream-2);
  color: var(--ink);
}
.btn-addcart {
  padding: 0 12px;
  background: var(--ink);
  color: white;
  display: flex;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}
.btn-addcart:hover {
  background: var(--wood-deep);
}
.btn-addcart svg,
.btn-quickview svg {
  width: 14px;
  height: 14px;
}
@media (max-width: 480px) {
  .btn-addcart span {
    display: none;
  }
  .btn-addcart {
    width: 36px;
  }
  .product-current-price {
    font-size: 1.05rem;
  }
}
/* ============================================================
   MOBİL ÜRÜN KARTI SIKIŞMA ÇÖZÜMÜ
   ============================================================ */
@media (max-width: 600px) {
  /* Footer'ı alt alta diz */
  .product-footer {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px;
  }
  
  /* Buton kapsayıcısını tam genişlik yap */
  .product-card-actions {
    width: 100%;
  }

  /* Göz ikonu sabit kalsın, Sepete Ekle butonu kalan tüm alanı doldursun */
  .btn-quickview {
    flex-shrink: 0;
  }
  .btn-addcart {
    flex: 1; 
    justify-content: center;
    width: auto !important; /* Eski 36px genişliği eziyoruz */
  }

  /* KDV yazısı sığmazsa alt satıra geçsin diye fiyat kutusunu sarmalla */
  .product-price-box > div {
    flex-wrap: wrap;
  }

  /* Mobilde fontu bir tık daha zarif yapalım */
  .product-current-price {
    font-size: 1.1rem !important;
  }
}
