/* TOP Responsive System */

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) {
  .top-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .top-hero__grid {
    gap: var(--top-space-lg);
  }

  .top-two-col {
    gap: var(--top-space-lg);
  }

  /* Medium screens: collapse nav into hamburger (8 items cannot fit) */
  .top-header__nav {
    display: none;
  }

  .top-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    color: var(--top-color-primary);
    cursor: pointer;
  }

  .top-mobile-nav {
    display: none;
    background-color: var(--top-color-bg);
    border-bottom: var(--top-border-width) solid var(--top-color-border);
    padding: var(--top-space-sm) var(--top-container-padding) var(--top-space-md);
  }

  .top-mobile-nav.is-open {
    display: block;
  }

  .top-mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .top-mobile-nav li {
    border-bottom: var(--top-border-width) solid var(--top-color-border);
  }

  .top-mobile-nav li:last-child {
    border-bottom: none;
  }

  .top-mobile-nav a {
    display: block;
    padding: var(--top-space-sm) 0;
    font-weight: 500;
    color: var(--top-color-text);
    text-decoration: none;
  }

  .top-mobile-nav a:hover {
    color: var(--top-color-accent);
  }

  .top-header__inner {
    height: 64px;
  }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
  :root {
    --top-space-section: clamp(3rem, 6vw, 4rem);
  }

  .top-grid-2,
  .top-grid-3,
  .top-grid-4 {
    grid-template-columns: 1fr;
  }

  .top-hero__grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .top-hero__content {
    max-width: 100%;
    order: 2;
  }

  .top-hero__image {
    order: 1;
  }

  .top-hero__cta {
    justify-content: center;
  }

  .top-two-col {
    grid-template-columns: 1fr;
  }

  .top-two-col--reverse {
    direction: ltr;
  }

  .top-header__nav {
    display: none;
  }

  .top-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    color: var(--top-color-primary);
    cursor: pointer;
  }

  .top-mobile-nav {
    display: none;
    background-color: var(--top-color-bg);
    border-bottom: var(--top-border-width) solid var(--top-color-border);
    padding: var(--top-space-sm) var(--top-container-padding) var(--top-space-md);
  }

  .top-mobile-nav.is-open {
    display: block;
  }

  .top-mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .top-mobile-nav li {
    border-bottom: var(--top-border-width) solid var(--top-color-border);
  }

  .top-mobile-nav li:last-child {
    border-bottom: none;
  }

  .top-mobile-nav a {
    display: block;
    padding: var(--top-space-sm) 0;
    font-weight: 500;
    color: var(--top-color-text);
    text-decoration: none;
  }

  .top-mobile-nav a:hover {
    color: var(--top-color-accent);
  }

  .top-mobile-nav .top-menu-item-cta a {
    color: var(--top-color-accent);
  }

  .top-header__inner {
    height: 60px;
  }

  .top-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--top-space-lg);
  }

  .top-footer__bottom {
    flex-direction: column;
    gap: var(--top-space-sm);
    text-align: center;
  }

  .top-mega__grid {
    grid-template-columns: 1fr;
  }

  .top-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .top-spec__row {
    grid-template-columns: 1fr;
  }

  .top-spec__label {
    border-bottom: var(--top-border-width) solid var(--top-color-border);
  }

  .top-process__item {
    grid-template-columns: 60px 1fr;
  }

  .top-mobile-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--top-color-bg);
    border-top: var(--top-border-width) solid var(--top-color-border);
    padding: var(--top-space-sm) var(--top-container-padding);
    z-index: var(--top-z-sticky);
    display: flex;
    gap: var(--top-space-sm);
  }

  .top-mobile-cta .top-btn {
    flex: 1;
    min-height: 44px;
  }

  body {
    padding-bottom: 72px;
  }

  .top-section {
    padding-top: var(--top-space-xl);
    padding-bottom: var(--top-space-xl);
  }

  .top-article p {
    max-width: 100%;
  }
}

/* Wide screens */
@media (min-width: 1440px) {
  :root {
    --top-max-width: 1320px;
  }
}

/* Print styles */
@media print {
  .top-header,
  .top-footer,
  .top-mobile-cta,
  .top-mega {
    display: none !important;
  }

  body {
    padding-bottom: 0;
  }

  .top-section {
    padding: 1rem 0;
  }
}
