/* Variáveis e cores */
:root {
  --dropdown-nudge-x: 0px;
  --brown: #412d1e;
  --orange: #ee8900;
  --yellow: #f9c623;
  --divider: #efeae4;
  --beige: #f5f3f0;
}

/* Reset básico */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

body {
  overflow-x: hidden;
}

/* Otimizar elementos pesados */
.cart-container {
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.overlay {
  will-change: opacity;
}

.logo-header h1 {
  margin: 0;
}

/* Menu mobile - ABRE DA DIREITA */
.mobile-menu {
  position: fixed !important;
  top: 0 !important;
  right: -100% !important; /* Mudou de left para right */
  width: 280px !important;
  height: 100vh !important;
  background: #fff !important;
  z-index: 55 !important;
  transition: right 0.3s ease !important; /* Mudou de left para right */
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1) !important; /* Shadow à esquerda */
  overflow-y: auto !important;
  padding-top: 80px !important;
}

.mobile-menu.active {
  right: 0 !important; /* Mudou de left para right */
}

/* Container do header */
.nav-container {
  position: relative;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 20px;
  width: 90%;
  overflow: visible;
  z-index: 40;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 40px;
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
}

.dropdown-container {
  position: static;
}

.nav-link {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  font-size: 16px;
  color: var(--brown);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.3s ease;
  padding: 10px 0;
  display: block;
  white-space: nowrap;
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 3px;
  bottom: 0;
  left: 0;
  background: linear-gradient(90deg, var(--brown), var(--orange));
  transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link:hover {
  color: var(--brown);
}

/* Dropdown */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: calc(50% + var(--dropdown-nudge-x));
  transform: translateX(-50%);
  width: 1115px;
  height: auto;
  background: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border-radius: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  z-index: 3000;
  max-width: calc(100vw - 32px);
  overflow: hidden;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-content {
  display: flex;
  width: 100%;
  height: auto;
  position: relative;
}

/* COLUNA ESQUERDA - Categorias */
.categories-column {
  width: 300px;
  padding: 40px 0 40px 20px;
  border-right: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.categories-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
}

.category-item a {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  font-size: 16px;
  line-height: 24px;
  text-transform: uppercase;
  color: var(--brown);
  font-weight: 400;
  cursor: pointer;
  transition: color 0.15s ease, font-weight 0.15s ease;
  white-space: nowrap;
  padding: 8px 0;
  position: relative;
  text-decoration: none;
}

.category-item a:hover {
  color: var(--orange);
}

.category-item a.active {
  font-weight: 700;
  color: var(--brown);
}

.category-item a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  height: 2px;
  width: 80px;
  background: var(--orange);
  border-radius: 2px;
  transform: translateX(-50%);
}

/* Rodapé da coluna esquerda */
.dropdown-footer {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  justify-content: center;
}

.view-all-btn {
  width: 206px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--brown);
  border: 1px solid var(--brown);
  border-radius: 32px;
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 21px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.view-all-btn:hover {
  background: var(--brown);
  color: #fff;
}

/* COLUNA DIREITA - Detalhes do Produto */
.product-details-column {
  flex: 1;
  display: flex;
  padding: 40px;
  gap: 40px;
  align-items: flex-start;
}

/* Imagem do produto */
.dropdown-menu .product-image {
  width: 328px;
  height: 467px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.dropdown-menu .product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Informações do produto */
.product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 20px;
}

.product-info .product-title {
  font-family: "MontecatiniPro-Ampio", sans-serif;
  font-weight: 400;
  font-size: 32px;
  line-height: 38px;
  text-transform: uppercase;
  color: var(--orange);
  margin: 0;
}

.product-description {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 160%;
  color: #7d7d7d;
  margin: 0;
}

.product-price {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 30px;
  color: var(--brown);
}

.baiani-add-to-cart-btn {
  width: 175px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--yellow);
  color: var(--brown) !important;
  border: 0;
  border-radius: 32px;
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  font-weight: 700;
  font-size: 12px;
  line-height: 18px;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
  text-decoration: none;
}

.baiani-add-to-cart-btn:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
}

/* Responsivo */
@media (max-width: 1200px) {
  .dropdown-menu {
    width: min(1115px, 95vw);
  }
}

@media (max-width: 768px) {
  .dropdown-menu {
    left: 50%;
    transform: translateX(-50%);
    width: 95vw;
    height: auto;
    min-height: 480px;
  }

  .dropdown-content {
    flex-direction: column;
  }

  .categories-column {
    width: 100%;
    padding: 20px;
    border-right: none;
    border-bottom: 1px solid var(--divider);
  }

  .categories-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .product-details-column {
    flex-direction: column;
    padding: 20px;
    gap: 20px;
  }

  .product-image {
    width: 100%;
    height: 260px;
  }

  .product-info .product-title {
    font-size: 24px;
    line-height: 30px;
  }

  .view-all-btn {
    width: 100%;
  }
}

.cart-container {
  background: white;
  padding: 30px;
  position: fixed;
  top: 0;
  right: 0;
  transform: translateX(100%);
  bottom: 0;
  z-index: 50;
  max-width: 400px;
  width: 100%;
  transition: transform 300ms ease-in-out;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
}

@media (max-width: 425px) {
  .cart-container {
    max-width: 100%;
    left: 0;
  }
}

.cart-container.show-cart {
  transform: translateX(0);
}

.cart-container.hide-cart {
  transform: translateX(100%);
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid #3c3c3c;
  padding-bottom: 15px;
}

.cart-title h3 {
  margin: 0;
  font-size: 1.5rem;
  color: #333;
}

.close-cart {
  cursor: pointer;
  background: none;
  border: none;
  font-size: 24px;
  color: #666;
  padding: 5px;
  line-height: 1;
}

.close-cart:hover {
  color: #333;
}

.cart-items {
  margin-bottom: 100px; /* Espaço para o footer */
}

.cart-item {
  display: flex;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #eee;
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  margin-right: 15px;
}

.item-details {
  flex: 1;
}

.item-name {
  font-weight: bold;
  margin-bottom: 5px;
}

.item-price {
  color: #666;
  font-size: 0.9rem;
}

.bottom-container {
  background: white;
  width: calc(100% - 60px);
  padding: 20px 30px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-top: 1px solid #eee;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  font-size: 1.2rem;
  font-weight: bold;
}

.btn.checkout {
  background: #a06019;
  display: block;
  text-align: center;
  color: white;
  padding: 15px 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.btn.checkout:hover {
  background: #a96f2e;
  text-decoration: none;
}

.overlay {
  background: rgba(30, 30, 30, 0.8);
  display: none;
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  transition: opacity 300ms ease-in-out;
}

.empty-cart {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

/* Navegação exemplo */
.nav-link {
  color: #333;
  text-decoration: none;
  padding: 10px 15px;
  display: inline-block;
}

/* MENU HAMBÚRGUER E MOBILE */

/* Botão do menu hambúrguer - APENAS MOBILE */
.mobile-menu-toggle {
  display: none; /* Oculto por padrão no desktop */
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
  position: relative;
  z-index: 60;
  order: 1; /* Coloca o botão hambúrguer à direita */
  margin-left: auto; /* Empurra para a direita */
}

.hamburger-line {
  width: 100%;
  height: 2px;
  background-color: var(--brown);
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Animação do botão hambúrguer quando ativo */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* (Removida duplicação do .mobile-menu que abria pela esquerda) */

/* Overlay do menu mobile */
.mobile-menu-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.5) !important;
  z-index: 50 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

.mobile-menu-overlay.active {
  opacity: 1 !important;
  visibility: visible !important;
}

.mobile-menu-header {
  position: absolute !important;
  top: 20px !important;
  right: 20px !important;
  z-index: 60 !important; /* Garantir que fique acima */
}

.mobile-menu-close {
  background: none !important;
  border: none !important;
  font-size: 24px !important;
  color: var(--brown) !important;
  cursor: pointer !important;
  padding: 5px !important;
  line-height: 1 !important;
  width: 34px !important;
  height: 34px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.mobile-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-menu-item {
  border-bottom: 1px solid var(--divider);
}

.mobile-menu-link-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-menu-link {
  display: block;
  padding: 16px 20px;
  color: var(--brown);
  text-decoration: none;
  font-family: "Poppins", sans-serif;
  font-size: 16px;
  font-weight: 400;
  transition: color 0.3s ease;
  flex: 1;
}

.mobile-menu-link:hover {
  color: var(--orange);
  text-decoration: none;
}

/* Carrinho mobile com ícone */
.mobile-cart-link {
  position: relative !important;
}

.mobile-cart-container {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  position: relative !important;
}

.mobile-cart-icon-wrap {
  position: relative !important;
  display: inline-flex !important;
  width: 20px !important;
  height: 20px !important;
}

.mobile-cart-icon {
  width: 20px !important;
  height: 20px !important;
  filter: brightness(0) saturate(100%) invert(28%) sepia(15%) saturate(1425%) hue-rotate(345deg) brightness(95%) contrast(86%) !important; /* Cor marrom */
}

.mobile-cart-text {
  flex: 1 !important;
}

.mobile-cart-count {
  background: var(--brown) !important;
  color: white !important;
  border-radius: 50% !important;
  font-size: 12px !important;
  height: 20px !important;
  width: 20px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  position: absolute !important;
  top: -10px !important;
  right: -10px !important;
  font-weight: bold !important;
}

.cart-mobile {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Submenu mobile - NOVA ABORDAGEM */
.mobile-submenu {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: var(--beige) !important;
  height: 0 !important;
  overflow: hidden !important;
  transition: all 0.4s ease !important;
  border-top: 0px solid rgba(0,0,0,0.1) !important;
  opacity: 0 !important;
}

.mobile-submenu.active {
  height: auto !important;
  min-height: 200px !important;
  padding: 10px 0 !important;
  border-top: 1px solid rgba(0,0,0,0.1) !important;
  opacity: 1 !important;
}

.submenu-toggle {
  background: none !important;
  border: none !important;
  color: var(--brown) !important;
  font-size: 18px !important;
  font-weight: bold !important;
  padding: 16px 20px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  min-width: 60px !important;
  line-height: 1 !important;
  user-select: none !important;
}

.submenu-toggle.active {
  transform: rotate(45deg) !important;
  color: var(--orange) !important;
}

.submenu-toggle:hover {
  color: var(--orange) !important;
}

.mobile-submenu-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-submenu-item:last-child {
  border-bottom: none;
}

.mobile-submenu-link {
  display: block;
  padding: 12px 40px;
  color: var(--brown);
  text-decoration: none;
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.mobile-submenu-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.mobile-submenu-item.view-all .mobile-submenu-link {
  font-weight: 600;
  color: var(--orange);
}

/* Responsividade - APENAS MOBILE */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex !important;
  }

  .nav-menu {
    display: none !important;
  }

  .nav-container {
    justify-content: space-between;
    padding: 15px 20px;
  }

  /* Ajustar logo no mobile */
  .logo-header h1 img {
    max-height: 40px;
    width: auto;
  }

  /* Ocultar o dropdown desktop em mobile */
  .dropdown-menu {
    display: none !important;
  }
  
  /* Ocultar comportamento hover no mobile */
  .nav-item:hover .dropdown-menu {
    opacity: 0 !important;
    visibility: hidden !important;
  }
}

/* Garantir que no desktop não apareça NUNCA */
@media (min-width: 769px) {
  .mobile-menu-toggle {
    display: none !important;
  }
  
  .mobile-menu {
    display: none !important;
  }
  
  .mobile-menu-overlay {
    display: none !important;
  }
}

.cart-icon { cursor: pointer; position: relative; }

.nav-link.cart-icon .cart-count {
  background: #412d1e;
  color: white;
  border-radius: 50%;
  font-size: 12px;
  position: absolute;
  top: -1px;
  right: 10px;
  text-align: center;
  height: 20px;
  width: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cart-count.updated {
  animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}
