/* =========================================================
  AJUSTES PERSONALIZADOS - DIGITAL HOUSE TECNOLOGIA
  Este arquivo complementa /assets/css/style.css.
========================================================= */

/* =========================================================
  MENU PRINCIPAL CENTRALIZADO
========================================================= */

.header-container {
  position: relative;
  justify-content: center;
}

.site-nav {
  margin: 0 auto;
}

/* =========================================================
  HERO AJUSTADA À ALTURA DA TELA
========================================================= */

.hero {
  min-height: calc(100svh - 82px);
  padding: clamp(32px, 4.5vh, 56px) 0;
}

.hero-grid {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  gap: clamp(30px, 4vw, 52px);
}

.hero-logo {
  display: block;
  width: 300px;
  max-width: 100%;
  height: auto;
  margin-top: 8px;
  filter: drop-shadow(0 0 24px rgba(24, 77, 205, 0.42));
}

.hero-content p {
  margin-top: 12px;
}

.hero-panel {
  padding: 22px;
}

/* Duas badges em cada linha */
.hero-badges {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.hero-badges span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 10px;
  text-align: center;
  line-height: 1.25;
}

.hero-mini-grid div {
  min-height: 100px;
  padding: 16px;
}

/* =========================================================
  SERVIÇOS PRINCIPAIS
========================================================= */

.services-section .cards-grid-4 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* =========================================================
  ESPAÇAMENTO DOS BOTÕES DE UPGRADES E ALUGUEL
========================================================= */

.split-content > .btn {
  margin-top: 34px;
}

.rental-section .section-heading > .btn {
  margin-top: 34px;
}

/* =========================================================
  CARROSSEL DE REPAROS
========================================================= */

.repair-carousel {
  padding: 8px 4px 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior-inline: contain;
}

.repair-carousel::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.carousel-btn {
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.carousel-btn:hover {
  background: rgba(24, 77, 205, 0.92);
  border-color: rgba(237, 235, 242, 0.42);
}

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

/* =========================================================
  DIFERENCIAIS - QUATRO CARDS
========================================================= */

.differentials-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* =========================================================
  CAPA DO VÍDEO NA SEÇÃO SOBRE NÓS
========================================================= */

.video-cover {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(237, 235, 242, 0.15);
  border-radius: 24px;
  color: #fff;
  background: #000;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  appearance: none;
}

.video-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(24, 77, 205, 0.14);
  pointer-events: none;
}

.video-cover img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.video-cover-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  background:
    linear-gradient(
      180deg,
      rgba(3, 2, 5, 0.08),
      rgba(3, 2, 5, 0.72)
    );
  transition: background 0.3s ease;
}

.video-cover-play {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  background:
    linear-gradient(
      135deg,
      var(--color-primary-blue),
      var(--color-electric-blue)
    );
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.38),
    var(--shadow-blue);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.video-cover-play svg {
  width: 32px;
  height: 32px;
  margin-left: 4px;
  fill: currentColor;
}

.video-cover-label {
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.75);
}

.video-cover:hover img {
  transform: scale(1.035);
}

.video-cover:hover .video-cover-overlay {
  background:
    linear-gradient(
      180deg,
      rgba(3, 2, 5, 0.02),
      rgba(3, 2, 5, 0.62)
    );
}

.video-cover:hover .video-cover-play {
  transform: scale(1.08);
  box-shadow:
    0 22px 46px rgba(0, 0, 0, 0.44),
    0 0 34px rgba(24, 77, 205, 0.5);
}

.video-cover:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.9);
  outline-offset: 4px;
}

/* =========================================================
  POPUP DO VÍDEO
========================================================= */

.video-modal {
  position: fixed;
  inset: 0;

  /*
    Mantém o popup acima do menu, do botão do WhatsApp
    e de qualquer outro elemento do site.
  */
  z-index: 2147483646;

  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(58px, 7vw, 82px) 18px 18px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.video-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(1, 1, 4, 0.93);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.video-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: calc(100svh - 76px);
  transform: translateY(18px) scale(0.97);
  transition: transform 0.28s ease;
}

.video-modal.is-open .video-modal-dialog {
  transform: translateY(0) scale(1);
}

.video-modal-player {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: #000;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
}

.video-modal-player video {
  display: block;
  width: 100%;
  max-height: calc(100svh - 82px);
  aspect-ratio: 560 / 848;
  object-fit: contain;
  background: #000;
}

/*
  BOTÃO DE FECHAR CORRIGIDO

  Agora ele fica preso ao canto superior direito da tela,
  e não acima do vídeo. Dessa forma, nunca ficará atrás
  do menu principal.
*/
.video-modal-close {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));

  /*
    Valor máximo para manter o botão acima de tudo.
  */
  z-index: 2147483647;

  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  color: #fff;
  background: rgba(8, 8, 16, 0.96);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.55),
    0 0 18px rgba(210, 13, 22, 0.24);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.video-modal-close svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
  pointer-events: none;
}

.video-modal-close:hover {
  transform: rotate(90deg) scale(1.06);
  border-color: rgba(255, 255, 255, 0.8);
  background: #d20d16;
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.6),
    0 0 24px rgba(210, 13, 22, 0.48);
}

.video-modal-close:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.95);
  outline-offset: 4px;
}

/*
  Durante a reprodução, o cabeçalho não recebe cliques.
  O popup permanece totalmente prioritário.
*/
body.video-modal-open .site-header {
  pointer-events: none;
}

body.video-modal-open {
  overflow: hidden;
}

/* =========================================================
  WHATSAPP FLUTUANTE COM ÍCONE
========================================================= */

.floating-whatsapp {
  gap: 10px;
}

.floating-whatsapp svg {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  fill: currentColor;
}

/* =========================================================
  BOTÃO VOLTAR AO TOPO NO FOOTER
========================================================= */

.back-to-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid rgba(24, 77, 205, 0.58);
  border-radius: var(--radius-md);
  color: #fff !important;
  background: rgba(19, 20, 45, 0.72);
  box-shadow: inset 0 0 18px rgba(24, 77, 205, 0.16);
  font-size: 0.84rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.back-to-top svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.back-to-top:hover {
  transform: translateY(-2px);
  border-color: rgba(24, 77, 205, 0.92);
  background: rgba(24, 77, 205, 0.22);
}

/* =========================================================
  RESPONSIVIDADE
========================================================= */

@media (max-width: 1100px) {
  .services-section .cards-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    min-height: auto;
    padding: 76px 0;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    width: 100%;
    max-width: 620px;
  }

  .differentials-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  .services-section .cards-grid-4 {
    grid-template-columns: 1fr;
  }

  .header-container {
    justify-content: flex-end;
  }

  .menu-toggle {
    position: relative;
    z-index: 2;
    margin-left: 0;
  }

  .site-nav {
    margin: 0;
  }

  .hero {
    padding: 72px 0 64px;
  }

  .hero-logo {
    width: 260px;
    margin-right: auto;
    margin-left: auto;
  }

  .hero-content {
    text-align: center;
  }

  .hero-content p {
    margin-right: auto;
    margin-left: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-panel {
    margin: 0 auto;
  }

  .differentials-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom-inner {
    align-items: flex-start;
  }
}

@media (max-width: 540px) {
  .hero-badges {
    grid-template-columns: 1fr 1fr;
  }

  .hero-badges span {
    min-height: 48px;
    font-size: 0.78rem;
  }

  .video-modal {
    padding: 72px 12px 12px;
  }

  /*
    No celular, o botão permanece dentro da área segura
    do aparelho e acima do vídeo.
  */
  .video-modal-close {
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    width: 46px;
    height: 46px;
  }

  .floating-whatsapp {
    width: 52px;
    height: 52px;
    min-height: 52px;
    padding: 0;
  }

  .floating-whatsapp span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}