/**
 * InBio Custom Theme - Native App-Style Mobile Stylesheet
 * Applied strictly for mobile screens (<= 768px). Desktop layout (>= 769px) is untouched.
 *
 * @package InBio_Custom
 */

/* ==========================================================================
   DESKTOP DEFAULT GUARDS (Hidden on >= 769px)
   ========================================================================== */
@media (min-width: 769px) {
  .mobile-bottom-tabbar,
  .mobile-services-sheet,
  .mobile-sheet-backdrop,
  .mobile-service-sticky-cta,
  .mobile-nav-services-submenu,
  .mobile-nav-accordion-toggle {
    display: none !important;
  }
}

/* ==========================================================================
   MOBILE NATIVE APP EXPERIENCE (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {

  /* Global micro-interactions & touch optimization */
  html, body {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
  }

  body.has-mobile-tabbar {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body.mobile-nav-open,
  body.sheet-open {
    overflow: hidden !important;
    touch-action: none;
  }

  button,
  a,
  input,
  select,
  textarea {
    touch-action: manipulation;
  }

  /* Active tap feedback */
  .btn-neumorphic:active,
  .card-neumorphic:active,
  .mobile-tab-btn:active,
  .sheet-service-card:active {
    transform: scale(0.97);
  }

  /* --------------------------------------------------------------------------
     1. SLIM STICKY HEADER (60px) & HIDE ON SCROLL DOWN
     -------------------------------------------------------------------------- */
  .site-header {
    height: 60px !important;
    min-height: 60px !important;
    background: rgba(238, 241, 245, 0.94) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    transition: transform 250ms ease, background 0.25s ease, box-shadow 0.25s ease !important;
  }

  .site-header.is-hidden {
    transform: translateY(-100%) !important;
  }

  .site-header.is-sticky {
    box-shadow: 0 4px 16px rgba(163, 177, 198, 0.3) !important;
  }

  .header-inner {
    height: 60px !important;
  }

  /* Brand */
  .header-brand .brand-avatar {
    width: 40px !important;
    height: 40px !important;
  }

  .header-brand .brand-avatar svg {
    width: 40px !important;
    height: 40px !important;
  }

  .header-brand .brand-name {
    font-size: 14.5px !important;
    letter-spacing: 0.5px !important;
  }

  /* Hide "Request Quote" button in navbar on mobile */
  .header-actions .btn-hire-me {
    display: none !important;
  }

  /* Hamburger touch target (min 44x44px) */
  .hamburger-btn {
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 0 !important;
    border-radius: 10px !important;
  }

  .hamburger-btn span {
    width: 22px !important;
    height: 2px !important;
    background: var(--color-heading) !important;
    border-radius: 2px !important;
    transition: transform 0.2s ease, opacity 0.2s ease !important;
  }

  /* --------------------------------------------------------------------------
     MOBILE NAVIGATION DRAWER (Slide-in from right)
     -------------------------------------------------------------------------- */
  .mobile-nav-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 27, 45, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .mobile-nav-backdrop.is-active {
    opacity: 1;
    visibility: visible;
  }

  .mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 86vw);
    height: 100dvh;
    background: var(--bg-primary);
    z-index: 1060;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overscroll-behavior: contain;
  }

  .mobile-nav-drawer.is-active {
    transform: translateX(0);
  }

  .mobile-drawer-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 18px 20px 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 16px;
  }

  .mobile-close-btn {
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    font-size: 30px;
    line-height: 1;
    color: var(--color-heading);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
  }

  .mobile-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .mobile-nav-link {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 14px;
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    color: var(--color-heading);
    border-radius: 12px;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .mobile-nav-link.active,
  .mobile-nav-link:hover {
    color: var(--accent-dark);
    background: var(--accent-soft);
  }

  /* Services Accordion inside Drawer */
  .mobile-nav-services-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .mobile-nav-accordion-toggle {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--color-heading);
    cursor: pointer;
    transition: transform 0.25s ease;
  }

  .mobile-nav-accordion-toggle[aria-expanded="true"] {
    transform: rotate(180deg);
    color: var(--accent-dark);
  }

  .mobile-nav-services-submenu {
    list-style: none;
    padding: 6px 0 8px 18px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-left: 2px solid var(--accent);
    margin-left: 14px;
  }

  .mobile-nav-sublink {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 6px 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-body);
    border-radius: 8px;
  }

  .mobile-nav-sublink:hover,
  .mobile-nav-sublink:active {
    color: var(--accent-dark);
    background: var(--accent-soft);
  }

  .sublink-dot {
    color: var(--accent);
    font-size: 18px;
    line-height: 1;
  }

  .mobile-drawer-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
  }

  .mobile-drawer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .mobile-drawer-action-btn {
    padding: 12px 10px;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  /* --------------------------------------------------------------------------
     2. APP-STYLE BOTTOM TAB BAR (4 Tabs with Cyan Indicator Pill)
     -------------------------------------------------------------------------- */
  .mobile-bottom-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(163, 177, 198, 0.35);
    border-top: 1px solid rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 990;
  }

  .mobile-tab-btn {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 100%;
    background: transparent;
    border: none;
    text-decoration: none;
    color: var(--color-muted);
    cursor: pointer;
    transition: color 0.15s ease;
    padding: 4px 0;
  }

  .mobile-tab-icon {
    transition: transform 0.15s ease, stroke 0.15s ease;
  }

  .mobile-tab-label {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
  }

  .mobile-tab-pill {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: transparent;
    transition: background 0.2s ease;
  }

  .mobile-tab-btn.active {
    color: var(--accent-dark);
  }

  .mobile-tab-btn.active .mobile-tab-icon {
    stroke: var(--accent-dark);
    transform: translateY(-1px);
  }

  .mobile-tab-btn.active .mobile-tab-pill {
    background: var(--accent);
  }

  /* --------------------------------------------------------------------------
     SERVICES NATIVE BOTTOM SHEET (2-Column Grid)
     -------------------------------------------------------------------------- */
  .mobile-sheet-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 27, 45, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1020;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
  }

  .mobile-sheet-backdrop.is-open {
    opacity: 1;
    visibility: visible;
  }

  .mobile-services-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 84dvh;
    background: var(--bg-primary);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -8px 35px rgba(0, 0, 0, 0.25);
    z-index: 1030;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    padding: 12px 18px calc(20px + env(safe-area-inset-bottom, 0px));
    overscroll-behavior: contain;
  }

  .mobile-services-sheet.is-open {
    transform: translateY(0);
  }

  .sheet-drag-handle {
    width: 38px;
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    margin: 0 auto 12px;
  }

  .sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
  }

  .sheet-title {
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 800;
    color: var(--color-heading);
    margin: 0;
  }

  .sheet-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    border: none;
    font-size: 24px;
    color: var(--color-heading);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .sheet-services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 2px 14px;
  }

  .sheet-service-card {
    background: var(--card-gradient);
    border-radius: 14px;
    padding: 14px 12px;
    box-shadow: var(--shadow-neumorphic-sm);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: transform 0.15s ease;
  }

  .sheet-service-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .sheet-service-name {
    font-family: var(--font-heading);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--color-heading);
    margin: 0;
    line-height: 1.3;
  }

  .sheet-service-short {
    font-size: 11px;
    color: var(--color-body);
    margin: 0;
    line-height: 1.35;
  }

  .sheet-footer {
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
  }

  /* --------------------------------------------------------------------------
     FLOATING WHATSAPP BUTTON (Above Tab Bar: bottom: 84px)
     -------------------------------------------------------------------------- */
  .floating-whatsapp-btn {
    position: fixed;
    right: 18px;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #25D366;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 989;
    text-decoration: none;
    transition: transform 0.2s ease;
  }

  .floating-whatsapp-btn:active {
    transform: scale(0.92);
  }

  /* Back to Top moved to bottom left on mobile */
  .back-to-top {
    left: 18px !important;
    right: auto !important;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important;
    width: 44px !important;
    height: 44px !important;
  }

  /* --------------------------------------------------------------------------
     3. HOME PAGE SECTIONS ON MOBILE
     -------------------------------------------------------------------------- */
  /* Hero */
  .hero-section {
    padding: 30px 0 40px !important;
  }

  .hero-grid {
    grid-template-columns: 1fr !important;
    gap: 30px !important;
    text-align: left !important;
  }

  .hero-title {
    font-size: clamp(26px, 7.5vw, 34px) !important;
    line-height: 1.22 !important;
    margin-bottom: 14px !important;
  }

  .hero-desc {
    font-size: 14.5px !important;
    line-height: 1.65 !important;
    margin-bottom: 22px !important;
  }

  .hero-actions {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .hero-actions .btn-neumorphic {
    flex: 1 !important;
    padding: 13px 8px !important;
    font-size: 12.5px !important;
    justify-content: center !important;
    text-align: center !important;
  }

  /* Direct contact icons in single row */
  .hero-social-strip {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 10px !important;
    padding-bottom: 4px !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Hero image wrapper & popped-out head */
  .hero-image-wrapper {
    max-width: 330px !important;
    margin: 10px auto 0 !important;
  }

  .badge-floating {
    transform: scale(0.82) !important;
    transform-origin: center !important;
  }

  .badge-left {
    left: -10px !important;
  }

  .badge-right {
    right: -10px !important;
  }

  /* Services Grid (Compact 2-Column Cards) */
  .services-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

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

  .service-card .service-title {
    font-size: 14px !important;
    margin-bottom: 6px !important;
    line-height: 1.3 !important;
  }

  .service-card .service-desc {
    font-size: 12px !important;
    line-height: 1.45 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  /* Testimonials Slider (Hide Arrows, Dots Below) */
  .testimonials-nav {
    display: none !important;
  }

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

  /* Home Blog Cards (Horizontal Swipe with Scroll-Snap) */
  .home-blog-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    gap: 14px !important;
    padding: 8px 4px 18px !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .home-blog-grid .blog-card {
    flex: 0 0 84% !important;
    max-width: 84% !important;
    scroll-snap-align: start !important;
  }

  /* FAQ Accordion (56px min tap area) */
  .faq-header {
    min-height: 56px !important;
    padding: 16px 14px !important;
  }

  .faq-question {
    font-size: 14.5px !important;
  }

  /* Forms & Inputs */
  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .inbio-input,
  .form-group select.inbio-input {
    height: 52px !important;
    font-size: 16px !important; /* Prevents auto-zoom on iOS */
    border-radius: 12px !important;
  }

  .inbio-textarea {
    font-size: 16px !important;
  }

  .btn-submit {
    width: 100% !important;
    min-height: 52px !important;
    font-size: 14px !important;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    text-align: left !important;
  }

  /* --------------------------------------------------------------------------
     4. SERVICE PAGES, ABOUT & BLOG ON MOBILE
     -------------------------------------------------------------------------- */
  .service-banner-title {
    font-size: clamp(24px, 6.5vw, 32px) !important;
    line-height: 1.25 !important;
  }

  /* Breadcrumb single line horizontal scroll */
  .breadcrumbs {
    white-space: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 4px !important;
  }

  .service-hero-actions {
    flex-direction: column !important;
    width: 100% !important;
    gap: 10px !important;
  }

  .service-hero-actions .btn-neumorphic {
    width: 100% !important;
    justify-content: center !important;
  }

  .service-hero-graphic {
    max-height: 250px !important;
    margin-top: 20px !important;
  }

  /* Deliverables List-Cards (Icon on left, text on right) */
  .deliverables-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .deliverable-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 14px !important;
    padding: 16px !important;
  }

  /* Counters (2x2 Grid) */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  /* Tools Horizontal Scroll */
  .tools-strip {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 10px !important;
    padding-bottom: 6px !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Sticky Bottom CTA Strip on Service Pages */
  .mobile-service-sticky-cta {
    position: fixed;
    bottom: calc(66px + env(safe-area-inset-bottom, 0px));
    left: 14px;
    right: 14px;
    z-index: 985;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 16px;
    padding: 8px 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.85);
    transform: translateY(160%);
    opacity: 0;
    transition: transform 0.28s ease, opacity 0.28s ease;
  }

  .mobile-service-sticky-cta.is-visible {
    transform: translateY(0);
    opacity: 1;
  }

  .sticky-cta-inner {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .btn-sticky-quote {
    flex: 1;
    background: var(--btn-gradient) !important;
    color: #ffffff !important;
    justify-content: center;
    padding: 11px 14px !important;
    font-size: 13px !important;
  }

  .btn-sticky-wa {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
  }

  /* Reading Progress Bar for Single Blog Post */
  .reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--accent);
    z-index: 1001;
    width: 0%;
    transition: width 0.1s linear;
  }

  /* Table responsive wrappers */
  table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

