/* =====================================================
   Hygienic — Complete Mobile Responsive Fix
   Fixes ALL overflow, layout, and spacing issues
   on screens 768px and below
===================================================== */

/* ---- Global overflow fix ---- */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

* {
  box-sizing: border-box !important;
}

img {
  max-width: 100% !important;
  height: auto !important;
}

/* ---- Container ---- */
@media (max-width: 768px) {
  .container {
    width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    margin: 0 auto !important;
    overflow: visible !important;
  }
}

/* ===================================================
   HEADER & NAV
=================================================== */
@media (max-width: 768px) {
  .topbar { display: none !important; }

  .site-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 900 !important;
    background: #fff !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1) !important;
  }

  .header-inner {
    height: 64px !important;
    padding: 0 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .site-logo img {
    height: 44px !important;
    width: auto !important;
    max-width: 160px !important;
  }

  .logo-text {
    font-size: .95rem !important;
  }

  .main-nav { display: none !important; }

  .mobile-menu-btn {
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
    width: 38px !important;
    height: 38px !important;
    padding: 8px !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
  }

  .mobile-menu-btn span {
    display: block !important;
    height: 2px !important;
    width: 100% !important;
    background: #1B5E20 !important;
    border-radius: 2px !important;
  }

  .header-cta .btn {
    display: none !important;
  }

  main#pageMain {
    margin-top: 0 !important;
  }
}

/* ===================================================
   HERO SECTION
=================================================== */
@media (max-width: 768px) {
  .hero-swiper,
  .hero-section section,
  .hero-section > div {
    min-height: 380px !important;
    max-height: 480px !important;
    height: auto !important;
  }

  .hero-slide {
    min-height: 380px !important;
  }

  .hero-content {
    padding: 24px 16px 32px !important;
    max-width: 100% !important;
  }

  .hero-label {
    font-size: .72rem !important;
    padding: 5px 12px !important;
    margin-bottom: 12px !important;
  }

  .hero-title {
    font-size: 1.6rem !important;
    line-height: 1.2 !important;
    margin-bottom: 12px !important;
  }

  .hero-subtitle {
    font-size: .88rem !important;
    line-height: 1.6 !important;
    margin-bottom: 20px !important;
  }

  .hero-btns {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  .hero-btns .btn {
    padding: 11px 20px !important;
    font-size: .85rem !important;
    flex: 1 1 auto !important;
    min-width: 140px !important;
    justify-content: center !important;
  }

  .hero-stats {
    flex-wrap: wrap !important;
    gap: 16px !important;
    margin-top: 24px !important;
    padding-top: 20px !important;
  }

  .hero-stat { min-width: 80px !important; }

  .hero-stat-num { font-size: 1.4rem !important; }

  .hero-stat-label { font-size: .68rem !important; }

  /* Swiper controls */
  .hero-swiper .swiper-button-prev,
  .hero-swiper .swiper-button-next {
    width: 36px !important;
    height: 36px !important;
  }
  .hero-swiper .swiper-button-prev::after,
  .hero-swiper .swiper-button-next::after {
    font-size: .8rem !important;
  }
}

/* ===================================================
   FEATURES STRIP
=================================================== */
@media (max-width: 768px) {
  .features-strip { padding: 16px 0 !important; }

  .features-strip-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }

  .feature-strip-item {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 8px !important;
    padding: 14px 10px !important;
    background: rgba(255,255,255,0.1) !important;
    border-radius: 10px !important;
  }

  .feature-strip-icon {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.1rem !important;
    margin: 0 auto !important;
  }

  .feature-strip-text strong { font-size: .82rem !important; }
  .feature-strip-text span   { font-size: .72rem !important; }
}

/* ===================================================
   ABOUT SECTION
=================================================== */
@media (max-width: 768px) {
  .about-section { padding: 32px 0 !important; }

  .about-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
  }

  .about-image-wrap {
    position: relative !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .about-img-main {
    width: 100% !important;
    height: 260px !important;
    object-fit: cover !important;
    border-radius: 16px !important;
  }

  .about-img-placeholder {
    width: 100% !important;
    aspect-ratio: 4/3 !important;
    font-size: 4rem !important;
    border-radius: 16px !important;
  }

  .about-img-secondary {
    width: 45% !important;
    right: -10px !important;
    bottom: -15px !important;
    border-width: 3px !important;
  }

  .about-badge {
    top: 16px !important;
    right: 8px !important;
    padding: 12px 16px !important;
  }

  .about-badge-num { font-size: 1.5rem !important; }
  .about-badge-label { font-size: .7rem !important; }

  .about-text { width: 100% !important; }

  .about-features {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .about-feature { font-size: .88rem !important; }

  .about-text .btn {
    width: 100% !important;
    justify-content: center !important;
    margin-top: 4px !important;
  }
}

/* ===================================================
   CATEGORIES
=================================================== */
@media (max-width: 768px) {
  .cats-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .cat-card {
    padding: 20px 12px !important;
    border-radius: 14px !important;
  }

  .cat-icon {
    width: 54px !important;
    height: 54px !important;
    font-size: 1.3rem !important;
    margin-bottom: 10px !important;
  }

  .cat-name { font-size: .82rem !important; }
}

@media (max-width: 400px) {
  .cats-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ===================================================
   PRODUCTS GRID
=================================================== */
@media (max-width: 768px) {
  .products-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .product-card { border-radius: 14px !important; }

  .product-card-img {
    aspect-ratio: 4/3 !important;
  }

  .product-card-body { padding: 12px !important; }

  .product-cat-name { font-size: .68rem !important; }

  .product-card-name {
    font-size: .88rem !important;
    margin-bottom: 4px !important;
  }

  .product-card-desc { display: none !important; }

  .product-meta {
    font-size: .72rem !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
  }

  .product-card-footer {
    flex-direction: column !important;
    gap: 6px !important;
  }

  .product-card-footer .btn {
    font-size: .75rem !important;
    padding: 8px 10px !important;
    width: 100% !important;
    justify-content: center !important;
  }
}

/* ===================================================
   STATS SECTION
=================================================== */
@media (max-width: 768px) {
  .stats-section { padding: 28px 0 !important; }

  .stats-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0 !important;
  }

  .stat-item {
    padding: 20px 12px !important;
    border-right: 1px solid rgba(255,255,255,0.1) !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
  }

  .stat-num { font-size: 1.8rem !important; }
  .stat-label { font-size: .7rem !important; margin-top: 6px !important; }
  .stat-icon { font-size: 1.4rem !important; margin-bottom: 10px !important; }
}

/* ===================================================
   WHY CHOOSE US
=================================================== */
@media (max-width: 768px) {
  .why-section { padding: 32px 0 !important; }

  .why-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
  }

  .why-image { display: none !important; }

  .why-content { padding: 0 !important; }

  .why-content .section-title,
  .why-content .section-label,
  .why-content .section-subtitle,
  .why-content .divider { text-align: left !important; margin-left: 0 !important; }

  .why-features { gap: 16px !important; margin-top: 24px !important; }

  .why-feature {
    display: flex !important;
    gap: 14px !important;
    align-items: flex-start !important;
  }

  .why-feature-icon {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.1rem !important;
    flex-shrink: 0 !important;
  }

  .why-feature h4 { font-size: .92rem !important; margin-bottom: 3px !important; }
  .why-feature p  { font-size: .82rem !important; }

  .why-content .btn {
    width: 100% !important;
    justify-content: center !important;
    margin-top: 24px !important;
    display: flex !important;
  }
}

/* ===================================================
   SERVICES GRID
=================================================== */
@media (max-width: 768px) {
  .services-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .service-card {
    padding: 22px 18px !important;
    border-radius: 14px !important;
  }

  .service-icon {
    width: 54px !important;
    height: 54px !important;
    font-size: 1.3rem !important;
    margin-bottom: 14px !important;
  }

  .service-title { font-size: 1rem !important; }
  .service-desc  { font-size: .85rem !important; }
}

/* ===================================================
   TESTIMONIALS
=================================================== */
@media (max-width: 768px) {
  .testimonials-section { padding: 32px 0 !important; }

  .testimonial-card { padding: 22px 18px !important; }

  .testimonial-text { font-size: .88rem !important; line-height: 1.7 !important; }

  .testimonial-name { font-size: .92rem !important; }
  .testimonial-position { font-size: .75rem !important; }
}

/* ===================================================
   PARTNERS
=================================================== */
@media (max-width: 768px) {
  .partners-section { padding: 24px 0 !important; }
}

/* ===================================================
   BLOG GRID
=================================================== */
@media (max-width: 768px) {
  .blog-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .blog-card { border-radius: 14px !important; }
  .blog-card-img { aspect-ratio: 16/9 !important; }
  .blog-card-body { padding: 16px !important; }
  .blog-card-title { font-size: .95rem !important; }
  .blog-card-excerpt { font-size: .83rem !important; }
}

/* ===================================================
   FAQ
=================================================== */
@media (max-width: 768px) {
  .faq-list { max-width: 100% !important; }
  .faq-question { padding: 16px !important; font-size: .88rem !important; }
  .faq-answer { font-size: .85rem !important; }
  .faq-answer.open { padding: 14px 16px !important; }
}

/* ===================================================
   CTA SECTION
=================================================== */
@media (max-width: 768px) {
  .cta-section { padding: 40px 20px !important; }

  .cta-section h2 {
    font-size: 1.3rem !important;
    margin-bottom: 12px !important;
  }

  .cta-section p { font-size: .88rem !important; margin-bottom: 24px !important; }

  .cta-section .btn {
    display: flex !important;
    width: 100% !important;
    justify-content: center !important;
    max-width: 320px !important;
    margin: 0 auto 10px !important;
  }

  .cta-section > .container > div > div {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
  }
}

/* ===================================================
   PAGE HEADER
=================================================== */
@media (max-width: 768px) {
  .page-header {
    padding: 28px 16px 24px !important;
  }

  .page-header h1 {
    font-size: 1.5rem !important;
    line-height: 1.2 !important;
  }

  .page-header p { font-size: .85rem !important; margin-top: 8px !important; }

  .breadcrumb { font-size: .72rem !important; margin-bottom: 10px !important; flex-wrap: wrap !important; }
}

/* ===================================================
   SECTION TYPOGRAPHY
=================================================== */
@media (max-width: 768px) {
  .section         { padding: 36px 0 !important; }
  .section-sm      { padding: 24px 0 !important; }
  .section-lg      { padding: 48px 0 !important; }
  .section-head    { margin-bottom: 24px !important; }
  .section-title   { font-size: 1.4rem !important; }
  .section-label   { font-size: .7rem !important; }
  .section-subtitle { font-size: .88rem !important; max-width: 100% !important; }
}

/* ===================================================
   ABOUT PAGE
=================================================== */
@media (max-width: 768px) {
  /* Mission/Vision/Values 3-col → 1-col */
  .about-section + section .services-grid,
  div[style*="grid-template-columns:repeat(3"] {
    grid-template-columns: 1fr !important;
  }

  /* Certs 4-col → 2-col */
  div[style*="grid-template-columns:repeat(4"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 14px !important;
  }

  /* Team grid */
  .team-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
  }

  .team-photo-wrap {
    width: 100px !important;
    height: 100px !important;
  }

  .team-name { font-size: .92rem !important; }
  .team-position { font-size: .75rem !important; }
  .team-bio { font-size: .78rem !important; }
}

/* ===================================================
   SERVICES PAGE
=================================================== */
@media (max-width: 768px) {
  /* How it works steps 4-col → 2-col */
  div[style*="grid-template-columns:repeat(4,1fr)"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
  }

  /* Clients grid 3-col → 1-col */
  .why-section div[style*="grid-template-columns:repeat(3"] {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
}

/* ===================================================
   PRODUCTS PAGE
=================================================== */
@media (max-width: 768px) {
  /* Full-width layout — remove sidebar */
  .products-section .container > div[style*="display:flex"],
  .products-section .container > div[style*="display: flex"] {
    flex-direction: column !important;
    gap: 16px !important;
  }

  /* Hide desktop sidebar */
  .products-section aside {
    width: 100% !important;
    position: static !important;
  }

  /* Category scroll — horizontal on mobile */
  .products-section aside .ap-card:first-child > div:first-child {
    display: flex !important;
    overflow-x: auto !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    padding: 12px !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    background: #fff !important;
    border-radius: 12px !important;
  }

  .products-section aside .ap-card:first-child > div:first-child::-webkit-scrollbar {
    display: none !important;
  }

  .products-section aside .ap-card:first-child > div:first-child a {
    display: inline-flex !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    padding: 7px 14px !important;
    border-radius: 50px !important;
    font-size: .8rem !important;
    background: #F3F4F6 !important;
    color: #374151 !important;
    text-decoration: none !important;
  }

  /* Hide the help box sidebar on mobile */
  .products-section aside > div:nth-child(2) {
    display: none !important;
  }
}

/* ===================================================
   CONTACT PAGE
=================================================== */
@media (max-width: 768px) {
  .contact-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
  }

  .contact-form-wrap {
    padding: 22px 16px !important;
    border-radius: 16px !important;
  }

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

  .form-control {
    font-size: 16px !important; /* prevents iOS zoom */
  }

  select.form-control { font-size: 16px !important; }

  .contact-info-list { gap: 16px !important; }

  .contact-info-item { gap: 12px !important; }

  .contact-info-icon {
    width: 44px !important;
    height: 44px !important;
    font-size: 1rem !important;
    flex-shrink: 0 !important;
  }

  .map-wrap { height: 260px !important; }

  /* Quick contact buttons — stack */
  div[style*="display:flex;gap:10px;flex-wrap:wrap"] {
    flex-direction: column !important;
  }

  div[style*="display:flex;gap:10px;flex-wrap:wrap"] .btn {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* ===================================================
   BLOG PAGE
=================================================== */
@media (max-width: 768px) {
  /* Blog layout — remove sidebar */
  .blog-grid[style*="grid-template-columns:repeat(2"] {
    grid-template-columns: 1fr !important;
  }

  /* Sidebar hidden on mobile */
  .blog-section > .container > div > aside,
  section[style*="cream"] .container > div > aside {
    display: none !important;
  }

  /* Full width main content */
  section[style*="cream"] .container > div > div:first-child {
    flex: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
  }
}

/* ===================================================
   BLOG POST PAGE
=================================================== */
@media (max-width: 768px) {
  article { max-width: 100% !important; }

  /* Post layout — remove sidebar */
  .section .container > div[style*="display:flex;gap"] {
    flex-direction: column !important;
  }

  .section .container aside[style*="280px"] {
    width: 100% !important;
    position: static !important;
  }

  /* Share buttons */
  div[style*="display:flex;align-items:center;gap:16px;flex-wrap:wrap"] {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
}

/* ===================================================
   FOOTER
=================================================== */
@media (max-width: 768px) {
  .footer-top { padding: 32px 0 24px !important; }

  .footer-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .footer-col:nth-child(2),
  .footer-col:nth-child(3) {
    display: none !important;
  }

  .footer-title { font-size: .92rem !important; margin-bottom: 14px !important; }

  .footer-desc { font-size: .82rem !important; }

  .footer-contact-list li { font-size: .82rem !important; }

  .footer-certs { flex-wrap: wrap !important; gap: 6px !important; }

  .cert-badge { font-size: .68rem !important; padding: 4px 10px !important; }

  .footer-social a {
    width: 34px !important;
    height: 34px !important;
    font-size: .8rem !important;
  }

  .footer-bottom { padding: 14px 0 !important; }

  .footer-bottom-inner {
    flex-direction: column !important;
    text-align: center !important;
    gap: 8px !important;
  }

  .copyright { font-size: .75rem !important; }

  .footer-bottom-links {
    justify-content: center !important;
    gap: 14px !important;
    flex-wrap: wrap !important;
    font-size: .75rem !important;
  }
}

/* ===================================================
   QUOTE PAGE
=================================================== */
@media (max-width: 768px) {
  .section .container > div[style*="grid-template-columns:1fr 380px"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
  }

  div[style*="width:380px"],
  div[style*="width: 380px"] {
    width: 100% !important;
  }
}

/* ===================================================
   PRODUCT DETAIL PAGE
=================================================== */
@media (max-width: 768px) {
  div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  div[style*="grid-template-columns:1fr 1fr"] > div {
    width: 100% !important;
  }

  div[style*="display:grid;grid-template-columns:1fr 1fr;gap:14px"] {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ===================================================
   ADMIN IMAGES / PAGE BUILDER (mobile usability)
=================================================== */
@media (max-width: 768px) {
  .ig-grid {
    grid-template-columns: 1fr !important;
  }

  .pb-grid2, .pb-grid3 {
    grid-template-columns: 1fr !important;
  }

  .pb-layout { flex-direction: column !important; }
  .pb-sidebar { width: 100% !important; position: static !important; }
}

/* ===================================================
   WHATSAPP & BACK-TO-TOP
=================================================== */
@media (max-width: 768px) {
  .whatsapp-float {
    bottom: 80px !important;
    right: 14px !important;
    width: 50px !important;
    height: 50px !important;
    font-size: 1.4rem !important;
  }

  .back-to-top {
    bottom: 140px !important;
    right: 14px !important;
    width: 40px !important;
    height: 40px !important;
    font-size: .82rem !important;
  }
}

/* ===================================================
   NEWSLETTER POPUP
=================================================== */
@media (max-width: 768px) {
  .newsletter-popup { padding: 12px !important; align-items: flex-end !important; }

  .newsletter-popup-inner {
    padding: 28px 18px 32px !important;
    border-radius: 20px 20px 0 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
}

/* ===================================================
   BUTTONS — prevent overflow
=================================================== */
@media (max-width: 480px) {
  .btn-lg {
    padding: 13px 22px !important;
    font-size: .9rem !important;
  }

  .btn {
    max-width: 100% !important;
    white-space: normal !important;
    word-break: break-word !important;
  }
}

/* ===================================================
   GENERAL UTILITY — prevent horizontal scroll
=================================================== */
@media (max-width: 768px) {
  table { display: block !important; overflow-x: auto !important; }

  pre, code {
    white-space: pre-wrap !important;
    word-break: break-word !important;
  }

  /* Any inline style with fixed widths that can overflow */
  [style*="min-width:220px"],
  [style*="min-width: 220px"] {
    min-width: 0 !important;
    width: 100% !important;
  }

  /* Section head alignment */
  .section-head { text-align: center !important; }
  .section-head.left { text-align: left !important; }

  /* Divider */
  .divider { margin: 14px auto 0 !important; }
  .section-head.left .divider,
  .about-text .divider,
  .why-content .divider { margin-left: 0 !important; margin-right: auto !important; }

  /* Grids that should collapse */
  .ap-form-grid { grid-template-columns: 1fr !important; }
  .ap-stats-grid { grid-template-columns: 1fr 1fr !important; }
  .ap-grid-2 { grid-template-columns: 1fr !important; }
  .ap-content-layout { grid-template-columns: 1fr !important; }
}
