/* Modal wyszukiwania ZOOFLIP */

html.search-modal-open,
html.search-modal-open body {
  overflow: hidden;
}

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.search-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.search-modal__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(82, 188, 180, 0.22), transparent 55%),
    rgba(18, 28, 42, 0.58);
  backdrop-filter: blur(6px);
}

.search-modal__panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(86vh, 760px);
  margin-top: clamp(1.5rem, 8vh, 4.5rem);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f7fafb 100%);
  border: 1px solid rgba(26, 46, 74, 0.08);
  box-shadow:
    0 24px 64px rgba(18, 28, 42, 0.28),
    0 2px 0 rgba(255, 255, 255, 0.7) inset;
  transform: translateY(14px) scale(0.985);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.search-modal.is-open .search-modal__panel {
  transform: translateY(0) scale(1);
}

.search-modal__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.15rem 0.35rem;
}

.search-modal__eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3da89f;
}

.search-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(26, 46, 74, 0.05);
  color: #1a2e4a;
  cursor: pointer;
}

.search-modal__close:hover {
  background: rgba(26, 46, 74, 0.1);
}

.search-modal__close .icon {
  font-size: 22px;
}

.search-modal__form {
  padding: 0.35rem 1.15rem 0.85rem;
}

.search-modal__field {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.55rem;
  min-height: 56px;
  padding: 0.35rem 0.4rem 0.35rem 0.95rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(26, 46, 74, 0.1);
  box-shadow: 0 8px 24px rgba(26, 46, 74, 0.06);
}

.search-modal__field:focus-within {
  border-color: rgba(61, 168, 159, 0.55);
  box-shadow:
    0 0 0 4px rgba(82, 188, 180, 0.16),
    0 8px 24px rgba(26, 46, 74, 0.06);
}

.search-modal__field-icon {
  font-size: 24px;
  color: #5a6472;
}

.search-modal__input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 500;
  color: #1a2e4a;
  outline: none;
}

.search-modal__input::placeholder {
  color: #8a93a0;
  font-weight: 400;
}

.search-modal__submit {
  min-height: 44px;
  padding: 0 1.05rem;
  border: 0;
  border-radius: 12px;
  background: #1a2e4a;
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.search-modal__submit:hover {
  opacity: 0.92;
}

.search-modal__body {
  padding: 0.25rem 1.15rem 1.2rem;
  overflow: auto;
}

.search-modal__section + .search-modal__section {
  margin-top: 1.15rem;
}

.search-modal__section-title {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5a6472;
}

.search-modal__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.search-modal__chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 0.85rem;
  border-radius: 999px;
  background: rgba(82, 188, 180, 0.12);
  color: #1a2e4a;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

.search-modal__chip:hover {
  background: rgba(82, 188, 180, 0.22);
  transform: translateY(-1px);
}

.search-modal__links {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.search-modal__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(26, 46, 74, 0.06);
  color: #1a2e4a;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.search-modal__link:hover {
  border-color: rgba(61, 168, 159, 0.45);
  transform: translateX(2px);
}

.search-modal__link .icon {
  font-size: 18px;
  color: #3da89f;
}

.search-modal__status {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: #5a6472;
}

.search-modal__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.search-modal__product {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0.8rem;
  align-items: center;
  padding: 0.55rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(26, 46, 74, 0.06);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-modal__product:hover {
  border-color: rgba(61, 168, 159, 0.4);
  box-shadow: 0 8px 20px rgba(26, 46, 74, 0.06);
}

.search-modal__product-media {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  background: #eef3f5;
}

.search-modal__product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.search-modal__product-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.search-modal__product-copy strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a2e4a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-modal__product-price {
  font-size: 0.86rem;
  font-weight: 600;
  color: #5a6472;
}

.search-modal__product-badge {
  align-self: flex-start;
  margin-top: 0.15rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(231, 111, 81, 0.12);
  color: #c24d33;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 700;
}

.search-modal__all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 0.85rem;
  border-radius: 12px;
  background: rgba(26, 46, 74, 0.06);
  color: #1a2e4a;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.search-modal__all:hover {
  background: rgba(26, 46, 74, 0.1);
}

@media (max-width: 640px) {
  .search-modal {
    padding: 0;
    align-items: stretch;
  }

  .search-modal__panel {
    width: 100%;
    max-height: none;
    height: 100%;
    margin: 0;
    border-radius: 0;
  }

  .search-modal__field {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    padding: 0.65rem 0.75rem;
  }

  .search-modal__submit {
    grid-column: 1 / -1;
    width: 100%;
  }

  .search-modal__body {
    padding-bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px));
  }
}
