/* Galeria de fotos da pagina do Instrumento (shortcode [corsell_instrumento_fotos]) */
/* Estilo tipo Apple: filmstrip horizontal, cards brancos, botao + preto, setas */
.corsell-instr-fotos-wrap {
  max-width: 1140px;
  margin: 20px auto;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}

.corsell-instr-fotos-grid {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 18px;
  margin: 0;
  padding: 6px 6px 10px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.corsell-instr-fotos-grid::-webkit-scrollbar {
  display: none;
}

.corsell-instr-fotos-grid a {
  flex: 0 0 auto;
  width: 260px;
  display: block;
  border-radius: 18px;
  overflow: hidden;
  scroll-snap-align: start;
  position: relative;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 10px 26px -14px rgba(0,0,0,.18);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.corsell-instr-fotos-grid a:hover {
  box-shadow: 0 1px 3px rgba(0,0,0,.10), 0 16px 32px -14px rgba(0,0,0,.24);
  transform: translateY(-2px);
}

.corsell-instr-fotos-grid img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}

.corsell-instr-fotos-grid a::after {
  content: "+";
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1d1d1f;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Jost', sans-serif;
  font-weight: 400;
  font-size: 22px;
  line-height: 33px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,.28);
  transition: transform 0.25s ease, background 0.25s ease;
  pointer-events: none;
}

.corsell-instr-fotos-grid a:hover::after {
  transform: scale(1.08);
  background: #000;
}

.corsell-instr-fotos-arrows {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.corsell-instr-fotos-arrows button.cif-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  outline: none;
  background: #F5F0E8;
  color: #2C2416;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
}

.corsell-instr-fotos-arrows button.cif-arrow:hover {
  background: #EDE0C8;
}

.corsell-instr-fotos-arrows button.cif-arrow:focus-visible {
  box-shadow: 0 0 0 3px rgba(200,169,110,.45);
}

@media (max-width: 767px) {
  /* Sangria so' do lado direito: mantem o alinhamento a esquerda com o
     resto da pagina, mas deixa a foto "cortada" ir ate a borda direita
     da tela em vez de sobrar um respiro/margem ali. O respiro depois da
     ULTIMA foto (final do scroll) fica por conta do padding-right do
     grid, que so aparece quando o scroll chega no fim. */
  .corsell-instr-fotos-wrap {
    padding-right: 0;
  }
  .corsell-instr-fotos-grid {
    padding-right: 24px;
  }
  .corsell-instr-fotos-grid a {
    width: 210px;
  }
  .corsell-instr-fotos-grid img {
    height: 210px;
  }
}

/* Lightbox customizado da galeria (substitui o lightbox nativo do Elementor, que apresentava bug) */
.corsell-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(20, 16, 10, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
  padding: 40px;
  box-sizing: border-box;
}

.corsell-lightbox-overlay.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease, visibility 0s linear 0s;
}

.corsell-lightbox-figure {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.corsell-lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  display: block;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
  background: rgba(255, 255, 255, 0.03);
}

.corsell-lightbox-img.is-loaded {
  opacity: 1;
}

.corsell-lightbox-overlay button {
  box-sizing: border-box;
  border: none;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background: #F5F0E8;
  color: #2C2416;
  border-radius: 50%;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: background 0.2s ease, transform 0.15s ease;
}

.corsell-lightbox-overlay button:hover {
  background: #EDE0C8;
}

.corsell-lightbox-overlay button:focus-visible {
  box-shadow: 0 0 0 3px rgba(200, 169, 110, 0.55);
}

.corsell-lightbox-close {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px;
  max-width: 40px;
  font-size: 20px;
  line-height: 1;
  z-index: 2;
}

.corsell-lightbox-prev,
.corsell-lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px !important;
  height: 48px !important;
  min-width: 48px;
  max-width: 48px;
  font-size: 22px;
  line-height: 1;
}

.corsell-lightbox-prev:hover,
.corsell-lightbox-next:hover {
  transform: translateY(-50%) scale(1.06);
}

.corsell-lightbox-prev {
  left: 24px;
}

.corsell-lightbox-next {
  right: 24px;
}

.corsell-lightbox-counter {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: #F5F0E8;
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

@media (max-width: 600px) {
  .corsell-lightbox-prev,
  .corsell-lightbox-next {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    max-width: 40px;
  }
  .corsell-lightbox-prev {
    left: 8px;
  }
  .corsell-lightbox-next {
    right: 8px;
  }
  .corsell-lightbox-close {
    top: -14px;
    right: 2px;
  }
}

/* Foto principal (shortcode [corsell_instrumento_foto_principal]) */
.corsell-instr-foto-principal {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Historia / Making of (shortcode [corsell_instrumento_historia]) */
.corsell-instr-historia {
  max-width: 65ch;
  margin: 0 auto;
  line-height: 1.75;
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  color: #331608;
  text-align: center;
}

/* Reforca contra cores herdadas de conteudo colado no editor (ex: spans com
   "color: #000" salvos no campo) -- o PHP ja limpa isso, mas o !important
   garante mesmo se algum conteudo antigo escapar da limpeza. */
.corsell-instr-historia,
.corsell-instr-historia * {
  color: #331608 !important;
}

.corsell-instr-historia p {
  margin: 0 0 1.2em;
}

/* Titulo / serie / descricao (shortcodes atomicos da pagina do Instrumento) */
.corsell-instr-titulo {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.04em;
  margin: 0;
  line-height: 1;
}

.corsell-instr-serie {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 13px;
  color: #8B7355;
}

.corsell-instr-descricao {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  margin: 0;
}
