@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .hero {
    padding: 36px 0 10px;
  }

  .media-card img {
    height: 320px;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .cart-grid {
    grid-template-columns: 1fr;
  }
  .summary-card {
    position: static;
    top: auto;
  }

  .split {
    grid-template-columns: 1fr;
  }
  .cta-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  /* Container e espaçamentos */
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Topbar não quebrar */
  .topbar-inner {
    padding: 12px 0;
    gap: 10px;
  }
  .brand-text b {
    font-size: 13px;
  }
  .brand-text span {
    font-size: 11px;
  }

  /* Esconde pills e deixa só carrinho */
  .top-actions .ghost-pill {
    display: none;
  }
  .cart-pill {
    padding: 10px 10px;
    gap: 8px;
  }
  .cart-pill > span:nth-of-type(2) {
    display: none;
  }
  /* esconde o texto "Carrinho" e deixa só ícone + badge */

  /* Hero: evitar texto cortado */
  .hero-copy h1 {
    font-size: 30px;
    line-height: 1.15;
    letter-spacing: -0.02em;
    word-break: break-word;
  }
  .hero-copy p {
    font-size: 14px;
    line-height: 1.5;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-primary,
  .btn-secondary {
    width: 100%;
  }

  /* Cards e grid */
  .grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .card-media {
    height: 200px;
  }
  .card-title {
    font-size: 16px;
  }
  .card-desc {
    min-height: 0;
  }

  /* Section head */
  .section-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .search-wrap {
    width: 100%;
  }
  .search-wrap input {
    width: 100%;
  }

  /* Modal */
  .modal-grid {
    grid-template-columns: 1fr;
  }

  /* Mobile polish: alinhamento e ritmo visual */

  /* Topbar: centraliza e reduz ruído */
  .topbar-inner {
    align-items: center;
  }
  .brand {
    gap: 10px;
  }
  .brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    padding: 7px;
  }
  .top-actions {
    gap: 8px;
  }
  .cart-pill {
    height: 40px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
  }
  .cart-badge {
    margin-left: 2px;
  }

  /* Hero: melhora composição */
  .hero {
    padding: 26px 0 6px;
  }
  .pill {
    padding: 9px 12px;
    font-size: 12px;
  }
  .hero-cta {
    margin-top: 14px;
    gap: 10px;
  }
  .hero-stats {
    gap: 10px;
    flex-wrap: wrap;
  }
  .stat {
    flex: 1 1 calc(50% - 10px);
    justify-content: center;
    padding: 10px 10px;
  }

  /* Hero imagem: não “estoura” e fica proporcional */
  .media-card img {
    height: 260px;
  }
  .media-badge {
    left: 12px;
    bottom: 12px;
    padding: 9px 10px;
    font-size: 12px;
  }

  /* Section: títulos e espaços mais consistentes */
  .section {
    padding-top: 26px;
    padding-bottom: 26px;
  }
  .section-head {
    margin-bottom: 10px;
  }

  /* Cards: altura e alinhamento mais uniformes */
  .card-body {
    padding: 12px 12px 14px;
  }
  .card-title {
    margin-bottom: 6px;
    line-height: 1.15;
  }
  .price-row {
    align-items: flex-end;
  }
  .add-btn {
    padding: 10px 12px;
    border-radius: 14px;
  }
}

/* Blindagem: evitar qualquer corte de texto em títulos */
h1,
h2,
h3 {
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Topbar: impedir overflow horizontal */
.topbar-inner {
  flex-wrap: nowrap;
}
.brand {
  min-width: 0;
}
.brand-text {
  min-width: 0;
}
.brand-text b,
.brand-text span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52vw;
}

/* Chips: evitar “quebra feia” e overflow */
.chips {
  gap: 8px;
}
.chip {
  padding: 9px 10px;
  font-size: 12px;
}

/* Search: garantir que não estoura */
.search-wrap {
  max-width: 100%;
}
.search-wrap input {
  min-width: 0;
}
