/* ==========================================================================
   PDP GALERIA — assets/css/pdp/pdp-gallery.css
   Imagem principal + thumbnails horizontais abaixo + modal lightbox
   ========================================================================== */

/* Layout da galeria */
.senv-pdp-gallery {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 72px;
}

/* Imagem principal */
.senv-pdp-main-img-wrap {
  position: relative;
  width: 100%;
}

.senv-pdp-main-img-wrap img {
  width: 100%;
  height: 640px;
  object-fit: cover;
  display: block;
}

/* Badge (Novo / Exclusivo) */
.senv-pdp-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  font-family: var(--senv-font-body);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--senv-gold);
  border: 1px solid var(--senv-gold);
  padding: 4px 10px;
  z-index: 1;
  pointer-events: none;
}

/* Zoom button (era <a>, agora <button>) */
.senv-pdp-zoom {
  display: block;
  text-decoration: none;
  position: relative;
  cursor: zoom-in;
  border: none;
  padding: 0;
  background: none;
  width: 100%;
}
.senv-pdp-zoom-hint {
  position: absolute;
  bottom: 12px;
  right: 12px;
  font-family: var(--senv-font-body);
  font-size: 10px;
  letter-spacing: .1em;
  color: rgba(255, 255, 255, .55);
  pointer-events: none;
  background: rgba(10, 8, 7, .45);
  padding: 4px 8px;
  border-radius: 2px;
  transition: opacity .2s;
}
.senv-pdp-zoom:hover .senv-pdp-zoom-hint {
  opacity: 0;
}

/* Thumbnails — row horizontal abaixo da imagem */
.senv-pdp-thumbs {
  display: flex;
  flex-direction: row;
  gap: 12px;
  padding: 12px 0 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.senv-pdp-thumbs::-webkit-scrollbar { display: none; }

.senv-pdp-thumb {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  border: 1px solid transparent;
  padding: 0;
  background: #2A2420;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .2s;
  border-radius: 2px;
  position: relative;
}
.senv-pdp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.senv-pdp-thumb.is-active {
  border-color: var(--senv-gold);
}
.senv-pdp-thumb:hover {
  border-color: rgba(184, 146, 74, .5);
}

/* Thumbnail de vídeo */
.senv-pdp-thumb--video {
  background: #1A1210;
}
.senv-pdp-thumb--video img {
  filter: brightness(.75);
}
.senv-pdp-thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--senv-gold);
  pointer-events: none;
  text-shadow: 0 2px 8px rgba(0,0,0,.6);
}

/* ==========================================================================
   MODAL LIGHTBOX
   ========================================================================== */

.senv-gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.senv-gallery-modal[hidden] {
  display: none;
}

.senv-gallery-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 7, .94);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
}

.senv-gallery-modal__wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 960px;
  max-height: 96vh;
  padding: 48px 24px 24px;
  z-index: 1;
  gap: 16px;
}

/* Botão fechar */
.senv-gallery-modal__close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: rgba(242, 235, 228, .6);
  font-size: 20px;
  cursor: pointer;
  padding: 6px 10px;
  line-height: 1;
  transition: color .2s;
}
.senv-gallery-modal__close:hover {
  color: var(--senv-offwhite);
}

/* Prev / Next */
.senv-gallery-modal__prev,
.senv-gallery-modal__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(242, 235, 228, .55);
  font-size: 48px;
  line-height: 1;
  cursor: pointer;
  padding: 8px 16px;
  transition: color .2s;
  z-index: 2;
}
.senv-gallery-modal__prev { left: 4px; }
.senv-gallery-modal__next { right: 4px; }
.senv-gallery-modal__prev:hover,
.senv-gallery-modal__next:hover { color: var(--senv-gold); }
.senv-gallery-modal__prev:disabled,
.senv-gallery-modal__next:disabled { opacity: .2; cursor: default; }

/* Área de mídia */
.senv-gallery-modal__media {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 70vh;
  overflow: hidden;
}
.senv-gallery-modal__media img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  display: block;
  border-radius: 2px;
  animation: senvModalFadeIn .2s ease;
}
.senv-gallery-modal__media .senv-gallery-modal__video-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 70vh;
  animation: senvModalFadeIn .2s ease;
}
.senv-gallery-modal__media .senv-gallery-modal__video-wrap iframe,
.senv-gallery-modal__media .senv-gallery-modal__video-wrap video {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Contador */
.senv-gallery-modal__counter {
  font-family: var(--senv-font-body);
  font-size: 11px;
  letter-spacing: .15em;
  color: rgba(242, 235, 228, .4);
}

/* Thumbnails no modal */
.senv-gallery-modal__thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
  padding: 4px 0;
}
.senv-gallery-modal__thumbs::-webkit-scrollbar { display: none; }

.senv-gallery-modal__thumb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border: 1px solid transparent;
  padding: 0;
  background: #2A2420;
  cursor: pointer;
  overflow: hidden;
  border-radius: 2px;
  transition: border-color .15s;
  position: relative;
}
.senv-gallery-modal__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.senv-gallery-modal__thumb.is-active {
  border-color: var(--senv-gold);
}
.senv-gallery-modal__thumb:hover {
  border-color: rgba(184, 146, 74, .4);
}
.senv-gallery-modal__thumb--video .senv-gallery-modal__thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--senv-gold);
  font-size: 14px;
  background: rgba(10,8,7,.4);
}

@keyframes senvModalFadeIn {
  from { opacity: 0; transform: scale(.97); }
  to   { opacity: 1; transform: scale(1); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .senv-pdp-gallery { position: static; }
  .senv-pdp-main-img-wrap img { height: 500px; }
  .senv-gallery-modal__prev { left: 0; }
  .senv-gallery-modal__next { right: 0; }
}
@media (max-width: 600px) {
  .senv-pdp-main-img-wrap img { height: 420px; }
  .senv-pdp-thumb { width: 72px; height: 72px; }
  .senv-gallery-modal__wrap { padding: 40px 8px 16px; }
  .senv-gallery-modal__prev,
  .senv-gallery-modal__next { font-size: 32px; padding: 4px 8px; }
}
