/* ===== CARROSSEL TOTALMENTE CENTRALIZADO E RESPONSIVO ===== */

.carrossel {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: center;
  gap: 1rem;
  min-height: 60vh;
  background: #f7f7f8;
  overflow: hidden;
  padding: 2rem 0;
  position: relative;
}

.cartext {
  text-align: center;
  margin-bottom: 20px;
  color: #03346E;
  font-size: 2.5rem;
  font-weight: 700;
}

/* esconder inputs */
input[type="radio"][name="position"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* container principal */
main#carousel {
  width: min(1100px, 95vw);
  height: 500px;
  position: relative;
  margin: 0 auto;
  perspective: 900px;
  padding: 1rem 0;
  overflow: visible;
  --position: 1;
}

/* ITEM CENTRALIZADO CORRETAMENTE */
main#carousel .item {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(280px, 30vw, 340px);
  height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  box-sizing: border-box;
  transform: translate(-50%, -50%);
  transition: all 320ms cubic-bezier(.2,.9,.28,1);
  opacity: 1;
  pointer-events: auto;
  z-index: 10;
}

/* Posicionamento dos cards no carrossel 3D */
main#carousel .item[style*="--offset:1"] {
  transform: translate(-50%, -50%) translateX(calc(-120%)) scale(0.85);
  opacity: 0.7;
  z-index: 1;
}

main#carousel .item[style*="--offset:2"] {
  transform: translate(-50%, -50%) translateX(calc(-60%)) scale(0.9);
  opacity: 0.8;
  z-index: 2;
}

main#carousel .item[style*="--offset:3"] {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  z-index: 10;
}

main#carousel .item[style*="--offset:4"] {
  transform: translate(-50%, -50%) translateX(calc(60%)) scale(0.9);
  opacity: 0.8;
  z-index: 2;
}

main#carousel .item[style*="--offset:5"] {
  transform: translate(-50%, -50%) translateX(calc(120%)) scale(0.85);
  opacity: 0.7;
  z-index: 1;
}

/* destaque do item ativo */
main#carousel .item[aria-current="true"] {
  z-index: 20;
}

/* cartão visual */
.card {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg,#fff 0%,#fafafa 100%);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card .img {
  height: 200px;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
  padding: 10px;
}

.card .img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card .body {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
}

.card .body .img2 {
  max-width: 120px;
  height: 40px;
  object-fit: contain;
  margin-bottom: 10px;
  display: block;
}

.card h2 {
  margin: 10px 0;
  font-size: 1.25rem;
  color: #333;
  font-weight: 600;
}

.card p {
  margin: 0;
  font-size: 0.95rem;
  color: #666;
  line-height: 1.4;
  flex-grow: 1;
  display: flex;
  align-items: center;
}

/* botão */
.card .btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: #0b74ff;
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  margin-top: 15px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}

.card .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(11, 116, 255, 0.4);
}

/* pontos de paginação */
.controls {
  display: grid;
  grid-auto-flow: column;
  gap: 0.6rem;
  margin-top: 80px;
  margin-bottom: 20px;
}

.controls .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #d1d1d1;
  transition: all 0.3s ease;
  cursor: pointer;
}

.controls .dot.active {
  background: #0b74ff;
  transform: scale(1.2);
}

/* botões de navegação */
.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: rgba(11, 116, 255, 0.12);
  border-radius: 50%;
  cursor: pointer;
  z-index: 999;
  margin: 0 8px;
  border: none;
  transition: all 0.3s ease;
}

.nav:hover {
  background: rgba(11, 116, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.nav.prev { left: 0; }
.nav.next { right: 0; }

.nav svg {
  width: 24px;
  height: 24px;
  stroke: #0b74ff;
}

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

@media (max-width: 1024px) {
  main#carousel {
    height: 450px;
    width: min(900px, 95vw);
  }
  
  main#carousel .item {
    width: clamp(260px, 28vw, 320px);
    height: 420px;
  }
  
  /* Ajuste da separação para tablets */
  main#carousel .item[style*="--offset:1"] {
    transform: translate(-50%, -50%) translateX(calc(-100%)) scale(0.85);
  }

  main#carousel .item[style*="--offset:2"] {
    transform: translate(-50%, -50%) translateX(calc(-50%)) scale(0.9);
  }

  main#carousel .item[style*="--offset:4"] {
    transform: translate(-50%, -50%) translateX(calc(50%)) scale(0.9);
  }

  main#carousel .item[style*="--offset:5"] {
    transform: translate(-50%, -50%) translateX(calc(100%)) scale(0.85);
  }
  
  .cartext {
    font-size: 2.2rem;
  }
}

@media (max-width: 820px) {
  main#carousel {
    height: 420px;
  }
  
  main#carousel .item {
    height: 400px;
    width: clamp(240px, 35vw, 300px);
  }
  
  .nav {
    width: 42px;
    height: 42px;
    margin: 0 6px;
  }
  
  .nav svg {
    width: 20px;
    height: 20px;
  }
  
  .card .img {
    height: 180px;
  }
  
  .cartext {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .carrossel {
    min-height: 50vh;
    padding: 1.5rem 0;
  }
  
  .controls {
    margin-top: 60px;
  }
}

@media (max-width: 520px) {
  .carrossel {
    min-height: 500px;
    padding: 1rem 0;
    overflow: hidden;
  }
  
  main#carousel {
    height: 400px;
    max-height: none;
    width: 100vw;
    perspective: 600px;
  }
  
  main#carousel .item {
    width: 280px;
    height: 380px;
    display: none;
    opacity: 0;
    pointer-events: none;
  }
  
  main#carousel .item[aria-current="true"] {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
    z-index: 20;
  }
  
  /* Esconder outros cards no mobile */
  main#carousel .item:not([aria-current="true"]) {
    display: none;
  }
  
  .card {
    width: 100%;
    height: 100%;
    max-width: none;
  }
  
  .card .img {
    height: 160px;
    padding: 8px;
  }
  
  .card .body {
    padding: 15px;
  }
  
  .card h2 {
    font-size: 1.2rem;
    margin: 8px 0;
  }
  
  .card p {
    font-size: 0.9rem;
  }
  
  .card .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
  }
  
  .nav {
    width: 40px;
    height: 40px;
    margin: 0 15px;
  }
  
  .nav svg {
    width: 18px;
    height: 18px;
  }
  
  .controls {
    margin-top: 50px;
    gap: 0.5rem;
  }
  
  .controls .dot {
    width: 12px;
    height: 12px;
  }
  
  .cartext {
    font-size: 1.8rem;
    margin-bottom: 15px;
  }
}

@media (max-width: 380px) {
  main#carousel {
    height: 380px;
  }
  
  main#carousel .item {
    width: 260px;
    height: 360px;
  }
  
  .card .img {
    height: 140px;
  }
  
  .card .body {
    padding: 12px;
  }
  
  .cartext {
    font-size: 1.6rem;
  }
  
  .controls {
    margin-top: 40px;
  }
}