/* Product list: hide baked grid + show sidebar skeleton until API hydrates. */

.if-product-filter-panel {
  overflow: visible;
}

.if-products-loading-wrap {
  grid-column: 1 / -1;
}

.if-products-loading-wrap > p {
  letter-spacing: 0.01em;
}

html.if-products-pending [data-intrafit='product-grid'] {
  visibility: visible;
  min-height: 16rem;
}

html.if-products-pending main.lg\:col-span-3 > .mb-8 {
  visibility: hidden;
  min-height: 1.25rem;
}

html.if-products-pending main.lg\:col-span-3 > nav[aria-label='Pagination'] {
  visibility: hidden;
}

html.if-products-ready [data-intrafit='product-grid'] {
  visibility: visible;
}

html.if-products-ready main.lg\:col-span-3 > .mb-8,
html.if-products-ready main.lg\:col-span-3 > nav[aria-label='Pagination'] {
  visibility: visible;
}

@keyframes if-filter-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

html.if-products-sidebar-pending [data-intrafit='product-filter-panel']:empty::before {
  content: '';
  display: block;
  min-height: 14rem;
  margin: 0.75rem;
  border-radius: 0.375rem;
  background: linear-gradient(90deg, rgb(244 244 245) 0%, rgb(228 228 231) 45%, rgb(244 244 245) 90%);
  background-size: 200% 100%;
  animation: if-filter-shimmer 1.4s ease-in-out infinite;
}

html.if-products-sidebar-ready .if-product-filter-panel,
html.if-products-sidebar-ready [data-intrafit='product-filter-panel'] {
  visibility: visible;
}
.if-product-filter-sublist {
  --if-filter-item-height: 2.625rem;
  max-height: calc(var(--if-filter-item-height) * 12);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 0.2s ease;
}

.if-product-filter-sublist:hover,
.if-product-filter-panel:hover .if-product-filter-sublist {
  scrollbar-color: rgb(161 161 170) rgb(244 244 245);
}

.if-product-filter-sublist::-webkit-scrollbar {
  width: 8px;
}

.if-product-filter-sublist::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 9999px;
  margin: 6px 0;
  transition: background 0.2s ease;
}

.if-product-filter-sublist::-webkit-scrollbar-thumb {
  background: transparent;
  border: 2px solid transparent;
  border-radius: 9999px;
  min-height: 2.5rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.if-product-filter-sublist:hover::-webkit-scrollbar-track,
.if-product-filter-panel:hover .if-product-filter-sublist::-webkit-scrollbar-track {
  background: rgb(244 244 245);
}

.if-product-filter-sublist:hover::-webkit-scrollbar-thumb,
.if-product-filter-panel:hover .if-product-filter-sublist::-webkit-scrollbar-thumb {
  background: rgb(161 161 170);
  border-color: rgb(244 244 245);
}

.if-product-filter-sublist:hover::-webkit-scrollbar-thumb:hover {
  background: rgb(234 179 8);
  border-color: rgb(254 249 195);
}

/* Product detail: color swatch without border */
[data-intrafit="color-options"] button > div:first-child {
  border: none !important;
  box-shadow: none !important;
}

/* Product detail: main image zoom (subtle hint + lightbox) */
.if-product-main-image-wrap {
  position: relative;
  cursor: zoom-in;
}

.if-product-main-image-wrap:focus-visible {
  outline: 2px solid rgb(234 179 8);
  outline-offset: 2px;
}

.if-product-zoom-hint {
  position: absolute;
  right: 0.625rem;
  bottom: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.25rem;
  background: rgb(255 255 255 / 0.72);
  color: rgb(113 113 122);
  opacity: 0.42;
  pointer-events: none;
  transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
}

.if-product-main-image-wrap:hover .if-product-zoom-hint,
.if-product-main-image-wrap:focus-visible .if-product-zoom-hint {
  opacity: 0.78;
  color: rgb(63 63 70);
  background: rgb(255 255 255 / 0.88);
}

html.if-product-lightbox-open {
  overflow: hidden;
}

.if-product-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 450;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.if-product-image-lightbox[hidden] {
  display: none !important;
}

.if-product-image-lightbox__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgb(0 0 0 / 0.72);
  cursor: zoom-out;
}

.if-product-image-lightbox__panel {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 72rem);
  max-height: min(88vh, 52rem);
  margin: 0;
}

.if-product-image-lightbox__img {
  display: block;
  max-width: min(92vw, 72rem);
  max-height: min(88vh, 52rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.25rem;
  background: #fff;
  box-shadow: 0 20px 50px rgb(0 0 0 / 0.35);
}

.if-product-image-lightbox__close {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 9999px;
  background: rgb(255 255 255 / 0.92);
  color: rgb(63 63 70);
  cursor: pointer;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.18);
  transition: background-color 0.15s ease;
}

.if-product-image-lightbox__close:hover {
  background: #fff;
}
