* {
  box-sizing: border-box;
}
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* evita rolagem horizontal */
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  color: white;
  min-height: 100vh;
}

/* BANNERS LATERAIS RESPONSIVOS */
.banner-lateral {
  position: fixed;
  top: 56px; /* abaixo do header fixo */
  width: 12vw;           /* largura proporcional à viewport */
  max-width: 250px;
  min-width: 180px;
  height: calc(70vh - 56px); /* 70% da altura da viewport menos header */
  max-height: 500px;
  min-height: 300px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 195, 255, 0.5);
  overflow: hidden;
  z-index: 999;
  transition: top 0.3s ease, height 0.3s ease, width 0.3s ease;
}
.banner-esquerdo {
  left: 10px;
}
.banner-direito {
  right: 10px;
}
.banner-lateral img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

/* CONTEÚDO PRINCIPAL */

/* HEADER FIXO E COMPACTO */
header {
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  padding: 0 20px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  position: fixed;
  top: 0;
  width: 100%;
  height: 56px;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  flex-wrap: nowrap;
  gap: 10px;
  box-sizing: border-box;
}

header .logo-container {
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
  line-height: 56px;
  font-size: 1.5rem;
}
header .logo-container h1 {
  font-size: inherit;
  font-weight: bold;
  color: #00e5ff;
  margin: 0;
}
header .logo-container span {
  color: #00bcd4;
}

form#search-form {
  margin-left: 20px;
  max-width: 280px;
  position: relative;
  display: flex;
  box-shadow: 0 0 8px rgba(0, 195, 255, 0.25);
  border-radius: 12px;
  background: #0a2636;
  transition: box-shadow 0.3s ease;
  height: 36px;
  align-items: center;
  flex-shrink: 1; /* para encolher no mobile */
  min-width: 0; /* evita overflow */
}
form#search-form:focus-within {
  box-shadow: 0 0 12px #00e0ff;
}
form#search-form input[type="search"] {
  width: 100%;
  padding: 6px 12px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  color: #00eaff;
  background: transparent;
  outline: none;
  font-weight: 600;
  caret-color: #00eaff;
  min-width: 0; /* evita overflow */
}
form#search-form input[type="search"]::placeholder {
  color: #4fd8ffcc;
  font-weight: 400;
  font-style: italic;
}
form#search-form button {
  display: none;
}

#menu-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  display: none;
  flex-shrink: 0;
  margin-left: auto;
  line-height: 56px;
}

nav#main-nav {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-left: auto;
  flex-wrap: nowrap;
  white-space: nowrap;
  min-width: 0; /* evita overflow */
}
nav#main-nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
nav#main-nav a:hover {
  text-decoration: underline;
}

h2 {
  margin-bottom: 20px;
  color: #00ffff;
  font-weight: 600;
}

.banner-rotacional {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  margin-bottom: 30px;
  height: 200px;
  background: #122a3a;
}
.banner-rotacional img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 1s ease-in-out;
}
.banner-rotacional img.active {
  opacity: 1;
  position: relative;
}

.vitrine {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
  justify-items: center;
  overflow-x: hidden; /* evitar overflow */
}
@media (min-width: 901px) {
  .vitrine {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 900px) {
  .vitrine {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 600px) {
  .vitrine {
    grid-template-columns: repeat(2, 1fr);
  }
}

.produto {
  background: rgba(0, 195, 255, 0.08);
  border-radius: 10px;
  padding: 10px;
  color: white;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 0 12px rgba(0, 195, 255, 0.2);
  overflow: hidden;
  position: relative;
  z-index: 0;
  max-width: 100%; /* para evitar overflow */
  box-sizing: border-box;
}
.produto:hover {
  transform: scale(1.03);
  box-shadow: 0 0 18px rgba(0, 195, 255, 0.6);
  z-index: 1;
}
.produto img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 10px;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
  transition: transform 0.3s ease;
}
.produto:hover img {
  transform: scale(1.05);
}
.produto strong {
  font-size: 14px;
  color: #00eaff;
  margin-bottom: 4px;
}

.btn-produto {
  display: inline-block;
  margin-top: 4px;
  background-color: #00c3ff;
  color: #000;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: bold;
  text-decoration: none;
  transition: background 0.3s, transform 0.2s;
  max-width: 100%; /* evitar overflow */
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-produto:hover {
  background-color: #00e0ff;
  transform: scale(1.08);
}

footer {
  background-color: #0f1f2e;
  text-align: center;
  padding: 20px;
  font-size: 14px;
  color: #ccc;
  width: 100%;
  margin-top: 40px;
  overflow-x: hidden;
}
footer a {
  color: #00ffff;
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}

/* RESPONSIVIDADE */
@media (max-width: 1024px) {
  .banner-lateral {
    width: 120px;
    height: calc(50vh - 56px);
    max-height: 350px;
    min-height: 250px;
  }
  main.container {
    margin: 100px 140px 120px 140px;
  }
}

@media (max-width: 768px) {
  .banner-lateral {
    display: none; /* remove banners laterais no mobile para evitar overflow */
  }
  main.container {
    margin: 100px 20px 120px 20px; /* margem lateral reduzida no mobile */
  }
  #menu-toggle {
    display: block;
  }
  nav#main-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 56px;
    right: 20px;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.6);
    z-index: 1100;
    width: 90%;
    max-width: 320px;
  }
  nav#main-nav.show {
    display: flex;
  }
  nav#main-nav a, nav#main-nav form {
    margin: 10px 0;
    white-space: normal;
  }
  form#search-form {
    max-width: 100%;
    order: 1;
  }
  .logo-container {
    order: 0;
    flex-grow: 0;
  }
}

/* Ajustes para telas muito grandes */
@media (min-width: 1920px) {
  header {
    height: 72px;
  }
  form#search-form {
    height: 44px;
  }
  header .logo-container {
    line-height: 72px;
    font-size: 2rem;
  }
  main.container {
    max-width: 1400px;
    margin: 100px calc(12vw + 40px) 120px calc(12vw + 40px);
  }
}
