/* ÜRÜNLER SAYFASI TASARIMI */

/* METALİK ARKA PLAN */
.metal-card {
  background: linear-gradient(135deg, #d9d9d9, #f2f2f2, #c9c9c9);
  background-size: 400% 400%;
  animation: metallicMove 12s ease infinite;
}

@keyframes metallicMove {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* HOVER KIRMIZI ÇİZGİ */
.product-card:hover {
  box-shadow: 0 0 12px rgba(255, 0, 0, 0.45);
  border: 1px solid #ff3b3b !important;
}

/* BAŞLIK ALT ÇİZGİ */
.card-title {
  position: relative;
  padding-bottom: 6px;
}
.card-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 60%;
  height: 2px;
  background: linear-gradient(to right, #ff0000, #8b0000);
  border-radius: 2px;
}
.product-text {
  color: #fff !important;
}

/* ================================
   SAYFAYI HEADER ALTINA OTURT
================================ */
.products-page {
  --products-card-max-width: 300px;
  --products-grid-gap: 22px;
  --products-panel-max-width: calc(
    (var(--products-card-max-width) * 3) + (var(--products-grid-gap) * 2)
  );
  margin-top: 20px;
  padding-bottom: 80px;
  background: #f0f0f3;
  min-height: 100vh;
  padding-top: 40px;
}

/* ================================
   ANA GRID YAPI (sol + sağ)
================================ */
.products-container {
  max-width: 1250px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 35px;
  align-items: start;
}
.products-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 25px 0 16px;
  padding: 0;
}

.products-panel {
  width: min(100%, var(--products-panel-max-width));
  margin: 0 auto;
}

/* ================================
   SOL FİLTRE PANELİ
================================ */
.filters-panel {
  background: #ffffff;
  padding: 12px 18px;
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  height: fit-content;
  position: sticky;
  margin-top: 128px;
  display: none !important;
}

.filters-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
}

.filter-group {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5e5e5;
  overflow-x: hidden !important;
}

.filter-group:last-child {
  border-bottom: none;
}

.filter-group-header {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
}

.filter-option {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  margin-bottom: 4px;
  cursor: pointer;
}

.filter-option input {
  width: 15px;
  height: 15px;
}

/* ================================
   ÜST BAR (Kategori adı + Sıralama)
================================ */
.products-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.category-title {
  font-size: 28px;
  font-weight: 700;
}

/* ======================================== */
/*  CUSTOM SORT DROPDOWN — PREMIUM DESIGN   */
/* ======================================== */
/* ======================================== */
/*   PREMIUM SORT CONTAINER                 */
/* ======================================== */

.sort-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 0;
}

.sort-label {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-top: 0;
  line-height: 1;
}

/* ======================================== */
/*   DROPDOWN TASARIMI                      */
/* ======================================== */

.sort-dropdown {
  position: relative;
  width: 220px;
  user-select: none;
  cursor: pointer;
}

/* Üst Görünen Alan */
.sort-selected {
  height: 42px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  font-weight: 600;
  color: #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: 0.2s ease;
  width: 100%;
  white-space: nowrap; /* Tek satır ZORUNLU */
  overflow: hidden;
  text-overflow: ellipsis;
}

/* OK simgesi */
.sort-selected::after {
  content: '';
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg fill='%23333' width='14' height='14' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 5l3 4 3-4'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  margin-left: 10px;
}

.sort-selected:hover {
  border-color: #ccc8c8;
}

/* Açılan liste */
.sort-options {
  position: absolute;
  left: 0;
  top: 110%;
  width: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: 0.25s ease;
  z-index: 100;
  white-space: nowrap;
}

.sort-dropdown.active .sort-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Tek Seçenek */
.sort-option {
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 500;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: 0.2s;
}

/* Premium Hover (Metalik kırmızı) */
.sort-option:hover {
  background: #b50000;
  color: #fff;
}

/* Seçili item */
.sort-option.selected {
  background: #cbc9c9;
  font-weight: 700;
}

/* Dropdown açıkken ok ters dönsün */
.sort-dropdown.active .sort-selected::after {
  transform: rotate(180deg);
}
/* İKON HİZALAMASI */
.sort-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}

/* İkon boyutu sabit */
.sort-option .sort-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

/* Hover'da ikon beyaza döner */
.sort-option:hover .sort-icon {
  stroke: #fff;
}

/* ================================
   ARAMA KUTUSU
================================ */
.products-search input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid #d1d1d1;
  font-size: 14px;
  margin-bottom: 0;
}
.products-search {
  margin: 10px 0 20px;
  padding: 0;
}

.products-search input:focus {
  border-color: #c0392b;
}

/* ================================
   ÜRÜN GRID
================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(220px, var(--products-card-max-width))
  );
  justify-content: center;
  gap: var(--products-grid-gap);
}

/* ================================
   ÜRÜN KARTI TASARIMI
================================ */
.product-card {
  background: #ffffff;
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: 0.2s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.product-image {
  aspect-ratio: 4 / 3;
  background: #fff;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: #fff;
}

.product-info {
  padding: 14px 16px 16px;
}

.product-type {
  font-size: 12px;
  color: #888;
}

.product-name {
  font-size: 16px;
  font-weight: 600;
  margin: 6px 0;
}

.product-price {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #333;
}

.product-button {
  width: 100%;
  background: #00a884;
  color: white;
  font-weight: 600;
  padding: 9px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.product-button:hover {
  background: #009873;
}

/* ================================
   RESPONSIVE
================================ */
@media (max-width: 1024px) {
  .products-container {
    grid-template-columns: 1fr;
  }

  .filters-panel {
    position: relative;
    top: 0;
  }
}

@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

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

  .product-image {
    aspect-ratio: 5 / 4;
  }
}

.filter-option input {
  accent-color: #e63946; /* checkbox kırmızı olsun */
}

.filter-option {
  padding: 6px 0;
  transition: 0.15s ease;
}

.filter-option:hover {
  color: #e63946;
  transform: translateX(4px);
}

.filter-group-header {
  font-weight: 700;
  color: #444;
}

.filters-panel {
  border: 1px solid #ececec;
  background: #ffffffee;
  backdrop-filter: blur(5px);
  transition: 0.2s ease;
}

.filters-panel:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}
.clear-filters-btn {
  width: 100%;
  padding: 10px;
  background: #f44336;
  color: white;
  border: none;
  border-radius: 8px;
  margin-top: 10px;
  cursor: pointer;
  font-size: 15px;
  transition: 0.2s;
}

.clear-filters-btn:hover {
  background: #d32f2f;
}
/* =============================== */
/*        MOBİL FİLTRE PANELİ      */
/* =============================== */
@media (max-width: 768px) {
  /* Panel kutusu */
  .filters-panel {
    background: #ffffff;
    padding: 18px;
    margin: 12px;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }

  /* Başlık */
  .filters-title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 18px;
  }

  /* Her dinamik filtre grubu */
  .filter-group {
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e5e5e5;
  }

  .filter-group:last-child {
    border-bottom: none;
  }

  /* Grup başlığı */
  .filter-group h3 {
    margin-bottom: 12px;
    font-size: 17px;
    font-weight: 600;
  }

  /* Checkbox + label hizalama */
  .filter-item {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 16px;
  }

  .filter-item input[type='checkbox'] {
    width: 18px;
    height: 18px;
  }

  /* Temizleme butonu */
  .clear-filters-btn {
    width: 100%;
    margin-top: 10px;
    padding: 14px;
    border-radius: 10px;
    font-size: 16px;
    background: #ef4444;
    color: white;
    border: none;
  }

  .clear-filters-btn:active {
    opacity: 0.8;
  }
}
.product-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* Spec Image Block */
.spec-image-wrapper {
  margin-top: 30px;
  text-align: center;
  padding: 20px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.spec-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #222;
}

/* Actual Spec Image */
.spec-image {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  display: block;
  margin: 0 auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

/* Hover Animasyon */
.spec-image:hover {
  transform: scale(1.03);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.18);
}

/* MOBİL */
@media (max-width: 600px) {
  .spec-image-wrapper {
    padding: 16px;
    border-radius: 14px;
  }

  .spec-image {
    border-radius: 10px;
  }
}
/* Topbar genel */
.products-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 0;
}

/* Sağ taraf: sayfa başı + sıralama */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 28px;
}

/* Control grubu (label + select) */
.page-size-wrapper,
.sort-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* "Sayfa başı:" yazısı */
.page-size-label,
.sort-label {
  font-size: 14px;
  font-weight: 500;
  color: #444;
  gap: 20px;
  line-height: 1;
}

/* Sayfa başı dropdown */
.page-size-select {
  height: 42px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid #d1d1d1;
  background: #fff;

  font-size: 14px;
  cursor: pointer;

  transition: all 0.2s ease;
}

.page-size-select:hover {
  border-color: #c0392b;
}

.page-size-select:focus {
  outline: none;
  border-color: #e53935;
  box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.25);
}

/* Sıralama dropdown ile daha güzel hizalanması için */
.sort-wrapper label {
  margin-right: 4px;
}

/* Topbar mobil görünüm */
@media (max-width: 768px) {
  .products-page {
    --products-grid-gap: 16px;
  }

  .products-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }
}
/* PAGINATION */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  margin-top: 30px;
  margin-bottom: 40px;

  font-family: inherit;
}

/* Pagination Buttons */
.pag-btn {
  padding: 8px 16px;
  border-radius: 10px;
  background-color: #fff;
  border: 1px solid #d1d1d1;

  font-size: 14px;
  cursor: pointer;

  transition: all 0.25s ease;
}

/* Kırmızı hover efekti */
.pag-btn:hover:not(:disabled) {
  background-color: #e53935;
  color: #fff;
  border-color: #e53935;
  transform: translateY(-2px);
}

/* Disabled state */
.pag-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

/* Sayfa X / Y */
.page-info {
  font-size: 15px;
  color: #444;
  margin: 0 10px;
}

/* Mobil uyumluluk */
@media (max-width: 600px) {
  .pagination {
    flex-wrap: wrap;
    gap: 6px;
  }

  .pag-btn {
    padding: 6px 12px;
  }
}
/* =============================== */
/* MOBİL FİLTRE: AÇ/KAPAT BUTONU   */
/* =============================== */

.mobile-filter-toggle {
  display: none !important;
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #cc0000;
  color: white;
  border: none;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 15px;
  z-index: 9999;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* KAPATMA BUTONU */
.filters-close-btn {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 22px;
  cursor: pointer;
  z-index: 10000;
}

/* =============================== */
/* MOBİLDE PANELİ GİZLE/SLIDE YAP  */
/* =============================== */

@media (max-width: 768px) {
  /* Filtre butonu sadece mobilde */
  .mobile-filter-toggle {
    display: block;
  }

  /* Sol filtre paneli başlangıçta gizli */
  .filters-panel {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 350px;
    height: 100vh;
    background: #fff;
    z-index: 9998;
    padding-top: 50px;
    transition: left 0.35s ease;
    overflow-y: auto;
    border-right: 3px solid #cc0000;
  }

  .filters-panel.open {
    left: 0;
  }

  /* X butonu mobilde görünür */
  .filters-close-btn {
    display: block;
  }

  /* Desktop layout bozulmasın diye ürün paneli genişlesin */
  .products-panel {
    width: 100%;
  }
}
