.market-search-shell {
  position: relative;
}

.market-search-results {
  position: absolute;
  top: calc(100% + 0.65rem);
  right: 0;
  left: 0;
  z-index: 1085;
  max-height: min(72vh, 38rem);
  overflow-y: auto;
  color: #14283c;
  background: rgba(255, 255, 255, 0.99);
  border: 1px solid rgba(20, 40, 60, 0.14);
  border-radius: 1rem;
  box-shadow: 0 1.6rem 4rem rgba(4, 20, 36, 0.24);
  text-align: left;
  overscroll-behavior: contain;
}

.market-search-results[hidden] {
  display: none !important;
}

.market-search-results__section + .market-search-results__section {
  border-top: 1px solid rgba(20, 40, 60, 0.09);
}

.market-search-results__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.9rem 0.35rem;
  color: #637487;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.market-search-option {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 3.85rem;
  padding: 0.65rem 0.9rem;
  color: #14283c;
  text-decoration: none;
  border-radius: 0.7rem;
  outline: none;
}

.market-search-option:hover,
.market-search-option:focus-visible,
.market-search-option.is-active {
  color: #0a4fae;
  background: rgba(18, 103, 232, 0.08);
}

.market-search-option__image,
.market-search-option__icon {
  flex: 0 0 3rem;
  width: 3rem;
  height: 3rem;
  overflow: hidden;
  background: #f1f5fa;
  border: 1px solid rgba(20, 40, 60, 0.09);
  border-radius: 0.7rem;
}

.market-search-option__image {
  object-fit: contain;
}

.market-search-option__icon {
  display: grid;
  place-items: center;
  color: #1267e8;
  font-size: 1.15rem;
}

.market-search-option__copy {
  min-width: 0;
  flex: 1;
}

.market-search-option__copy strong,
.market-search-option__copy small {
  display: block;
}

.market-search-option__copy strong {
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-search-option__copy small {
  margin-top: 0.16rem;
  overflow: hidden;
  color: #6d7d8d;
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-search-option__price {
  flex: 0 0 auto;
  color: #0a2947;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.market-search-results__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.9rem;
  color: #0a4fae;
  background: #f7faff;
  border-radius: 0 0 1rem 1rem;
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
}

.market-search-results__footer:hover,
.market-search-results__footer:focus-visible {
  color: #073b81;
  background: #edf5ff;
}

.market-search-empty,
.market-search-loading {
  padding: 1.2rem;
  color: #6d7d8d;
  font-size: 0.85rem;
  text-align: center;
}

.market-active-filters .market-filter-pill {
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.market-active-filters a.market-filter-pill:hover,
.market-active-filters a.market-filter-pill:focus-visible {
  color: #9e2c20;
  background: rgba(188, 52, 38, 0.08);
  border-color: rgba(188, 52, 38, 0.18);
}

.market-filter-pill__remove {
  margin-left: 0.18rem;
  font-size: 0.72rem;
}

.market-product-card__actions {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.market-quick-add-form {
  display: contents;
}

.market-quick-add-button {
  min-width: 2.85rem;
}

.market-quick-add-button[disabled] {
  cursor: wait;
  opacity: 0.72;
}

.market-recommendation-section {
  margin-top: 2rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  background: linear-gradient(145deg, #f8fbff, #fff);
  border: 1px solid rgba(20, 40, 60, 0.1);
  border-radius: 1.35rem;
}

.market-recommendation-section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.market-recommendation-section__head h2 {
  margin: 0;
  color: #0a2947;
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  font-weight: 780;
  letter-spacing: -0.025em;
}

.market-recommendation-section__head p {
  max-width: 42rem;
  margin: 0.35rem 0 0;
  color: #657689;
}

.market-search-results mark {
  padding: 0;
  color: inherit;
  background: transparent;
  font-weight: 850;
}

/* Product image motion */
.market-product-card__media::after {
  position: absolute;
  inset: -30% 115% -30% -70%;
  z-index: 1;
  background: linear-gradient(
    105deg,
    transparent 22%,
    rgba(255, 255, 255, 0.14) 38%,
    rgba(255, 255, 255, 0.72) 50%,
    rgba(255, 255, 255, 0.14) 62%,
    transparent 78%
  );
  content: "";
  pointer-events: none;
  transform: skewX(-16deg);
  transition: transform 720ms cubic-bezier(0.16, 1, 0.3, 1);
}

.market-product-card__image-link img {
  transform-origin: 50% 58%;
  transition:
    transform 440ms cubic-bezier(0.16, 1, 0.3, 1),
    filter 440ms ease;
  will-change: transform;
}

.market-product-card:hover .market-product-card__image-link img,
.market-product-card:focus-within .market-product-card__image-link img {
  filter: saturate(1.04) contrast(1.025);
  transform: translateY(-3px) scale(1.065) rotate(0.25deg);
}

.market-product-card:hover .market-product-card__media::after,
.market-product-card:focus-within .market-product-card__media::after {
  transform: translateX(255%) skewX(-16deg);
}

/* Viewport-safe quick view */
body.market-quick-view-open {
  overflow: hidden;
}

.market-product-card.has-open-quick-view {
  z-index: 1090;
  overflow: visible;
  transform: none !important;
}

.market-card-quick-view[open]::before {
  position: fixed;
  inset: 0;
  z-index: 1090;
  background: rgba(4, 17, 30, 0.62);
  backdrop-filter: blur(5px);
  content: "";
  cursor: default;
}

.market-card-quick-view__panel {
  position: fixed !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  z-index: 1092 !important;
  width: min(27rem, calc(100vw - 2rem)) !important;
  max-width: calc(100vw - 2rem);
  max-height: min(78vh, 42rem);
  padding: clamp(1.15rem, 3vw, 1.55rem) !important;
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 1.2rem !important;
  box-shadow: 0 2.2rem 6rem rgba(4, 17, 30, 0.36) !important;
  transform: translate(-50%, -50%) !important;
  animation: market-quick-view-enter 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.market-card-quick-view__panel::after {
  display: none !important;
}

.market-card-quick-view__panel,
.market-card-quick-view__panel * {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.market-card-quick-view__panel h4,
.market-card-quick-view__panel p,
.market-card-quick-view__panel dt,
.market-card-quick-view__panel dd,
.market-card-quick-view__panel a {
  overflow-wrap: anywhere;
  word-break: normal;
}

.market-card-quick-view__panel dl div {
  grid-template-columns: minmax(6.5rem, 0.75fr) minmax(0, 1.25fr) !important;
}

.market-quick-view-close {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  width: 2.45rem;
  height: 2.45rem;
  margin: -0.35rem -0.35rem 0.45rem auto;
  place-items: center;
  color: #20384e;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(20, 40, 60, 0.14);
  border-radius: 50%;
  box-shadow: 0 0.5rem 1.4rem rgba(4, 20, 36, 0.12);
}

.market-quick-view-close:hover,
.market-quick-view-close:focus-visible {
  color: #0a4fae;
  border-color: rgba(18, 103, 232, 0.35);
}

@keyframes market-quick-view-enter {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 0.8rem)) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Product detail gallery motion and controls */
.product-gallery-stage {
  --gallery-shift-x: 0px;
  --gallery-shift-y: 0px;
  --gallery-scale: 1;
  --gallery-pointer-x: 50%;
  --gallery-pointer-y: 50%;
  overflow: hidden;
  outline: none;
}

.product-gallery-stage::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(
    circle at var(--gallery-pointer-x) var(--gallery-pointer-y),
    rgba(86, 199, 233, 0.11),
    transparent 32%
  );
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.product-gallery-stage.is-pointer-active::after {
  opacity: 1;
}

.product-gallery-stage picture,
.product-gallery-stage .product-detail-image,
.product-gallery-stage .product-detail-placeholder {
  position: relative;
  z-index: 1;
}

.product-gallery-stage .product-detail-image {
  transform: translate3d(var(--gallery-shift-x), var(--gallery-shift-y), 0)
    scale(var(--gallery-scale));
  transform-origin: var(--gallery-pointer-x) var(--gallery-pointer-y);
  transition:
    transform 260ms cubic-bezier(0.16, 1, 0.3, 1),
    filter 260ms ease,
    opacity 180ms ease;
  will-change: transform;
}

.product-gallery-stage.is-pointer-active .product-detail-image {
  filter: saturate(1.025) contrast(1.015);
}

.product-gallery-stage.is-changing .product-detail-image {
  opacity: 0.25;
  transform: translate3d(0, 5px, 0) scale(0.985);
}

.product-gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 4;
  display: grid;
  width: clamp(2.55rem, 5vw, 3.2rem);
  height: clamp(2.55rem, 5vw, 3.2rem);
  place-items: center;
  color: #102235;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(16, 34, 53, 0.13);
  border-radius: 50%;
  box-shadow: 0 0.8rem 2.2rem rgba(8, 29, 50, 0.18);
  opacity: 0.82;
  transform: translateY(-50%);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.product-gallery-nav--previous {
  left: clamp(0.65rem, 2vw, 1.15rem);
}

.product-gallery-nav--next {
  right: clamp(0.65rem, 2vw, 1.15rem);
}

.product-gallery-nav:hover,
.product-gallery-nav:focus-visible {
  color: #0b4fb9;
  background: #fff;
  box-shadow: 0 1rem 2.8rem rgba(8, 29, 50, 0.24);
  opacity: 1;
}

.product-gallery-nav--previous:hover,
.product-gallery-nav--previous:focus-visible {
  transform: translate(-3px, -50%);
}

.product-gallery-nav--next:hover,
.product-gallery-nav--next:focus-visible {
  transform: translate(3px, -50%);
}

.product-gallery-stage:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(18, 103, 232, 0.28);
}

@media (max-width: 1199.98px) {
  .market-global-search .market-search-results {
    position: fixed;
    top: 5.3rem;
    right: 0.75rem;
    left: 0.75rem;
    max-height: calc(100vh - 7rem);
  }
}

@media (max-width: 575.98px) {
  .market-search-option__price {
    display: none;
  }

  .market-product-card__actions {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .market-recommendation-section__head {
    align-items: start;
    flex-direction: column;
  }

  .market-card-quick-view__panel dl div {
    grid-template-columns: 1fr !important;
    gap: 0.15rem !important;
  }

  .product-gallery-nav {
    width: 2.65rem;
    height: 2.65rem;
  }
}

@media (hover: none), (pointer: coarse) {
  .market-product-card:hover .market-product-card__image-link img {
    filter: none;
    transform: none;
  }

  .market-product-card__media::after {
    display: none;
  }

  .product-gallery-stage .product-detail-image {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .market-active-filters .market-filter-pill,
  .market-product-card__image-link img,
  .market-product-card__media::after,
  .market-card-quick-view__panel,
  .product-gallery-stage .product-detail-image,
  .product-gallery-nav {
    animation: none !important;
    transition: none !important;
  }
}
