/* ══════════════════════════════════════════════════════
   BEARAND — MOBILE RESPONSIVE CSS
   ══════════════════════════════════════════════════════ */

@media (max-width: 991px) {
  /* ══ GENERAL & TYPOGRAPHY ══ */
  .container { padding: 0 20px !important; }
  .section { padding: 60px 0 !important; }
  
  .h-section { font-size: clamp(2rem, 8vw, 2.8rem) !important; margin-bottom: 24px !important; }
  .h-panel { font-size: 1.5rem !important; }
  
  /* ══ NAVBAR ══ */
  .nav-links, .nav-right { display: none !important; }
  .hamburger { display: flex !important; }
  .nav-logo img { height: 48px !important; width: 48px !important; }
  .nav-logo-text { font-size: 1.1rem !important; }
  
  /* ══ MOBILE MENU OVERLAY & DRAWER ══ */
  .mobile-menu-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 1000; opacity: 0; transition: opacity 0.3s ease; }
  .mobile-menu-overlay.open { display: block; opacity: 1; }
  
  .mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 75%;
    max-width: 320px;
    height: 100vh;
    background: var(--bg-main);
    border-left: 1px solid var(--card-border);
    z-index: 1001;
    padding: 32px 16px 24px !important;
    display: flex;
    flex-direction: column;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
    box-shadow: -20px 0 40px rgba(0,0,0,0.2);
  }
  .mobile-menu.open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  .mobile-menu .nav-logo {
    height: auto !important;
    margin: 0 0 24px 0 !important;
    padding: 0 !important;
  }
  .mobile-menu a {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: var(--text-main) !important;
    text-decoration: none;
    position: relative;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    padding: 10px 0 !important;
    margin: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
    transition: color 0.3s ease !important;
  }
  [data-theme="light"] .mobile-menu a { border-bottom: 1px solid rgba(10, 22, 40, 0.04) !important; }
  .mobile-menu a:hover { color: var(--brand-blue-light) !important; padding-left: 0 !important; }
  .mobile-nav-bottom { display: none !important; margin: 0 !important; padding: 0 !important; }
  
  [dir="rtl"] .mobile-menu {
    right: auto !important;
    left: 0 !important;
    border-left: none !important;
    border-right: 1px solid var(--card-border) !important;
    box-shadow: 20px 0 40px rgba(0,0,0,0.2);
  }
  [dir="rtl"] .mobile-menu.open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .mobile-contact-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 240px !important;
    margin: auto auto 40px auto !important;
    padding: 12px 24px !important;
    border-radius: 100px !important;
    font-size: var(--text-sm) !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    background: linear-gradient(135deg, #1E6FD9, #38BEFF) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
    transition: all 0.3s ease !important;
  }
  [data-theme="light"] .mobile-contact-btn {
    background: linear-gradient(135deg, #1E6FD9, #38BEFF) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
  }
  .mobile-contact-btn:hover {
    transform: scale(1.05) !important;
    box-shadow: none !important;
  }
  .mobile-contact-btn:active {
    transform: scale(0.95) !important;
    box-shadow: none !important;
    background: linear-gradient(135deg, #1E6FD9, #38BEFF) !important;
    color: #ffffff !important;
  }
  

  
  /* ══ HERO SECTION ══ */
  .hero { min-height: 100vh !important; padding-top: 80px !important; display: flex !important; flex-direction: column !important; justify-content: center !important; position: relative !important; overflow: hidden !important; }
  .hero-content { padding: 0 20px !important; text-align: center !important; width: 100% !important; z-index: 10 !important; position: relative !important; margin: -20px 0 70px !important; } /* Shifted up by 60px */
  .hero-title { font-size: clamp(2rem, 8vw, 2.5rem) !important; line-height: 1.2 !important; margin-bottom: 16px !important; }
  
  /* Typewriter with fixed width to prevent shifting */
  .hero-label {
    font-size: 0.75rem !important;
    margin: 0 auto 12px auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: 180px !important;
    text-align: left !important;
    color: #38BEFF !important;
  }
  [data-theme="light"] .hero-label { color: #1E6FD9 !important; }
  [dir="rtl"] .hero-label {
    direction: rtl !important;
    justify-content: flex-start !important;
    text-align: right !important;
    width: 180px !important;
  }
  
  .hero-slogan { font-size: 0.85rem !important; line-height: 1.5 !important; margin-bottom: 24px !important; margin-left: auto !important; margin-right: auto !important; color: #a0aabf !important; }
  .hero-ctas { flex-direction: column !important; gap: 16px !important; align-items: center !important; width: 100% !important; justify-content: center !important; text-align: center !important; }
  .hero-ctas .btn { width: max-content !important; justify-content: center !important; padding: 12px 24px !important; margin: 0 auto !important; }
  .dn-slider { right: 10px !important; transform: scale(0.8) translateY(-50%) !important; transform-origin: right center !important; }
  
  /* Show all 6 hero float cards logically positioned around toggle */
  .hero-vacuum-toggle { 
    z-index: 20 !important; 
    top: 50% !important; 
    bottom: auto !important;
    right: 10px !important; 
    transform: translateY(-50%) !important;
    margin: 0 !important;
  }
  
  .hero-float-cards {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    left: 12px !important;
    right: auto !important;
    width: 145px !important;
    height: auto !important;
    display: none !important; /* Managed by JS toggle */
    flex-direction: column !important;
    gap: 8px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 99999 !important;
    opacity: 0;
    visibility: hidden;
    overflow: visible !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease !important;
  }
  .hero-float-cards.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  [dir="rtl"] .hero-float-cards {
    right: auto !important;
    left: 12px !important;
    transform: translateY(-50%) !important;
  }
  

  
  .hero-float-card {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    padding: 8px 12px !important;
    border-radius: 12px !important;
    background: rgba(8, 18, 38, 0.45) !important;
    border: 1px solid rgba(56, 190, 255, 0.15) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    z-index: 100000 !important;
    pointer-events: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    text-align: left !important;
    margin: 0 !important;
    animation: none !important; /* Disable CSS float animation on mobile to avoid GSAP override */
    transition: background 0.3s ease, border-color 0.3s ease !important;
  }
  [dir="rtl"] .hero-float-card {
    text-align: right !important;
    align-items: flex-start !important;
  }
  [data-theme="light"] .hero-float-card {
    background: rgba(255, 255, 255, 0.45) !important;
    border: 1px solid rgba(10, 80, 200, 0.12) !important;
  }
  
  /* Stack layout position offsets removed for vertical list */
  .hfc-1, .hfc-2, .hfc-3, .hfc-4, .hfc-5, .hfc-6 {
    top: auto !important;
    left: auto !important;
    z-index: 100000 !important;
  }

  .card-icon { font-size: 1.05rem !important; margin-bottom: 2px !important; line-height: 1 !important; }
  .card-icon svg { width: 14px !important; height: 14px !important; }
  .card-tag { font-size: 0.58rem !important; margin-bottom: 2px !important; }
  .card-title { font-size: 0.68rem !important; line-height: 1.25 !important; }
  


  /* ══ PORTFOLIO THUMBNAILS ══ */
  .portfolio-grid-v2 { display: grid !important; grid-template-columns: 1fr !important; gap: 24px !important; }
  .pf-card { height: 300px !important; width: 100% !important; margin-bottom: 16px !important; }
  .pf-tall, .pf-wide, .pf-full { grid-column: auto !important; grid-row: auto !important; }
  .pf-title { font-size: 1.4rem !important; }
  
  .portfolio-modal-content { width: 92% !important; height: auto !important; max-height: 85vh !important; border-radius: 16px !important; padding: 0 !important; margin: 0 auto !important; overflow: hidden !important; }
  .portfolio-modal-close { top: 16px !important; right: 16px !important; background: rgba(0,0,0,0.5) !important; }
  .portfolio-modal-info { padding: 24px !important; }

  /* ══ STATS SECTION ══ */
  .stats-bar { display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; text-align: center !important; gap: 32px !important; margin-top: 32px !important; }
  .stat-item { align-items: center !important; text-align: center !important; }
  .stat-item .h-stat { justify-content: center !important; }

  /* ══ ABOUT & APPROACH ══ */
  .clients-section { padding: 30px 0 !important; }
  .about-split { grid-template-columns: 1fr !important; gap: 32px !important; }
  .about-image { order: -1 !important; }
  .about-image img { height: 300px !important; border-radius: 16px !important; }
  
  .approach-tabs { display: flex !important; overflow-x: auto !important; flex-wrap: nowrap !important; gap: 8px !important; padding-bottom: 0 !important; scrollbar-width: none !important; -webkit-overflow-scrolling: touch; margin-bottom: 0 !important; border-bottom: none !important; }
  .approach-panel { grid-template-columns: 1fr !important; gap: 24px !important; padding: 24px !important; margin-top: -1px !important; border-radius: var(--radius-lg) !important; }
  .approach-panel-visual { height: 200px !important; order: -1 !important; }

  /* ══ FOUNDER & TESTIMONIALS ══ */
  .founder-layout { grid-template-columns: 1fr !important; gap: 40px !important; }
  .founder-photo-wrap { max-width: 280px !important; margin: 0 auto !important; padding-right: 20px !important; padding-bottom: 40px !important; }
  .testimonials-section { overflow: hidden !important; padding-left: 0 !important; padding-right: 0 !important; }
  .testi-marquee { width: 100vw !important; margin-left: 0 !important; }
  .testi-card { width: 85vw !important; max-width: 320px !important; padding: 24px !important; }
  
  /* ══ FOOTER & OTHERS ══ */
  .cta-layout, .contact-info, .footer-grid { grid-template-columns: 1fr !important; gap: 40px !important; }
  .floating-corner { bottom: 16px !important; right: 16px !important; gap: 10px !important; }
  input[type="text"], input[type="email"], input[type="tel"], textarea { font-size: 16px !important; }
}

/* ══════════════════════════════════════════════════════
   USER REQUESTED OVERRIDES (BATCH 6)
   ══════════════════════════════════════════════════════ */

/* HERO MOBILE BACKGROUNDS */
@media (max-width: 991px) {
  .hero-sky-mobile {
    position: absolute !important;
    inset: 0 !important;
    z-index: -1 !important;
    background-image: url('../assets/images/hero-bg-night-mobile.png') !important;
    background-size: cover !important;
    background-position: center !important;
  }
  [data-theme="light"] .hero-sky-mobile {
    background-image: url('../assets/images/hero-bg-day-mobile.png') !important;
  }
  /* Hide desktop sky on mobile so mobile bg shows clearly */
  .sky-gradient { display: none !important; }
  
  /* HERO POPUP CARDS SCROLLABLE - REMOVED FOR DRAGGABLE STACK OVERRIDES */
  
  /* STATS 2x2 GRID */
  .stats-bar {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 32px 16px !important;
    align-items: start !important;
  }
  
  /* ABOUT SECTION WHITE BACKGROUND & MIDDLE THIRD GREY OVERLAY (Faded & Shifted Up under the bear) */
  [data-theme="light"] .about-section {
    background: linear-gradient(
      to bottom,
      #ffffff 0%,
      #ffffff 5%,
      #f3f4f6 18%,
      #f3f4f6 50%,
      #ffffff 65%,
      #ffffff 100%
    ) !important;
  }


  /* SERVICES SWAP ON MOBILE ONLY */
  /* Removed .pin-container and .service-panel overrides to allow GSAP pinning */
  .service-panel-inner {
    flex-direction: column !important;
    height: 100% !important;
    width: 100% !important;
  }
  .sp-visual {
    flex: 0 0 45vh !important;
    width: 100% !important;
    height: 45vh !important;
  }
  .sp-content {
    flex: 0 0 55vh !important;
    width: 100% !important;
    height: 55vh !important;
    padding: 24px 20px !important;
    overflow-y: auto !important;
  }
  .service-panel .sp-title {
    font-size: clamp(1.4rem, 5vw, 1.8rem) !important;
    line-height: 1.2 !important;
  }
  .service-panel .sp-desc {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
  }
  .service-panel .btn {
    margin-top: 1.5rem !important;
  }

  /* PORTFOLIO GAP POLISH */
  .portfolio-grid-v2 {
    gap: 12px !important;
  }
  .pf-card {
    margin-bottom: 0 !important;
  }
  
  /* FOUNDER LAYOUT CENTER-ALIGN & RIGHT CORNERS SQUARE */
  .founder-info {
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .founder-skills {
    justify-content: center !important;
  }
  .founder-bio {
    text-align: center !important;
  }
  .skill-chat-box {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  .founder-whatsapp {
    margin: 0 auto !important;
  }
  
  
  .founder-name-card {
    border-top-right-radius: 0px !important;
    border-bottom-right-radius: 0px !important;
    border-top-left-radius: 20px !important;
    border-bottom-left-radius: 20px !important;
  }
  .founder-info .btn {
    margin-top: 12px !important;
  }

  /* TESTIMONIALS MOBILE FULL WIDTH FIX */
  .testimonials-section {
    width: 100% !important;
    overflow: hidden !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .testimonials-section .container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 20px !important;
  }
  .testimonials-section .section-header {
    padding: 0 !important;
  }
  .testi-marquee {
    position: relative !important;
    left: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    overflow: hidden !important;
  }
  .testi-track {
    padding-left: 20px !important;
    animation: none !important; /* Disable CSS animation on mobile to avoid conflict with JS drag marquee */
  }
  .testi-card {
    flex: 0 0 85vw !important; /* Force cards to take exact width and not shrink */
    max-width: 320px !important;
  }
}

/* ══════════════════════════════════════════════════════
   USER REQUESTED OVERRIDES (BATCH 7)
   ══════════════════════════════════════════════════════ */
@media (max-width: 991px) {
  /* SWAP ICONS: Hamburger Left, Theme Toggle Right, Logo Center */
  .nav-inner {
    position: relative !important;
    justify-content: center !important;
  }
  .nav-inner > div:first-child {
    position: static !important;
  }
  .nav-inner > div:last-child {
    position: static !important;
  }
  .hamburger {
    position: absolute !important;
    left: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
  }
  #theme-toggle {
    position: absolute !important;
    right: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
  }
  .nav-logo {
    margin: 0 auto !important;
  }

  /* 50% WHITE OVERLAY IN LIGHT MODE HERO */
  [data-theme="light"] .hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.5) !important;
    z-index: -1;
  }

  /* PORTFOLIO BUTTON AT BOTTOM */
  .portfolio-section .container {
    display: flex !important;
    flex-direction: column !important;
  }
  .portfolio-section .section-header-row {
    display: contents !important;
  }
  .portfolio-section .section-header-row > div {
    order: 1 !important;
    margin-bottom: 24px !important;
    width: 100% !important;
    text-align: center !important;
  }
  .portfolio-grid-v2 {
    order: 2 !important;
  }
  .portfolio-section .section-header-row .btn-outline {
    order: 3 !important;
    align-self: center !important;
    margin-top: 32px !important;
    width: max-content !important;
  }
  .pf-card {
    margin-bottom: 48px !important; /* Larger gap */
  }

  /* HERO CARDS ORDER & SCROLLING - REMOVED FOR DRAGGABLE STACK OVERRIDES */

  /* VORTEX ICON ALWAYS SPINNING */
  .vortex-icon {
    animation: spinSlow 8s linear infinite !important;
  }
}
@keyframes spinSlow {
  100% { transform: rotate(360deg); }
}



/* ══════════════════════════════════════════════════════
   ABOUT SECTION SHOOTING STARS (MOBILE OVERRIDE)
   ══════════════════════════════════════════════════════ */
@media (max-width: 991px) {
  /* Limit the rendering area just in case */
  .about-shooting-stars {
    height: 35% !important; 
  }
  
  /* Faster fade out, shorter distance for mobile */
  @keyframes aboutShootingStarMobile {
    0% { transform: rotate(35deg) translateX(-50px); opacity: 0; }
    2% { opacity: 1; }
    8% { transform: rotate(35deg) translateX(350px); opacity: 0; } /* Fades completely before 350px */
    100% { transform: rotate(35deg) translateX(350px); opacity: 0; }
  }

  /* Apply mobile animation while inheriting the original delays and durations */
  .about-shooting-stars .star {
    animation-name: aboutShootingStarMobile !important;
  }
}

/* ══════════════════════════════════════════════════════
   PORTFOLIO GRID SPACING FIX (MOBILE)
   ══════════════════════════════════════════════════════ */
@media (max-width: 991px) {
  .portfolio-grid-v2 {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
  }
  
  .pf-card {
    width: 100% !important;
    height: 280px !important;
    margin-bottom: 0 !important; /* Reset margin since flex gap handles it */
  }
  
  .pf-tall, .pf-wide {
    height: 280px !important; /* Uniform height in mobile */
  }
}

/* ══════════════════════════════════════════════════════
   STATS ALIGNMENT TO CENTER (MOBILE)
   ══════════════════════════════════════════════════════ */
@media (max-width: 991px) {
  .stats-bar {
    justify-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }
  
  .stat-item {
    align-items: center !important; /* Centers the icon and text inside each item */
    text-align: center !important;
  }
}

/* ══════════════════════════════════════════════════════
   FIX STATS ALIGNMENT TO CENTER (MOBILE SPECIFICITY FIX)
   ══════════════════════════════════════════════════════ */
@media (max-width: 991px) {
  .stats-bar .stat-item {
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }
}

/* ══════════════════════════════════════════════════════
   CONTACT SECTION SPECIFIC TEXTS CENTERING (MOBILE)
   ══════════════════════════════════════════════════════ */
@media (max-width: 991px) {
  .cta-text > .label-sm,
  .cta-text > .h-section,
  .cta-text > .text-body {
    text-align: center !important;
    align-self: center !important;
  }
}
