/* ==============================================
   CATALOGO PREVIEW — Galeria Leme
   Layout de spreads (livro aberto) identico ao mockup
   v1.1 — NAO compilado de SCSS, editar direto
   ============================================== */

/* ==============================================
   CATALOGO CONTAINER
   ============================================== */
.catalogo {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==============================================
   BARRA PDF (topo)
   ============================================== */
.pdf-bar {
  max-width: 1300px;
  margin: 24px auto 0;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-selecionar-obras {
  display: inline-block;
  padding: 10px 24px;
  background: transparent;
  color: #333;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: 1px solid #333;
  cursor: default;
}

.btn-gerar-pdf {
  display: none;
  padding: 10px 24px;
  background: #d9ed09;
  color: #333;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-gerar-pdf.visible { display: inline-block; }
.btn-gerar-pdf:hover { background: #c8dc08; }

/* ==============================================
   SPREAD — livro aberto (duas paginas)
   ============================================== */
.spread {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 560px;
  margin: 40px 0;
  background: #e7e7e2;
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.spread.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Linha central do livro */
.spread::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 1px;
  background: linear-gradient(to bottom, transparent 5%, #e0e0e0 20%, #e0e0e0 80%, transparent 95%);
  pointer-events: none;
}

/* ==============================================
   TIPO 1: VISTA FULLBLEED + FICHA
   Como pag 178-179 do catalogo
   ============================================== */
.spread--vista .spread-left {
  position: relative;
  overflow: hidden;
}
.spread--vista .spread-left img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform 0.6s ease;
}
.spread--vista:hover .spread-left img { transform: scale(1.02); }

/* Pagina direita: numero + artista + ficha + imagem menor */
.spread--vista .spread-right {
  position: relative;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #e7e7e2;
}

.page-number {
  font-size: 9px; letter-spacing: 2px; color: #ccc;
  text-transform: uppercase; margin-bottom: 32px;
}

.spread-artist {
  font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
  color: #666; margin-bottom: 16px; font-weight: 500;
}

.spread-title {
  font-size: 22px; font-weight: 400; color: #333;
  margin-bottom: 8px; line-height: 1.3;
}

.spread-ficha {
  margin: 16px 0;
}
.spread-ficha p {
  font-size: 12px; color: #888; line-height: 1.7;
}

.spread-thumb {
  margin-top: 24px;
  max-width: 280px;
  position: relative;
}
.spread-thumb img {
  width: 100%; height: auto; display: block;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.1));
}

/* ==============================================
   TIPO 2: DUAS OBRAS LADO A LADO
   Como pag 188-189 do catalogo
   ============================================== */
.spread--dupla .spread-page {
  position: relative;
  padding: 48px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #e7e7e2;
}
.spread--dupla .spread-page:first-child {
  border-right: 1px solid #f0f0f0;
}

.spread--dupla .page-inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.spread--dupla .obra-ficha {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.spread--dupla .obra-ficha .spread-artist {
  margin-bottom: 12px;
}
.spread--dupla .obra-ficha .spread-title {
  font-size: 18px;
  margin-bottom: 12px;
}
.spread--dupla .obra-ficha .spread-ficha p {
  font-size: 11px;
}

.spread--dupla .obra-imagem {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.spread--dupla .obra-imagem img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.1));
  transition: transform 0.5s ease;
}
.spread--dupla .obra-imagem:hover img { transform: scale(1.03); }

/* ==============================================
   TIPO 3: OBRA FULL (uma obra grande)
   ============================================== */
.spread--full .spread-left {
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #DADAD5;
  position: relative;
}
.spread--full .spread-left img {
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.12));
  transition: transform 0.5s ease;
}
.spread--full:hover .spread-left img { transform: scale(1.02); }

.spread--full .spread-right {
  position: relative;
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #e7e7e2;
}

/* ==============================================
   SELETOR DE OBRA (checkbox)
   ============================================== */
.obra-selector {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 3;
}
.obra-selector input[type="checkbox"] {
  display: none;
}
.obra-selector label {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.85);
  border: 2px solid #c8c8c7;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.obra-selector label:hover {
  border-color: #d9ed09;
  background: rgba(255,255,255,0.95);
}
.obra-selector input:checked + label {
  background: #d9ed09;
  border-color: #d9ed09;
}
.obra-selector input:checked + label::after {
  content: '\2713';
  font-size: 16px;
  font-weight: 700;
  color: #333;
}
.obra-selector input:disabled + label {
  background: #d9ed09;
  border-color: #d9ed09;
  cursor: default;
  opacity: 0.7;
}
.obra-selector input:disabled + label::after {
  content: '\1F512';
  font-size: 12px;
}

/* ==============================================
   BOTAO FLIPBOOK
   ============================================== */
.flipbook-cta {
  text-align: center;
  padding: 48px 0;
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.flipbook-cta.visible { opacity: 1; transform: translateY(0); }

.btn-flipbook {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 40px; background: #333; color: #d9ed09;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; text-decoration: none;
  border: none; cursor: pointer; transition: all 0.3s;
}
.btn-flipbook:hover { background: #1a1a1a; }
.btn-flipbook svg { width: 20px; height: 20px; fill: #d9ed09; }

.flipbook-note {
  display: block; margin-top: 8px;
  font-size: 11px; color: #999; letter-spacing: 0.5px;
}

/* ==============================================
   MODAL DO FORMULARIO
   ============================================== */
.catalogo-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.catalogo-modal-overlay.active {
  display: flex;
}

.catalogo-modal {
  background: #fff;
  max-width: 440px;
  width: 90%;
  padding: 40px;
  position: relative;
}

.catalogo-modal__close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  background: none; border: none;
  font-size: 20px; color: #999;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.catalogo-modal__close:hover { color: #333; }

.catalogo-modal__title {
  font-size: 18px; font-weight: 700; color: #333; margin-bottom: 8px;
}

.catalogo-modal__subtitle {
  font-size: 12px; color: #888; margin-bottom: 24px; line-height: 1.5;
}

.catalogo-modal__field {
  margin-bottom: 16px;
}
.catalogo-modal__field label {
  display: block;
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  color: #666; margin-bottom: 6px; font-weight: 500;
}
.catalogo-modal__field input {
  width: 100%; padding: 12px 16px;
  border: 1px solid #ddd;
  font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
  font-size: 14px; color: #333;
  transition: border-color 0.2s;
}
.catalogo-modal__field input:focus {
  outline: none; border-color: #d9ed09;
}
.catalogo-modal__field input.error {
  border-color: #e74c3c;
}
.catalogo-modal__field .field-error {
  font-size: 11px; color: #e74c3c; margin-top: 4px; display: none;
}
.catalogo-modal__field input.error + .field-error {
  display: block;
}

.catalogo-modal__submit {
  width: 100%; padding: 14px;
  background: #333; color: #fff;
  font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; border: none; cursor: pointer;
  margin-top: 8px; transition: background 0.2s;
}
.catalogo-modal__submit:hover { background: #1a1a1a; }
.catalogo-modal__submit:disabled { background: #999; cursor: wait; }

.catalogo-modal__loading {
  display: none; text-align: center;
  padding: 20px; font-size: 13px; color: #666;
}

/* ==============================================
   MOBILE
   ============================================== */
@media (max-width: 900px) {
  .catalogo { padding: 0 12px; }
  .pdf-bar { flex-wrap: wrap; gap: 8px; }
  .spread { grid-template-columns: 1fr; min-height: auto; margin: 24px 0; }
  .spread::after { display: none; }
  .spread--vista .spread-left { min-height: 280px; }
  .spread--vista .spread-right { padding: 32px 24px; }
  .spread--dupla .page-inner { grid-template-columns: 1fr; gap: 16px; }
  .spread--dupla .spread-page { padding: 32px 24px; }
  .spread--dupla .spread-page:first-child { border-right: none; border-bottom: 1px solid #f0f0f0; }
  .spread--full .spread-left { padding: 24px; }
  .spread--full .spread-right { padding: 32px 24px; }
  .spread-title { font-size: 18px; }
  .spread-thumb { max-width: 200px; }
  .catalogo-modal { padding: 24px; width: 95%; }
}
