/* Havuzmalzemem — modern su/havuz temalı arama çubuğu */

.hm-search {
  position: relative;
}

.hm-search .hm-search-form {
  margin: 0;
  position: relative;
}

.hm-search .hm-search-field {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(240, 249, 255, 0.96) 100%);
  border: 1px solid rgba(26, 107, 154, 0.28);
  border-radius: 999px;
  box-shadow:
    0 8px 28px rgba(13, 59, 102, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  display: flex;
  isolation: isolate;
  min-height: 50px;
  overflow: hidden;
  position: relative;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.hm-search .hm-search-field::before {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(26, 107, 154, 0.18) 25%,
    rgba(56, 189, 248, 0.35) 50%,
    rgba(26, 107, 154, 0.18) 75%,
    transparent 100%
  );
  background-size: 200% 100%;
  bottom: 0;
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  right: 0;
  z-index: 1;
}

.hm-search .hm-search-field::after {
  background: radial-gradient(circle at 20% 120%, rgba(56, 189, 248, 0.12) 0%, transparent 55%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.hm-search .hm-search-field:focus-within {
  border-color: rgba(13, 59, 102, 0.42);
  box-shadow:
    0 10px 32px rgba(13, 59, 102, 0.14),
    0 0 0 3px rgba(56, 189, 248, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

.hm-search .hm-search-field:focus-within::before {
  animation: hm-search-wave 2.4s ease-in-out infinite;
}

@keyframes hm-search-wave {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.hm-search .hm-search-leading {
  align-items: center;
  color: #1a6b9a;
  display: flex;
  flex-shrink: 0;
  justify-content: center;
  padding-left: 16px;
  position: relative;
  z-index: 2;
}

.hm-search .hm-search-water-icon {
  display: block;
  filter: drop-shadow(0 1px 2px rgba(13, 59, 102, 0.15));
  opacity: 0.88;
}

.hm-search form input[type="text"] {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #0a1628 !important;
  flex: 1 1 auto;
  font-size: 14px;
  font-weight: 500;
  height: 48px !important;
  line-height: 1.4;
  margin-top: 0 !important;
  min-width: 0 !important;
  outline: none !important;
  padding: 0 10px !important;
  position: relative;
  width: auto !important;
  z-index: 2;
}

.hm-search form input[type="text"]::placeholder {
  color: rgba(13, 59, 102, 0.48) !important;
  font-weight: 400;
  text-indent: 0 !important;
}

.hm-search form input[type="text"]:focus {
  color: #0a1628 !important;
}

.hm-search form button[type="submit"],
.hm-search .hm-search-submit {
  align-items: center;
  background: linear-gradient(145deg, #38bdf8 0%, #1a6b9a 52%, #0d3b66 100%) !important;
  border: none !important;
  border-radius: 999px !important;
  bottom: auto !important;
  box-shadow: 0 4px 14px rgba(13, 59, 102, 0.28);
  color: #fff !important;
  cursor: pointer;
  display: inline-flex !important;
  flex-shrink: 0;
  font-weight: 400 !important;
  height: 40px !important;
  justify-content: center;
  margin: 5px !important;
  padding: 0 !important;
  position: relative !important;
  right: auto !important;
  top: auto !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  width: 40px !important;
  z-index: 2;
}

.hm-search form button[type="submit"] .material-icons,
.hm-search .hm-search-submit .material-icons {
  color: #fff !important;
  font-size: 21px;
  line-height: 1;
  text-shadow: none !important;
}

.hm-search form button[type="submit"]:hover,
.hm-search .hm-search-submit:hover {
  box-shadow: 0 6px 18px rgba(13, 59, 102, 0.34);
  transform: scale(1.05);
}

/* Autocomplete — modern dropdown */
.ui-autocomplete.searchbar-autocomplete {
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid rgba(26, 107, 154, 0.18) !important;
  border-radius: 16px !important;
  box-shadow: 0 16px 40px rgba(13, 59, 102, 0.14) !important;
  list-style: none !important;
  margin: 8px 0 0 !important;
  max-height: 70vh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 6px 0 !important;
}

.ui-autocomplete.searchbar-autocomplete li {
  border-bottom: 1px solid rgba(26, 107, 154, 0.08);
}

.ui-autocomplete.searchbar-autocomplete li:last-child {
  border-bottom: none;
}

.ui-autocomplete.searchbar-autocomplete li a.autocomplete-item,
.ui-autocomplete.searchbar-autocomplete li a,
.ui-autocomplete.searchbar-autocomplete li a.ui-state-focus {
  align-items: center;
  border: none !important;
  border-radius: 0 !important;
  color: #0d3b66 !important;
  display: flex !important;
  font-size: 13px;
  gap: 12px;
  padding: 8px 14px !important;
  text-decoration: none !important;
}

.ui-autocomplete.searchbar-autocomplete li a:hover,
.ui-autocomplete.searchbar-autocomplete li a.ui-state-focus {
  background: linear-gradient(90deg, rgba(240, 249, 255, 0.95), rgba(224, 245, 255, 0.95)) !important;
  color: #0a1628 !important;
}

.ui-autocomplete.searchbar-autocomplete .autocomplete-thumbnail {
  border: 1px solid rgba(26, 107, 154, 0.12);
  border-radius: 8px;
  flex-shrink: 0;
  height: auto;
  object-fit: contain;
  width: 60px;
}

.ui-autocomplete.searchbar-autocomplete .autocomplete-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.ui-autocomplete.searchbar-autocomplete .autocomplete-name {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #1e293b;
  display: -webkit-box;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ui-autocomplete.searchbar-autocomplete .autocomplete-price {
  color: #0d3b66;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
}

@media (min-width: 992px) {
  .header-top .hm-search {
    align-items: center;
    display: flex;
    float: none !important;
    justify-content: stretch;
    padding: 0;
  }

  .header-top .hm-search .hm-search-form {
    margin: 0;
    max-width: none;
    width: 100%;
  }

  .header-top .hm-search .hm-search-toggle {
    display: none;
  }

  .header-top .search-widget {
    float: none !important;
    position: static;
    width: auto;
  }
}

@media (max-width: 991px) {
  .header-top .hm-search {
    float: none;
    position: static;
  }

  .hm-search .hm-search-toggle {
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    box-sizing: border-box;
    color: #fff !important;
    cursor: pointer;
    display: inline-flex !important;
    float: none;
    height: 48px;
    justify-content: center;
    line-height: 1;
    margin: 0;
    padding: 0;
    width: 48px;
  }

  .hm-search .hm-search-toggle .material-icons {
    color: #fff !important;
    font-size: 23px;
    text-shadow: none !important;
  }

  .hm-search .hm-search-toggle.active {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.38);
  }

  .hm-search .hm-search-toggle.active .material-icons {
    color: #fff !important;
  }

  .header-top .hm-search.search-widget {
    position: relative;
    z-index: 130;
  }

  .header-top .hm-search .hm-search-form {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 18px;
    box-shadow: 0 14px 36px rgba(13, 59, 102, 0.16);
    left: 12px;
    margin-top: 0;
    opacity: 0;
    padding: 10px;
    pointer-events: none;
    position: absolute !important;
    right: 12px;
    top: calc(100% + 4px);
    transition: opacity 0.28s ease, visibility 0.28s ease;
    visibility: hidden;
    z-index: 200;
  }

  .header-top .hm-search .hm-search-form.open {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
  }

  /* Mobil arama — şeffaf beyaz perde (koyu gri değil) */
  body.hm-search-open::before {
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    background-color: rgba(255, 255, 255, 0.55);
    bottom: 0;
    content: "";
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 120;
  }

  body.hm-search-open .header-top .hm-search.search-widget,
  body.hm-search-open #search_widget {
    position: relative;
    z-index: 130;
  }

  body.hm-search-open .header-top .hm-search .hm-search-form.open,
  body.hm-search-open #search_widget form.open {
    z-index: 140;
  }

  .header-top .hm-search .hm-search-field {
    min-height: 46px;
  }

  .header-top .hm-search form input[type="text"] {
    height: 44px !important;
    padding: 0 8px !important;
  }

  .header-top .hm-search form button[type="submit"],
  .header-top .hm-search .hm-search-submit {
    height: 36px !important;
    margin: 4px !important;
    width: 36px !important;
  }
}

@media (max-width: 767px) {
  .header-top .hm-search {
    position: static;
  }
}

/* 404 / arama sayfası */
#pagenotfound .hm-search .hm-search-form,
#products .page-not-found .hm-search .hm-search-form {
  max-width: 520px;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: relative !important;
  visibility: visible !important;
}

#pagenotfound .hm-search .hm-search-toggle,
#products .page-not-found .hm-search .hm-search-toggle {
  display: none !important;
}

/* ═══════════════════════════════════════════
   Mobil — tam sayfa arama overlay
   ═══════════════════════════════════════════ */
.hm-mobile-search-overlay {
  background: linear-gradient(180deg, #f8fafc 0%, #fff 30%);
  bottom: 0;
  display: flex;
  flex-direction: column;
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  right: 0;
  top: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100000;
}

.hm-mobile-search-overlay.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

body.hm-ms-body-lock {
  overflow: hidden !important;
}

/* ── Üst bölüm: kapatma + logo ── */
.hm-ms-top {
  align-items: center;
  background: linear-gradient(180deg, #0d3b66 0%, #145a8a 100%);
  display: flex;
  flex-shrink: 0;
  justify-content: center;
  min-height: 56px;
  padding: 10px 14px;
  position: relative;
}

.hm-ms-close {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  height: 36px;
  justify-content: center;
  left: 12px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
}

.hm-ms-close .material-icons {
  font-size: 20px;
}

.hm-ms-logo {
  text-align: center;
}

.hm-ms-logo img {
  height: 36px;
  max-width: 180px;
  object-fit: contain;
  width: auto;
}

/* ── Kategoriler ── */
.hm-ms-categories {
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
}

.hm-ms-categories ul {
  display: flex;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

.hm-ms-categories li {
  flex-shrink: 0;
}

.hm-ms-categories li a {
  align-items: center;
  border-bottom: 2px solid transparent;
  color: #475569 !important;
  display: flex;
  font-size: 12.5px;
  font-weight: 600;
  gap: 2px;
  padding: 10px 14px;
  text-decoration: none !important;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.hm-ms-categories li a .material-icons {
  color: #94a3b8;
  font-size: 16px;
  transition: color 0.2s;
}

.hm-ms-categories li a:active {
  border-bottom-color: #1a6b9a;
  color: #0d3b66 !important;
}

.hm-ms-categories li a:active .material-icons {
  color: #1a6b9a;
}

/* ── Arama kutusu ── */
.hm-ms-search-wrap {
  flex-shrink: 0;
  padding: 12px 14px 8px;
}

.hm-ms-field {
  align-items: center;
  background: #fff;
  border: 1.5px solid rgba(26, 107, 154, 0.25);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(13, 59, 102, 0.06);
  display: flex;
  min-height: 48px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hm-ms-field:focus-within {
  border-color: rgba(26, 107, 154, 0.5);
  box-shadow: 0 2px 12px rgba(13, 59, 102, 0.12), 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.hm-ms-icon {
  color: #1a6b9a;
  flex-shrink: 0;
  font-size: 22px;
  padding: 0 4px 0 14px;
}

.hm-ms-input {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #0a1628;
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  height: 48px;
  min-width: 0;
  outline: none !important;
  padding: 0 8px;
  width: 100%;
}

.hm-ms-input::placeholder {
  color: rgba(13, 59, 102, 0.4);
  font-weight: 400;
}

.hm-ms-clear {
  align-items: center;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  flex-shrink: 0;
  height: 48px;
  justify-content: center;
  padding: 0 12px;
}

.hm-ms-clear .material-icons {
  font-size: 20px;
}

/* ── Sonuçlar ── */
.hm-ms-results {
  -webkit-overflow-scrolling: touch;
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.hm-ms-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hm-ms-item {
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.hm-ms-item:last-child {
  border-bottom: none;
}

.hm-ms-link {
  align-items: center;
  color: inherit !important;
  display: flex;
  gap: 12px;
  padding: 10px 14px;
  text-decoration: none !important;
  transition: background 0.15s ease;
}

.hm-ms-link:active {
  background: rgba(240, 249, 255, 0.8);
}

.hm-ms-thumb {
  border: 1px solid rgba(226, 232, 240, 0.6);
  border-radius: 8px;
  flex-shrink: 0;
  height: 64px;
  object-fit: contain;
  width: 64px;
}

.hm-ms-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.hm-ms-name {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #1e293b;
  display: -webkit-box;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hm-ms-price {
  color: #0d3b66;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

/* ── Boş sonuç ── */
.hm-ms-empty {
  align-items: center;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  gap: 8px;
  padding: 48px 24px;
  text-align: center;
}

.hm-ms-empty .material-icons {
  font-size: 40px;
  opacity: 0.5;
}

/* Desktop — overlay gizle */
@media (min-width: 992px) {
  .hm-mobile-search-overlay {
    display: none !important;
  }
}
