/*
Theme Name:   Mars Child - EK Tuning
Theme URI:    https://ektuningshop.com/
Description:  EK Tuning Shop için güncellemeye dayanıklı Mars Child Theme
Author:       EK Tuning
Template:     mars
Version:      1.3.0
Text Domain:  mars-child
*/

/* ==========================================================================
   EK TUNING — KOMPAKT HEADER & MENÜ ALTI CANLI ARAMA BARİ
   Palet: #ff0022 (ana) | #1a1d20 (koyu) | #65718a (ikincil) | #ebebeb (kenarlık)
   ========================================================================== */

:root {
  --mars-header-height: 52px;
  --mars-secondary-menu-height: 30px;
}

/* İkincil üst menüyü incelt */
.mars-secondary-menu {
  min-height: 30px !important;
  height: auto !important;
}

.mars-secondary-menu__list > li > a {
  padding-top: 5px !important;
  padding-bottom: 5px !important;
  font-size: 12px;
  line-height: 1.3;
}

/* Üst satırda menü kenar boşluklarını ve yüksekliği kompaktlaştır */
.mars-header .mars-header__inner {
  min-height: 52px !important;
  height: 52px !important;
  gap: 12px;
  padding-top: 2px;
  padding-bottom: 2px;
}

.mars-header .mars-logo img {
  max-height: 36px;
  width: auto;
}

.mars-header .mars-main-nav .mars-menu {
  gap: 18px;
}

.mars-header .mars-main-nav .mars-menu > li > a {
  padding: 2px 4px;
  line-height: 1.25;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  transition: color 0.18s ease;
}

.mars-header .mars-main-nav .mars-menu > li > a:hover,
.mars-header .mars-main-nav .mars-menu > li.current-menu-item > a {
  color: #ff0022;
}

/* Header içindeki küçük arama ikonunu tüm cihazlarda gizle (alt ortada canlı arama var) */
.mars-header .mars-header-action--search {
  display: none !important;
}

/* Giriş yapan kullanıcı adı / Ad Soyad etiketi uzun olduğunda header düzenini bozmasın */
.mars-header .mars-header-action--account .mars-header-action__label {
  max-width: 135px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mars-header .mars-header-action--account.is-logged-in .mars-header-action__label {
  font-weight: 600;
}

/* Alt Satır: Sol Markalar + Belirgin Canlı Arama Kutusu */
.mars-header-searchbar {
  border-top: 1px solid #eceef2;
  border-bottom: 1px solid #eceef2;
  background: #f7f8fa;
  padding: 5px 0 6px;
}

.mars-searchbar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Sol Köşe: Araç Markaları Açılır Menüsü */
.mars-brands-menu {
  position: relative;
  flex-shrink: 0;
}

.mars-brands-menu__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border: 1.5px solid #1a1d20;
  border-radius: 8px;
  background: #1a1d20;
  color: #ffffff;
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(26, 29, 32, 0.12);
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.mars-brands-menu__btn:hover,
.mars-brands-menu.is-open .mars-brands-menu__btn {
  background: #ff0022;
  border-color: #ff0022;
  box-shadow: 0 4px 12px rgba(255, 0, 34, 0.22);
}

.mars-brands-menu__icon,
.mars-brands-menu__caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mars-brands-menu__caret {
  transition: transform 0.2s ease;
}

.mars-brands-menu.is-open .mars-brands-menu__caret {
  transform: rotate(180deg);
}

.mars-brands-menu__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 560px;
  max-width: calc(100vw - 24px);
  background: #ffffff;
  border: 1px solid #e4e6eb;
  border-top: 2.5px solid #ff0022;
  border-radius: 10px;
  box-shadow: 0 16px 36px rgba(26, 29, 32, 0.16);
  z-index: 9999;
  display: none;
  overflow: hidden;
}

.mars-brands-menu.is-open .mars-brands-menu__dropdown {
  display: block;
}

.mars-brands-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8f9fb;
  border-bottom: 1px solid #eceef2;
  font-size: 12.5px;
}

.mars-brands-menu__head strong {
  color: #1a1d20;
  font-weight: 700;
}

.mars-brands-menu__head span {
  color: #65718a;
  font-weight: 500;
}

.mars-brands-menu__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  max-height: 360px;
  overflow-y: auto;
}

.mars-brand-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid #eceef2;
  border-radius: 7px;
  background: #ffffff;
  text-decoration: none;
  color: #1a1d20;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.mars-brand-item:hover {
  border-color: #ff0022;
  background: #fff6f7;
  color: #ff0022;
  transform: translateY(-1px);
}

.mars-brand-item__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #f8f9fb;
  border: 1px solid #eceef2;
  flex-shrink: 0;
  overflow: hidden;
  padding: 2px;
  box-sizing: border-box;
}

.mars-brand-item__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.mars-brand-item__fallback {
  font-size: 11px;
  font-weight: 700;
  color: #1a1d20;
  letter-spacing: -0.02em;
}

.mars-brand-item__name {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mars-inline-search {
  position: relative;
  flex: 1;
  max-width: 760px;
  margin: 0 auto;
}

.mars-inline-search__form {
  display: flex;
  align-items: center;
  height: 38px;
  background: #ffffff;
  border: 1.5px solid #cfd5df;
  border-radius: 8px;
  padding: 0 4px 0 13px;
  box-shadow: 0 2px 10px rgba(26, 29, 32, 0.06);
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.mars-inline-search__form:hover {
  border-color: #aeb6c4;
}

.mars-inline-search__form:focus-within {
  background: #ffffff;
  border-color: #ff0022;
  box-shadow: 0 4px 16px rgba(255, 0, 34, 0.14);
}

.mars-inline-search__icon {
  display: inline-flex;
  align-items: center;
  color: #ff0022;
  font-size: 15px;
  margin-right: 10px;
  flex-shrink: 0;
}

.mars-inline-search__form:focus-within .mars-inline-search__icon {
  color: #ff0022;
}

.mars-inline-search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: #1a1d20;
  padding: 0;
}

.mars-inline-search__input::placeholder {
  color: #5a6478;
  font-weight: 400;
  font-size: 13px;
}

.mars-inline-search__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  background: #ff0022;
  color: #ffffff;
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(255, 0, 34, 0.22);
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.mars-inline-search__btn:hover {
  background: #d9001d;
  box-shadow: 0 3px 10px rgba(217, 0, 29, 0.28);
}

/* Canlı Arama Açılır Sonuç Kutusu */
.mars-inline-search__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #ebebeb;
  border-top: 2px solid #ff0022;
  border-radius: 7px;
  box-shadow: 0 12px 30px rgba(26, 29, 32, 0.12);
  z-index: 9999;
  overflow: hidden;
  display: none;
}

.mars-inline-search__dropdown.is-open {
  display: block;
}

.mars-inline-search__results {
  max-height: 360px;
  overflow-y: auto;
}

.mars-inline-search__results .mars-search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid #f4f5f7;
  text-decoration: none;
  color: #1a1d20;
  transition: background-color 0.15s ease;
}

.mars-inline-search__results .mars-search-result:hover {
  background: #f8f9fb;
}

.mars-inline-search__results .mars-search-result img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid #ebebeb;
  flex-shrink: 0;
}

.mars-inline-search__results .mars-search-result__title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: #1a1d20;
  line-height: 1.35;
}

.mars-inline-search__results .mars-search-result__price {
  font-size: 13px;
  font-weight: 600;
  color: #ff0022;
  white-space: nowrap;
}

.mars-inline-search__results .mars-search-state {
  padding: 14px;
  text-align: center;
  font-size: 13px;
  color: #65718a;
}

.mars-inline-search__all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  background: #f4f5f7;
  border-top: 1px solid #ebebeb;
  font-size: 12.5px;
  font-weight: 600;
  color: #1a1d20;
  text-decoration: none;
}

.mars-inline-search__all:hover {
  color: #ff0022;
  background: #eff1f5;
}

/* Mobilde Markalar butonu ve arama kutusu kompakt şekilde yan yana dursun */
@media (max-width: 991px) {
  .mars-header-searchbar {
    display: block;
    padding: 5px 0 6px;
  }

  .mars-searchbar-row {
    gap: 8px;
  }

  .mars-brands-menu__btn {
    height: 38px;
    padding: 0 10px;
    font-size: 12.5px;
    gap: 5px;
  }

  .mars-brands-menu__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 10px;
    max-height: 300px;
  }

  .mars-inline-search__form {
    height: 38px;
    padding: 0 3px 0 10px;
  }

  .mars-inline-search__input {
    font-size: 12.5px;
  }

  .mars-inline-search__input::placeholder {
    font-size: 12px;
  }

  .mars-inline-search__btn {
    height: 30px;
    padding: 0 12px;
    font-size: 12px;
  }
}
