/* =========================================
   CASA DE FESTA BH — style.css
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Shadows+Into+Light&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&display=swap');

/* =========================================
   1. TOKENS DE DESIGN
   ========================================= */
:root {
  --dourado:        #d4af37;
  --dourado-escuro: #b5952f;
  --dourado-claro:  #e8ca5a;

  --bg-fundo:     #fafafa;
  --bg-header:    #ffffff;
  --bg-card:      #ffffff;
  --texto-titulo: #1a1a1a;
  --texto-corpo:  #555555;
  --borda:        #eaeaea;
  --sombra:       rgba(0, 0, 0, 0.06);
  --sombra-forte: rgba(0, 0, 0, 0.15);

  --fonte-display: 'Shadows Into Light', cursive;
  --fonte-corpo:   'Archivo Black', sans-serif;
  --fonte-ui:      system-ui, sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --trans: 0.3s ease;

  /* Ícones: cor única controlada por variável */
  --icon-color: #d4af37;
}

body.tema-escuro {
  --bg-fundo:     #121212;
  --bg-header:    #1e1e1e;
  --bg-card:      #242424;
  --texto-titulo: #f5f5f5;
  --texto-corpo:  #aaaaaa;
  --borda:        #333333;
  --sombra:       rgba(0, 0, 0, 0.30);
  --sombra-forte: rgba(0, 0, 0, 0.55);
  --icon-color:   #e8ca5a;
}

/* =========================================
   2. BASE
   ========================================= */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--fonte-corpo);
  background-color: var(--bg-fundo);
  color: var(--texto-titulo);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--trans), color var(--trans);
  overflow-x: hidden;
}

a { text-decoration: none !important; }

.titulo-principal,
.titulo-secao { color: var(--texto-titulo); }

.paragrafo-destaque {
  color: var(--texto-corpo);
  font-family: var(--fonte-ui);
  line-height: 1.6;
}

.opacidade { opacity: 0.6; }

/* =========================================
   3. ÍCONES (Lucide via SVG inline)
   ========================================= */
.icone-feature {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background-color: rgba(212, 175, 55, 0.12);
  border-radius: 50%;
  margin: 0 auto 12px;
  flex-shrink: 0;
}

.icone-feature svg {
  width: 26px;
  height: 26px;
  stroke: var(--icon-color);
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icone-sm svg {
  width: 16px;
  height: 16px;
  stroke: var(--texto-corpo);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
  margin-right: 4px;
}

/* =========================================
   4. HEADER & NAVEGAÇÃO
   ========================================= */
.header {
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--borda);
  box-shadow: 0 4px 15px var(--sombra);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background-color var(--trans);
  width: 100%;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-family: var(--fonte-display);
  font-size: 2rem;
  color: var(--dourado);
  margin: 0;
}
.logo img {
  height: 44px;
  width: auto;
  display: block;
}
.footer .logo img { height: 40px; margin: 0 auto; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 25px;
  margin-bottom: 0;
}
.nav-menu a {
  color: var(--texto-titulo);
  font-family: var(--fonte-ui);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color var(--trans);
}
.nav-menu a:hover,
.nav-menu a:focus-visible { color: var(--dourado); }

.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--texto-titulo);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.menu-toggle svg {
  width: 28px;
  height: 28px;
  stroke: var(--texto-titulo);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* =========================================
   5. TOGGLE DE TEMA
   ========================================= */
.btn-tema {
  position: relative;
  width: 54px;
  height: 28px;
  background-color: #cfd8dc;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  transition: background-color 0.4s;
  display: flex;
  align-items: center;
  padding: 2px;
  flex-shrink: 0;
}
.btn-tema::after {
  content: "";
  width: 24px;
  height: 24px;
  background-color: white;
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px;
  transition: transform var(--trans);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
body.tema-escuro .btn-tema { background-color: var(--dourado-escuro); }
body.tema-escuro .btn-tema::after {
  transform: translateX(26px);
  background-color: #1a1a1a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23e8ca5a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E");
}

/* =========================================
   6. BOTÕES
   ========================================= */
.btn-dourado {
  background-color: var(--dourado) !important;
  color: #1a1a1a !important;
  font-weight: bold;
  border: none;
  transition: background-color var(--trans), transform var(--trans);
}
.btn-dourado:hover,
.btn-dourado:focus-visible {
  background-color: var(--dourado-escuro) !important;
  transform: scale(1.02);
}

.btn-outline-dourado {
  border: 2px solid var(--dourado) !important;
  color: var(--texto-titulo) !important;
  font-weight: bold;
  transition: background-color var(--trans), color var(--trans);
  background-color: transparent;
}
.btn-outline-dourado:hover,
.btn-outline-dourado:focus-visible {
  background-color: var(--dourado) !important;
  color: #1a1a1a !important;
}

/* =========================================
   7. CARDS DE FEATURE (serviços)
   ========================================= */
.custom-card {
  background-color: var(--bg-card) !important;
  border: 1px solid var(--borda) !important;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 20px var(--sombra);
  transition: transform var(--trans), border-color var(--trans);
}
.custom-card:hover { transform: translateY(-4px); }
.custom-card .card-title { color: var(--texto-titulo); }

.feature-card {
  background-color: var(--bg-card);
  border: 1px solid var(--borda);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  height: 100%;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.feature-card:hover {
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.1);
}

.card.custom-card > img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

/* =========================================
   8. CARROSSEL SWIPE
   ========================================= */
.carrossel-swipe {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  gap: 15px;
  padding-bottom: 15px;
  scrollbar-width: none;
}
.carrossel-swipe::-webkit-scrollbar { display: none; }
.carrossel-swipe.dragging { cursor: grabbing; }

.swipe-item {
  flex: 0 0 auto;
  width: 80%;
  max-width: 300px;
  border-radius: var(--radius-md);
  scroll-snap-align: center;
  background-color: var(--bg-card);
  border: 1px solid var(--borda);
  box-shadow: 0 4px 10px var(--sombra);
}
img.swipe-item {
  height: 350px;
  object-fit: cover;
  border: none;
}
.video-container {
  height: 400px;
  border: none;
  padding: 0;
}
.video-container video {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  object-fit: cover;
}

/* =========================================
   9. POSTER DE TEMA (catálogo)
   ========================================= */
.tema-poster {
  position: relative;
  flex: 0 0 auto;
  width: 140px;
  height: 210px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--trans);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.tema-poster:hover,
.tema-poster:focus-visible { transform: scale(1.05); outline: 2px solid var(--dourado); }

.tema-poster img,
.tema-poster video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tema-nome {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
  color: #ffffff !important;
  text-align: center;
  padding: 20px 5px 10px;
  font-weight: bold;
  font-size: 0.85rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

/* --- Ícone ▶ nos posters de vídeo --- */
.tema-poster__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: background-color var(--trans), transform var(--trans);
  z-index: 2;
}
.tema-poster__play svg {
  width: 16px;
  height: 16px;
  fill: #ffffff;
  stroke: none;
  margin-left: 2px; /* ícone play fica visualmente centralizado */
}
.tema-poster:hover .tema-poster__play {
  background: var(--dourado);
  transform: translate(-50%, -60%) scale(1.1);
}
.tema-poster:hover .tema-poster__play svg {
  fill: #1a1a1a;
}

/* Borda dourada sutil nos posters de vídeo */
.tema-poster--video {
  box-shadow:
    0 4px 8px rgba(0,0,0,0.2),
    inset 0 0 0 2px rgba(212, 175, 55, 0.3);
}

/* =========================================
   10. MODAL
   ========================================= */
.modal-tema-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  overflow-y: auto;
}
.modal-tema-content {
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}
.modal-fechar {
  position: sticky;
  top: 15px;
  float: right;
  background: var(--dourado);
  color: #1a1a1a;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-family: var(--fonte-ui);
  font-weight: bold;
  cursor: pointer;
  z-index: 10;
  transition: background-color var(--trans);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.modal-fechar svg {
  width: 14px;
  height: 14px;
  stroke: #1a1a1a;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}
.modal-fechar:hover { background: var(--dourado-escuro); }

.modal-tema-content h2,
.modal-tema-content h4 { color: #ffffff !important; }

#modalTemaFotos[hidden],
#modalTemaVideos[hidden],
#labelModalFotos[hidden],
#labelModalVideos[hidden] { display: none; }

/* --- Layout vertical para vídeos no modal --- */
.modal-videos-vertical {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 20px;
  /* Sobrescreve o carrossel horizontal */
  overflow-x: visible;
  scroll-snap-type: none;
}

.modal-video-card {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modal-video-counter {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-family: var(--fonte-ui);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  z-index: 2;
  letter-spacing: 0.5px;
}

.modal-video-player {
  position: relative;
  width: 100%;
  /* Aspect ratio 9:16 pra vídeos verticais, com fallback */
  aspect-ratio: 9 / 16;
  max-height: 70vh;
  background: #000;
}

.modal-video-player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  display: block;
  background: #000;
}

/* =========================================
   11. LOADER
   ========================================= */
.loader {
  position: fixed;
  inset: 0;
  background-color: var(--bg-fundo);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--borda);
  border-top-color: var(--dourado);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================
   12. FOOTER
   ========================================= */
.footer {
  background-color: var(--bg-header);
  border-top: 1px solid var(--borda);
  margin-top: auto;
}

/* =========================================
   13. RESPONSIVIDADE
   ========================================= */
@media (max-width: 768px) {
  .menu-toggle { display: block; }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-header);
    flex-direction: column;
    padding: 20px 0;
    gap: 20px;
    box-shadow: 0 10px 15px var(--sombra-forte);
    border-bottom: 1px solid var(--borda);
    transform: translateY(-150%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s ease, opacity 0.4s ease, visibility 0.4s;
    z-index: 999;
  }
  .nav-menu.ativo {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .btn-tema { margin-top: 10px; }
  .tema-poster { width: 120px; height: 180px; }
  .modal-tema-content { padding: 12px; }

  /* Vídeos no modal: ocupam mais tela no mobile */
  .modal-video-player {
    max-height: 60vh;
  }
}

@media (max-width: 400px) {
  .logo { font-size: 1.5rem; }
  .logo img { height: 36px; }
}

/* =========================================
   14. SETAS DE CARROSSEL (desktop)
   ========================================= */
.carrossel-wrapper {
  position: relative;
}

.carrossel-seta {
  display: none; /* escondido no mobile */
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--dourado);
  background: var(--bg-card);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px var(--sombra-forte);
  transition: background-color var(--trans), transform var(--trans), opacity var(--trans);
  opacity: 0.9;
}
.carrossel-seta svg {
  width: 20px;
  height: 20px;
  stroke: var(--dourado);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.carrossel-seta:hover {
  background: var(--dourado);
  transform: translateY(-50%) scale(1.1);
  opacity: 1;
}
.carrossel-seta:hover svg {
  stroke: #1a1a1a;
}
.carrossel-seta--esq { left: -8px; }
.carrossel-seta--dir { right: -8px; }

.carrossel-seta.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Setas dentro do modal: cores claras */
.modal-tema-content .carrossel-seta {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--dourado);
}
.modal-tema-content .carrossel-seta:hover {
  background: var(--dourado);
}

/* =========================================
   15. DESKTOP (769px+)
   ========================================= */
@media (min-width: 769px) {

  /* Mostrar setas de navegação */
  .carrossel-seta {
    display: flex;
  }

  /* Cursor grab nos carrosseis */
  .carrossel-swipe {
    cursor: grab;
  }
  .carrossel-swipe.dragging {
    cursor: grabbing;
  }

  /* Header: mais padding, logo maior */
  .header-container {
    padding: 14px 30px;
  }
  .logo {
    font-size: 2.4rem;
  }
  .logo img {
    height: 56px;
  }
  .nav-menu {
    gap: 32px;
  }
  .nav-menu a {
    font-size: 0.95rem;
    position: relative;
  }
  /* Underline animado nos links do menu */
  .nav-menu a::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--dourado);
    transition: width var(--trans);
  }
  .nav-menu a:hover::after,
  .nav-menu a:focus-visible::after {
    width: 100%;
  }

  /* Seções: padding lateral generoso */
  section,
  .container {
    padding-left: 40px;
    padding-right: 40px;
  }

  /* Feature cards: grid de 3 ou 4 colunas */
  .row .col-md-4,
  .row .col-lg-3 {
    /* Bootstrap já cuida, mas caso use flex puro: */
  }
  .feature-card {
    padding: 28px 22px;
  }
  .icone-feature {
    width: 60px;
    height: 60px;
  }
  .icone-feature svg {
    width: 30px;
    height: 30px;
  }

  /* Card de categoria: imagem mais alta */
  .card.custom-card > img {
    height: 260px;
  }

  /* Posters maiores no desktop */
  .tema-poster {
    width: 180px;
    height: 270px;
    border-radius: 12px;
  }
  .tema-nome {
    font-size: 0.95rem;
    padding: 24px 8px 12px;
  }
  .tema-poster__play {
    width: 48px;
    height: 48px;
  }
  .tema-poster__play svg {
    width: 20px;
    height: 20px;
  }

  /* Carrossel swipe: items maiores, gap maior */
  .carrossel-swipe {
    gap: 20px;
    padding: 10px 0 20px;
  }
  .swipe-item {
    width: 45%;
    max-width: 380px;
  }
  img.swipe-item {
    height: 420px;
  }

  /* Modal: mais espaço */
  .modal-tema-content {
    padding: 40px;
    max-width: 900px;
  }
  .modal-fechar {
    padding: 10px 20px;
    font-size: 0.95rem;
  }

  /* Vídeos no modal: lado a lado se tiver 2+ */
  .modal-videos-vertical {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 24px;
  }
  .modal-video-card {
    flex: 1 1 calc(50% - 12px);
    min-width: 300px;
  }
  .modal-video-player {
    max-height: 55vh;
  }

  /* Fotos no modal: items maiores */
  #modalTemaFotos img.swipe-item {
    height: 450px;
    max-width: 400px;
  }
}

/* =========================================
   16. DESKTOP LARGO (1200px+)
   ========================================= */
@media (min-width: 1200px) {

  .header-container {
    padding: 16px 40px;
  }
  .logo {
    font-size: 2.6rem;
  }
  .logo img {
    height: 64px;
  }

  /* Posters ainda maiores */
  .tema-poster {
    width: 200px;
    height: 300px;
  }

  /* Carrossel: mais items visíveis */
  .swipe-item {
    width: 35%;
    max-width: 420px;
  }
  img.swipe-item {
    height: 480px;
  }

  /* Modal mais largo */
  .modal-tema-content {
    max-width: 1060px;
    padding: 50px 60px;
  }

  /* Vídeos podem ficar maiores */
  .modal-video-player {
    max-height: 65vh;
  }

  #modalTemaFotos img.swipe-item {
    height: 520px;
    max-width: 450px;
  }

  /* Feature cards: mais padding */
  .feature-card {
    padding: 32px 28px;
  }
}