/* ==========================================================================
   Nortech Recycling — Responsive Styles
   ========================================================================== */

/* --- Large Desktop (1400px+) --- */
@media (min-width: 1400px) {
  :root {
    --container-max: 1400px;
  }
}

/* --- Laptop (1024px - 1199px) --- */
@media (max-width: 1199px) {
  .hero--unified {
    overflow-x: clip;
  }

  .hero__right {
    overflow: hidden;
    max-width: 100%;
  }

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

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

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

  .footer__main {
    grid-template-columns: 1fr 1fr;
  }

  .footer__brand {
    grid-column: span 2;
  }
}

/* --- Tablet / iPad (768px - 1023px) --- */
@media (max-width: 1023px) {
  :root {
    --topbar-height: 40px;
    --header-height: 68px;
    --space-4xl: 5rem;
    --space-3xl: 4rem;
  }

  /* Topbar */
  .topbar__contact--email {
    display: none;
  }

  .topbar__message {
    display: none;
  }

  .topbar__text {
    font-size: var(--text-xs);
  }

  /* Navigation */
  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(360px, 85vw);
    height: 100vh;
    background: var(--white);
    box-shadow: var(--shadow-xl);
    padding: calc(var(--site-top-height) + var(--space-lg)) var(--space-lg) var(--space-lg);
    transition: right var(--transition-base);
    z-index: 999;
    overflow-y: auto;
  }

  .nav.open {
    right: 0;
  }

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

  .nav__link {
    padding: 1rem;
    color: #000 !important;
    font-size: var(--text-base);
    border-bottom: 1px solid rgba(107, 124, 138, 0.1);
  }

  .nav__dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    padding-left: var(--space-md);
    display: none;
    background: var(--light);
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
  }

  .nav__dropdown.open .nav__dropdown-menu {
    display: block;
  }

  .header__cta {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  /* Mobile nav overlay */
  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
  }

  .nav-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* Hero — prevent horizontal overflow */
  .hero--unified {
    overflow-x: clip;
  }

  .hero__wrap {
    padding-top: var(--space-lg);
    padding-bottom: var(--space-xl);
    gap: var(--space-xl);
  }

  .hero__layout {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .hero__right {
    order: -1;
    overflow: hidden;
    max-width: 100%;
  }

  .hero__visual {
    max-width: min(380px, 100%);
  }

  .hero__floats {
    position: static;
    inset: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    pointer-events: auto;
    margin-top: var(--space-md);
  }

  .hero__float {
    position: static;
    max-width: none;
    width: 100%;
    white-space: normal;
    animation: heroFloatBob 5s ease-in-out infinite;
  }

  .hero__merge-panel {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    text-align: center;
  }

  .hero__merge-intro p {
    margin: 0 auto;
  }

  .hero__merge-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* About */
  .about__header {
    flex-direction: column;
    align-items: center;
  }

  .about__grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .about__visual {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .about__visual img {
    aspect-ratio: 4 / 3.5;
    min-height: 280px;
    object-position: center center;
  }

  .about__feature-bar {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    margin-top: 0.85rem;
    flex-direction: column;
    min-height: auto;
  }

  .about__feature-bar-items {
    grid-template-columns: 1fr;
  }

  .about__bar-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.75rem;
    text-align: left;
    padding: 0.8rem 1rem;
    border-left: none;
    border-top: 1px solid rgba(0, 102, 179, 0.08);
  }

  .about__bar-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
  }

  .about__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .about__content .btn {
    width: 100%;
    justify-content: center;
  }

  .about__secondary-link {
    justify-content: center;
  }

  /* Services */
  .services__grid {
    grid-template-columns: 1fr;
  }

  .services__actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Why */
  .why__layout {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .why__intro {
    position: static;
    text-align: center;
  }

  .why__highlights {
    justify-content: center;
  }

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

  .request-cta__panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .request-cta__content {
    max-width: 100%;
  }

  .request-cta__actions {
    width: 100%;
    align-items: center;
  }

  .request-cta__btn {
    width: 100%;
    max-width: 22rem;
    justify-content: center;
  }

  /* Process timeline */
  .process-timeline__spine {
    left: 1.75rem;
    transform: none;
  }

  .process-step {
    grid-template-columns: auto 1fr;
    gap: 1.25rem;
    padding: 0.75rem 0;
  }

  .process-step--left .process-step__card,
  .process-step--right .process-step__card {
    grid-column: 2;
    grid-row: 1;
    justify-self: stretch;
    max-width: none;
    text-align: left;
  }

  .process-step--left .process-step__node,
  .process-step--right .process-step__node {
    grid-column: 1;
    grid-row: 1;
  }

  .process-step__card::after {
    display: none;
  }

  /* Industries */
  .industries__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Gallery */
  .gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-modal {
    padding: 3.5rem 3.25rem;
  }

  /* FAQ */
  .faq__grid {
    grid-template-columns: 1fr;
    gap: clamp(1.5rem, 4vw, 2rem);
  }

  .faq__intro {
    text-align: center;
  }

  .faq__tag {
    margin-left: auto;
    margin-right: auto;
  }

  /* Contact */
  .contact__grid {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer__cta {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .footer__brand {
    grid-column: span 2;
  }
}

/* --- Mobile (max 767px) --- */
@media (max-width: 767px) {
  :root {
    --topbar-height: 38px;
    --header-height: 64px;
    --space-4xl: 4rem;
    --space-3xl: 3rem;
    --space-2xl: 2.5rem;
  }

  .container {
    padding: 0 var(--space-md);
  }

  .header__inner {
    gap: 0.5rem;
  }

  .header__logo img {
    height: 40px;
    width: auto;
    max-width: min(150px, 42vw);
  }

  .topbar__inner {
    padding-right: 2rem;
  }

  .topbar__icon {
    display: none;
  }

  .topbar__sep,
  .topbar__contact {
    display: none;
  }

  .topbar__text {
    gap: 0;
  }

  .topbar__cta {
    background: var(--white);
    color: var(--primary-dark);
    padding: 0.4rem 1rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  .topbar__cta::after {
    display: none;
  }

  .topbar__cta:hover {
    color: var(--primary-dark);
    background: #F0FFE8;
  }

  .hero__merge-stats {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }

  .hero__collage {
    min-height: 0;
    max-width: 100%;
    aspect-ratio: 16 / 9;
  }

  .hero__collage-main {
    inset: 0;
    border-width: 3px;
  }

  .hero__collage-main::after {
    background: linear-gradient(180deg, transparent 38%, rgba(0, 24, 48, 0.78) 100%);
  }

  .hero__image-caption {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.18rem;
    position: absolute;
    left: 0.7rem;
    right: 0.7rem;
    bottom: 0.7rem;
    z-index: 3;
    padding: 0.65rem 0.85rem 0.7rem;
    background: rgba(8, 22, 38, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
    pointer-events: none;
  }

  .hero__image-caption-tag {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #b7e08a;
    line-height: 1.2;
  }

  .hero__image-caption-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: clamp(0.92rem, 4.2vw, 1.05rem);
    font-weight: 800;
    line-height: 1.25;
    color: var(--white);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  }

  .hero__image-chips {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
  }

  .hero__image-chip {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    padding: 0.26rem 0.55rem 0.26rem 0.26rem;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 999px;
    box-shadow: 0 8px 22px rgba(0, 12, 28, 0.28);
    font-family: var(--font-heading);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #102033;
    text-decoration: none;
    white-space: nowrap;
    pointer-events: auto;
    animation: heroFloatBob 4.8s ease-in-out infinite;
  }

  .hero__image-chip-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--secondary-light);
    color: var(--secondary-dark);
  }

  .hero__image-chip-icon--blue {
    background: var(--primary-light);
    color: var(--primary-dark);
  }

  .hero__image-chip--2 {
    top: 44%;
    right: 0.55rem;
    left: auto;
    animation-delay: 0.85s;
  }

  .hero__image-chip--3 {
    top: 9%;
    left: 0.55rem;
    animation-delay: 0s;
  }

  .hero__collage-circle--top {
    right: -2%;
  }

  .hero__collage-circle--bottom {
    left: -2%;
  }

  .hero__left::before {
    display: none;
  }

  .hero__merge-panel {
    padding: 1.15rem 1rem;
  }

  .hero__merge-stat {
    min-height: auto;
    padding: 0.75rem 0.5rem;
  }

  .hero__merge-stat strong {
    font-size: 1.1rem;
  }

  .hero__right {
    display: flex;
    order: -1;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .hero__visual {
    max-width: 100%;
    width: 100%;
  }

  .hero__visual-backdrop {
    display: none;
  }

  .hero__floats {
    display: none;
  }

  .section {
    padding-top: 4rem;
    padding-bottom: 4rem;
    margin-top: 0;
    margin-bottom: 0;
  }

  .services {
    margin-top: 0;
  }

  .about__header,
  .services__header,
  .process__header,
  .industries__header,
  .certifications__header,
  .gallery__header,
  .testimonials__header {
    margin-bottom: 2rem;
  }

  .about__header,
  .services__header {
    padding-bottom: 1.25rem;
  }

  /* About */
  .about__visual img {
    aspect-ratio: 4 / 3.75;
    min-height: 300px;
  }

  .about__feature-bar {
    margin-top: 1rem;
  }

  .about__bar-item {
    padding: 0.9rem 1rem;
  }

  /* Hero */
  .hero {
    min-height: auto;
    padding-top: calc(var(--site-top-height) + 0.75rem);
    padding-bottom: 4rem;
    align-items: flex-start;
  }

  .hero__wrap {
    padding-top: 0.75rem;
    padding-bottom: 0;
    gap: var(--space-lg);
  }

  .hero__layout {
    gap: var(--space-md);
  }

  .hero__left {
    gap: var(--space-sm);
  }

  .hero__title {
    font-size: clamp(1.35rem, 5vw, 1.75rem);
  }

  .hero__eyebrow {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    width: 100%;
    max-width: 100%;
    padding: 0.38rem 0.5rem;
    gap: 0.28rem 0.38rem;
    justify-content: center;
    box-sizing: border-box;
  }

  .hero__eyebrow-item {
    font-size: clamp(0.44rem, 2.35vw, 0.55rem);
    letter-spacing: 0.035em;
    white-space: nowrap;
    flex: 0 1 auto;
    line-height: 1.15;
  }

  .hero__eyebrow-dot {
    width: 4px;
    height: 4px;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(109, 179, 63, 0.2);
  }

  .hero__highlights {
    display: none;
  }

  .hero__highlight {
    justify-content: center;
    text-align: center;
    padding: 0.4rem 0.3rem;
    font-size: clamp(0.52rem, 2.6vw, 0.65rem);
    letter-spacing: 0.03em;
    min-width: 0;
  }

  .hero__desc {
    font-size: 0.875rem;
  }

  .hero__slogan {
    display: none;
  }

  .hero__actions {
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
    gap: 0.5rem;
  }

  .hero__actions .btn {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    justify-content: center;
    white-space: nowrap;
    padding: 0.72rem 0.55rem;
    font-size: clamp(0.8rem, 3.1vw, 0.82rem);
    gap: 0.3rem;
  }

  .hero__actions .btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
  }

  .btn {
    white-space: normal;
  }

  .wave-divider svg {
    height: 50px;
  }

  /* Services */
  .services__grid {
    grid-template-columns: 1fr;
  }

  /* Why */
  .why__mosaic {
    grid-template-columns: 1fr;
  }

  .why__stats {
    grid-template-columns: 1fr;
  }

  .why__stat:not(:last-child) {
    border-right: none;
    border-bottom: 1px solid rgba(0, 102, 179, 0.1);
    padding-bottom: 0.65rem;
  }

  /* Process */
  .process__body {
    padding: 0 0.5rem;
  }

  .process-step {
    gap: 0.85rem;
    padding: 0.65rem 0;
  }

  .process-step__node {
    width: 48px;
    height: 48px;
  }

  .process-step__icon {
    width: 44px;
    height: 44px;
  }

  .process-step__card {
    padding: 1rem;
  }

  .process__highlights {
    gap: 0.4rem;
  }

  /* Industries */
  .industries__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Stats */
  .stats__grid {
    grid-template-columns: 1fr;
  }

  /* Certifications */
  .certifications__grid {
    grid-template-columns: 1fr;
  }

  /* Gallery */
  .gallery__grid {
    grid-template-columns: 1fr;
  }

  .gallery-modal {
    padding: 3.5rem 1rem;
  }

  .gallery-modal__nav--prev {
    left: 0.25rem;
  }

  .gallery-modal__nav--next {
    right: 0.25rem;
  }

  /* FAQ */
  .accordion__trigger {
    font-size: 0.92rem;
    padding: 0.95rem 1rem;
    gap: 0.65rem;
  }

  .accordion__panel p {
    padding: 0 1rem;
    font-size: 15px;
  }

  .faq__cta {
    width: 100%;
    justify-content: center;
  }

  /* Request CTA */
  .request-cta__panel {
    padding: 1.75rem 1.25rem;
    border-radius: 1.25rem;
  }

  .request-cta__content {
    max-width: 100%;
  }

  .request-cta__title {
    font-size: clamp(1.25rem, 5vw, 1.65rem);
  }

  .request-cta__phone {
    font-size: 0.9rem;
    text-align: center;
  }

  .industry-card {
    min-width: 0;
  }

  /* Testimonials */
  .testimonial-slider {
    --slides-per-view: 1;
    max-width: 100%;
  }

  .testimonial-slider__viewport {
    max-width: 100%;
  }

  .testimonial-card {
    padding: clamp(1.25rem, 4vw, 1.5rem) clamp(1rem, 3vw, 1.25rem);
  }

  /* Contact */
  .form-row {
    grid-template-columns: 1fr;
  }

  .contact__form {
    padding: var(--space-md);
  }

  /* Footer */
  .footer__cta-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .footer__cta-btn {
    justify-content: center;
  }

  .footer__cta-phone {
    justify-content: center;
  }

  .footer__main {
    grid-template-columns: 1fr;
  }

  .footer__brand {
    grid-column: span 1;
  }

  .footer__nav {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer__contact-item a,
  .footer__contact-item p {
    word-break: break-word;
  }

  .footer__tagline {
    max-width: none;
  }

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

  /* Back to top */
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
  }
}

/* --- Small Mobile (max 480px) --- */
@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .hero__merge-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm);
  }

  .process-timeline__spine {
    left: 1.35rem;
  }

  .industries__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm);
  }

  .industry-card {
    padding: var(--space-md) var(--space-sm);
  }

  .footer__cta-title {
    font-size: 1.05rem;
  }

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

/* --- Touch-friendly targets --- */
@media (hover: none) and (pointer: coarse) {
  .btn {
    min-height: 48px;
  }

  .nav__link {
    min-height: 48px;
  }

  .accordion__trigger {
    min-height: 48px;
  }

  .testimonial-slider__btn {
    width: 48px;
    height: 48px;
  }
}

/* --- Print --- */
@media print {
  .header,
  .loader,
  .scroll-progress,
  .back-to-top,
  .scroll-indicator,
  .hamburger {
    display: none !important;
  }

  .hero {
    min-height: auto;
    padding: 2rem 0;
  }

  .section {
    padding: 1.5rem 0;
    break-inside: avoid;
  }
}
