/* ====================================================================
   RESPONSIVE.CSS — Elements India
   --------------------------------------------------------------------
   Loaded LAST, after style.css / header.css / footer.css / [page].css.
   Base styles throughout the project are desktop-first; this file
   overrides downward at each breakpoint.

   Breakpoints:
   1200px  -> laptop / small desktop
   1024px  -> tablet landscape
   768px   -> tablet portrait / mobile nav switch
   480px   -> small mobile
   ==================================================================== */


/* ============================================================
   LAPTOP (<= 1200px)
   ============================================================ */
@media (max-width: 1200px) {

  :root {
    /* Type scales fluidly via clamp() in style.css — no fixed overrides here. */
    --container-pad: var(--space-4);
  }

  .hero__content {
    padding-inline: var(--space-6);
  }

  .cta-banner {
    padding: var(--space-6);
  }
}


/* ============================================================
   TABLET LANDSCAPE (<= 1024px)
   ============================================================ */
@media (max-width: 1024px) {

  .section {
    padding-block: var(--space-8);
  }

  /* --- Home --- */
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    max-height: none;
  }

  .hero__content {
    order: 2;
    max-width: none;
    margin-inline: 0;
    padding: var(--space-7) var(--container-pad);
  }

  .hero__image-wrap {
    order: 1;
    height: 360px;
  }

  .about-section {
    grid-template-columns: 1fr;
  }

  .about__image-wrap img {
    aspect-ratio: 16 / 9;
  }

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

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

  .industries-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .cta-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  /* --- Products / product detail --- */
  .product-intro {
    grid-template-columns: 1fr;
  }

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

  .benefits-list {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 180px;
  }

  .related-products-grid {
    grid-template-columns: 1fr;
  }

  /* --- Footer --- */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    row-gap: var(--space-7);
  }

  .footer-col--brand {
    grid-column: 1 / -1;
  }
}


/* ============================================================
   TABLET PORTRAIT / MOBILE NAV SWITCH (<= 768px)
   ============================================================ */
@media (max-width: 768px) {

  html {
    font-size: 15px;
  }

  :root {
    --header-height: 72px;
  }

  /* --- Header / Mobile nav --- */
  .nav-toggle {
    display: flex;
  }

  .primary-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background-color: var(--color-paper);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: var(--space-6) var(--container-pad);
    gap: var(--space-6);
    transform: translateX(100%);
    transition: transform var(--duration-base) var(--ease-standard);
    overflow-y: auto;
  }

  .primary-nav--open {
    transform: translateX(0);
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-item {
    border-bottom: 1px solid var(--color-line);
  }

  .nav-link {
    width: 100%;
    justify-content: space-between;
    padding: var(--space-4) 0;
    font-size: var(--fs-md);
  }

  .nav-link--dropdown-toggle {
    width: 100%;
  }

  /* Dropdown becomes an inline accordion, not a floating panel, on mobile */
  .dropdown-menu {
    position: static;
    width: 100%;
    transform: none;
    box-shadow: none;
    border: none;
    max-height: 0;
    padding: 0;
    overflow: hidden;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: max-height var(--duration-base) var(--ease-standard);
  }

  .nav-item--dropdown[data-open="true"] .dropdown-menu {
    max-height: 320px;
    padding: var(--space-2) 0 var(--space-4);
    transform: none;
  }

  .nav-cta {
    margin-top: var(--space-4);
    width: 100%;
    justify-content: center;
  }

  /* --- Home --- */
  .about-section,
  .product-intro {
    gap: var(--space-6);
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .product-grid,
  .products-listing-grid,
  .why-grid,
  .industries-grid,
  .applications-grid,
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero__specs,
  .about__stats {
    flex-wrap: wrap;
    gap: var(--space-4) var(--space-6);
  }

  /* --- Footer --- */
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .site-footer__bottom-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .back-to-top {
    right: var(--space-4);
    bottom: var(--space-4);
    width: 40px;
    height: 40px;
  }
}


/* ============================================================
   SMALL MOBILE (<= 480px)
   ============================================================ */
@media (max-width: 480px) {

  :root {
    --space-9: 3.5rem;
    --space-8: 2.5rem;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }

  .hero__actions .btn {
    width: 100%;
  }

  .product-grid,
  .products-listing-grid,
  .why-grid,
  .industries-grid,
  .applications-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .product-card--featured {
    flex-direction: column;
  }

  .product-card--featured .product-card__image-wrap {
    aspect-ratio: 4 / 3;
  }

  .gallery-item--wide {
    grid-column: span 1;
  }

  .cta-banner__actions {
    width: 100%;
    flex-direction: column;
  }

  .cta-banner__actions .btn {
    width: 100%;
  }

  .product-inquiry {
    flex-direction: column;
    align-items: flex-start;
  }

  .product-inquiry .btn {
    width: 100%;
  }
}


/* ============================================================
   NO HORIZONTAL SCROLL — safety net across all breakpoints
   ============================================================ */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}
