/* ================================================
   MEDIA QUERIES
================================================ */

/* BELOW 1344px (84em) */
@media (max-width: 84em) {
  .container {
    max-width: 120rem;
  }
  .hero--content {
    max-width: 60%;
  }
  .hero--title {
    font-size: 3.2rem;
  }
  .about--item-img {
    height: 40rem;
  }
}

/* BELOW 1200px (75em) */
@media (max-width: 75em) {
  html {
    font-size: 56.25%; /* 9px */
  }
  .container {
    max-width: 100rem;
    padding: 0 1.6rem;
  }

  .grid--5-cols {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }

  .heading--primary {
    font-size: 3.2rem;
  }
  .heading--secondary {
    font-size: 2.8rem;
  }

  .grid {
    gap: 1.8rem;
  }
  .hero--content {
    max-width: 70%;
  }
  .nav--list {
    gap: 3.2rem;
  }
  .hero--title {
    font-size: 2.8rem;
  }
  .about--secondary {
    font-size: 2rem;
  }
  .main--nav {
    padding: 0 2.4rem;
  }
  .products--image img {
    width: 250px;
    height: 250px;
  }
  .about--item-img {
    height: 35rem;
  }
}

/* BELOW 992px */
@media (max-width: 62em) {
  .grid--5-cols {
    grid-template-columns: repeat(3, 1fr);
  }
  .back-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.8rem;
  }
}

/* BELOW 944px (59em) */
@media (max-width: 59em) {
  html {
    font-size: 50%; /* 8px */
  }

  .heading--primary {
    font-size: 2.4rem;
  }
  .heading--secondary {
    font-size: 2.8rem;
  }

  .hero {
    text-align: center;
  }
  .hero--content {
    max-width: 80%;
    text-align: center;
  }
  .hero--title {
    font-size: 2.4rem;
  }
  .hero--subtitle,
  .hero--description {
    font-size: 1.2rem;
  }

  .logo--img {
    height: 2.4rem;
  }
  .hero--btn {
    justify-content: center;
  }

  .grid--3-cols {
    grid-template-columns: 1fr;
  }
  .grid--4-cols {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid--5-cols {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.8rem;
  }

  .products--image img {
    width: 220px;
    height: 220px;
  }
  .products--item-title {
    font-size: 1.2rem;
  }
  .products--item-price {
    font-size: 1rem;
  }
  .about--item-img {
    height: 30rem;
  }
  .pricing--plan-title,
  .pricing--plan-price {
    font-size: 2rem;
  }

  /* Mobile nav toggle */
  .btn-mobile-nav {
    display: block;
    z-index: 999;
  }
  .nav--list {
    background: rgba(255, 255, 255, 0.672);
    backdrop-filter: blur(10px);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4.8rem;
    transform: translateX(100%);
    transition: all 0.5s ease-in;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
  }
  .nav--list-item:link,
  .nav--list-item:visited {
    font-size: 2.4rem;
    color: #333;
  }
  .nav-open .nav--list {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: translateX(0);
  }
  .nav-open .icon-mobile-nav[name="close-outline"] {
    display: block;
  }
  .nav-open .icon-mobile-nav[name="menu-outline"] {
    display: none;
  }
  .nav--btn {
    display: none;
  }
}

/* BELOW 704px (44em) */
@media (max-width: 44em) {
  .heading--primary {
    font-size: 2rem;
  }
  .heading--secondary {
    font-size: 2.4rem;
  }

  .grid--2-cols,
  .grid--3-cols {
    grid-template-columns: 1fr;
  }
  .grid--4-cols,
  .grid--5-cols {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero--content {
    max-width: 90%;
  }
  .hero--title {
    font-size: 2rem;
  }
  .hero--btn {
    flex-direction: column;
    gap: 0.8rem;
  }

  .about--content {
    text-align: center;
  }
  .about--item {
    margin-top: 2rem;
  }

  .products--image img {
    width: 300px;
    height: 300px;
  }
  .products--item-title,
  .products--item-price {
    font-size: 1.4rem;
  }

  .newsletter--form {
    flex-direction: column;
    max-width: 300px;
  }
  .newsletter--input {
    border-radius: 9px;
    margin-bottom: 1.2rem;
  }

  .footer--bottom {
    flex-direction: column;
    gap: 1rem;
    font-size: 0.9rem;
  }
  .footer--logo {
    grid-column: span 2;
    text-align: center;
  }
  .footer--social {
    justify-content: center;
  }
}

/* BELOW 544px (34em) */
@media (max-width: 34em) {
  .heading--primary {
    font-size: 1.8rem;
  }
  .heading--secondary {
    font-size: 2.2rem;
  }

  .grid,
  .grid--2-cols,
  .grid--3-cols,
  .grid--4-cols,
  .grid--5-cols {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .hero--title {
    font-size: 1.8rem;
  }
  .hero--subtitle {
    font-size: 1rem;
    letter-spacing: 2px;
  }

  /* Make product images full width */
  .products--image {
    width: 100%;
  }
  .products--image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
  }

  /* Always show overlay on mobile */
  .products--overlay {
    position: static;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    background: none;
    margin-top: 1rem;
  }

  .products--btn {
    display: block;
    width: 100%;
    padding: 0.8rem 1.2rem;
    text-align: center;
  }

  .products--item-title {
    font-size: 1.1rem;
  }
  .products--item-price {
    font-size: 0.95rem;
  }

  .pricing--plan-title,
  .pricing--plan-price {
    font-size: 1.8rem;
  }
  .review--text {
    font-size: 1rem;
  }

  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
    font-size: 1.6rem;
  }
}

/* BELOW 375px (23.4em) */
@media (max-width: 23.4em) {
  .hero--title {
    font-size: 1.6rem;
  }
  .hero--subtitle {
    font-size: 0.9rem;
    letter-spacing: 1px;
  }
  .heading--secondary {
    font-size: 2rem;
  }
  .about--secondary {
    font-size: 1.6rem;
  }

  /* Extra small screens: buttons stay inside image */
  .products--overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 0.4rem;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.6rem;
    border-radius: 0 0 8px 8px;
  }

  .products--btn {
    flex: 1;
    padding: 0.6rem;
    font-size: 0.85rem;
    text-align: center;
    background: #fff;
    color: #333;
    border-radius: 4px;
  }
}
.products--image img {
  width: 100%;
  height: auto;
  max-width: 100%;
}

.products--item-title {
  font-size: 1.2rem;
}
.products--item-price {
  font-size: 1rem;
}

.pricing--plan-title,
.pricing--plan-price {
  font-size: 1.2rem;
}
