/*
=========================================
CloudCart Responsive Styles
=========================================
*/

/* =====================================
   Large Devices (≤ 1200px)
===================================== */

@media (max-width: 1200px) {
  h1 {
    font-size: 3.2rem;
  }

  h2 {
    font-size: 2.6rem;
  }

  .container {
    width: min(92%, var(--container-width));
  }
}

/* =====================================
   Tablets (≤ 992px)
===================================== */

@media (max-width: 992px) {
  section {
    padding: 5rem 0;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }

  .newsletter-form {
    flex-direction: column;
    align-items: center;
  }

  .newsletter-form input {
    width: 100%;
    max-width: 500px;
  }
}

/* =====================================
   Mobile Navigation (≤ 768px)
===================================== */

@media (max-width: 768px) {
  .navbar-container {
    height: 72px;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;

    display: none;
    flex-direction: column;
    align-items: center;

    gap: 1.5rem;

    padding: 2rem;

    background: var(--color-surface);

    border-top: 1px solid var(--color-border);
  }

  .nav-links.active {
    display: flex;
  }

  h1 {
    font-size: 2.7rem;
  }

  h2 {
    font-size: 2.2rem;
  }

  h3 {
    font-size: 1.8rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-brand p {
    margin-left: auto;
    margin-right: auto;
  }

  .logo,
  .footer-logo {
    justify-content: center;
  }

  .newsletter {
    padding: 3rem 2rem;
  }
}

/* =====================================
   Small Mobile Devices (≤ 576px)
===================================== */

@media (max-width: 576px) {
  body {
    font-size: 0.95rem;
  }

  section {
    padding: 4rem 0;
  }

  h1 {
    font-size: 2.2rem;
  }

  h2 {
    font-size: 1.9rem;
  }

  h3 {
    font-size: 1.5rem;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .newsletter-form input,
  .newsletter-form button {
    width: 100%;
  }

  .dashboard-card,
  .statistic-card,
  .review-card,
  .product-content {
    padding: 1.5rem;
  }
}

/* =====================================
   Extra Small Devices (≤ 400px)
===================================== */

@media (max-width: 400px) {
  .container {
    width: 94%;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.7rem;
  }

  .navbar-container {
    height: 68px;
  }

  .logo span,
  .footer-logo span {
    font-size: 1.2rem;
  }

  .logo img,
  .footer-logo img {
    width: 36px;
    height: 36px;
  }
}

/*
=========================================
Products, Product Details,
Cart & Dashboard Responsive
=========================================
*/

/* =====================================
   Tablets (≤ 992px)
===================================== */

@media (max-width: 992px) {
  .hero-container,
  .product-details-grid,
  .cart-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cart-item {
    grid-template-columns: 120px 1fr;
    gap: 1.5rem;
  }

  .cart-item .quantity-selector,
  .cart-item .remove-item {
    grid-column: 2;
  }
}

/* =====================================
   Mobile (≤ 768px)
===================================== */

@media (max-width: 768px) {
  .toolbar {
    flex-direction: column;
  }

  .toolbar input,
  .toolbar select {
    width: 100%;
  }

  .hero {
    padding: 4rem 0;
  }

  .hero-content,
  .hero-image {
    text-align: center;
  }

  .hero-content p {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .products-grid,
  .categories-grid,
  .reviews-grid,
  .statistics-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .thumbnail-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-actions {
    flex-direction: column;
  }

  .quantity-selector {
    width: fit-content;
  }

  .chart-bars {
    height: 220px;
  }

  .orders-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* =====================================
   Small Mobile (≤ 576px)
===================================== */

@media (max-width: 576px) {
  .cart-item {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .cart-item img {
    max-width: 220px;
    margin: auto;
  }

  .cart-item .quantity-selector,
  .cart-item .remove-item {
    grid-column: auto;
    justify-self: center;
  }

  .product-details {
    padding: 4rem 0;
  }

  .main-image,
  .order-summary,
  .dashboard-card {
    padding: 1rem;
  }

  .chart-placeholder {
    padding: 1rem;
  }

  .error-content h1 {
    font-size: 4rem;
  }
}
