/* ==========================================================================
   CoreX Native Mobile App Experience (90%+ Mobile & Ads Traffic Engine)
   1. Zero Overflow & Viewport Fixes
   2. Native App Bottom Dock (iOS/Android Tab Bar)
   3. Thumb-Friendly Touch Targets & Horizontal Package Swiping
   4. Safe Area Support for iPhone Notches & Dynamic Island
   ========================================================================== */

/* 1. Viewport & Overflow Safety */
html, body {
  overflow-x: hidden !important;
  max-width: 100% !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* 2. Mobile Responsive Overrides (max-width: 768px) */
@media (max-width: 768px) {
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Hide old redundant floating button on mobile */
  .corex-whatsapp {
    display: none !important;
  }

  /* Sales Toast Positioning above Dock */
  .cx-sales-toast {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
    left: 14px !important;
    right: 14px !important;
    max-width: none !important;
    padding: 10px 14px !important;
  }

  /* Fix Hero Headline on Mobile (Prevent text cutoff) */
  .mxd-hero-special .mxd-hero-05__wrap {
    padding-top: 100px !important;
    padding-bottom: 24px !important;
    padding-inline: 16px !important;
  }

  .mxd-hero-special .mxd-hero-05__headline,
  .mxd-hero-05__headline {
    width: 100% !important;
    max-width: 100% !important;
    padding-top: 12px !important;
    padding-bottom: 16px !important;
    padding-inline: 0 !important;
    margin: 0 auto !important;
  }

  .mxd-hero-special .mxd-hero-05__headline h1,
  .mxd-hero-05__headline h1 {
    font-size: clamp(28px, 7.8vw, 36px) !important;
    line-height: 1.18 !important;
    letter-spacing: -0.025em !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    text-wrap: balance !important;
    margin: 0 auto !important;
    text-align: center !important;
  }

  .corex-home-intro {
    font-size: 15px !important;
    line-height: 1.55 !important;
    max-width: 100% !important;
    padding-inline: 8px !important;
    margin: 14px auto 0 !important;
  }

  /* 2-Column Hero action buttons on mobile (Side-by-Side) */
  .corex-home-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    width: 100% !important;
    max-width: 440px !important;
    margin: 18px auto 0 !important;
    padding-inline: 0 !important;
    gap: 10px !important;
  }

  .corex-home-actions a {
    width: 100% !important;
    min-height: 48px !important;
    padding: 10px 8px !important;
    border-radius: 12px !important;
    font-size: clamp(12px, 3.3vw, 14px) !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  /* Search bar */
  .cx-hero-search {
    width: 100% !important;
    max-width: 100% !important;
    margin: 18px 0 !important;
  }

  /* Trust Strip (Under Search Button) - 2-Column Compact Mobile App Dashboard */
  .cx-trust-strip {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    padding: 12px 10px !important;
    margin: 16px auto 24px !important;
    border-radius: 16px !important;
    width: calc(100% - 24px) !important;
    max-width: 500px !important;
  }

  /* Our Clients - 4 per row on mobile with last cell as View All Clients */
  .cx-brand-table-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1px !important;
  }
  .cx-brand-table-cell {
    height: 70px !important;
    padding: 6px 4px !important;
  }
  .cx-brand-table-cell img {
    max-height: 28px !important;
    max-width: 82% !important;
  }
  .cx-brand-table-cta {
    grid-column: span 1 !important;
    height: 70px !important;
    padding: 4px !important;
    text-align: center !important;
    flex-direction: column !important;
    gap: 2px !important;
  }
  .cx-brand-table-cta span {
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    display: block !important;
  }
  .cx-trust-item {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px !important;
  }
  .cx-trust-icon {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border-radius: 10px !important;
  }
  .cx-trust-icon svg {
    width: 16px !important;
    height: 16px !important;
  }
  .cx-trust-data strong {
    font-size: 13px !important;
    line-height: 1.2 !important;
  }
  .cx-trust-data span {
    font-size: 10px !important;
    line-height: 1.25 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    opacity: 0.75 !important;
  }

  /* Horizontal Swipeable Category Tabs (App Style) */
  .cx-filter-tabs {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 4px 16px 8px !important;
    margin: 0 -16px 20px !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
  }
  .cx-filter-tabs::-webkit-scrollbar {
    display: none !important;
  }
  .cx-filter-btn {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    font-size: 13px !important;
    padding: 9px 18px !important;
    border-radius: 999px !important;
  }

  /* Package Cards 2-Column Mobile Grid */
  .cx-products-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .cx-prod-card {
    border-radius: 14px !important;
    padding: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .cx-prod-media {
    height: 105px !important;
  }
  .cx-prod-media img {
    height: 100% !important;
    object-fit: cover !important;
  }
  .cx-prod-badge {
    top: 6px !important;
    left: 6px !important;
    font-size: 8.5px !important;
    padding: 2px 6px !important;
  }
  .cx-prod-body {
    padding: 10px 9px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
  }
  .cx-prod-cat {
    font-size: 9px !important;
    margin-bottom: 4px !important;
  }
  .cx-prod-title {
    font-size: 12.5px !important;
    line-height: 1.25 !important;
    margin: 0 0 6px !important;
    min-height: 32px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }
  .cx-prod-desc {
    display: none !important;
  }
  .cx-prod-deliverables {
    display: none !important;
  }
  .cx-prod-price-box {
    margin-top: auto !important;
    padding-top: 6px !important;
    margin-bottom: 8px !important;
  }
  .cx-prod-price-label {
    font-size: 8.5px !important;
  }
  .cx-prod-price {
    font-size: 16px !important;
    line-height: 1 !important;
  }
  .cx-prod-price small {
    font-size: 10px !important;
  }
  .cx-prod-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
  .cx-prod-actions a {
    min-height: 34px !important;
    padding: 6px 10px !important;
    font-size: 11px !important;
    border-radius: 8px !important;
    justify-content: center !important;
  }
  .cx-prod-btn-details {
    display: none !important;
  }
  .cx-prod-actions .cx-prod-btn-order {
    width: 100% !important;
  }

  /* Client Grid Table safe bottom padding for Mobile Dock */
  .cx-clients-section {
    padding: 40px 0 90px !important;
  }

  /* Native Mobile App Dock */
  .cx-mobile-dock {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 99998 !important;
    height: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    background: rgba(15, 23, 42, 0.94) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35) !important;
    justify-content: space-around !important;
    align-items: center !important;
  }

  html[color-scheme="light"] .cx-mobile-dock,
  [data-theme="light"] .cx-mobile-dock {
    background: rgba(255, 255, 255, 0.94) !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08) !important;
  }

  .cx-dock-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    flex: 1 !important;
    height: 100% !important;
    color: rgba(255, 255, 255, 0.65) !important;
    text-decoration: none !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    transition: color 0.15s ease, transform 0.15s ease !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  html[color-scheme="light"] .cx-dock-item,
  [data-theme="light"] .cx-dock-item {
    color: #64748b !important;
  }

  .cx-dock-item:active {
    transform: scale(0.92) !important;
  }

  .cx-dock-item.cx-dock-active {
    color: #ff4a2a !important;
  }

  html[color-scheme="light"] .cx-dock-item.cx-dock-active,
  [data-theme="light"] .cx-dock-item.cx-dock-active {
    color: #ff4a2a !important;
  }

  /* Center Floating 1$ Boost Action Button */
  .cx-dock-hero-boost {
    position: relative !important;
    margin-top: -18px !important;
  }

  .cx-dock-boost-bubble {
    position: relative !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #ff4a2a 0%, #ea580c 100%) !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 18px rgba(255, 74, 42, 0.55) !important;
    border: 2px solid rgba(255, 255, 255, 0.25) !important;
    animation: cx-dock-pulse 3s infinite ease-in-out;
  }

  @keyframes cx-dock-pulse {
    0%, 100% {
      transform: scale(1);
      box-shadow: 0 4px 18px rgba(255, 74, 42, 0.55);
    }
    50% {
      transform: scale(1.05);
      box-shadow: 0 6px 24px rgba(255, 74, 42, 0.85);
    }
  }

  .cx-dock-boost-badge {
    position: absolute !important;
    top: -8px !important;
    right: -8px !important;
    background: #10b981 !important;
    color: #ffffff !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    padding: 1px 6px !important;
    border-radius: 999px !important;
    border: 1.5px solid #ffffff !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
  }

  .cx-dock-hero-boost span:last-child {
    font-weight: 700 !important;
    color: #ff4a2a !important;
    margin-top: 2px !important;
  }

  .cx-dock-wa svg {
    color: #25d366 !important;
  }
}

/* Hide Dock on Desktop */
@media (min-width: 769px) {
  .cx-mobile-dock {
    display: none !important;
  }
}

/* ==========================================================================
   Header Mobile Touch Fix & Z-Index Layering
   ========================================================================== */
#header,
.mxd-header {
  position: absolute !important;
  z-index: 100 !important;
  pointer-events: auto !important;
}

.mxd-header__controls {
  position: relative !important;
  z-index: 101 !important;
  pointer-events: auto !important;
}

.corex-header-search-btn {
  position: relative !important;
  z-index: 102 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
}

.corex-header-search-btn * {
  pointer-events: none !important;
}

/* Guarantee hero-wrap does not block header clicks */
.mxd-hero-05__wrap {
  pointer-events: none !important;
}
.mxd-hero-05__wrap > * {
  pointer-events: auto !important;
}
.mxd-hero-05__headline,
.corex-home-actions,
.corex-home-actions a {
  pointer-events: auto !important;
}

/* ==========================================================================
   Mobile Auto Water-Drop Floating Hero Showcase
   "auto water drop er moto hiro section e desktop er moto image gulo
    jeno auto joom out theke joom in hoy ba joom in thke out hoy
    ak sate 5-10 ta aktar por akta smothly jate sondor lage mobile e"
   ========================================================================== */
.cx-mobile-hero-drops {
  display: none;
}

@media (max-width: 900px) {
  .cx-mobile-hero-drops {
    display: block !important;
    position: absolute !important;
    top: 104px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: calc(100% - 104px) !important;
    pointer-events: none !important;
    overflow: hidden !important;
    z-index: 1 !important;
  }

  .cx-drop-item {
    position: absolute !important;
    pointer-events: none !important;
    will-change: transform, opacity !important;
    animation: cxWaterDropZoom ease-in-out infinite alternate !important;
    opacity: 0;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .cx-drop-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45)) drop-shadow(0 2px 6px rgba(255, 74, 42, 0.15)) !important;
    pointer-events: none !important;
    user-select: none !important;
  }

  /* Specific positions & sizes framing the hero area (Safe from header & text) */
  .cx-drop-1 {
    top: 6%;
    left: 2%;
    width: 44px;
    height: 44px;
    animation-duration: 5.6s !important;
    animation-delay: 0s !important;
  }

  .cx-drop-2 {
    top: 5%;
    right: 3%;
    width: 48px;
    height: 48px;
    animation-duration: 6.2s !important;
    animation-delay: 1.4s !important;
  }

  .cx-drop-3 {
    top: 30%;
    left: 1%;
    width: 50px;
    height: 50px;
    animation-duration: 5.8s !important;
    animation-delay: 2.6s !important;
  }

  .cx-drop-4 {
    top: 32%;
    right: 2%;
    width: 48px;
    height: 48px;
    animation-duration: 6.6s !important;
    animation-delay: 0.8s !important;
  }

  .cx-drop-5 {
    top: 52%;
    left: 2%;
    width: 44px;
    height: 44px;
    animation-duration: 5.4s !important;
    animation-delay: 3.2s !important;
  }

  .cx-drop-6 {
    top: 50%;
    right: 3%;
    width: 48px;
    height: 48px;
    animation-duration: 6.4s !important;
    animation-delay: 1.8s !important;
  }

  .cx-drop-7 {
    top: 72%;
    left: 4%;
    width: 46px;
    height: 46px;
    animation-duration: 5.9s !important;
    animation-delay: 2.2s !important;
  }

  .cx-drop-8 {
    top: 70%;
    right: 4%;
    width: 48px;
    height: 48px;
    animation-duration: 6.8s !important;
    animation-delay: 3.8s !important;
  }

  .cx-drop-9 {
    top: 82%;
    left: 22%;
    width: 40px;
    height: 40px;
    animation-duration: 6.0s !important;
    animation-delay: 4.4s !important;
  }

  .cx-drop-10 {
    top: 84%;
    right: 22%;
    width: 42px;
    height: 42px;
    animation-duration: 6.5s !important;
    animation-delay: 5.0s !important;
  }

  @keyframes cxWaterDropZoom {
    0% {
      transform: scale(0.18) translateY(10px) rotate(-4deg);
      opacity: 0;
      filter: blur(2px);
    }
    20% {
      opacity: 0.55;
      filter: blur(0px);
    }
    48% {
      transform: scale(1.04) translateY(-4px) rotate(2deg);
      opacity: 0.70;
    }
    65% {
      transform: scale(0.96) translateY(2px) rotate(-1deg);
      opacity: 0.60;
    }
    82% {
      opacity: 0.45;
      filter: blur(0px);
    }
    100% {
      transform: scale(0.14) translateY(-10px) rotate(5deg);
      opacity: 0;
      filter: blur(3px);
    }
  }
}

