@import url("./variables.css");

/* Footer */
.footer {
  background: var(--black);
  color: var(--white);
}

.container-footer {
  max-width: 1270px;
  margin: 0 auto;
  padding: 50px 20px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 3fr 1fr;
  gap: 4rem;
  margin-bottom: 3rem;
}

.footer-info img {
  height: 40px;
  margin-bottom: 1rem;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}
.social-links svg {
  color: var(--accent);
}
.social-links svg:hover {
  color: var(--white);
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.link-group h4 {
  color: var(--white);
  margin-bottom: 1.5rem;
}

.link-group ul {
  list-style: none;
}

.link-group ul li {
  margin-bottom: 0.75rem;
}

.link-group ul li a {
  color: var(--gray-300);
  text-decoration: none;
  transition: var(--transition);
}

.link-group ul li a:hover {
  color: var(--white);
}

.footer-contact p {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--gray-300);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-legal {
  display: flex;
  gap: 2rem;
}

.footer-legal a {
  color: var(--white);
  text-decoration: none;
  transition: var(--transition);
}

.footer-legal a:hover {
  color: var(--white);
}

/* Responsive Design */
@media (max-width: 1024px) {
  /* Hide desktop nav links at this width */
  .nav-links {
    display: none;
  }

  /* 2x2 grid below the intro block */
  .footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: auto;
    gap: 3rem;
  }

  /* Intro (logo + text + socials) stays full width on the first row */
  .footer-info {
    grid-column: 1 / -1;
  }

  /* Flatten the links container so its children (link groups) become grid items of .footer-grid */
  .footer-links {
    display: contents;
  }

  /* Place the three link groups explicitly into a 2x2:
     Row 2: Products | Company
     Row 3: Support  | Contact Us (moved from the separate block)
     The separate Contact block is placed at row 3 right column. */
  .footer-links .link-group:nth-child(1) {
    /* Products */
    grid-column: 1;
    grid-row: 2;
  }
  .footer-links .link-group:nth-child(2) {
    /* Company */
    grid-column: 2;
    grid-row: 2;
  }
  .footer-links .link-group:nth-child(3) {
    /* Support */
    grid-column: 1;
    grid-row: 3;
  }

  /* Contact Us block to the right of Support */
  .footer-contact {
    grid-column: 2;
    grid-row: 3;
  }

  /* Bottom row spans full width */
  .footer-bottom {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .footer-legal {
    flex-direction: column;
    gap: 1rem;
  }

  /* keep the 2x2 placement at 768 as well (inherited from 1024 rules) */
  .footer-grid {
    row-gap: 2rem;
  }
}
