/* ==========================================================================
   NORSTOK - Responsive Styles
   Fully responsive across Desktop, Tablet, and Mobile devices
   ========================================================================== */

/* Prevent horizontal overflow on mobile viewports */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* ==========================================================================
   LAPTOP & SMALL DESKTOP (<= 1200px)
   ========================================================================== */
@media (max-width: 1200px) {
  .nav-list {
    gap: 22px;
  }
  
  .nav-link {
    font-size: 12.5px;
  }

  .home-hero-title {
    font-size: 54px;
  }

  .page-hero-container {
    padding-left: clamp(45px, 19.5vw, 200px);
  }

  .page-hero-bg {
    display: none;
  }

  .page-hero-image-wrap {
    left: 37.5%;
    right: 0;
  }
}

/* ==========================================================================
   TABLET LANDSCAPE (<= 992px)
   ========================================================================== */
@media (max-width: 992px) {
  .nav-list {
    gap: 16px;
  }
  
  .nav-link {
    font-size: 12px;
    letter-spacing: 0.8px;
  }
  
  .home-hero {
    min-height: 700px;
  }

  .home-hero-title {
    font-size: 46px;
  }
  
  .home-builder-heading,
  .home-mission-heading {
    font-size: 38px;
  }

  .home-builder-grid,
  .home-mission-grid {
    gap: 40px;
  }
  
  .home-builder-image-wrap {
    margin-top: -60px;
  }

  .section-grid {
    gap: 40px;
  }
}

/* ==========================================================================
   TABLET PORTRAIT (<= 860px)
   ========================================================================== */
@media (max-width: 860px) {
  .home-products-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .home-products-section {
    padding-bottom: 120px;
  }

  .home-builder-image-wrap {
    margin-top: 0;
  }

  .home-innovation-split {
    grid-template-columns: 1fr;
    height: auto;
  }

  .innovation-left {
    align-items: flex-start;
    padding: 50px 30px;
  }

  .innovation-right {
    min-height: 280px;
    height: 280px;
  }

  .home-cta-card {
    padding: 35px 30px;
  }
}

/* ==========================================================================
   MOBILE PHONES (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
  /* Header & Navigation */
  .site-header {
    height: 75px;
    overflow: visible !important;
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #23272c;
  }

  body.home-page .site-header {
    position: sticky;
    top: 0;
    background-color: #23272c;
  }

  .site-header-inner {
    padding-left: 20px;
    padding-right: 20px;
    height: 75px;
  }

  .site-header::after,
  .page-hero-bg {
    display: none !important;
  }

  .site-logo img {
    height: 22px;
  }

  /* Hamburger Toggle */
  .mobile-nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1002;
  }

  .mobile-nav-toggle span {
    display: block;
    width: 25px;
    height: 2.5px;
    background-color: #ffffff;
    border-radius: 2px;
    margin: 3px 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.2s ease,
                background-color 0.25s ease;
  }

  .mobile-nav-toggle.active span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
    background-color: var(--color-accent-gold);
  }

  .mobile-nav-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }

  .mobile-nav-toggle.active span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
    background-color: var(--color-accent-gold);
  }

  /* Mobile Drawer Menu */
  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #23272c;
    flex-direction: column;
    padding: 0;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.3s ease,
                visibility 0.3s ease,
                padding 0.3s ease;
    z-index: 1001;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .primary-nav.active {
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    visibility: visible;
    opacity: 1;
    padding: 10px 0 24px;
  }

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

  .nav-item {
    width: 100%;
  }

  .nav-link {
    padding: 15px 24px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #ffffff;
  }

  .mobile-dropdown-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-accent-gold);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
  }

  .dropdown-open .mobile-dropdown-arrow {
    transform: rotate(180deg);
    background-color: rgba(229, 161, 51, 0.15);
  }

  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border-top: none;
    background-color: #1a1e22;
    padding: 0;
    display: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }

  .nav-item.dropdown-open .dropdown-menu {
    display: block;
    max-height: 500px;
    padding: 6px 0 12px;
  }

  .dropdown-link {
    padding: 13px 24px 13px 40px;
    font-size: 13.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: #c5c8cb;
  }

  /* Inner Page Hero on Mobile */
  .page-hero {
    height: auto;
    min-height: auto;
    padding: 28px 0 0;
    overflow: hidden;
  }

  .page-hero-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 20px;
    gap: 18px;
  }

  .page-hero-title {
    font-size: 34px;
    line-height: 1.15;
  }

  .page-hero-image-wrap {
    position: relative;
    left: 0;
    right: 0;
    width: 100%;
    height: 210px;
    border-radius: 4px;
    overflow: hidden;
    margin-left: 0;
  }

  .page-hero-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
  }

  /* Homepage Hero on Mobile */
  .home-hero {
    min-height: 520px;
    background-position: right center;
    padding: 40px 0 60px;
  }

  .home-hero-title {
    font-size: 36px;
    line-height: 1.15;
  }

  .home-hero-subtitle {
    font-size: 14px;
    max-width: 100%;
  }

  /* Section Layouts to 1 Column */
  .content-section {
    padding: 50px 0;
  }

  .section-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .section-grid.reversed {
    direction: ltr;
  }

  .section-grid.reversed > * {
    direction: ltr;
  }

  .section-heading {
    font-size: 28px;
  }

  .home-builder-section {
    padding: 40px 0 80px 0;
  }

  .home-builder-grid,
  .home-mission-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .home-builder-heading,
  .home-mission-heading {
    font-size: 32px;
  }

  .home-mission-section {
    padding: 70px 0 140px 0;
  }

  /* CTA Card on Mobile */
  .home-cta-section {
    margin-bottom: -60px;
  }

  .home-cta-card {
    flex-direction: column;
    text-align: center;
    gap: 22px;
    padding: 35px 20px;
  }

  .cta-center-content {
    padding-right: 0;
  }

  .cta-left {
    flex-direction: column;
  }

  /* Footer on Mobile */
  .footer {
    padding: 110px 0 35px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 35px;
  }
  
  .contact-cards-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

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

/* ==========================================================================
   EXTRA SMALL MOBILE (<= 480px)
   ========================================================================== */
@media (max-width: 480px) {
  .home-products-row {
    grid-template-columns: 1fr;
  }

  .home-hero-title {
    font-size: 32px;
  }

  .home-builder-heading,
  .home-mission-heading {
    font-size: 28px;
  }

  .page-hero-title {
    font-size: 30px;
  }

  .innovation-badge {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}
