/* ==========================================================================
   EK TUNING SHOP — MAĞAZA & ARŞİV SAYFASI UI/UX + SEO + PERFORMANS STİLLERİ
   Yalnızca WooCommerce arşiv/mağaza/kategori/marka sayfalarında yüklenir.
   Palet: #ff0022 (ana) | #1a1d20 (koyu) | #65718a (ikincil) | #eceef2 (kenarlık)
   ========================================================================== */

/* 1. Ana Kapsayıcı Boşluklarını Sıkılaştır (Above-the-Fold Ürün Görünürlüğü) */
main.mars-shop-main {
  padding: 10px 0 36px !important;
}

/* 2. Kompakt Tek Satır Arşiv Başlık & Sıralama Barı */
.mars-archive-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid #eceef2;
}

.mars-archive-bar__left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.mars-archive-bar .mars-breadcrumbs {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 11.5px;
  line-height: 1.3;
  color: #65718a;
}

.mars-archive-bar__title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.mars-archive-bar__title {
  margin: 0 !important;
  font-size: 20px !important;
  line-height: 1.2 !important;
  font-weight: 700;
  color: #1a1d20;
  letter-spacing: -0.02em;
}

.mars-archive-bar__count {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  background: #f1f5f9;
  color: #475569;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.mars-archive-bar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Sıralama Select Kutusu — Tek Temiz Ok */
.mars-archive-bar .woocommerce-ordering {
  margin: 0 !important;
  float: none !important;
}

.mars-archive-bar .woocommerce-ordering select.orderby {
  height: 36px;
  padding: 0 32px 0 12px;
  font-size: 13px;
  font-weight: 500;
  color: #1a1d20;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2365718a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 14px 14px !important;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.mars-archive-bar .woocommerce-ordering select.orderby:hover {
  border-color: #aeb6c4;
}

.mars-archive-bar .woocommerce-ordering select.orderby:focus {
  outline: none;
  border-color: #ff0022;
  box-shadow: 0 0 0 3px rgba(255, 0, 34, 0.10);
}

/* Mobil Filtre Açma Butonu (Masaüstünde gizli) */
.mars-filter-open {
  display: none;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  background: #1a1d20;
  color: #ffffff;
  border: 1px solid #1a1d20;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.18s ease;
}

.mars-filter-open:hover {
  background: #ff0022;
  border-color: #ff0022;
}

.mars-filter-open__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff0022;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

/* 3. Mağaza Grid Yerleşimi (235px Kompakt Sticky Sidebar + Geniş Ürün Alanı) */
.mars-shop-layout {
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.mars-shop-sidebar {
  position: sticky;
  top: 112px;
  max-height: calc(100vh - 124px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
  padding-right: 2px;
  font-family: inherit;
}

.mars-shop-sidebar::-webkit-scrollbar {
  width: 4px;
}

.mars-shop-sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.mars-shop-sidebar__mobile-head {
  display: none;
}

/* 4. Akordeon (<details>) Sidebar Blokları — Sıfır JS */
.mars-acc {
  background: #ffffff;
  border: 1px solid #eceef2;
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(26, 29, 32, 0.03);
}

.mars-acc__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #1a1d20;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: #ffffff;
  transition: background-color 0.15s ease;
}

.mars-acc__head::-webkit-details-marker {
  display: none;
}

.mars-acc__head:hover {
  background: #f8f9fb;
}

.mars-acc__title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mars-acc__meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: #8c96a6;
}

.mars-acc__caret {
  display: inline-flex;
  align-items: center;
  color: #65718a;
  transition: transform 0.2s ease;
}

.mars-acc[open] > .mars-acc__head {
  border-bottom: 1px solid #f1f3f6;
}

.mars-acc[open] > .mars-acc__head .mars-acc__caret {
  transform: rotate(180deg);
}

.mars-acc__body {
  padding: 10px 10px 11px;
}

/* 5. Taranabilir Kategori Link Listesi (SEO + Hızlı Gezinme) */
.mars-cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mars-cat-list li.is-extra-cat {
  display: none;
}

.mars-cat-list.is-expanded li.is-extra-cat {
  display: block;
}

.mars-cat-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.mars-cat-list li.is-child a {
  padding-left: 18px;
  font-size: 12px;
  color: #526075;
}

.mars-cat-list li a:hover {
  background: #f4f6f9;
  color: #1a1d20;
}

.mars-cat-list li.is-active a {
  background: #fff5f6;
  color: #ff0022;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #ff0022;
}

.mars-item-count {
  font-size: 11px;
  font-weight: 500;
  color: #8c96a6;
  flex-shrink: 0;
}

.mars-cat-list li.is-active .mars-item-count,
.mars-brand-list li.is-active .mars-item-count {
  color: #ff0022;
}

.mars-cat-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 6px;
  padding: 5px 8px;
  background: #f8f9fb;
  border: 1px dashed #d5dce6;
  border-radius: 7px;
  color: #475569;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mars-cat-more-btn:hover {
  border-color: #ff0022;
  color: #ff0022;
  background: #fff5f6;
}

/* 6. Araç Markaları Listesi — Sola Hizalı, Kompakt Scroll */
.mars-brand-search-wrap {
  position: relative;
  margin-bottom: 8px;
}

.mars-brand-search-input {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 30px;
  font-size: 12.5px;
  color: #1a1d20;
  background: #f8f9fb;
  border: 1px solid #dfe3e8;
  border-radius: 7px;
  font-family: inherit;
  box-sizing: border-box;
  transition: all 0.18s ease;
}

.mars-brand-search-input::placeholder {
  color: #8c96a6;
}

.mars-brand-search-input:focus {
  outline: none;
  background: #ffffff;
  border-color: #ff0022;
  box-shadow: 0 0 0 3px rgba(255, 0, 34, 0.10);
}

.mars-brand-search-icon {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: #65718a;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.mars-brand-empty {
  display: none;
  padding: 10px 6px;
  text-align: center;
  font-size: 12px;
  color: #65718a;
}

ul.mars-brand-list {
  list-style: none;
  padding: 0 2px 0 0;
  margin: 0;
  max-height: 255px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

ul.mars-brand-list::-webkit-scrollbar {
  width: 4px;
}

ul.mars-brand-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

ul.mars-brand-list li {
  margin-bottom: 2px;
}

ul.mars-brand-list li:last-child {
  margin-bottom: 0;
}

ul.mars-brand-list li a {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 7px;
  color: #334155;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  text-align: left !important;
  transition: background-color 0.15s ease, color 0.15s ease;
}

ul.mars-brand-list li a:hover {
  background: #f4f6f9;
  color: #1a1d20;
}

ul.mars-brand-list li.is-active a {
  background: #fff5f6;
  color: #ff0022;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #ff0022;
}

.mars-brand-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
  background: #ffffff;
  border: 1px solid #eceef2;
  padding: 2px;
  flex-shrink: 0;
  display: block;
}

.mars-brand-name {
  flex: 1;
  min-width: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 7. Sidebar İkincil Özellikler (Renk, Malzeme, Montaj Tipi vb.) */
.mars-attr-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.mars-attr-list li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 6px;
  font-size: 12.5px;
  color: #334155;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.mars-attr-list li a:hover {
  background: #f4f6f9;
  color: #1a1d20;
}

.mars-attr-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: transparent;
  transition: all 0.15s ease;
}

.mars-attr-list li.is-active a {
  background: #fff5f6;
  color: #ff0022;
  font-weight: 600;
}

.mars-attr-list li.is-active .mars-attr-check {
  background: #ff0022;
  border-color: #ff0022;
  color: #ffffff;
}

/* 8. Stok Toggle & Filtreleri Temizle */
.mars-stock-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  background: #ffffff;
  border: 1px solid #eceef2;
  border-radius: 10px;
  color: #1a1d20;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.18s ease;
  margin-bottom: 10px;
}

.mars-stock-toggle:hover {
  border-color: #ff0022;
  color: #ff0022;
}

.mars-stock-toggle.is-active {
  background: #fff5f6;
  border-color: #ff0022;
  color: #ff0022;
}

.mars-stock-switch {
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}

.mars-stock-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.mars-stock-toggle.is-active .mars-stock-switch {
  background: #ff0022;
}

.mars-stock-toggle.is-active .mars-stock-switch::after {
  transform: translateX(14px);
}

.mars-clear-filters-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 7px 10px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #ff0022;
  background: #fff5f6;
  border: 1px solid #ffd6dc;
  border-radius: 8px;
  text-decoration: none;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.mars-clear-filters-btn:hover {
  background: #ff0022;
  border-color: #ff0022;
  color: #ffffff;
}

/* 9. Tek Satır Hızlı Model, Alt Kategori & Aktif Filtre Şeridi (Ürünlerin Hemen Üstü) */
.mars-quick-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 7px 10px;
  background: #ffffff;
  border: 1px solid #eceef2;
  border-radius: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.mars-quick-bar::-webkit-scrollbar {
  display: none;
}

.mars-quick-bar__label {
  font-size: 11.5px;
  font-weight: 700;
  color: #65718a;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}

.mars-quick-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

.mars-quick-pills li {
  flex-shrink: 0;
}

.mars-quick-pills li a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  background: #f8f9fb;
  color: #334155;
  border: 1px solid #e2e6ec;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.mars-quick-pills li a:hover {
  border-color: #ff0022;
  color: #ff0022;
  background: #fff5f6;
}

.mars-quick-pills li.is-active a {
  background: #ff0022;
  border-color: #ff0022;
  color: #ffffff;
  font-weight: 600;
}

.mars-quick-pills li.is-chip-remove a {
  background: #1a1d20;
  border-color: #1a1d20;
  color: #ffffff;
  font-weight: 600;
}

.mars-quick-pills li.is-chip-remove a:hover {
  background: #ff0022;
  border-color: #ff0022;
  color: #ffffff;
}

.mars-quick-divider {
  width: 1px;
  height: 18px;
  background: #e2e6ec;
  flex-shrink: 0;
}

.mars-subcat-count {
  font-size: 11px;
  font-weight: 600;
  color: #65718a;
  background: #eceef2;
  padding: 0 6px;
  border-radius: 999px;
}

/* 10. Alt SEO Kategori / Marka Açıklaması (Ürün Listesinin Altında) */
.mars-cat-seo-footer {
  margin: 28px 0 20px 0;
  padding: 20px 24px;
  background: #ffffff;
  border: 1px solid #eceef2;
  border-left: 4px solid #ff0022;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  color: #334155;
  font-size: 13.5px;
  line-height: 1.7;
}

.mars-cat-seo-footer h2 {
  margin: 0 0 10px 0;
  font-size: 17px;
  font-weight: 600;
  color: #1a1d20;
}

.mars-cat-seo-footer p {
  margin: 0 0 10px 0;
}

.mars-cat-seo-footer p:last-child {
  margin-bottom: 0;
}

/* 11. Mobil & Tablet Düzenlemeleri (H1 SEO için GÖRÜNÜR kalır!) */
@media (max-width: 980px) {
  main.mars-shop-main {
    padding: 8px 0 28px !important;
  }

  .mars-shop-layout {
    display: block !important;
    width: 100% !important;
  }

  .mars-shop-results {
    width: 100% !important;
    max-width: 100% !important;
  }

  .mars-archive-bar {
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 10px;
  }

  .mars-archive-bar__title {
    font-size: 17px !important;
  }

  .mars-archive-bar__right {
    width: 100%;
    justify-content: space-between;
  }

  .mars-filter-open {
    display: inline-flex;
  }

  .mars-archive-bar .woocommerce-ordering {
    flex: 1;
    max-width: 220px;
  }

  .mars-archive-bar .woocommerce-ordering select.orderby {
    width: 100%;
    font-size: 12.5px;
  }

  /* Mobil Sidebar Çekmecesi (Ana tema JS [data-mars-shop-sidebar] ile uyumlu) */
  .mars-shop-sidebar {
    position: fixed;
    max-height: 100vh;
    top: 0;
    padding-right: 0;
  }

  .mars-shop-sidebar__mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #eceef2;
    margin-bottom: 10px;
  }

  .mars-quick-bar {
    padding: 6px 8px;
    margin-bottom: 10px;
  }

  /* Mobilde 2 Kolonlu Temiz Ürün Izgarası */
  .mars-shop-results ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .mars-shop-results ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
  }

  .mars-cat-seo-footer {
    padding: 16px;
    margin: 20px 0 16px 0;
    font-size: 13px;
  }
}
