/* =================================================================
   HORIZON SEARCH FORM - NOWY DESIGN
   Mobile-first: do 924px dropdown, powyżej inline
   ================================================================= */

/* Original container - stays in normal flow */
.horizon-search-container {
  position: relative !important;
  z-index: 1 !important;
  background: rgba(235, 223, 198, 0.9) !important;
  overflow: visible !important;
}

/* Fixed clone - shown when original scrolls out of view */
.horizon-search-fixed {
  position: fixed !important;
  top: 74px !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 600 !important;
  background: rgba(235, 223, 198, 0.9) !important;
  overflow: visible !important;
}

/* Desktop - zmiana top na 90px */
@media (min-width: 924px) {
  .horizon-search-fixed {
    top: 90px !important;
  }
}

/* Desktop large - zmiana top na 70px */
@media (min-width: 1471px) {
  .horizon-search-fixed {
    top: 70px !important;
  }
}

/* Reset & Base */
.horizon-search-form {
  width: 100%;
  position: relative;
  font-family: 'Poppins', sans-serif;
}

.horizon-search-form * {
  box-sizing: border-box;
}

/* =================================================================
   MOBILE: Toggle button (do 924px)
   ================================================================= */
.search-form-toggle {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  padding: 1rem 1.5rem !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  font-family: inherit !important;
  outline: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  text-decoration: none !important;
}

.search-form-toggle:hover,
.search-form-toggle:focus,
.search-form-toggle:active,
.search-form-toggle:focus-visible,
.search-form-toggle.active {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: inherit !important;
  text-decoration: none !important;
}

.toggle-text {
  font-size: 24px !important;
  font-weight: 600 !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
  text-align: center !important;
}

.toggle-text .gold {
  color: rgb(175, 128, 29) !important;
}

.toggle-text .black {
  color: #000 !important;
}

/* =================================================================
   Fields container
   ================================================================= */
.horizon-search-fields {
  display: none;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
}

.horizon-search-fields.active {
  display: flex;
}

/* =================================================================
   Individual field
   ================================================================= */
.horizon-search-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.horizon-search-label {
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 1px;
  color: #666;
  text-transform: lowercase;
}

/* =================================================================
   Date fields (input z ikoną)
   ================================================================= */
.date-picker-wrapper {
  position: relative;
  width: 100%;
  height: 40px;
  cursor: pointer;
  border: 1px solid #000;
  border-radius: 0;
  background: rgba(235, 223, 198, 0.9);
  display: flex;
  align-items: center;
  padding: 0 3rem 0 1rem;
}

.datepicker-input {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: auto;
  z-index: 1;
}

.date-display {
  font-size: 0.8rem;
  color: #000;
  font-family: inherit;
  line-height: 40px;
}

.datepicker-input::placeholder {
  color: #999;
  text-transform: lowercase;
  font-size: 0.875rem;
}

.field-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.field-icon svg {
  width: 100%;
  height: 100%;
  fill: #666;
}

/* =================================================================
   Select fields (guests, bedrooms)
   ================================================================= */
.select-wrapper {
  position: relative;
  width: 100%;
  height: 40px;
}

.select-input {
  width: 100%;
  height: 40px;
  padding: 0 2.5rem 0 1rem;
  border: 1px solid #000;
  border-radius: 0;
  background: rgba(235, 223, 198, 0.9);
  font-family: Poppins, sans-serif;
  font-size: 11.2px;
  font-weight: 300;
  letter-spacing: 1px;
  color: #000;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  line-height: 40px;
  display: block;
}

.select-arrow {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.75rem;
  color: #666;
}

/* =================================================================
   Mobile footer
   ================================================================= */
.search-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-collapse {
  background: none;
  border: none;
  color: #666;
  font-size: 0.875rem;
  cursor: pointer;
  text-transform: lowercase;
  padding: 0;
  font-family: inherit;
}

.btn.btn--primary {
  padding: 0.875rem 1.5rem;
  background: #666;
  color: #fff;
  border: none;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: inherit;
  transition: background 0.3s ease;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn.btn--primary:hover {
  background: #444;
}

/* =================================================================
   DESKTOP: powyżej 924px - wszystko w jednej linii
   ================================================================= */
@media (min-width: 924px) {
  /* Container na pełną szerokość dla tła */
  .horizon-search-container,
  .horizon-search-fixed {
    width: 100% !important;
  }

  /* Formularz max-width i wyśrodkowanie */
  .horizon-search-form {
    display: flex !important;
    align-items: center !important;
    max-width: 1270px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    gap: 2rem !important;
    padding: 0.75rem 0 !important;
  }

  /* Toggle button w jednej linii z polami */
  .search-form-toggle {
    display: flex !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    width: auto !important;
    cursor: default !important;
  }

  .toggle-text {
    font-size: 20px !important;
    white-space: nowrap !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    line-height: 1.2 !important;
  }

  .toggle-text .gold {
    font-family: 'Simple Joys', sans-serif !important;
    font-size: 50px !important;
    text-transform: capitalize !important;
    margin-bottom: -20px;
    font-weight: 400;
  }

  .toggle-text .black {
    font-size: 20px !important;
    font-weight: 600;
    letter-spacing: 6px;
  }

  /* Pokaż fields jako flex row */
  .horizon-search-fields {
    display: flex !important;
    flex-direction: row;
    align-items: flex-end;
    gap: 1rem;
    padding: 0 !important;
    flex: 1;
  }

  /* Wszystkie fieldy równej szerokości */
  .horizon-search-field {
    flex: 1;
    min-width: 0;
  }

  /* Zachowaj stałą wysokość 40px */
  .date-picker-wrapper,
  .select-wrapper {
    height: 40px;
  }

  .datepicker-input,
  .select-input {
    height: 40px;
    line-height: 40px;
  }

  /* Footer staje się inline */
  .search-form-footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding-top: 0;
    border-top: none;
    flex: 0 0 auto;
  }

  /* Ukryj przycisk "zwiń filtry" */
  .btn-collapse {
    display: none !important;
  }

  /* Przycisk submit */
  .btn.btn--primary {
    white-space: nowrap;
    padding: 0 2rem;
    height: 40px;
  }
}

/* =================================================================
   Larger desktop (opcjonalnie)
   ================================================================= */
@media (min-width: 1024px) {
  .horizon-search-fields {
    padding: 1rem 2rem;
    gap: 1.5rem;
  }
}

/* Override Leaflet z-index */
.leaflet-top {
  z-index: 500 !important;
}
