/**
 * Menu Hamburger Mobile - VERSÃO FINAL CORRIGIDA
 * Bruno Calado Photography
 */

/* ============================================
   BOTÃO HAMBURGER
   ============================================ */

.nav-toggle {
  display: none;
}

@media screen and (max-width: 980px) {
  
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0.75em;
    right: 0.75em;
    z-index: 99999 !important;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    width: 2.75em;
    height: 2.75em;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }

  .nav-toggle:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(0, 0, 0, 0.2);
  }
  
  .nav-toggle:active {
    transform: scale(0.95);
  }
  
  .nav-toggle:focus {
    outline: 2px solid rgba(51, 51, 51, 0.3);
    outline-offset: 2px;
  }
  
  /* Container do hamburger */
  .hamburger-box {
    width: 18px;
    height: 14px;
    display: inline-block;
    position: relative;
    pointer-events: none;
  }
  
  /* Linhas do hamburger */
  .hamburger-inner,
  .hamburger-inner::before,
  .hamburger-inner::after {
    width: 18px;
    height: 2px;
    background-color: #333;
    border-radius: 1px;
    position: absolute;
    transition: transform 0.25s ease, opacity 0.25s ease;
    pointer-events: none;
  }
  
  .hamburger-inner {
    display: block;
    top: 50%;
    margin-top: -1px;
  }
  
  .hamburger-inner::before,
  .hamburger-inner::after {
    content: "";
    display: block;
  }
  
  .hamburger-inner::before {
    top: -6px;
  }
  
  .hamburger-inner::after {
    top: 6px;
  }
  
  /* Animação X quando aberto */
  .nav-toggle.active .hamburger-inner {
    transform: rotate(45deg);
  }
  
  .nav-toggle.active .hamburger-inner::before {
    top: 0;
    opacity: 0;
  }
  
  .nav-toggle.active .hamburger-inner::after {
    top: 0;
    transform: rotate(-90deg);
  }
  
  /* ============================================
     HEADER MOBILE - AUMENTADO
     ============================================ */
  
  #header {
    height: 4em !important;
    line-height: 4em !important;
  }
  
  body {
    padding-top: 4em !important;
  }
  
}

/* ============================================
   MENU MOBILE
   ============================================ */

@media screen and (max-width: 980px) {
  
  /* Forçar navegação visível */
  #header nav {
    display: block !important;
    position: fixed;
    top: 0;
    right: -100%;
    width: 260px;
    max-width: 80vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 10000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    padding-top: 4.5em;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
    line-height: normal;
  }
  
  /* Menu aberto */
  #header nav.active {
    right: 0;
  }
  
  /* Lista */
  #header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  
  #header nav ul li {
    display: block;
    margin: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }
  
  #header nav ul li:last-child {
    border-bottom: none;
  }
  
  /* Links */
  #header nav ul li a {
    display: block;
    padding: 1em 1.5em !important;
    color: #333;
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.2s ease;
    position: relative;
    height: auto !important;
    line-height: 1.4 !important;
    border-left: 3px solid transparent;
  }
  
  #header nav ul li a:hover,
  #header nav ul li a:focus {
    background: rgba(0, 0, 0, 0.05);
    color: #000;
    border-left-color: #333;
  }
  
  /* Overlay */
  body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
  }
  
  body.menu-open::after {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
  }
  
  body.menu-open {
    overflow: hidden;
  }
  
  /* Logo - SEMPRE dentro da barra */
  #header .logo {
    position: absolute !important;
    left: 1em !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10001 !important;
    max-width: 160px !important;
    height: auto !important;
    line-height: 1 !important;
  }
  
  #header .logo a {
    display: block !important;
    line-height: 1 !important;
    height: auto !important;
  }
  
  #header .logo img {
    max-height: 3em !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
  }
  
}

/* ============================================
   MOBILE MUITO PEQUENO (≤480px)
   ============================================ */

@media screen and (max-width: 480px) {
  
  #header {
    height: 3.5em !important;
    line-height: 3.5em !important;
  }
  
  body {
    padding-top: 3.5em !important;
  }
  
  .nav-toggle {
    width: 2.5em;
    height: 2.5em;
    top: 0.5em;
    right: 0.5em;
    z-index: 99999 !important;
  }
  
  #header nav {
    width: 100%;
    max-width: 100%;
    padding-top: 4em;
  }
  
  #header nav ul li a {
    font-size: 0.8em;
    padding: 0.9em 1.25em !important;
  }
  
  #header .logo {
    max-width: 120px !important;
    left: 0.75em !important;
  }
  
  #header .logo img {
    max-height: 2.5em !important;
  }
  
}

/* ============================================
   MOBILE PEQUENO (481px - 736px)
   ============================================ */

@media screen and (min-width: 481px) and (max-width: 736px) {
  
  #header {
    height: 3.75em !important;
    line-height: 3.75em !important;
  }
  
  body {
    padding-top: 3.75em !important;
  }
  
  #header .logo {
    max-width: 140px !important;
    left: 0.75em !important;
  }
  
  #header .logo img {
    max-height: 2.75em !important;
  }
  
}

/* ============================================
   TABLET (737px - 980px)
   ============================================ */

@media screen and (min-width: 737px) and (max-width: 980px) {
  
  .nav-toggle {
    top: 0.85em;
    right: 0.85em;
    z-index: 99999 !important;
  }
  
  #header .logo {
    max-width: 160px !important;
  }
  
  #header .logo img {
    max-height: 3em !important;
  }
  
}

/* ============================================
   DESKTOP (>980px)
   ============================================ */

@media screen and (min-width: 981px) {
  
  .nav-toggle {
    display: none !important;
  }
  
  /* Header desktop - AUMENTADO */
  #header {
    height: 4em !important;
    line-height: 4em !important;
  }
  
  body {
    padding-top: 4em !important;
  }
  
  #header nav {
    display: block !important;
    position: absolute !important;
    right: 0.75em !important;
    top: 0 !important;
    width: auto !important;
    height: 4em !important;
    line-height: 4em !important;
    background: transparent !important;
    padding-top: 0 !important;
    box-shadow: none !important;
  }
  
  #header nav ul li {
    display: inline-block !important;
    border-bottom: none !important;
  }
  
  #header nav ul li a {
    padding: 0 0.6em !important;
    height: 4em !important;
    line-height: 4em !important;
    border-left: none !important;
  }
  
  /* Logo desktop - AUMENTADO */
  #header .logo {
    position: absolute !important;
    left: 1.25em !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    height: auto !important;
    line-height: 1 !important;
    z-index: auto !important;
    max-width: 220px !important;
  }
  
  #header .logo img {
    max-height: 3.25em !important;
    height: auto !important;
  }
  
}

/* ============================================
   ANIMAÇÕES SUAVES
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
