/* ==========================================================
   POPUP KONTA + MODAL WYSZUKIWANIA
   ========================================================== */

/* ===== Rozwijane menu użytkownika ===== */

.account-popover {
  position: fixed;
  z-index: 4800;
  width: 245px;
  visibility: hidden;
  padding: 10px;
  border: 1px solid #e3e3e3;
  border-radius: 11px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(-7px);
  transition:
    opacity 150ms ease,
    transform 150ms ease,
    visibility 150ms ease;
}

.account-popover.is-open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.account-popover::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 34px;
  width: 11px;
  height: 11px;
  border-top: 1px solid #e3e3e3;
  border-left: 1px solid #e3e3e3;
  background: #ffffff;
  transform: rotate(45deg);
}

.account-popover-header {
  padding: 10px 11px 13px;
  border-bottom: 1px solid #ededed;
}

.account-popover-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
}

.account-popover-subtitle {
  margin: 0;
  overflow: hidden;
  color: #777777;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.account-popover-nav {
  display: grid;
  padding: 6px 0;
}

.account-popover-link,
.account-popover-logout {
  width: 100%;
  min-height: 39px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #111111;
  text-align: left;
  font-size: 11px;
}

.account-popover-link:hover,
.account-popover-link:focus-visible,
.account-popover-logout:hover,
.account-popover-logout:focus-visible {
  background: #f1f1f1;
}

.account-popover-link svg,
.account-popover-logout svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-popover-primary {
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 7px 4px 4px;
  border-radius: 7px;
  background: #000000;
  color: #ffffff;
  font-size: 11px;
}

.account-popover-secondary {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px;
  border: 1px solid #d6d6d6;
  border-radius: 7px;
  background: #ffffff;
  color: #111111;
  font-size: 11px;
}

/* ===== Modal wyszukiwania ===== */

.search-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 5100;
  visibility: hidden;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.57);
  opacity: 0;
  backdrop-filter: blur(3px);
  transition:
    opacity 180ms ease,
    visibility 180ms ease;
}

.search-popup-overlay.is-open {
  visibility: visible;
  opacity: 1;
}

.search-popup {
  width: min(790px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  border-radius: 13px;
  background: #e7e7e7;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.26);
  transform: translateY(14px) scale(0.985);
  transition: transform 190ms ease;
}

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

body.search-popup-open {
  overflow: hidden;
}

.search-popup-head {
  min-height: 69px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.search-popup-head h2 {
  margin: 0;
  font-size: 20px;
}

.search-popup-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: #111111;
}

.search-popup-close:hover,
.search-popup-close:focus-visible {
  background: #f4f4f4;
}

.search-popup-close svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.search-popup-form {
  display: grid;
  padding: 34px 38px 27px;
}

.search-popup-query-wrap {
  position: relative;
}

.search-popup-query-icon {
  position: absolute;
  top: 50%;
  left: 15px;
  width: 18px;
  height: 18px;
  pointer-events: none;
  fill: none;
  stroke: #666666;
  stroke-width: 1.7;
  transform: translateY(-50%);
}

.search-popup-query {
  width: 100%;
  height: 44px;
  padding: 0 17px 0 45px;
  border: 0;
  border-radius: 9px;
  outline: 0;
  background: #ffffff;
  font-size: 12px;
}

.search-popup-query:focus,
.search-popup-select:focus {
  box-shadow: 0 0 0 2px #1d96ff;
}

.search-popup-advanced {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 14px;
  margin-top: 13px;
}

.search-popup-advanced[hidden] {
  display: none;
}

.search-popup-field {
  position: relative;
  min-width: 0;
}

.search-popup-field::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 7px;
  height: 7px;
  border-right: 1px solid #667784;
  border-bottom: 1px solid #667784;
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.search-popup-select {
  width: 100%;
  height: 39px;
  padding: 0 35px 0 14px;
  border: 0;
  border-radius: 8px;
  outline: 0;
  background: #ffffff;
  color: #111111;
  font-size: 11px;
  appearance: none;
}

.search-popup-field-wide {
  grid-column: span 2;
}

.search-popup-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 25px;
}

.search-popup-submit {
  width: 205px;
  height: 39px;
  border: 0;
  border-radius: 8px;
  background: #cecece;
  color: #111111;
  font-size: 11px;
}

.search-popup-submit:hover,
.search-popup-submit:focus-visible {
  background: #c2c2c2;
}

.search-popup-toggle {
  margin-top: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #111111;
  font-size: 9px;
}

.search-popup-toggle:hover,
.search-popup-toggle:focus-visible {
  text-decoration: underline;
}

.search-popup-feedback {
  min-height: 15px;
  margin: 12px 0 0;
  color: #555555;
  text-align: center;
  font-size: 10px;
}

/* Informacja po przejściu do katalogu z wyszukiwarki. */
.search-results-notice {
  width: min(1120px, calc(100% - 40px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto 17px;
  padding: 12px 15px;
  border-radius: 8px;
  background: #efefef;
  font-size: 10px;
}

.search-results-notice strong {
  font-size: 11px;
}

.search-results-notice button {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  text-decoration: underline;
  font-size: 10px;
}

@media (max-width: 760px) {
  .account-popover {
    display: none;
  }

  .search-popup-overlay {
    align-items: end;
    padding: 0;
  }

  .search-popup {
    width: 100%;
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
  }

  .search-popup-head {
    min-height: 63px;
    padding-inline: 18px;
  }

  .search-popup-head h2 {
    font-size: 18px;
  }

  .search-popup-form {
    padding: 25px 18px 30px;
  }

  .search-popup-advanced {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .search-popup-advanced {
    grid-template-columns: 1fr;
  }

  .search-popup-field-wide {
    grid-column: auto;
  }

  .search-popup-submit {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .account-popover,
  .search-popup,
  .search-popup-overlay {
    transition: none;
  }
}
