/* ═══════════════════════════════════════════════════════════════════
   Voya Indis Co. — voya-catalog.css
   Paginated product catalog: grid + pagination UI
   Include on every page that has a gallery or .auto-gallery-grid
   ═══════════════════════════════════════════════════════════════════ */

/* ── Viewport / overflow safety ─────────────────────────────────── */
html, body { max-width: 100vw; overflow-x: hidden; }

/* ── Suppress redundant auto-gallery heading + count ────────────── */
.auto-gallery-title,
.gallery-count { display: none !important; }

/* ── Reset .auto-gallery-section so it adds no extra spacing ────── */
.auto-gallery-section {
  display: block;
  margin: 0 !important;
  padding: 0 !important;
}

/* gallery.html: info line sits outside section — add bottom breathing room */
.gallery-section + .voya-pagination + .voya-pg-info {
  margin-bottom: 40px;
}

/* ═══════════════════════════════════════════════════════════════════
   CATALOG GRID  — .auto-gallery-grid (product pages)
   ═══════════════════════════════════════════════════════════════════ */
.auto-gallery-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 6px !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

.auto-gallery-grid > div {
  position: relative !important;
  overflow: hidden !important;
  aspect-ratio: 4 / 3 !important;
  width: 100% !important;
  background: #f2ede6;
  cursor: zoom-in;
}

.auto-gallery-grid > div img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
  transition: transform 0.5s cubic-bezier(0.25,0.46,0.45,0.94),
              opacity 0.5s ease !important;
  will-change: transform;
}

.auto-gallery-grid > div:hover img {
  transform: scale(1.06) !important;
  opacity: 0.88 !important;
}

/* Items hidden by pagination */
.auto-gallery-grid > div.catalog-hidden {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════
   CATALOG GRID  — gallery.html (.gallery-grid-wrap / .gallery-item)
   ═══════════════════════════════════════════════════════════════════ */
.gallery-grid-wrap {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 6px !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Override any legacy hero-first span */
.gallery-item {
  position: relative !important;
  overflow: hidden !important;
  aspect-ratio: 4 / 3 !important;
  background: #f2ede6 !important;
  cursor: zoom-in !important;
  transition: opacity 0.25s ease !important;
}

.gallery-item img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
  transition: transform 0.5s cubic-bezier(0.25,0.46,0.45,0.94),
              opacity 0.5s ease !important;
  will-change: transform;
}

.gallery-item:hover img {
  transform: scale(1.06) !important;
  opacity: 0.88 !important;
}

/* Hidden by filter or pagination */
.gallery-item.hidden,
.gallery-item.catalog-page-hidden {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════
   KILL OLD GALLERY-GRID hero-first override
   ═══════════════════════════════════════════════════════════════════ */
.gallery-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 6px !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
}
.gallery-grid img {
  display: block !important;
  width: 100% !important;
  aspect-ratio: 4 / 3 !important;
  object-fit: cover !important;
  height: auto !important;
  transition: transform 0.5s ease !important;
}
.gallery-grid img:hover { transform: scale(1.06) !important; opacity: 0.88 !important; }
.gallery-grid img:first-child {
  grid-column: unset !important;
  grid-row: unset !important;
  aspect-ratio: 4 / 3 !important;
  height: auto !important;
}

/* ═══════════════════════════════════════════════════════════════════
   PAGINATION CONTROLS
   ═══════════════════════════════════════════════════════════════════ */
.voya-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 24px 0 8px;
  font-family: 'Jost', sans-serif;
  user-select: none;
}

/* gallery.html: pagination sits OUTSIDE .gallery-section (which has 80px padding-bottom).
   Pull it up so there's no 100px+ gap between the grid and controls. */
.gallery-section + .voya-pagination {
  margin-top: -36px;
}

/* Prev / Next buttons */
.voya-pg-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 26px;
  height: 44px;
  border: 1px solid rgba(184,147,90,0.55);
  background: transparent;
  color: rgba(28,26,24,0.82);
  font-family: 'Jost', sans-serif;
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.voya-pg-btn svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.voya-pg-btn:hover:not(:disabled) {
  background: var(--gold, #b8935a);
  border-color: var(--gold, #b8935a);
  color: var(--ink, #1c1a18);
}
.voya-pg-btn:hover:not(:disabled) .voya-pg-arrow-prev {
  transform: translateX(-3px);
}
.voya-pg-btn:hover:not(:disabled) .voya-pg-arrow-next {
  transform: translateX(3px);
}
.voya-pg-btn:disabled {
  opacity: 0.38;
  cursor: default;
  pointer-events: none;
}
/* First-page link (‹‹ Page 1) */
.voya-pg-first {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 18px;
  height: 44px;
  border: 1px solid rgba(184,147,90,0.45);
  border-right: none;
  background: transparent;
  color: rgba(28,26,24,0.68);
  font-family: 'Jost', sans-serif;
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.voya-pg-first:hover:not(:disabled) {
  color: var(--gold, #b8935a);
  border-color: rgba(184,147,90,0.5);
}
.voya-pg-first:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* Divider between first and prev */
.voya-pg-divider {
  width: 1px;
  height: 44px;
  background: rgba(184,147,90,0.45);
  flex-shrink: 0;
}

/* Counter: "Page X of Y" */
.voya-pg-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 28px;
  height: 44px;
  border-top: 1px solid rgba(184,147,90,0.45);
  border-bottom: 1px solid rgba(184,147,90,0.45);
  background: transparent;
  color: rgba(28,26,24,0.72);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  white-space: nowrap;
  min-width: 120px;
  text-align: center;
}
.voya-pg-counter b {
  color: var(--gold, #b8935a);
  font-weight: 500;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.9rem;
  font-style: normal;
  letter-spacing: 0.06em;
  margin: 0 2px;
}

/* ── Page info line ──────────────────────────────────────────────── */
.voya-pg-info {
  text-align: center;
  font-family: 'Jost', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(28,26,24,0.62);
  margin: 10px 0 0;
}

/* Fade-in effect on page change */
@keyframes voyaCatalogFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.catalog-page-enter {
  animation: voyaCatalogFadeIn 0.35s ease both;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .auto-gallery-grid,
  .gallery-grid-wrap,
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 700px) {
  .auto-gallery-grid,
  .gallery-grid-wrap,
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .voya-pagination {
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 20px;
  }
  .voya-pg-first { display: none; }
  .voya-pg-divider { display: none; }
  .voya-pg-btn { padding: 0 18px; font-size: 0.62rem; letter-spacing: 0.12em; }
  .voya-pg-counter { padding: 0 16px; min-width: 100px; font-size: 0.62rem; }
}

@media (max-width: 420px) {
  .auto-gallery-grid,
  .gallery-grid-wrap,
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   LIGHTBOX (carried over from voya-lightbox.css)
   ═══════════════════════════════════════════════════════════════════ */
.voya-lb {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(8,8,8,0.97);
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.voya-lb.open { display: flex !important; }

.voya-lb-close {
  position: absolute; top: 18px; right: 22px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.28);
  color: #fff; font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.22s;
  z-index: 10; padding: 0; outline: none;
}
.voya-lb-close:hover { background: rgba(255,255,255,0.28); transform: scale(1.1) rotate(90deg); }

.voya-lb-prev, .voya-lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 54px; height: 54px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.22);
  color: #fff; font-size: 2.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; z-index: 10; user-select: none;
  padding: 0 0 2px 0; outline: none;
}
.voya-lb-prev { left: 20px; }
.voya-lb-next { right: 20px; }
.voya-lb-prev:hover, .voya-lb-next:hover { background: rgba(255,255,255,0.24); }

.voya-lb-counter {
  position: absolute; top: 24px; left: 50%; transform: translateX(-50%);
  font-family: 'Jost', sans-serif; font-size: 0.68rem;
  letter-spacing: 0.24em; color: rgba(255,255,255,0.42);
  text-transform: uppercase; white-space: nowrap; pointer-events: none;
}

.voya-lb-label {
  position: absolute; bottom: 100px; left: 50%; transform: translateX(-50%);
  font-family: 'Jost', sans-serif; font-size: 0.65rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(184,147,90,0.6); white-space: nowrap; pointer-events: none;
}

.voya-lb-img-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 66px 96px 12px; box-sizing: border-box; overflow: hidden;
}
#voyaLBImg {
  max-width: 100%; max-height: calc(100vh - 195px);
  object-fit: contain; box-shadow: 0 24px 80px rgba(0,0,0,0.65);
  display: block; transition: opacity 0.18s ease;
}
#voyaLBImg.voya-fade { opacity: 0; }

.voya-lb-thumbs {
  display: flex; gap: 6px; padding: 10px 20px 14px;
  justify-content: center; overflow-x: auto; max-width: 100vw;
  flex-shrink: 0; scrollbar-width: thin;
  scrollbar-color: rgba(184,147,90,0.5) transparent;
}
.voya-lb-thumbs::-webkit-scrollbar { height: 3px; }
.voya-lb-thumbs::-webkit-scrollbar-thumb {
  background: rgba(184,147,90,0.5); border-radius: 2px;
}
.voya-lb-thumb {
  width: 60px; height: 44px; object-fit: cover; cursor: pointer;
  opacity: 0.38; flex-shrink: 0; border: 2px solid transparent;
  border-radius: 2px; transition: opacity 0.2s, border-color 0.2s;
}
.voya-lb-thumb:hover { opacity: 0.7; }
.voya-lb-thumb.active { opacity: 1; border-color: #b8935a; }

@media (max-width: 640px) {
  .voya-lb-prev { left: 8px; width: 42px; height: 42px; font-size: 1.8rem; }
  .voya-lb-next { right: 8px; width: 42px; height: 42px; font-size: 1.8rem; }
  .voya-lb-img-wrap { padding: 56px 62px 10px; }
  #voyaLBImg { max-height: calc(100vh - 168px); }
  .voya-lb-thumb { width: 46px; height: 34px; }
}

/* ── Product page pagination wrapper ────────────────────────────────
   White background, tight spacing — matches the gallery page style.    */
.voya-product-pg-wrap {
  background: var(--white, #ffffff);
  padding: 20px 60px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.voya-product-pg-wrap .voya-pagination {
  margin: 0;
}

.voya-product-pg-wrap .voya-pg-info {
  margin: 0;
}

@media (max-width: 900px) {
  .voya-product-pg-wrap {
    padding: 16px 16px 24px;
  }
}
