/* RetroPlus search bar + modal — scoped under .rps-search-bar / .rps-modal */

:root {
  --rps-primary: var(--primary);
  --rps-primary-contrast: #ffffff;
  --rps-text: #000;
  --rps-muted: #6b7280;
  --rps-border: var(--border);
  --rps-bg: #ffffff;
  --rps-bg-alt: #f3f4f6;
  --rps-radius: 6px;
}

/* ===== Search bar (shortcode output) ===== */
.rps-search-bar {
  display: flex;
  align-items: stretch;
  width: 100%;
  background: var(--rps-bg);
  border: 1px solid #000;
  border-radius: 4px;
  overflow: hidden;
  font: inherit;
  color: var(--rps-text);
}

.rps-search-bar__category {
  flex: 0 0 auto;
  border: 0;
  border-right: 1px solid #000;
  background: var(--rps-bg);
  padding: 12px 8px;
  font-size: 15px;
  line-height: 19px;
  color: var(--rps-text);
  font-weight: 500;
  cursor: pointer;
  outline: none;
  max-width: 160px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  position: relative;
  padding-right: 32px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='19' height='19' viewBox='0 0 19 19' fill='none'><path d='M9.50001 10.4273L13.4186 6.50882L14.5382 7.6284L9.50001 12.6666L4.46191 7.6284L5.5815 6.50882L9.50001 10.4273Z' fill='black'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 19px 19px;
}

.rps-search-bar__category:focus {
  border-color: #000;
  color: var(--rps-text);
  background-color: var(--rps-bg);
}

input[type="search"].rps-search-bar__input {
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  padding: 10px 14px;
  font-size: 15px;
  line-height: 19px;
  color: var(--rps-text);
  outline: none;
  min-width: 0;
}

input[type="search"].rps-search-bar__input:focus {
  background: transparent;
  color: var(--rps-text);
}

.rps-search-bar__submit {
  flex: 0 0 auto;
  border: 0;
  background: var(--primary);
  color: #fff;
  padding: 0 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid #000;
}
.rps-search-bar__submit:hover,
.rps-search-bar__submit:focus {
  background: var(--primary-hover);
  color: #fff;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Modal ===== */
.rps-modal[hidden] {
  display: none;
}

.rps-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 20px 20px;
}

.rps-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.rps-modal__panel {
  position: relative;
  background: var(--rps-bg-alt);
  width: 100%;
  max-width: 1500px;
  max-height: calc(100vh - 80px);
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rps-modal__close {
  margin-left: auto;
  margin-bottom: 20px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--rps-text);
  font-size: 20px;
  line-height: 23px;
  cursor: pointer;
}
.rps-modal__close:hover,
.rps-modal__close:focus {
  color: var(--rps-text);
  background: transparent;
}
.rps-modal__close-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}
.rps-modal__close-icon svg {
  display: block;
}

@media (max-width: 767px) {
  .rps-modal__close {
    position: absolute;
    top: 20px;
    right: 20px;
    align-self: auto;
    width: auto;
		height: 45px;
    padding: 0;
    justify-content: center;
    z-index: 2;
		margin-bottom: 0;
  }

	.rps-modal__close-icon {
		width: 24px;
		height: 24px;
	}

  .rps-modal__close-label {
    display: none;
  }
}

.rps-modal__form {
  display: flex;
  align-items: stretch;
  border: 1px solid #000;
  border-radius: 4px;
  overflow: hidden;
  background: var(--rps-bg);
}

input[type="search"].rps-modal__input,
.rps-modal__input {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 19px;
  color: var(--rps-text);
  outline: none;
  min-width: 0;
}
input[type="search"].rps-modal__input:focus {
  background: transparent;
  color: var(--rps-text);
}

.rps-modal__submit {
  flex: 0 0 auto;
  border: 0;
  background: var(--primary);
  color: #fff;
  padding: 0 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid #000;
}
.rps-modal__submit:hover,
.rps-modal__submit:focus {
  background: var(--primary-hover);
  color: #fff;
}

.rps-modal__body {
  display: flex;
  flex: 1 1 auto;
  min-height: 360px;
  overflow: hidden;
}

.rps-modal__sidebar {
  flex: 0 0 420px;
  display: flex;
  flex-direction: column;
  background: var(--rps-bg);
  overflow: hidden;
  min-height: 0;
  padding: 30px;
}

.rps-modal__nav {
  overflow-y: auto;
  min-height: 0;
  margin-top: 24px;
  border: 0.5px solid var(--rps-border);
}

.rps-modal__sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 16px;
  font-size: 14px;
  line-height: 16px;
  color: var(--rps-text);
  cursor: pointer;
  border-left: 3px solid transparent;
  border-bottom: 0.5px solid var(--rps-border);
  text-transform: uppercase;
}
.rps-modal__sidebar-item:last-child {
  border-bottom: none;
}
.rps-modal__sidebar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: currentColor;
}
.rps-modal__sidebar-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}
.rps-modal__pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  color: currentColor;
}
.rps-modal__pill-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.rps-modal__sidebar-item:hover,
.rps-modal__sidebar-item:focus {
  background: rgba(0, 123, 255, 0.06);
  color: var(--rps-text);
}
.rps-modal__sidebar-item.is-active {
  background: var(--rps-bg);
  border-left-color: var(--rps-primary);
  color: var(--rps-primary);
  font-weight: 600;
}

.rps-modal__sidebar-close {
  display: none;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: currentColor;
  opacity: 0;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}
.rps-modal__sidebar-close svg {
  width: 14px;
  height: 14px;
  display: block;
}
.rps-modal__sidebar-item.is-active .rps-modal__sidebar-close {
  display: inline-flex;
}
.rps-modal__sidebar-item.is-active:hover .rps-modal__sidebar-close,
.rps-modal__sidebar-item.is-active:focus-within .rps-modal__sidebar-close,
.rps-modal__sidebar-close:hover,
.rps-modal__sidebar-close:focus {
  opacity: 1;
}
.rps-modal__sidebar-close:hover {
  background: rgba(0, 0, 0, 0.06);
}

@media (max-width: 768px) {
  .rps-modal__sidebar-close {
    display: none !important;
  }
}

.rps-modal__pills {
  display: none;
}

.rps-modal__content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 30px 30px 0;
}

.rps-modal__content-inner {
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 24px;
	align-items: flex-start;
	padding-bottom: 30px;
}

/* Default state: subcategory cards */
.rps-modal__subcat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
	width: 100%;
}

.rps-modal__subcat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
  padding: 20px;
  border: 1px solid var(--rps-border);
  border-radius: 8px;
  background: var(--rps-bg);
  color: var(--rps-text);
  text-decoration: none;
  transition: border-color 0.1s ease;
}
.rps-modal__subcat-card:hover {
  border-color: var(--border-hover);
}
.rps-modal__subcat-card img {
  width: 100%;
  height: auto;
	aspect-ratio: 1 / 1;
  object-fit: contain;
}
.rps-modal__subcat-card span {
  font-size: 20px;
  line-height: 20px;
  font-family: Muro Slant;
}


/* Typing state: chip + result list */
.rps-modal__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 123, 255, 0.1);
  color: var(--rps-primary);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
}
.rps-modal__chip-clear {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}

.rps-modal__chip-clear:hover,
.rps-modal__chip-clear:focus {
	color: inherit;
	background-color: transparent;
}

.rps-modal__results {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
}

.rps-modal__result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 16px;
  border: 1px solid var(--rps-border);
  border-radius: 8px;
  color: var(--rps-text);
  text-decoration: none;
  background-color: var(--rps-bg);
}
.rps-modal__result:hover {
  border-color: var(--border-hover);
  background: var(--rps-bg);
}
.rps-modal__result-thumb {
	width: 100%;
	aspect-ratio: 1 / 1;
}
.rps-modal__result img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.rps-modal__result-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.rps-modal__result-title {
  font-size: 14px;
  line-height: 16px;
  text-align: center;
  font-weight: 600;
  flex-grow: 1;
  margin: 0;
}
.rps-modal__result-meta {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: var(--rps-muted);
  align-items: center;
  justify-content: center;
}

.rps-modal__result-price {
  font-size: 14px;
  line-height: 16px;
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  font-weight: 700;
  color: #000;
}

.rps-modal__result-price del {
  opacity: 0.4;
  font-weight: 400;
}

.rps-modal__stock--in {
  color: #15803d;
}
.rps-modal__stock--out {
  color: #b91c1c;
}

.rps-modal__viewall-wrap {
  margin-top: auto;
  display: flex;
  justify-content: center;
  width: 100%;
}

.rps-modal__viewall {
  display: inline-block;
  font-weight: 600;
  text-decoration: none;
  width: auto;
  text-align: center;
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
  border-radius: 0;
  color: #fff;
  background: var(--primary);
  padding: 10px 20px;
}
.rps-modal__viewall:hover,
.rps-modal__viewall:focus {
	color: #fff;
	background-color: var(--primary-hover);
}

.rps-modal__empty {
  color: var(--rps-muted);
  padding: 30px 0;
  text-align: center;
  width: 100%;
}
.rps-modal__empty strong {
  color: var(--rps-text);
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

body.rps-modal-open {
  overflow: hidden;
}

@media (max-width: 1024px) {
	.rps-modal__sidebar {
		flex: 0 0 320px;
	}

	.rps-modal__subcat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.rps-modal__results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* ===== Mobile ===== */
@media (max-width: 767px) {
  .rps-search-bar {
    max-width: none;
  }
  .rps-search-bar__category {
    max-width: 110px;
    font-size: 13px;
    padding: 0 8px;
  }

  .rps-modal {
    padding: 0;
  }
  .rps-modal__panel {
    max-width: none;
    max-height: none;
    height: 100vh;
    border-radius: 0;
  }
  .rps-modal__body {
    flex-direction: column;
    min-height: 0;
  }
  .rps-modal__sidebar {
    flex: 0 0 auto;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--rps-border);
    overflow: visible;
		padding: 20px;
  }
  .rps-modal__nav {
    display: none;
  }

  .rps-modal__pills {
    display: flex;
    order: 1;
    gap: 8px;
    overflow-x: auto;
    padding: 0;
    border-bottom: none;
		margin-top: 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .rps-modal__pills::-webkit-scrollbar {
    display: none;
  }

  .rps-modal__pill {
    flex: 0 0 auto;
    border: 1px solid var(--rps-border);
    background: var(--rps-bg);
    color: var(--rps-text);
    padding: 6px 14px 6px 8px;
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
		display: flex;
		align-items: center;
  }
  .rps-modal .rps-modal__pill:not(.is-active),
  .rps-modal .rps-modal__pill:not(.is-active):focus,
  .rps-modal .rps-modal__pill:not(.is-active):active {
    background: var(--rps-bg);
    color: var(--rps-text);
    border-color: var(--rps-border);
  }
  .rps-modal .rps-modal__pill.is-active,
  .rps-modal .rps-modal__pill.is-active:focus,
  .rps-modal .rps-modal__pill:focus-visible {
    background: var(--rps-primary);
    color: var(--rps-primary-contrast);
    border-color: var(--rps-primary);
  }
  @media (hover: hover) {
    .rps-modal .rps-modal__pill:hover {
      background: var(--rps-primary);
      color: var(--rps-primary-contrast);
      border-color: var(--rps-primary);
    }
  }

  .rps-modal__searchwrap {
    order: 0;
    position: sticky;
    top: 0;
    background: var(--rps-bg);
    z-index: 1;
		padding-right: 36px;
  }
  .rps-modal__contact {
    padding: 12px 56px 0 16px;
  }
  .rps-modal__content {
    padding: 20px;
  }

  .rps-search-bar__category,
  .rps-search-bar__category-label {
    display: none;
  }

	.rps-modal__subcat-grid {
		gap: 8px;
	}

	.rps-modal__subcat-card {
		padding: 16px;
		gap: 16px;
	}

	.rps-modal__subcat-card span {
		font-size: 16px;
		line-height: 16px;
	}

	.rps-modal__results {
		gap: 8px;
	}

	.rps-modal__result {
		padding: 16px 10px;
	}
}
