/* ============================================================
   MANJU CAD EXPERTS — Mobile Optimization Stylesheet
   Additive only — no existing styles removed.
   ============================================================ */

/* -------------------------------------------------------
   0. GLOBAL — prevent horizontal overflow
------------------------------------------------------- */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* -------------------------------------------------------
   1. MOBILE NAV DRAWER STYLES
------------------------------------------------------- */
#mob-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,0.45);
}
#mob-nav-overlay.open { display: block; }

#mob-nav-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 9999;
  width: min(320px, 88vw);
  background: #fff;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 4px 0 40px rgba(0,0,0,0.15);
  -webkit-overflow-scrolling: touch;
}
#mob-nav-drawer.open { transform: translateX(0); }

#mob-nav-drawer .mob-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 64px;
  border-bottom: 1px solid #e5e5e5;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
#mob-nav-drawer .mob-drawer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
#mob-nav-drawer .mob-drawer-logo img {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: contain;
}
#mob-nav-drawer .mob-drawer-logo span {
  font-size: 15px; font-weight: 700; color: #cc0000;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
#mob-close-btn {
  background: none;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
#mob-nav-drawer nav a {
  display: block;
  padding: 13px 20px;
  font-size: 15px; font-weight: 600; color: #111;
  text-decoration: none;
  border-bottom: 1px solid #f0f0f0;
  transition: color 0.15s, background 0.15s;
}
#mob-nav-drawer nav a:hover,
#mob-nav-drawer nav a.active { color: #cc0000; background: #fff5f5; }

#mob-nav-drawer .mob-courses-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 13px 20px;
  font-size: 15px; font-weight: 600; color: #111;
  background: none; border: none;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer; text-align: left;
}
#mob-nav-drawer .mob-courses-toggle[aria-expanded="true"] { color: #cc0000; }
#mob-nav-drawer .mob-courses-toggle svg {
  transition: transform 0.2s;
  flex-shrink: 0;
}
#mob-nav-drawer .mob-courses-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

#mob-courses-panel { display: none; background: #fafafa; border-bottom: 1px solid #f0f0f0; }
#mob-courses-panel.open { display: block; }

#mob-courses-panel .mob-cat-label {
  padding: 10px 20px 4px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: #cc0000;
}
#mob-courses-panel a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px 9px 24px;
  font-size: 13.5px; font-weight: 500; color: #333;
  text-decoration: none;
  border-bottom: 1px solid #efefef;
}
#mob-courses-panel a:hover { color: #cc0000; background: #fff5f5; }
#mob-courses-panel a img {
  width: 18px; height: 18px;
  object-fit: contain; border-radius: 3px; flex-shrink: 0;
}
#mob-courses-panel .mob-view-all {
  display: block;
  padding: 11px 20px;
  font-size: 13px; font-weight: 700; color: #cc0000;
  border-top: 1px solid #e5e5e5; background: #fff;
}
#mob-nav-drawer .mob-drawer-cta { padding: 16px 20px 24px; }
#mob-nav-drawer .mob-drawer-cta a {
  display: block; text-align: center;
  background: #cc0000; color: #fff;
  font-size: 14px; font-weight: 700;
  padding: 13px; border-radius: 8px;
  text-decoration: none; letter-spacing: 0.03em;
}

/* -------------------------------------------------------
   2. HERO — precise fixes based on actual HTML structure

   Structure:
   <section>
     <div class="relative h-[640px] w-full">   ← slider wrapper
       <img ...> × 3                            ← bg images
       <div class="hero-overlay">               ← gradient
       <div class="container-x ... flex h-full flex-col justify-center">
         <div class="max-w-2xl">               ← headline + buttons
           ...h1, p, buttons...
         </div>
         <div class="mt-8 flex flex-wrap ..."> ← STATS BAR (sibling)
           <div>4190+ Students</div>
           <div>37+ Software</div>
           <div>13+ Years</div>
           <div>93% Placement</div>
         </div>
       </div>
     </div>
   </section>
------------------------------------------------------- */
@media (max-width: 767px) {

  /* 1. Make hero taller so content + stats both fit without overflow */
  .relative.h-\[640px\].w-full {
    height: auto !important;
    min-height: 560px;
  }

  /* 2. The container inside hero: switch from justify-center to
        space-between + padding so headline is near top and stats
        stick to bottom, with breathing room */
  .relative.h-\[640px\].w-full > .container-x {
    justify-content: space-between !important;
    padding-top: 2.5rem !important;
    padding-bottom: 5rem !important; /* room for slide dots */
  }

  /* 3. Headline sizing */
  .relative.h-\[640px\].w-full h1 {
    font-size: clamp(1.8rem, 7vw, 2.5rem) !important;
    line-height: 1.05 !important;
  }

  /* 4. Hero badge pill */
  .relative.h-\[640px\].w-full .fade-up-1.mb-4 {
    font-size: 9px !important;
    padding: 3px 8px !important;
    margin-bottom: 10px !important;
  }

  /* 5. Hero paragraph */
  .relative.h-\[640px\].w-full p {
    font-size: 0.85rem !important;
    margin-top: 0.75rem !important;
  }

  /* 6. Hero buttons — stack vertically, full width */
  .relative.h-\[640px\].w-full .fade-up-3.mt-7 {
    margin-top: 0.75rem !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  .relative.h-\[640px\].w-full .fade-up-3.mt-7 .btn-brand,
  .relative.h-\[640px\].w-full .fade-up-3.mt-7 .btn-ghost {
    width: 100% !important;
    justify-content: center !important;
    padding: 0.7rem 1rem !important;
    font-size: 0.85rem !important;
  }

  /* 7. STATS BAR — the sibling div after max-w-2xl
        It has: mt-8 flex flex-wrap items-center gap-x-4 gap-y-2
        On mobile: make it a 2x2 grid layout */
  .relative.h-\[640px\].w-full .container-x > div.mt-8 {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px 12px !important;
    margin-top: 1rem !important;
    width: 100% !important;
    flex-wrap: unset !important;
  }

  /* Each stat item */
  .relative.h-\[640px\].w-full .container-x > div.mt-8 > div {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px !important;
    background: rgba(0,0,0,0.25) !important;
    border-radius: 8px !important;
    padding: 8px 10px !important;
  }

  /* Stat number */
  .relative.h-\[640px\].w-full .container-x > div.mt-8 .font-display {
    font-size: 1.4rem !important;
    line-height: 1 !important;
  }

  /* Stat label */
  .relative.h-\[640px\].w-full .container-x > div.mt-8 .text-xs {
    font-size: 9px !important;
    white-space: nowrap !important;
  }

  /* 8. Hero overlay — darken more on mobile for legibility */
  .hero-overlay {
    background: linear-gradient(
      160deg,
      rgba(0,0,0,0.80) 0%,
      rgba(0,0,0,0.65) 50%,
      rgba(0,0,0,0.45) 100%
    ) !important;
  }

  /* 9. Slide dots — keep visible */
  .absolute.bottom-6.left-1\/2 {
    bottom: 1.25rem !important;
  }
}

/* Institute image section */
@media (max-width: 767px) {
  [class*="h-[420px]"],
  [class*="h-[520px]"] {
    height: 260px !important;
  }
  [class*="h-[420px]"] .container-x,
  [class*="h-[520px]"] .container-x {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  [class*="h-[420px]"] h2,
  [class*="h-[520px]"] h2 {
    font-size: 1.5rem !important;
  }
  [class*="h-[420px]"] p,
  [class*="h-[520px]"] p {
    font-size: 0.8rem !important;
  }
}

/* -------------------------------------------------------
   3. TYPOGRAPHY SCALING (general sections)
------------------------------------------------------- */
@media (max-width: 767px) {
  h2.font-display { font-size: clamp(1.4rem, 5.5vw, 2rem) !important; }
  h3.font-display { font-size: 1.15rem !important; }
  .text-lg { font-size: 1rem !important; }
}

/* -------------------------------------------------------
   4. SECTION PADDING
------------------------------------------------------- */
@media (max-width: 767px) {
  .py-20 { padding-top: 2.75rem !important; padding-bottom: 2.75rem !important; }
  .py-16 { padding-top: 2.25rem !important; padding-bottom: 2.25rem !important; }
  .py-14 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
  .py-12 { padding-top: 1.75rem !important; padding-bottom: 1.75rem !important; }
}

/* -------------------------------------------------------
   5. CARD GRIDS
------------------------------------------------------- */
@media (max-width: 639px) {
  .grid.gap-5.sm\:grid-cols-2.lg\:grid-cols-3,
  .grid.gap-6.md\:grid-cols-2.lg\:grid-cols-4,
  .grid.gap-5.md\:grid-cols-3 {
    grid-template-columns: 1fr !important;
  }
  [class*="min-h-[260px]"] { min-height: 190px !important; }
  [class*="min-h-[240px]"] { min-height: 170px !important; }
  [class*="min-h-[220px]"] { min-height: 160px !important; }
}

/* -------------------------------------------------------
   6. COURSE DETAIL PAGE — 2-col to 1-col
------------------------------------------------------- */
@media (max-width: 1023px) {
  .lg\:grid-cols-2 { grid-template-columns: 1fr !important; }
  .lg\:grid-cols-2 .relative.overflow-hidden.rounded-2xl img {
    height: 220px; object-fit: cover;
  }
}

/* -------------------------------------------------------
   7. COURSE INFO TABLE
------------------------------------------------------- */
@media (max-width: 599px) {
  table.w-full th,
  table.w-full td { display: block; width: 100% !important; }
  table.w-full th {
    padding-bottom: 2px !important;
    border-bottom: none !important;
    background: #fff5f5 !important;
  }
  table.w-full td {
    padding-top: 6px !important;
    border-bottom: 1px solid #e5e5e5 !important;
  }
  table.w-full tr { display: block; }
}

/* -------------------------------------------------------
   8. SYLLABUS ACCORDION INDENT
------------------------------------------------------- */
@media (max-width: 639px) {
  .space-y-3 ul.pl-16,
  #syllabus ul.pl-16 { padding-left: 1rem !important; }
}

/* -------------------------------------------------------
   9. FOOTER
------------------------------------------------------- */
@media (max-width: 767px) {
  footer .md\:grid-cols-4 { grid-template-columns: 1fr !important; }
  footer .md\:col-span-2  { grid-column: span 1 !important; }
}

/* -------------------------------------------------------
   10. COURSES / GALLERY GRIDS
------------------------------------------------------- */
@media (max-width: 639px) {
  [class*="sm:grid-cols-2"][class*="md:grid-cols-3"],
  [class*="sm:grid-cols-3"],
  [class*="grid-cols-4"] { grid-template-columns: repeat(2,1fr) !important; }
}
@media (max-width: 400px) {
  [class*="grid-cols-4"],
  [class*="sm:grid-cols-3"] { grid-template-columns: 1fr !important; }
}

/* -------------------------------------------------------
   11. BLOG & CONTACT GRIDS
------------------------------------------------------- */
@media (max-width: 767px) {
  [class*="md:grid-cols-2"],
  [class*="md:grid-cols-3"] { grid-template-columns: 1fr !important; }
  input, textarea, select { font-size: 16px !important; } /* prevent iOS zoom */
}

/* -------------------------------------------------------
   12. WHATSAPP FAB
------------------------------------------------------- */
@media (max-width: 767px) {
  .pulse-whatsapp {
    bottom: 16px !important; right: 16px !important;
    width: 52px !important; height: 52px !important;
  }
  .pulse-whatsapp svg { width: 22px !important; height: 22px !important; }
}

/* -------------------------------------------------------
   13. HEADER LOGO on tiny screens
------------------------------------------------------- */
@media (max-width: 360px) {
  header .text-\[10px\] { display: none; }
  header .text-xl.font-bold { font-size: 0.95rem !important; }
}
