/* CloudDevNest Mobile App — bottom dock like native app */
@media (max-width: 991.98px) {
  :root {
    --mobile-nav-height: 78px;
    --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
    --mobile-nav-active: #3b82f6;
    --mobile-nav-active-dark: #2563eb;
    --site-header-offset: 100px;
  }

  /* ===== BOTTOM DOCK ===== */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9999 !important;
    min-height: calc(var(--mobile-nav-height) + var(--mobile-safe-bottom));
    padding: 10px 8px calc(8px + var(--mobile-safe-bottom));
    background: #ffffff;
    border-top: none;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -8px 32px rgba(37, 99, 235, 0.14);
    align-items: center;
    justify-content: space-around;
    gap: 4px;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .mobile-bottom-nav .mobile-nav-item {
    flex: 1;
    min-width: 0;
    max-width: 88px;
    border: none;
    background: transparent;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 6px;
    border-radius: 14px;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
  }

  .mobile-bottom-nav .mobile-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    line-height: 1;
  }

  .mobile-bottom-nav .mobile-nav-icon i {
    font-size: 1.15rem;
    color: var(--mobile-nav-active);
    transition: color 0.2s ease;
  }

  .mobile-bottom-nav .mobile-nav-label {
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1.1;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    transition: color 0.2s ease;
  }

  /* Active tab — blue pill like reference app */
  .mobile-bottom-nav .mobile-nav-item.active {
    background: linear-gradient(135deg, var(--mobile-nav-active) 0%, var(--mobile-nav-active-dark) 100%);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  }

  .mobile-bottom-nav .mobile-nav-item.active .mobile-nav-icon i,
  .mobile-bottom-nav .mobile-nav-item.active .mobile-nav-label {
    color: #ffffff !important;
  }

  .mobile-bottom-nav .mobile-nav-external .mobile-nav-icon i {
    color: #25d366;
  }

  /* ===== FRONTEND ===== */
  body.cd-app-frontend {
    background: #f1f5f9;
    padding-bottom: calc(var(--mobile-nav-height) + var(--mobile-safe-bottom) + 4px);
  }

  body.cd-app-frontend .main-navbar .navbar-toggler,
  body.cd-app-frontend .main-navbar .navbar-collapse,
  body.cd-app-frontend .navbar-cta-mobile {
    display: none !important;
  }

  body.cd-app-frontend .main-navbar {
    top: 0;
    padding: 0.5rem 0;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
  }

  body.cd-app-frontend .main-navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  body.cd-app-frontend .mobile-header-actions {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
  }

  body.cd-app-frontend .mobile-header-call {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6, #10b981);
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
  }

  body.cd-app-frontend .floating-widget {
    display: none !important;
  }

  body.cd-app-frontend .chatbot-modal {
    bottom: calc(var(--mobile-nav-height) + var(--mobile-safe-bottom) + 8px);
  }

  /* More menu sheet */
  .mobile-more-sheet {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    visibility: hidden;
  }

  .mobile-more-sheet.open {
    pointer-events: auto;
    visibility: visible;
  }

  .mobile-more-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    opacity: 0;
    transition: opacity 0.25s ease;
  }

  .mobile-more-sheet.open .mobile-more-backdrop {
    opacity: 1;
  }

  .mobile-more-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 1rem 1rem calc(var(--mobile-nav-height) + var(--mobile-safe-bottom) + 1rem);
    transform: translateY(100%);
    transition: transform 0.28s ease;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
  }

  .mobile-more-sheet.open .mobile-more-panel {
    transform: translateY(0);
  }

  .mobile-more-handle {
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: #cbd5e1;
    margin: 0 auto 1rem;
  }

  .mobile-more-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.85rem;
  }

  .mobile-more-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
  }

  .mobile-more-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 600;
    border: none;
    background: transparent;
    padding: 0;
  }

  .mobile-more-link .mobile-more-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #3b82f6;
    font-size: 1.1rem;
  }

  .mobile-more-link.urgent .mobile-more-icon {
    background: linear-gradient(135deg, #3b82f6, #10b981);
    color: #fff;
  }

  .mobile-more-link.whatsapp .mobile-more-icon {
    background: #dcfce7;
    color: #16a34a;
  }

  .mobile-more-link.call .mobile-more-icon {
    background: #fee2e2;
    color: #ef4444;
  }

  /* ===== ADMIN ===== */
  body.cd-app-admin {
    background: #eef2f7;
  }

  body.cd-app-admin .admin-wrapper {
    padding-bottom: calc(var(--mobile-nav-height) + var(--mobile-safe-bottom) + 4px);
  }

  body.cd-app-admin .admin-navbar {
    padding: 0.65rem 1rem;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  }

  body.cd-app-admin .admin-navbar #sidebarToggleMobile {
    display: none !important;
  }

  body.cd-app-admin .admin-navbar .navbar-breadcrumb {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
  }

  body.cd-app-admin .admin-navbar #userDropdown {
    font-size: 0;
    padding: 0.25rem;
  }

  body.cd-app-admin .admin-navbar #userDropdown i {
    font-size: 1.4rem;
  }

  body.cd-app-admin .admin-navbar .dropdown-toggle::after {
    display: none;
  }

  body.cd-app-admin .admin-main {
    padding: 0.75rem;
  }

  body.cd-app-admin .page-header,
  body.cd-app-admin .card,
  body.cd-app-admin .stat-card,
  body.cd-app-admin .admin-table .table-responsive {
    border-radius: 14px;
  }

  body.cd-app-admin .page-header {
    padding: 1rem;
    margin-bottom: 0.75rem;
  }

  body.cd-app-admin .page-title {
    font-size: 1.3rem;
  }

  body.cd-app-admin .admin-sidebar.show {
    z-index: 10001;
  }

  body.cd-app-admin .sidebar-overlay.show {
    z-index: 10000;
  }

  body.cd-app-admin .dataTables_wrapper {
    padding: 0.25rem 0;
  }

  body.cd-app-admin .admin-mobile-card-actions .btn {
    font-size: 0.78rem;
    padding: 0.45rem 0.55rem;
  }

  body.cd-app-admin .team-status-toggle {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* ===== FRONTEND MOBILE PAGE POLISH ===== */
  html.cd-mobile-view {
    scroll-padding-top: calc(var(--site-header-offset, 92px) + 8px);
  }

  body.cd-app-frontend .site-main > section:first-child {
    padding-top: calc(var(--site-header-offset, 92px) + 1.35rem) !important;
    padding-bottom: 2rem !important;
    overflow: visible !important;
  }

  body.cd-app-frontend .site-main > section.bg-primary:first-child {
    background: linear-gradient(165deg, #1e3a8a 0%, #2563eb 52%, #3b82f6 100%) !important;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
  }

  body.cd-app-frontend .site-main > section:first-child [data-aos] {
    transform: none !important;
    opacity: 1 !important;
  }

  body.cd-app-frontend .site-main > section:first-child .display-4 {
    font-size: 1.7rem !important;
    line-height: 1.28 !important;
    letter-spacing: -0.025em;
    margin-bottom: 0.85rem !important;
    word-wrap: break-word;
  }

  body.cd-app-frontend .site-main > section:first-child .lead {
    font-size: 0.94rem !important;
    line-height: 1.65 !important;
    margin-bottom: 1.15rem !important;
    font-weight: 400;
    opacity: 0.96;
  }

  body.cd-app-frontend .site-main > section:first-child .d-flex.gap-3 {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.65rem !important;
  }

  body.cd-app-frontend .site-main > section:first-child .btn-lg {
    width: 100%;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 0.72rem 1.15rem;
    border-radius: 12px;
    min-height: 46px;
  }

  body.cd-app-frontend .site-main > section:first-child .btn-light {
    color: #1e40af;
    border: none;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  }

  body.cd-app-frontend .site-main > section:first-child .btn-outline-light {
    border-width: 1.5px;
    color: #fff;
  }

  body.cd-app-frontend .site-main > section:first-child .row.align-items-center > .col-lg-6:last-child {
    margin-top: 1.35rem;
  }

  body.cd-app-frontend .site-main > section:first-child .media-frame,
  body.cd-app-frontend .site-main > section:first-child img.rounded-3 {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 16px !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22) !important;
  }

  body.cd-app-frontend .site-main .display-5 {
    font-size: 1.42rem !important;
    line-height: 1.3 !important;
  }

  body.cd-app-frontend .site-main section.py-5:not(:first-child) {
    padding-top: 2.35rem !important;
    padding-bottom: 2.35rem !important;
  }

  body.cd-app-frontend .site-main .container {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  body.cd-app-frontend .site-main section.bg-light .row.g-4.text-center {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
  }

  body.cd-app-frontend .site-main section.bg-light .row.g-4.text-center > [class*="col-"] {
    width: 100%;
    max-width: 100%;
    padding: 0.85rem 0.5rem;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  }

  body.cd-app-frontend .site-main section.bg-light .stat-number.display-4 {
    font-size: 1.55rem !important;
    line-height: 1.1;
    margin-bottom: 0.25rem;
  }

  body.cd-app-frontend .site-main section.bg-light .stat-label {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    line-height: 1.35;
  }

  body.cd-app-frontend .main-navbar {
    min-height: 64px;
    padding: 0.5rem 0 !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  }

  body.cd-app-frontend .main-navbar .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  body.cd-app-frontend .main-navbar .navbar-brand img {
    width: 34px;
    height: 34px;
  }

  body.cd-app-frontend .main-navbar .brand-text {
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -0.02em;
  }

  body.cd-app-frontend .mobile-header-call {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
  }

  /* ===== MOBILE FOOTER ===== */
  body.cd-app-frontend .footer-chocolate {
    padding: 2rem 0 calc(var(--mobile-nav-height) + var(--mobile-safe-bottom) + 1.25rem) !important;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    margin-top: 0.5rem;
  }

  body.cd-app-frontend .footer-chocolate .container {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  body.cd-app-frontend .footer-chocolate .row > .col-lg-2.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  body.cd-app-frontend .footer-chocolate .row > .col-lg-4.mb-4:first-child {
    margin-bottom: 1.25rem !important;
  }

  body.cd-app-frontend .footer-chocolate .col-lg-4 > .d-flex img {
    max-width: 130px;
    height: auto;
  }

  body.cd-app-frontend .footer-chocolate .footer-tagline {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.65rem !important;
  }

  body.cd-app-frontend .footer-chocolate .footer-description {
    font-size: 0.88rem;
    line-height: 1.65;
    color: rgba(241, 245, 249, 0.88);
    margin-bottom: 0;
  }

  body.cd-app-frontend .footer-chocolate .footer-heading {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.85rem !important;
    padding-bottom: 0.35rem;
  }

  body.cd-app-frontend .footer-chocolate .footer-heading::after {
    width: 28px;
    height: 2px;
  }

  body.cd-app-frontend .footer-chocolate .footer-links li {
    margin-bottom: 0.15rem;
  }

  body.cd-app-frontend .footer-chocolate .footer-link {
    font-size: 0.88rem;
    padding: 0.3rem 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }

  body.cd-app-frontend .footer-chocolate .contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem !important;
  }

  body.cd-app-frontend .footer-chocolate .contact-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
  }

  body.cd-app-frontend .footer-chocolate .contact-label {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.85;
  }

  body.cd-app-frontend .footer-chocolate .contact-value {
    font-size: 0.88rem;
    line-height: 1.45;
    word-break: break-word;
  }

  body.cd-app-frontend .footer-chocolate .social-links-chocolate {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
  }

  body.cd-app-frontend .footer-chocolate .social-link {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
  }

  body.cd-app-frontend .footer-bottom {
    margin-top: 1.25rem;
    padding-top: 1.15rem;
    padding-bottom: 0.25rem;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
  }

  body.cd-app-frontend .footer-bottom .row {
    row-gap: 1rem;
    text-align: center;
  }

  body.cd-app-frontend .footer-bottom .col-md-6.text-md-end {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center !important;
    gap: 0.55rem;
  }

  body.cd-app-frontend .footer-copyright {
    font-size: 0.8rem;
    line-height: 1.5;
    color: rgba(226, 232, 240, 0.85);
  }

  body.cd-app-frontend .footer-legal-link {
    font-size: 0.78rem;
  }

  body.cd-app-frontend .footer-comm-btn {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }

  /* Services / portfolio cards on mobile */
  body.cd-app-frontend .service-card,
  body.cd-app-frontend .portfolio-card,
  body.cd-app-frontend .modern-card {
    padding: 1.25rem !important;
    border-radius: 16px !important;
  }

  body.cd-app-frontend .service-card .service-title,
  body.cd-app-frontend .portfolio-card h4,
  body.cd-app-frontend .portfolio-card h5 {
    font-size: 1.05rem !important;
  }

  body.cd-app-frontend .site-main > .blog-hero:first-child {
    padding-top: calc(var(--site-header-offset, 92px) + 1.25rem) !important;
    padding-bottom: 1.75rem !important;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
  }

  body.cd-app-frontend .blog-hero-title {
    font-size: 1.55rem !important;
    line-height: 1.28 !important;
  }

  body.cd-app-frontend .blog-hero-subtitle {
    font-size: 0.92rem !important;
    line-height: 1.6 !important;
  }

  body.cd-app-frontend .blog-hero [data-aos] {
    transform: none !important;
    opacity: 1 !important;
  }

  body.cd-app-frontend .hero-slider-section .hero-slide .display-3 {
    font-size: 1.65rem !important;
    line-height: 1.25 !important;
  }

  body.cd-app-frontend .hero-slider-section .hero-slide .lead {
    font-size: 0.92rem !important;
    line-height: 1.6 !important;
  }

  body.cd-app-frontend .hero-slider-section .hero-slide .btn-lg {
    font-size: 0.88rem;
    padding: 0.65rem 1.1rem;
  }
}

@media (min-width: 992px) {
  .mobile-bottom-nav,
  .mobile-more-sheet,
  .mobile-header-actions {
    display: none !important;
  }
}
