/* ============================================================
   DGWO — MOBILE RESPONSIVE STYLESHEET v4
   Clean, breathing-space focused, solid header, world-class mobile UX
   ============================================================ */

/* ---- Global: no horizontal scroll ---- */
html, body { 
  overflow-x: hidden !important; 
  background-color: var(--bg-base);
}
/* Ensure header/footer logos keep their exact sizes on desktop */
.logo img,
header .logo img {
  height: 48px !important;
  width: auto !important;
}

footer .logo img {
  height: 62px !important;
  width: auto !important;
}

*, *::before, *::after { box-sizing: border-box; max-width: 100%; }
img:not([src*="logo"]):not(.logo img) { max-width: 100% !important; height: auto !important; }


/* ============================================================
   TABLET  ≤ 1024px
   ============================================================ */
@media screen and (max-width: 1024px) {

  .container { width: 92% !important; padding: 0 1rem !important; }

  /* All inline grids → 1 column (except 2-column grids) */
  div[style*="display:grid"]:not(.services-grid):not([data-mobile-keep-grid]),
  section[style*="display:grid"]:not(.services-grid):not([data-mobile-keep-grid]) {
    display: flex !important;
    flex-direction: column !important;
    gap: 2rem !important;
  }

  /* Section padding */
  section[style*="padding:5rem 0"],
  section[style*="padding:6rem 0"],
  section[style*="padding:7rem 0"],
  section[style*="padding:5rem 0 0 0"] {
    padding: 3.5rem 0 !important;
  }

  /* Global Pass inner container */
  div[style*="padding:4rem 5rem"] {
    padding: 2.5rem 1.5rem !important;
  }
}

/* ============================================================
   MOBILE  ≤ 768px
   ============================================================ */
@media screen and (max-width: 768px) {

  /* ---- Container ---- */
  .container { width: 90% !important; padding: 0 1rem !important; }

  /* ---- SOLID compact header to prevent overlap with scrolling content ---- */
  .header { 
    height: 54px !important; 
    background-color: var(--bg-surface) !important;
    background: var(--bg-surface) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06) !important;
  }
  main { margin-top: 54px !important; }

  /* Logo smaller */
  .header .logo img,
  header img[alt="DGWO Logo"] {
    height: 28px !important;
    width: auto !important;
  }

  /* Burger button — comfortable tap */
  .burgerBtn { padding: 0.5rem !important; }

  /* Mobile menu top offset matches new header height */
  .mobileMenu { 
    top: 54px !important; 
    height: calc(100vh - 54px) !important;
    background-color: var(--bg-surface) !important;
  }

  /* ---- ALL SECTIONS: breathing space ---- */
  section, section[style] {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  /* ---- ALL INLINE GRIDS → single column with gap ---- */
  div[style*="display:grid"]:not(.services-grid):not([data-mobile-keep-grid]),
  section[style*="display:grid"]:not(.services-grid):not([data-mobile-keep-grid]) {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.75rem !important;
    width: 100% !important;
    align-items: stretch !important;
  }

  /* Every direct child gets full width */
  div[style*="display:grid"]:not(.services-grid):not([data-mobile-keep-grid]) > *,
  section[style*="display:grid"]:not(.services-grid):not([data-mobile-keep-grid]) > * {
    width: 100% !important;
    max-width: 100% !important;
    flex-shrink: 0 !important;
  }

  /* ---- SERVICES GRID: 2 COLUMNS ON MOBILE ---- */
  .services-grid,
  div.services-grid[style],
  div[data-mobile-keep-grid="true"] {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
    width: 100% !important;
  }

  .services-grid > *,
  div.services-grid[style] > *,
  div[data-mobile-keep-grid="true"] > * {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1.15rem 0.65rem !important;
    box-sizing: border-box !important;
  }

  .services-grid .service-card h3,
  .services-grid h3 {
    font-size: 0.88rem !important;
    margin-bottom: 0.35rem !important;
    line-height: 1.25 !important;
  }

  .services-grid .service-card p,
  .services-grid p {
    font-size: 0.76rem !important;
    line-height: 1.35 !important;
  }

  .services-grid div[style*="width:50px"] {
    width: 40px !important;
    height: 40px !important;
    margin-bottom: 0.6rem !important;
    border-radius: 10px !important;
  }

  .services-grid div[style*="width:50px"] svg,
  .services-grid div[style*="width:50px"] i {
    width: 20px !important;
    height: 20px !important;
  }

  /* ---- FONT SIZES ---- */
  [style*="font-size:4rem"]   { font-size: 2.2rem  !important; line-height: 1.15 !important; }
  [style*="font-size:3.5rem"] { font-size: 1.85rem !important; line-height: 1.2 !important; }
  [style*="font-size:3rem"]   { font-size: 1.7rem  !important; line-height: 1.2 !important; }
  [style*="font-size:2.8rem"] { font-size: 1.6rem  !important; line-height: 1.2 !important; }
  [style*="font-size:2.6rem"] { font-size: 1.5rem  !important; line-height: 1.25 !important; }
  [style*="font-size:2.5rem"] { font-size: 1.45rem !important; line-height: 1.2 !important; }
  [style*="font-size:2rem"]   { font-size: 1.3rem  !important; line-height: 1.2 !important; }
  [style*="font-size:1.8rem"] { font-size: 1.15rem !important; }
  [style*="font-size:1.5rem"] { font-size: 1.05rem !important; }
  [style*="font-size:1.2rem"] { font-size: 1rem    !important; }

  /* ---- HERO ---- */
  #hero-section {
    padding: 2.5rem 0 !important;
    min-height: auto !important;
  }

  /* Prevent text slides from collapsing and overlapping with below image */
  .hero-slides-container {
    min-height: 310px !important;
    position: relative !important;
  }

  /* Hero grid container */
  #hero-section .container > div[style] {
    display: flex !important;
    flex-direction: column !important;
    gap: 2.5rem !important;
    text-align: center !important;
  }

  /* Hero right image column — hide on mobile */
  #hero-section .container > div > div:last-child[style*="position:relative"][style*="display:flex"] {
    display: none !important;
  }

  /* Hero text column → center */
  #hero-section .container > div > div:first-child {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    width: 100% !important;
  }

  #hero-section [style*="font-size:2rem"][style*="font-weight:800"] {
    font-size: 1.7rem !important;
    text-align: center !important;
  }

  /* Hero CTA buttons */
  #hero-section [style*="display:flex"][style*="gap:1rem"],
  #hero-section [style*="display:flex"][style*="gap:0.75rem"] {
    justify-content: center !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    gap: 0.75rem !important;
  }

  /* Hero dots */
  #hero-section [style*="display:flex; gap:8px"] {
    justify-content: center !important;
    margin-top: 1rem !important;
  }

  /* ---- WHY CHOOSE DGWO ---- */
  .why-choose-img {
    max-height: none !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 12px !important;
    width: 100% !important;
  }

  /* ---- CTA SECTION ---- */
  section[style*="padding:7rem 0"] {
    padding: 3rem 0 !important;
  }

  section[style*="padding:7rem 0"] h2 {
    font-size: 1.5rem !important;
    margin-bottom: 1rem !important;
  }

  section[style*="padding:7rem 0"] p[style*="font-size:1.2rem"] {
    font-size: 0.95rem !important;
    margin-bottom: 1.5rem !important;
  }

  /* ---- GLOBAL PASS ---- */
  section[style*="padding:5rem 0 0 0"] { padding: 0 !important; }

  div[style*="background:#b88835"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.75rem !important;
    padding: 2.25rem 1.25rem !important;
    border-radius: 12px !important; /* Premium rounded container */
    align-items: stretch !important;
  }

  div[style*="background:#b88835"] h2 {
    font-size: 1.5rem !important;
  }

  div[style*="background:#b88835"] p[style*="font-size:1.15rem"] {
    font-size: 0.9rem !important;
    margin-bottom: 1rem !important;
  }

  /* ₹999 card (supports both index.php beige and other forms) */
  div[style*="background:#fff3cd"],
  div[style*="background:#fef3c7"],
  div[style*="background:#fffbeb"],
  div[style*="background:#f4efe6"],
  div[style*="background: #f4efe6"] {
    width: 100% !important;
    padding: 2rem 1.5rem !important;
    margin: 0 !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
  }

  /* Benefits list items — clean wrap and layout */
  div[style*="background:#b88835"] li {
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
    font-size: 1rem !important;
    line-height: 1.4 !important;
    margin-bottom: 0.5rem !important;
    flex-wrap: nowrap !important;
  }

  div[style*="background:#b88835"] li svg,
  div[style*="background:#b88835"] li i {
    flex-shrink: 0 !important;
    margin-top: 0.15rem !important;
  }

  /* ---- SUCCESS STORIES ---- */
  section[style*="background:#fff8f0"],
  section[style*="background:var(--bg-primary); padding:5rem"][style*="Success"],
  section[style*="background:#fffdf9"] {
    padding: 2.5rem 0 !important;
  }

  /* Reset the offset layout of images on mobile */
  div[style*="display:flex"][style*="gap:1rem"] > div[style*="transform:translateY"] {
    transform: none !important;
  }

  /* Before/After images side by side height */
  div[style*="display:flex"][style*="gap:1rem"] img {
    height: 180px !important;
    object-fit: cover !important;
    border-radius: 12px !important;
  }

  /* ---- B2B PROGRAMS ---- */
  div[style*="background:#fff"][style*="border-radius:20px"][style*="padding:2.5rem"],
  div[style*="background:#fff"][style*="border-radius:20px"][style*="padding:2rem"] {
    padding: 1.5rem !important;
  }

  /* B2B stats: keep 2-col grid */
  div[style*="grid-template-columns:1fr 1fr"][style*="gap:2rem"] {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1.25rem !important;
    flex-direction: unset !important;
  }

  /* B2B stat box padding */
  div[style*="border-left:2px solid #d4af37"] {
    padding-left: 0.75rem !important;
    padding-right: 0.5rem !important;
  }

  div[style*="border-left:2px solid #d4af37"] [style*="font-size:1.8rem"] {
    font-size: 1.35rem !important;
  }

  /* ---- HEALTH BLOG ---- */
  .blog-cards-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 2rem !important;
  }

  .blog-card-item {
    border-radius: 16px !important;
  }

  .blog-card-img {
    height: 180px !important;
  }

  .blog-card-body {
    padding: 1.5rem !important;
  }

  /* ---- CONTACT SECTION ---- */
  div[style*="border-radius:24px; padding:3.5rem"],
  div[style*="border-radius:24px; padding:2.5rem"] {
    padding: 1.5rem 1.25rem !important;
    margin-bottom: 0 !important;
  }

  /* Name/Email row inside contact form → stack */
  form div[style*="display:grid"][style*="1fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
  }

  /* ---- INPUTS ---- */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  textarea,
  select {
    width: 100% !important;
    font-size: 16px !important;
  }

  /* ---- BUTTONS ---- */
  .btn { min-height: 44px !important; }

  /* Flex rows with justify-content:center */
  [style*="justify-content:center"][style*="display:flex"] {
    flex-wrap: wrap !important;
    gap: 0.75rem !important;
  }

  /* ---- EXPERTS CAROUSEL ---- */
  #experts-viewport {
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%) !important;
    mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%) !important;
  }

  /* ---- FOOTER ---- */
  .footer { padding: 3rem 0 1.5rem !important; }
  .footer .container:not(.bottom) {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 2rem !important;
  }

  /* ---- GENERAL SPACING FIXES ---- */
  /* Remove excessive margins pushed by block conversion */
  div[style*="display:grid"] > * + * { margin-top: 0 !important; }

  /* Inline padding overrides that are too large */
  [style*="padding:6rem"] { padding: 2.5rem 1.25rem !important; }
  [style*="padding:5rem"] { padding: 2rem 1.25rem !important; }
  [style*="padding:4rem 5rem"] { padding: 2rem 1.25rem !important; }
  [style*="padding:3.5rem"] { padding: 1.5rem 1.25rem !important; }
  [style*="padding:3rem"] { padding: 1.5rem 1.15rem !important; }
  [style*="padding:2.5rem"] { padding: 1.5rem 1.25rem !important; }
  
  [style*="gap:6rem"] { gap: 2rem !important; }
  [style*="gap:4rem"] { gap: 1.75rem !important; }
  [style*="gap:3rem"] { gap: 1.5rem !important; }

  /* Sticky sidebars static on mobile */
  .sidebar,
  .sidebarCard,
  form.sidebar[style*="position: sticky"],
  div.sidebarCard[style*="position: sticky"] {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 2rem !important;
  }

  /* Events list card layout fix */
  div[style*="grid-template-columns: 300px 1fr"],
  div[style*="grid-template-columns:300px 1fr"] {
    display: flex !important;
    flex-direction: column !important;
  }
  div[style*="grid-template-columns: 300px 1fr"] > div:first-child,
  div[style*="grid-template-columns:300px 1fr"] > div:first-child {
    border-right: none !important;
    border-bottom: 1px solid var(--border) !important;
    height: auto !important;
    min-height: 150px !important;
    padding: 2rem 1rem !important;
  }

  /* Image banner height overrides */
  [style*="height:400px"],
  [style*="height:450px"] {
    height: 220px !important;
  }

  /* B2B Card custom padding override */
  div[style*="background:#fff"][style*="border-radius:16px"][style*="padding:3rem"] {
    padding: 1.75rem 1.25rem !important;
    box-shadow: -4px 4px 0px #b8862d, 0 10px 20px rgba(0,0,0,0.05) !important;
  }
}

/* ============================================================
   SMALL MOBILE  ≤ 480px
   ============================================================ */
@media screen and (max-width: 480px) {

  .container { width: 94% !important; padding: 0 0.75rem !important; }

  /* Header logo compact */
  header img[alt="DGWO Logo"] { height: 24px !important; }

  /* Section breathing */
  section, section[style] { padding-top: 2rem !important; padding-bottom: 2rem !important; }

  /* Expert card width */
  #experts-scroll-track > div { width: 240px !important; }

  /* Footer → single col */
  .footer .container:not(.bottom) { grid-template-columns: 1fr !important; gap: 1.5rem !important; }

  /* B2B stats → single col */
  div[style*="grid-template-columns:1fr 1fr"][style*="gap:2rem"] {
    grid-template-columns: 1fr !important;
  }

  /* Comfortable buttons */
  .btn { padding: 0.65rem 1.2rem !important; font-size: 0.9rem !important; }

  /* Before/After height smaller */
  div[style*="display:flex"][style*="gap:1rem"] img {
    height: 130px !important;
  }
}

/* ============================================================
   FRANCHISE SECTION MOBILE UI/UX EXPERT STYLES
   ============================================================ */
.franchise-banner-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
}

.franchise-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2.25rem;
}

.franchise-metric-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.franchise-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

@media screen and (max-width: 991px) {
  .franchise-banner-grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }
  .franchise-highlights-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .franchise-hero-grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }
}

@media screen and (max-width: 768px) {
  .franchise-banner-section {
    padding: 3rem 0 !important;
  }
  .franchise-banner-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 2rem !important;
    text-align: left !important;
  }
  .franchise-metrics-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.4rem !important;
    margin-bottom: 1.75rem !important;
  }
  .franchise-metric-badge {
    flex-direction: column !important;
    text-align: center !important;
    padding: 0.75rem 0.25rem !important;
    gap: 0.3rem !important;
    justify-content: center !important;
    border-radius: 10px !important;
  }
  .franchise-metric-badge i {
    width: 18px !important;
    height: 18px !important;
  }
  .franchise-metric-badge div div:first-child {
    font-size: 0.85rem !important;
    font-weight: 800 !important;
  }
  .franchise-metric-badge div div:last-child {
    font-size: 0.62rem !important;
    letter-spacing: -0.2px !important;
  }
  .franchise-btn-group {
    display: flex !important;
    flex-direction: row !important; /* side by side */
    width: 100% !important;
    gap: 0.65rem !important;
    align-items: center !important;
  }
  .franchise-btn-group a {
    flex: 1 1 0% !important;
    width: 50% !important;
    text-align: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    padding: 0.75rem 0.4rem !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    border-radius: 50px !important;
  }
  .franchise-preview-card {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    margin: 0.5rem 0 0 0 !important;
    border-radius: 16px !important;
  }
  .franchise-preview-card img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    object-fit: cover !important;
  }
  .franchise-highlights-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }
  .franchise-form-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  .franchise-hero-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 2rem !important;
  }
}

