/* ============================================================
   RESPONSIVE — Breakpoints & adaptive layout
   ============================================================ */

/* ── Tablet / Medium (≤980px) ── */
@media (max-width: 980px) {
  .hero-bottom-grid,
  .two-col,
  .product-grid,
  .visionx-card {
    grid-template-columns: 1fr;
  }

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

  .summary-grid,
  .alert-grid {
    grid-template-columns: 1fr;
  }

  .topnav .container {
    width: min(100% - 24px, var(--container-max));
    min-height: var(--nav-height);
    align-items: center;
    flex-direction: row;
    gap: 12px;
    padding: 10px 0;
    position: relative;
  }

  .menu-toggle {
    display: grid;
    place-items: center;
    margin-left: auto;
  }

  .navlinks {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xs);
    width: 100%;
    max-height: min(72vh, 620px);
    padding: 12px;
    overflow-y: auto;
    background: color-mix(in oklch, var(--surface) 94%, transparent);
    border: 1px solid color-mix(in oklch, var(--border) 84%, transparent);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    pointer-events: none;
    transition: opacity var(--duration-fast) var(--ease-out-expo),
                transform var(--duration-fast) var(--ease-out-expo);
  }

  .topnav.menu-open .navlinks {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  .navlinks a {
    width: 100%;
    padding: 14px 16px;
    font-size: var(--text-lg);
    color: var(--fg);
  }

  .navlinks a[aria-current="true"] {
    background: var(--soft);
    color: var(--link);
  }

  .navlinks a.btn-primary {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
    color: var(--surface);
  }

  body.nav-open {
    overflow: hidden;
  }

  .visionx-points {
    grid-template-columns: 1fr;
  }
}

/* ── Table Responsive (≤720px) ── */
@media (max-width: 720px) {
  .comparison-wrap {
    overflow-x: visible;
    padding: 0;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tr {
    margin: 0 0 var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--surface);
    overflow: hidden;
    box-shadow: 0 18px 60px var(--lift);
  }

  td {
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
  }

  td:first-child {
    background: var(--bg);
    font-weight: 800;
    color: var(--fg);
  }

  td:nth-child(2),
  th:nth-child(2) {
    border-left: 0;
    border-right: 0;
    box-shadow: none;
    background: color-mix(in oklch, var(--accent) 8%, var(--surface));
  }

  td:nth-child(2)::before,
  td:nth-child(3)::before {
    display: block;
    margin-bottom: 5px;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
  }

  td:nth-child(2)::before {
    content: "VisionX";
    color: var(--link);
  }

  td:nth-child(3)::before {
    content: "Visium Pro";
  }
}

/* ── Mobile Compact (≤560px) ── */
@media (max-width: 560px) {
  .container {
    width: min(100% - 28px, var(--container-max));
  }

  .ingredient-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .navlinks .btn {
    width: auto;
  }

  .navlinks a.btn-primary {
    width: 100%;
  }

  .section {
    padding: clamp(48px, 14vw, 78px) 0;
  }

  h1 {
    font-size: clamp(40px, 13vw, 58px);
  }

  h2 {
    font-size: clamp(30px, 10vw, 42px);
  }

  .hero .container {
    min-height: auto;
    padding-top: 54px;
    padding-bottom: 60px;
  }

  .comparison-wrap {
    margin-inline: -14px;
    border-radius: var(--radius-xl);
  }

  th, td {
    padding: 14px;
  }

  .faq-q {
    align-items: flex-start;
  }

  .ingredient {
    min-height: auto;
    padding: 16px;
  }

  .ingredient-visual {
    min-height: 112px;
  }

  .visionx-main,
  .visionx-visual,
  .testimonial-shell {
    border-radius: 26px;
  }

  .testimonial-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .controls {
    width: 100%;
    justify-content: space-between;
  }

  .verdict-comparison {
    gap: 18px;
    margin: 40px 0 28px 0;
  }

  .verdict-item {
    width: 124px;
  }

  .verdict-img {
    width: 116px;
    height: 160px;
    border-radius: var(--radius-xl);
  }

  .winner-highlight {
    transform: scale(1.08);
  }

  .winner-highlight:hover {
    transform: scale(1.1) translateY(-2px);
  }

  .winner-tag {
    top: -12px;
    font-size: 9px;
    padding: 4px 10px;
  }

  /* Ajustes responsivos para o Modal Amsler Grid */
  .amsler-modal {
    padding: 24px 16px;
    border-radius: var(--radius-2xl);
    margin: 20px auto;
  }

  .amsler-title {
    font-size: var(--text-2xl);
    margin-bottom: 8px;
  }

  .amsler-desc {
    font-size: var(--text-sm);
    margin-bottom: var(--space-md);
  }

  .amsler-grid-visual {
    width: 190px;
    height: 190px;
    background-size: 10px 10px;
    margin-bottom: var(--space-md);
  }

  .amsler-instructions {
    padding: 12px 14px;
    font-size: var(--text-xs);
  }

  .amsler-instructions ol {
    padding-left: 16px;
    margin-top: 4px;
  }

  .amsler-instructions li {
    margin-bottom: 4px;
  }

  .amsler-close {
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
  }
}

/* ── Accessibility: Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal,
  .time-item {
    opacity: 1;
    transform: none;
  }

  .scroll-progress {
    display: none;
  }
}
