/* ============================================================
   SEARCH.CSS — WCL
   3-ZONE ARCHITECTURE · CANONICAL v9
   search | divider | filters | divider | clear
   ============================================================ */

/* ================= CAPSULE ================= */

.search-capsule {
  display: flex;
  align-items: center;

  width: 100%;
  max-width: 1100px;
  min-width: 320px;
  height: clamp(52px, 6.5vh, 64px);

  background: var(--bg);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px;

  padding: 0 2.2rem;
  margin: 0 auto;

  overflow: hidden;
}

/* ================= ZONES ================= */

.search-zone {
  display: flex;
  align-items: center;
}

/* SEARCH takes remaining space */

.zone-search {
  display: flex;
  align-items: center;
  gap: 1.2rem;

  flex: 0 0 auto;        /* 🔑 får inte krympa */
  min-width: 420px;      /* 🔑 search alltid användbar */
}
/* FILTERS + CLEAR stay fixed */

.zone-filters {
  display: flex;
  align-items: center;
  gap: 1rem;          /* 🔥 lite tightare */
  flex: 1 1 auto;

  overflow: hidden;
  white-space: nowrap;   /* 🔥 stoppar radbrytning */
}

.zone-filters button {
  white-space: nowrap;
}

/* ================= SEARCH ================= */

.search-label {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--global);
  white-space: nowrap;
  pointer-events: none;
}

#searchInput {
  flex: 1;
  min-width: 200px;      /* 🔑 input aldrig för liten */
  max-width: 420px;

  border: none;
  outline: none;
  background: transparent;

  font-family: "DM Sans", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;

  text-align: center;
}

#searchInput::placeholder {
  color: rgba(255,255,255,0.45);
  font-size: 0.80rem;
  font-weight: 400;
}

/* ================= DIVIDER ================= */

.zone-divider {
  width: 1px;
  height: 38px;
  background: rgba(255,255,255,0.28);
  margin: 0 1.4rem;
}

/* ================= FILTER BUTTONS ================= */

.control-btn {
  appearance: none;
  -webkit-appearance: none;

  background: none;
  border: 1.5px solid transparent;
  padding: 4px 10px;

  font-family: "DM Sans", sans-serif;
  font-size: 0.9rem;
  font-weight: 500;

  color: rgb(var(--global));
  opacity: 0.75;

  cursor: pointer;
  border-radius: 999px;

  transition: opacity 0.18s ease, border 0.18s ease;
}

.control-btn:hover {
  opacity: 1;
}

.control-btn.active:not(.sort-btn) {
  border: 1.5px solid rgba(var(--global), 1);
  opacity: 1;
}

/* SORT */

.sort-btn.active {
  color: var(--gold);
  opacity: 1;
  position: relative;
}

.sort-btn.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1px;
  background: var(--gold);
}

/* ================= CLEAR ================= */

.clear-btn {
  appearance: none;
  -webkit-appearance: none;

  background: none;
  border: 1.5px solid transparent;
  padding: 4px 12px;

  font-family: "DM Sans", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;

  color: rgb(var(--global));
  opacity: 0.75;

  border-radius: 999px;
  cursor: pointer;

  transition: opacity 0.18s ease, border 0.18s ease;
}

.clear-btn:hover {
  opacity: 1;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 900px) {

  .zone-filters {
    display: none;
  }

  .zone-divider {
    display: none;
  }

  .search-label {
    display: none;
  }

  .search-capsule {
    padding: 0 1.6rem;
  }

  #searchInput {
    width: 100%;
    font-size: 1rem;
    text-align: left;
  }
}
