/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background-color: hsl(var(--background) / 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid hsl(var(--border));
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 5rem;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-image {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
}

.logo-text {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: hsl(var(--primary));
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  font-size: var(--font-size-base);
  font-weight: 500;
  color: hsl(var(--foreground));
  transition: var(--transition-base);
}

.nav-link:hover {
  color: hsl(var(--primary));
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
}

.menu-icon {
  position: relative;
  width: 1.5rem;
  height: 2px;
  background-color: hsl(var(--foreground));
  transition: var(--transition-base);
}

.menu-icon::before,
.menu-icon::after {
  content: '';
  position: absolute;
  width: 1.5rem;
  height: 2px;
  background-color: hsl(var(--foreground));
  transition: var(--transition-base);
}

.menu-icon::before {
  top: -0.5rem;
}

.menu-icon::after {
  bottom: -0.5rem;
}

.menu-toggle.active .menu-icon {
  background-color: transparent;
}

.menu-toggle.active .menu-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.menu-toggle.active .menu-icon::after {
  bottom: 0;
  transform: rotate(-45deg);
}

.nav-mobile {
  display: none;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  background-color: hsl(var(--background));
  border-bottom: 1px solid hsl(var(--border));
}

.nav-mobile.active {
  display: flex;
  animation: slideInRight 0.3s ease-out;
}

.nav-link-mobile {
  padding: 0.75rem 1rem;
  font-size: var(--font-size-base);
  font-weight: 500;
  color: hsl(var(--foreground));
  border-radius: var(--radius);
  transition: var(--transition-base);
}

.nav-link-mobile:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--primary));
}

.btn-mobile {
  margin-top: 0.5rem;
}

@media (min-width: 1024px) {
  .nav-desktop {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }

  .nav-mobile {
    display: none !important;
  }
}

/* Hero Section */
.hero {
  position: relative;
  min-height: calc(100vh - 5rem);
  display: flex;
  align-items: center;
  background: linear-gradient(to bottom, hsl(var(--background)), hsl(var(--accent) / 0.3));
  padding: 3rem 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  border-radius: 9999px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin: 0 auto;
}

.hero-badge-icon {
  width: 1rem;
  height: 1rem;
}

.hero-title {
  font-size: var(--font-size-4xl);
  font-weight: 700;
  line-height: 1.1;
  color: hsl(var(--foreground));
}

.hero-description {
  font-size: var(--font-size-lg);
  color: hsl(var(--muted-foreground));
  max-width: 42rem;
  margin: 0 auto;
}

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 1rem;
  margin-top: 2rem; /* ADICIONADO: Empurra os botões para baixo da grelha */
  align-items: center; /* ADICIONADO: Centraliza os botões no mobile/tablet */
}

.hero-image-wrapper {
  position: relative;
  animation: fadeIn 0.3s ease-out;
}

.hero-image {
  width: 100%;
  height: auto;
  border-radius: 1rem;
  box-shadow: var(--shadow-xl);
  object-fit: cover;
}

.hero-glow {
  position: absolute;
  border-radius: 9999px;
  filter: blur(3rem);
  pointer-events: none;
}

.hero-glow-top {
  top: -1rem;
  right: -1rem;
  width: 6rem;
  height: 6rem;
  background-color: hsl(var(--primary) / 0.2);
}

.hero-glow-bottom {
  bottom: -1rem;
  left: -1rem;
  width: 8rem;
  height: 8rem;
  background-color: hsl(var(--secondary) / 0.2);
}

@media (min-width: 640px) {
  .hero-title {
    font-size: var(--font-size-5xl);
  }

  .hero-buttons {
    justify-content: center;
  }
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
  }

  .hero-content {
    text-align: left;
  }

  .hero-badge {
    margin: 0;
  }

  .hero-description {
    margin: 0;
  }

  .hero-buttons {
    flex-direction: row; /* ADICIONADO: Lado a lado SÓ no desktop */
    justify-content: center; /* MUDADO: Centraliza os botões no desktop */
  }

  .hero-title {
    font-size: var(--font-size-6xl);
  }
}

/* Sections */
.products-section,
.builder-section,
.about-section {
  padding: 4rem 0;
}

@media (min-width: 1024px) {
  .products-section,
  .builder-section,
  .about-section {
    padding: 6rem 0;
  }
}

.section-header {
  text-align: center;
  max-width: 48rem;
  margin: 0 auto 3rem;
  animation: fadeIn 0.3s ease-out;
}

.section-title {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 1rem;
}

.section-description {
  font-size: var(--font-size-lg);
  color: hsl(var(--muted-foreground));
}

@media (min-width: 640px) {
  .section-title {
    font-size: var(--font-size-4xl);
  }
}

@media (min-width: 1024px) {
  .section-title {
    font-size: var(--font-size-5xl);
  }
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  animation: fadeIn 0.3s ease-out;
}

@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Builder Section */
.builder-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.builder-main {
  animation: fadeIn 0.3s ease-out;
  order: 2;
}

.tab-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.builder-sidebar {
  animation: fadeIn 0.3s ease-out 0.1s;
  animation-fill-mode: both;
  order: 1;
}

.cart-card {
  /*position: sticky;
  top: 6rem;*/
  background-color: hsl(var(--card));
  border-radius: calc(var(--radius) * 2);
  padding: 1.5rem;
  box-shadow: var(--shadow-xl);
}

.cart-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 1rem;
}

.cart-items {
  max-height: 20rem;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.cart-empty {
  font-size: var(--font-size-sm);
  color: hsl(var(--muted-foreground));
  text-align: center;
  padding: 2rem 0;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-top: 2px solid hsl(var(--border));
  border-bottom: 2px solid hsl(var(--border));
  margin-bottom: 1rem;
}

.cart-total-label {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: hsl(var(--foreground));
}

.cart-total-value {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: hsl(var(--primary));
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .tab-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .builder-layout {
    grid-template-columns: 2fr 1fr;
  }
  .builder-main {
    order: 0; /* Reseta a ordem para o padrão */
  }

  .builder-sidebar {
    order: 0; /* Reseta a ordem para o padrão */
  }

  .cart-card {
    position: sticky; /* Devolve o sticky SÓ no desktop */
    top: 6rem; /* Devolve o top SÓ no desktop */
  }
}

/* About Section */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

.about-image-wrapper {
  position: relative;
  animation: fadeIn 0.3s ease-out;
}

.about-image {
  width: 100%;
  height: auto;
  border-radius: 1rem;
  box-shadow: var(--shadow-xl);
  object-fit: cover;
}

.about-glow {
  position: absolute;
  bottom: -1.5rem;
  right: -1.5rem;
  width: 8rem;
  height: 8rem;
  background-color: hsl(var(--primary) / 0.2);
  border-radius: 9999px;
  filter: blur(3rem);
}

.about-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.3s ease-out;
}

.about-text {
  font-size: var(--font-size-lg);
  color: hsl(var(--muted-foreground));
  line-height: 1.75;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding-top: 1.5rem;
}

@media (min-width: 640px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .about-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Footer */
.footer {
  background-color: hsl(var(--muted));
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.footer-logo-image {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
}

.footer-logo-text {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: hsl(var(--primary));
}

.footer-tagline {
  font-size: var(--font-size-sm);
  color: hsl(var(--muted-foreground));
  max-width: 20rem;
}

.footer-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
}

.footer-links,
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a,
.footer-contact li {
  font-size: var(--font-size-sm);
  color: hsl(var(--muted-foreground));
  transition: var(--transition-base);
}

.footer-links a:hover {
  color: hsl(var(--primary));
}

.footer-social {
  display: flex;
  gap: 1rem;
}

.social-link {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  transition: var(--transition-base);
}

.social-link:hover {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  transform: scale(1.1);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid hsl(var(--border));
  font-size: var(--font-size-sm);
  color: hsl(var(--muted-foreground));
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Dropdown Menu (Desktop) */
.nav-item-dropdown {
  /* Isso permite que o submenu fique posicionado em relação a este item */
  position: relative;
}

.nav-item-dropdown .nav-link {
  /* Alinha o link e a seta */
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.dropdown-icon {
  width: 1rem;
  height: 1rem;
  transition: var(--transition-base);
}

/* Gira a seta quando o menu está aberto (hover) */
.nav-item-dropdown:hover .dropdown-icon {
  transform: rotate(180deg);
}

.dropdown-menu {
  /* 1. Esconde o menu por padrão */
  display: none; 
  
  /* 2. Posiciona o menu abaixo do link "Cestas Prontas" */
  position: absolute;
  top: 100%;
  left: 0;
  
  /* 3. Estilização */
  min-width: 250px; /* Largura para caber os textos */
  padding: 0.75rem;
  padding-top: 1.25rem; /* (0.75rem original + 0.5rem da antiga margem) */
  margin-top: 0;      /* Removemos a margem que criava o "abismo" */
  background-color: hsl(var(--card));
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  border: 1px solid hsl(var(--border));
  z-index: var(--z-dropdown); /* Garante que o menu fique sobre outros elementos */
}

/* 4. Mostra o menu quando o usuário passa o mouse sobre .nav-item-dropdown */
.nav-item-dropdown:hover .dropdown-menu {
  display: block;
  animation: fadeIn 0.2s ease-out; /* Animação de fade-in */
}

.dropdown-link {
  display: block;
  padding: 0.75rem 1rem;
  font-size: var(--font-size-sm);
  color: hsl(var(--foreground));
  border-radius: var(--radius);
  transition: var(--transition-base);
  white-space: nowrap; /* Impede que o texto quebre a linha */
}

.dropdown-link:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--primary));
}