/* =========================================
   ADeX SYSTEM — RESPONSIVE STYLES
   Mobile & Tablet Breakpoints
   Append this file AFTER style.css
   ========================================= */

/* =========================================
   TABLET — 768px to 1024px
   ========================================= */
@media (max-width: 1024px) {

  /* === CONTAINER === */
  .container {
    padding: 0 28px;
  }

  /* === HEADER === */
  #header {
    height: 70px;
  }

  .header-inner {
    height: 70px;
    padding: 0 24px;
  }

  .header-cta {
    display: none;
  }

  /* === HERO SECTION === */
  #intro {
    flex-direction: column;
    padding: 110px 28px 80px;
    gap: 40px;
    align-items: flex-start;
    max-width: 100%;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-line {
    font-size: clamp(34px, 5.5vw, 56px);
  }

  .hero-desc {
    max-width: 100%;
  }

  .hero-carousel {
    width: 100%;
    max-width: 560px;
    align-self: center;
  }

  .scroll-indicator {
    display: none;
  }

  /* === PRODUCTS GRID === */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  /* === ABOUT === */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }

  .about-visual {
    height: 340px;
    order: -1;
  }

  .hex-container {
    width: 280px;
    height: 280px;
  }

  .hex-center {
    width: 88px;
    height: 100px;
  }

  .hex {
    width: 70px;
    height: 80px;
    font-size: 9px;
  }

  .ring-1 { width: 240px; height: 240px; }
  .ring-2 { width: 320px; height: 320px; }

  .about-content {
    text-align: left;
  }

  .feature-item {
    justify-content: flex-start;
  }

  /* === SERVICES GRID === */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  /* === CONTACT GRID === */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* === FOOTER === */
  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }

  .cert-col {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    border-left: none;
    border-top: 2px solid #386FA3;
    padding-left: 0;
    padding-top: 28px;
    gap: 16px;
  }

  .cert-img {
    height: 48px;
    margin-bottom: 0;
  }
}

/* =========================================
   MOBILE NAVIGATION — Below 992px
   ========================================= */
@media (max-width: 992px) {

  /* Show hamburger button */
  .nav-toggle {
    display: flex !important;
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 1100;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
  }

  .nav-toggle span {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
  }

  /* Animate hamburger → X when open */
  .nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

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

  .nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Full-screen slide-in nav overlay */
  #main-nav {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: 100vh !important;
    background: rgba(4, 6, 15, 0.98);
    backdrop-filter: blur(20px);
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-16px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    z-index: 1050;
  }

  #main-nav.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
  }

  #main-nav ul {
    flex-direction: column !important;
    align-items: center;
    gap: 0 !important;
    padding: 0;
    width: 100%;
  }

  #main-nav ul li {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  #main-nav ul li:first-child {
    border-top: 1px solid rgba(255,255,255,0.06);
  }

  .nav-link {
    display: block;
    padding: 20px 32px;
    font-size: 16px !important;
    letter-spacing: 0.15em;
    transition: color 0.3s, background 0.3s;
  }

  .nav-link:hover,
  .nav-link.active {
    background: rgba(56, 111, 163, 0.1);
    color: var(--accent);
  }

  .nav-link::after {
    display: none;
  }
}

/* =========================================
   SMALL TABLET — Below 768px
   ========================================= */
@media (max-width: 768px) {

  /* === CONTAINER === */
  .container {
    padding: 0 20px;
  }

  /* === SECTIONS === */
  #products,
  #about,
  #services,
  #contact {
    padding: 80px 0;
  }

  /* === SECTION HEADER === */
  .section-header {
    margin-bottom: 44px;
  }

  /* === HERO === */
  #intro {
    padding: 100px 20px 70px;
  }

  .hero-actions {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .hero-actions .btn-primary,
  .hero-actions .btn-ghost {
    width: 100%;
    justify-content: center;
  }

  .hero-stats {
    gap: 20px;
  }

  .stat-num {
    font-size: 28px;
  }

  .stat-suffix {
    font-size: 18px;
  }

  /* === ABOUT VISUAL — Scale down hex === */
  .about-visual {
    height: 300px;
  }

  .hex-container {
    width: 240px;
    height: 240px;
  }

  .hex {
    width: 60px;
    height: 70px;
    font-size: 8px;
  }

  .hex-center {
    width: 76px;
    height: 88px;
    font-size: 11px;
  }

  /* === FOOTER === */
  #footer {
    padding: 60px 0 24px;
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .cert-col {
    grid-column: 1;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
    padding: 24px 0;
  }
}

/* =========================================
   MOBILE — Below 600px
   ========================================= */
@media (max-width: 600px) {

  /* === GLOBAL === */
  html { font-size: 15px; }

  .container {
    padding: 0 16px;
  }

  /* === HEADER === */
  #header {
    height: 64px;
  }

  .header-inner {
    height: 64px;
    padding: 0 16px;
  }

  .logo-image {
    height: 44px;
  }

  /* === HERO === */
  #intro {
    padding: 90px 16px 60px;
    gap: 36px;
  }

  .hero-line {
    font-size: clamp(30px, 9vw, 44px) !important;
  }

  .hero-badge {
    font-size: 9px;
    padding: 6px 12px;
  }

  .hero-desc {
    font-size: 15px;
  }

  .hero-carousel {
    max-width: 100%;
  }

  .carousel-slide {
    padding: 24px 20px;
  }

  /* === PRODUCTS GRID — single column === */
  .products-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .product-card {
    padding: 28px 22px;
  }

  /* === ABOUT === */
  #about {
    padding: 64px 0;
  }

  .about-visual {
    height: 260px;
  }

  .hex-container {
    width: 200px;
    height: 200px;
  }

  .hex {
    width: 52px;
    height: 60px;
    font-size: 7px;
  }

  .hex-center {
    width: 64px;
    height: 74px;
    font-size: 10px;
  }

  .ring-1 { width: 180px; height: 180px; }
  .ring-2 { width: 240px; height: 240px; }

  /* === SERVICES GRID — single column === */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .service-card {
    padding: 32px 22px;
  }

  /* === CONTACT === */
  #contact {
    padding: 64px 0;
  }

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

  .contact-form-wrap {
    padding: 28px 20px;
  }

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

  .btn-submit {
    font-size: 12px;
    padding: 14px;
  }

  /* === FOOTER === */
  #footer {
    padding: 48px 0 20px;
  }

  .footer-main {
    gap: 32px;
  }

  .footer-logo-img {
    height: 44px;
  }

  .cert-col {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
    border-left: none;
    border-top: 2px solid #386FA3;
    padding-left: 0;
    padding-top: 24px;
  }

  .cert-img {
    height: 40px;
    margin-bottom: 0;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .footer-bottom-links {
    gap: 16px;
  }

  /* === BACK TO TOP === */
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}

/* =========================================
   SMALL MOBILE — Below 400px
   ========================================= */
@media (max-width: 400px) {

  .hero-line {
    font-size: clamp(26px, 8.5vw, 36px) !important;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
  }

  .stat-divider {
    display: none;
  }

  .stat {
    min-width: 70px;
  }

  .product-card {
    padding: 22px 18px;
  }

  .service-card {
    padding: 26px 18px;
  }

  .contact-form-wrap {
    padding: 22px 16px;
  }

  .footer-main {
    gap: 28px;
  }

  .cert-col {
    gap: 10px;
  }

  .cert-img {
    height: 34px;
  }

  .section-header h2 {
    font-size: clamp(22px, 7vw, 30px);
  }
}

/* =========================================
   TOUCH DEVICE OPTIMIZATIONS
   ========================================= */
@media (hover: none) and (pointer: coarse) {

  /* Remove hover-dependent card lifts on touch */
  .product-card:hover,
  .service-card:hover {
    transform: none;
  }

  /* Larger tap targets */
  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .btn-primary,
  .btn-ghost {
    min-height: 48px;
  }

  .carousel-btn {
    width: 44px;
    height: 44px;
  }

  .dot {
    width: 10px;
    height: 10px;
    min-width: 10px;
  }

  /* Back to top — always visible on mobile */
  .back-to-top {
    opacity: 1 !important;
  }
}

/* =========================================
   SAFE AREA INSETS (iPhone notch / dynamic island)
   ========================================= */
@supports (padding-top: env(safe-area-inset-top)) {
  #header {
    padding-top: env(safe-area-inset-top);
    height: calc(70px + env(safe-area-inset-top));
  }

  .header-inner {
    height: 70px;
  }

  @media (max-width: 600px) {
    #header {
      height: calc(64px + env(safe-area-inset-top));
    }
  }
}
