/* ============================================================
   KarNit — mobile.css  (load AFTER style.css)
   ============================================================ */


/* ============================================================
   1. HAMBURGER BUTTON
   ============================================================ */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  margin-left: auto;
  z-index: 1300;        /* must be above drawer AND overlay */
  flex-shrink: 0;
  position: relative;
}

.hamburger span {
  display: block;
  width: 26px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.2s ease;
}

.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ============================================================
   2. OVERLAY  (behind drawer, above page content)
   z-index ladder:  page(1) < overlay(1050) < drawer(1100) < hamburger(1300)
   ============================================================ */
.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 60%;           /* STOPS before the drawer — drawer is 62% wide from right */
  background: rgba(0, 0, 0, 0.55);
  z-index: 1050;
  opacity: 0;
  transition: opacity 0.3s ease;
  /* No pointer-events tricks needed — overlay physically cannot overlap the drawer */
}

.nav-overlay.active {
  display: block;
  opacity: 1;
}


/* ============================================================
   3. SIDE DRAWER
   ============================================================ */
@media (max-width: 768px) {

  .hamburger { display: flex; }

  /* Navbar bar: single row, logo left, burger right */
  .navbar .container {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 0;
    padding: 0 16px;
  }

  nav { position: static; width: auto; }

  /* Drawer panel */
  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 62%;
    max-width: 280px;
    background: #111;
    flex-direction: column;
    gap: 0;
    padding-top: 80px;
    box-shadow: -6px 0 24px rgba(0,0,0,0.6);
    border-left: 1px solid rgba(255,255,255,0.08);
    z-index: 1100;        /* above overlay, below hamburger */
    pointer-events: auto; /* always clickable */

    /* Hidden: slid off-screen right */
    display: flex;
    transform: translateX(110%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  }

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

  .nav-links li {
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    pointer-events: auto;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 16px 28px;
    font-size: 15px;
    font-weight: 500;
    color: #ddd;
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
    pointer-events: auto;
    position: relative;
    z-index: 1101;        /* sit above everything inside drawer */
  }

  .nav-links a:hover,
  .nav-links a.active {
    color: #13b1cd;
    background: rgba(19,177,205,0.08);
  }

  /* Kill old mobile overrides */
  .nav-links li:last-child a {
    background: none;
    color: #ddd;
    padding: 16px 28px;
    border-radius: 0;
  }
  .nav-links li:last-child a:hover {
    background: rgba(19,177,205,0.08);
    color: #13b1cd;
  }
}


/* ============================================================
   4. GLOBAL BOX MODEL FIX
   Stops horizontal overflow / accidental side-scroll
   ============================================================ */
html, body {
  overflow-x: hidden;
  width: 100%;
}


/* ============================================================
   5. HERO
   ============================================================ */
@media (max-width: 600px) {
  .hero {
    padding: 70px 20px 40px;
    min-height: 100svh;   /* safe viewport height on mobile browsers */
  }
  .hero h1  { font-size: clamp(1.5rem, 7vw, 2.4rem); line-height: 1.25; }
  .hero p   { font-size: clamp(0.9rem, 4vw, 1.1rem); margin-bottom: 24px; }
  .hero .btn { font-size: 0.9rem; padding: 10px 22px; }
}


/* ============================================================
   6. CONTAINER — edge padding on small screens
   ============================================================ */
@media (max-width: 600px) {
  .container {
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }
}


/* ============================================================
   7. SERVICES
   ============================================================ */
@media (max-width: 600px) {
  .services { padding: 50px 16px; }

  .services-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
  }

  .services-center { order: -1; margin-bottom: 10px; }
  .services-center .section-title { font-size: clamp(1.6rem, 7vw, 2.4rem); }

  .service-card {
    padding: 24px 18px;
    text-align: left;
  }
  .service-card h3 { font-size: 1.05rem; }
  .service-card p  { font-size: 0.9rem; }
}


/* ============================================================
   8. ABOUT
   ============================================================ */
@media (max-width: 600px) {
  .about { padding: 50px 0; }

  .about-container {
    flex-direction: column;
    gap: 28px;
    padding: 0 16px;
  }

  .about-image,
  .about-text {
    min-width: unset;
    width: 100%;
  }

  .about-image img {
    max-height: 210px;
    object-fit: cover;
    width: 100%;
  }

  .about-text h2 { font-size: clamp(1.3rem, 6vw, 1.8rem); }
  .about-text p  { font-size: 0.92rem; }
}


/* ============================================================
   9. CONTACT SECTION
   ============================================================ */
@media (max-width: 600px) {
  .contact { padding: 50px 0; }

  .contact-container { padding: 0 16px; }

  .section-title { font-size: clamp(1.5rem, 7vw, 2.4rem); margin-bottom: 28px; }

  .contact-content {
    flex-direction: column;
    align-items: stretch;
    gap: 32px;
  }

  .contact-form,
  .contact-info {
    min-width: unset;
    max-width: 100%;
    width: 100%;
  }

  .contact-info { text-align: center; }
}

/* Contact form inputs — full width, comfortable size */
@media (max-width: 600px) {
  .contact-form input,
  .contact-form textarea {
    width: 100%;
    font-size: 16px;    /* prevents iOS zoom-in on focus */
    padding: 13px 14px;
  }

  .contact-form textarea { min-height: 120px; }

  .contact-form .btn {
    width: 100%;
    text-align: center;
    min-height: 48px;
  }
}


/* ============================================================
   10. RFQ / QUOTE FORM
   ============================================================ */
@media (max-width: 600px) {
  #quote { padding: 80px 0 50px; }

  #quote .contact-container { padding: 0 16px; }

  #quote .section-title  { font-size: clamp(1.4rem, 7vw, 2.2rem); }
  #quote .section-subtext { font-size: 0.92rem; padding: 0 4px; }

  /* Every input in the quote form */
  #quoteForm input,
  #quoteForm textarea {
    width: 100%;
    font-size: 16px;    /* prevents iOS zoom */
    padding: 13px 14px;
  }

  #quoteForm textarea { min-height: 120px; }

  #quoteForm .btn {
    width: 100%;
    text-align: center;
    min-height: 48px;
  }
}


/* ============================================================
   11. PRODUCTS PAGE
   ============================================================ */
@media (max-width: 600px) {
  .products-hero {
    padding: 90px 16px 40px;
  }
  .products-hero h1 {
    font-size: clamp(1.3rem, 6vw, 1.9rem);
    line-height: 1.3;
  }
  .products-hero p { font-size: 0.92rem; }

  #searchInput {
    width: 100%;
    font-size: 16px;    /* prevent iOS zoom */
    padding: 12px 14px;
  }

  .products-trust {
    font-size: 12px;
    line-height: 1.6;
  }

  .product-category {
    font-size: 1.15rem;
    text-align: center;
    margin: 20px 0 8px;
  }

  .products-footer {
    padding: 50px 16px 60px;
  }
  .products-footer h2 { font-size: 1.3rem; }
  .products-footer p  { font-size: 0.92rem; }
}


/* ============================================================
   12. FOOTER
   ============================================================ */
@media (max-width: 600px) {
  .footer {
    padding: 28px 16px 20px;
    font-size: 0.8rem;
  }

  .footer .container {
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .footer-text { line-height: 2.0; }

  .footer-contacts {
    font-size: 0.76rem;
    line-height: 1.8;
  }

  .footer-content-email { text-align: center; font-size: 0.76rem; }
}


/* ============================================================
   13. TOUCH TARGETS  (min 44px on all interactive elements)
   ============================================================ */
@media (max-width: 768px) {
  .btn,
  .quote-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}
