/**
 * ==============================================================================
 * GOODSENSE FORKLIFT UAE - DEDICATED MOBILE & PHONE RESPONSIVE ENGINE (mobile.css)
 * High-Performance, Touch-Optimized, Ultra-Clean Mobile Experience
 * Target Viewports: Mobile Phones (<= 576px) and Tablets (<= 991px)
 * ==============================================================================
 */

/* ------------------------------------------------------------------------------
   1. GLOBAL MOBILE VIEWPORT SHIFT & HORIZONTAL OVERFLOW PREVENTION (ZERO OVERFLOW)
   ------------------------------------------------------------------------------ */
@media screen and (max-width: 991px) {
  html,
  body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    position: relative !important;
    -webkit-text-size-adjust: 100% !important;
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation;
  }

  body {
    padding-bottom: 74px !important; /* Space for the floating mobile app bottom bar */
  }

  .page-wraper,
  .page-content,
  #bg {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* Prevent Bootstrap container horizontal padding blowing out on narrow screens */
  .container,
  .container-fluid {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    overflow-x: clip !important;
  }

  .row {
    margin-left: -8px !important;
    margin-right: -8px !important;
  }

  .row > [class*="col-"] {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  /* Ensure media, images, tables, & iframes never overflow */
  img, video, iframe, embed, object {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Prevent pre, code, and tables from breaking mobile screens */
  table {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Floating Widgets repositioning so they never block content or bottom bar */
  .whatsapp-float-btn {
    bottom: 82px !important;
    right: 16px !important;
    width: 50px !important;
    height: 50px !important;
    font-size: 26px !important;
    box-shadow: 0 4px 18px rgba(37, 211, 102, 0.4) !important;
  }

  .scroltop {
    bottom: 140px !important;
    right: 16px !important;
    width: 40px !important;
    height: 40px !important;
    line-height: 40px !important;
    font-size: 16px !important;
  }
}

/* ------------------------------------------------------------------------------
   2. MOBILE APP HEADER & SLIDE-IN NAVIGATION DRAWER
   ------------------------------------------------------------------------------ */
@media screen and (max-width: 991px) {
  /* Site Header Container */
  .site-header.modern-apex-header,
  .site-header.modern-apex-header.is-home-header,
  .site-header.modern-apex-header.is-inner-header,
  .site-header.modern-apex-header.is-fixed {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 64px !important;
    background: #09131d !important;
    background: rgba(9, 19, 29, 0.98) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45) !important;
    z-index: 99990 !important;
    transform: none !important;
  }

  .modern-apex-header .main-bar-wraper,
  .modern-apex-header .main-bar {
    height: 64px !important;
    line-height: 64px !important;
  }

  .modern-apex-header .main-bar .container {
    height: 64px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .modern-brand-logo img {
    max-height: 36px !important;
    max-width: 165px !important;
    width: auto !important;
    object-fit: contain !important;
  }

  /* Hamburger Toggle Button */
  .modern-apex-header .navbar-toggler {
    width: 42px !important;
    height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    color: #ffffff !important;
    font-size: 1.15rem !important;
    padding: 0 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
  }

  .modern-apex-header .navbar-toggler:active {
    background: #f37021 !important;
    border-color: #f37021 !important;
    color: #ffffff !important;
  }

  /* Slide-In Navigation Drawer */
  .modern-apex-header .header-nav {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 84vw !important;
    max-width: 320px !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: #09131d !important;
    border-right: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.85) !important;
    z-index: 999999 !important;
    display: flex !important;
    flex-direction: column !important;
    transform: translateX(-105%) !important;
    visibility: hidden !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s ease !important;
    padding: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .modern-apex-header .header-nav.show {
    transform: translateX(0) !important;
    visibility: visible !important;
  }

  /* Drawer Top Bar */
  .mobile-side-drawer-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 16px 18px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: #060e17 !important;
    flex-shrink: 0 !important;
  }

  .drawer-logo img {
    max-height: 32px !important;
    width: auto !important;
  }

  .drawer-close-btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.1rem !important;
    cursor: pointer !important;
  }

  /* Drawer Nav List */
  .mobile-side-drawer-body {
    padding: 12px 14px 40px 14px !important;
    flex-grow: 1 !important;
    overflow-y: auto !important;
  }

  .modern-apex-header .navbar-nav {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  .modern-apex-header .navbar-nav > li {
    width: 100% !important;
    margin: 0 0 4px 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  }

  .modern-apex-header .navbar-nav > li > a {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 13px 14px !important;
    font-size: 0.96rem !important;
    font-weight: 600 !important;
    color: #cbd5e1 !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    transition: background 0.15s ease, color 0.15s ease !important;
  }

  .modern-apex-header .navbar-nav > li.active > a,
  .modern-apex-header .navbar-nav > li > a:hover {
    color: #ffffff !important;
    background: rgba(243, 112, 33, 0.16) !important;
  }

  /* Submenu accordion */
  .modern-apex-header .navbar-nav > li .sub-menu {
    display: none !important;
    list-style: none !important;
    padding: 4px 0 8px 16px !important;
    margin: 0 !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 6px !important;
  }

  .modern-apex-header .navbar-nav > li.open > .sub-menu {
    display: block !important;
  }

  .modern-apex-header .navbar-nav > li .sub-menu li a {
    display: block !important;
    padding: 9px 12px !important;
    font-size: 0.88rem !important;
    color: #94a3b8 !important;
    text-decoration: none !important;
    border-radius: 6px !important;
  }

  .modern-apex-header .navbar-nav > li .sub-menu li a:hover,
  .modern-apex-header .navbar-nav > li .sub-menu li.active a {
    color: #f37021 !important;
    background: rgba(243, 112, 33, 0.1) !important;
  }
}

/* ------------------------------------------------------------------------------
   3. MODERN APP-STYLE MOBILE BOTTOM NAVIGATION BAR
   ------------------------------------------------------------------------------ */
.mobile-bottom-nav {
  display: none;
}

@media screen and (max-width: 991px) {
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 62px !important;
    background: rgba(9, 19, 29, 0.97) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    z-index: 99995 !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.55) !important;
    align-items: center !important;
    justify-content: space-around !important;
    padding: 0 4px !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }

  .mobile-bottom-item {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    color: #94a3b8 !important;
    text-decoration: none !important;
    font-size: 0.68rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.2px !important;
    padding: 4px 2px !important;
    transition: color 0.15s ease, transform 0.15s ease !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer !important;
  }

  .mobile-bottom-item i {
    font-size: 1.15rem !important;
    margin-bottom: 3px !important;
    transition: transform 0.2s ease !important;
  }

  .mobile-bottom-item.active,
  .mobile-bottom-item:active {
    color: #f37021 !important;
  }

  .mobile-bottom-item.active i {
    transform: scale(1.1) !important;
  }

  /* WhatsApp Pulse in Bottom Nav */
  .mobile-bottom-item.wa-item {
    color: #25d366 !important;
  }

  .mobile-bottom-item.wa-item i {
    font-size: 1.3rem !important;
    filter: drop-shadow(0 2px 8px rgba(37, 211, 102, 0.5)) !important;
  }

  /* Highlighted Quote Action */
  .mobile-bottom-item.quote-item {
    color: #ffffff !important;
  }

  .mobile-bottom-item.quote-item .quote-bubble {
    background: linear-gradient(135deg, #f37021 0%, #d95e14 100%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -16px;
    box-shadow: 0 4px 14px rgba(243, 112, 33, 0.55);
    border: 2px solid #09131d;
  }

  .mobile-bottom-item.quote-item .quote-bubble i {
    font-size: 1.05rem !important;
    color: #ffffff !important;
    margin-bottom: 0 !important;
  }
}

/* ------------------------------------------------------------------------------
   4. ULTRA-MODERN HERO SECTION (< 991px & < 576px)
   ------------------------------------------------------------------------------ */
@media screen and (max-width: 991px) {
  .modern-goodsense-hero {
    padding: 85px 0 40px !important;
  }

  .hero-tag-badge {
    font-size: 0.72rem !important;
    padding: 5px 12px !important;
    margin-bottom: 14px !important;
  }

  .hero-heading {
    font-size: 2.1rem !important;
    line-height: 1.22 !important;
    margin-bottom: 14px !important;
  }

  .hero-lead {
    font-size: 0.94rem !important;
    line-height: 1.55 !important;
    margin-bottom: 22px !important;
  }

  /* Interactive card */
  .hero-interactive-card {
    margin-top: 25px !important;
    padding: 18px !important;
  }
}

@media screen and (max-width: 576px) {
  .modern-goodsense-hero {
    padding: 78px 0 32px !important;
  }

  .hero-heading {
    font-size: 1.72rem !important;
    line-height: 1.25 !important;
    letter-spacing: -0.3px !important;
  }

  /* Prevent desktop <br> tags from breaking words awkwardly on phone */
  .hero-heading br {
    display: inline !important;
  }

  .hero-lead {
    font-size: 0.88rem !important;
    line-height: 1.5 !important;
    margin-bottom: 18px !important;
  }

  /* Hero Buttons: Clean vertical touch stack */
  .modern-goodsense-hero .d-flex.flex-wrap.gap-3.align-items-center {
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .hero-btn-primary,
  .hero-btn-secondary {
    width: 100% !important;
    justify-content: center !important;
    padding: 12px 18px !important;
    font-size: 0.92rem !important;
    border-radius: 8px !important;
  }

  /* Hero Checklist Pills */
  .modern-goodsense-hero .text-white-50 {
    font-size: 0.78rem !important;
    gap: 10px !important;
    justify-content: flex-start !important;
  }

  /* Equipment switcher buttons inside hero card: 2x2 grid */
  .hero-interactive-card .d-flex.gap-1.mb-3 {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  .hero-switch-btn {
    width: 100% !important;
    font-size: 0.74rem !important;
    padding: 7px 4px !important;
    text-align: center !important;
  }
}

/* ------------------------------------------------------------------------------
   5. STATS STRIP ON PHONES
   ------------------------------------------------------------------------------ */
@media screen and (max-width: 767px) {
  .goodsense-stats-strip {
    padding: 18px 0 !important;
  }

  .stat-block {
    padding: 6px 4px !important;
  }

  .stat-number {
    font-size: 1.55rem !important;
    line-height: 1.1 !important;
  }

  .stat-label {
    font-size: 0.68rem !important;
    letter-spacing: 0.2px !important;
  }
}

/* ------------------------------------------------------------------------------
   6. RENTAL & RFQ CALCULATOR WIZARD
   ------------------------------------------------------------------------------ */
@media screen and (max-width: 991px) {
  .rental-calc-section {
    padding: 50px 0 !important;
  }

  .calc-wizard-card {
    padding: 22px 16px !important;
    border-radius: 14px !important;
  }

  .wizard-title-box h5 {
    font-size: 1.05rem !important;
  }
}

@media screen and (max-width: 576px) {
  /* Truck choice buttons: Clean 2-column touch cards */
  .truck-choice-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .truck-choice-btn {
    padding: 10px 6px !important;
    font-size: 0.78rem !important;
    min-height: 68px !important;
  }

  .truck-choice-btn i {
    font-size: 1.15rem !important;
  }

  /* Capacity pills: Swipeable horizontal chips or clean wrap */
  .capacity-pill-row {
    gap: 6px !important;
  }

  .cap-pill-btn {
    padding: 6px 10px !important;
    font-size: 0.78rem !important;
    flex-grow: 1 !important;
    text-align: center !important;
  }

  /* Form inputs touch-standard (prevent iOS auto-zoom on focus) */
  .rental-calc-section input.form-control,
  .rental-calc-section select.form-select {
    font-size: 16px !important;
    height: 44px !important;
  }

  .rental-calc-section .d-flex.gap-2 {
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .rental-calc-section .btn {
    width: 100% !important;
    padding: 12px !important;
    font-size: 0.9rem !important;
  }
}

/* ------------------------------------------------------------------------------
   7. SMART HORIZONTAL SWIPEABLE CATEGORY CHIPS (EQUIPMENT FLEET)
   ------------------------------------------------------------------------------ */
@media screen and (max-width: 991px) {
  .products-goodsense-section {
    padding: 50px 0 !important;
  }

  .section-main-title {
    font-size: 1.7rem !important;
    line-height: 1.25 !important;
  }

  /* Horizontal swipeable chip bar with native touch inertia */
  .category-filter-pills {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x proximity;
    gap: 8px !important;
    padding: 4px 16px 14px 16px !important;
    margin-left: -16px !important;
    margin-right: -16px !important;
    margin-bottom: 18px !important;
    justify-content: flex-start !important;
    scrollbar-width: none !important;
  }

  .category-filter-pills::-webkit-scrollbar {
    display: none !important;
  }

  .cat-pill-tab {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: 0.82rem !important;
    padding: 8px 14px !important;
    border-radius: 20px !important;
    scroll-snap-align: center !important;
  }

  .fleet-counter-badge {
    font-size: 0.78rem !important;
    padding: 5px 12px !important;
  }
}

/* ------------------------------------------------------------------------------
   8. COMPACT TOUCH PRODUCT CARDS ON PHONES
   ------------------------------------------------------------------------------ */
@media screen and (max-width: 767px) {
  #fleetGrid .fleet-item {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }

  .goodsense-product-card {
    border-radius: 12px !important;
    margin-bottom: 12px !important;
  }

  .product-card-thumb {
    height: 190px !important;
    padding: 12px !important;
  }

  .product-card-body {
    padding: 14px !important;
  }

  .product-category-sub {
    font-size: 0.72rem !important;
    margin-bottom: 4px !important;
  }

  .product-card-title {
    font-size: 0.98rem !important;
    height: auto !important;
    min-height: 2.5rem !important;
    line-height: 1.3 !important;
    margin-bottom: 8px !important;
  }

  .product-specs-summary {
    padding: 6px 10px !important;
    font-size: 0.78rem !important;
    margin-bottom: 12px !important;
  }

  .fleet-action-btn {
    width: 100% !important;
    padding: 12px 16px !important;
    font-size: 0.9rem !important;
    margin-right: 0 !important;
  }
}

/* ------------------------------------------------------------------------------
   9. SERVICES & CASE STUDIES ON PHONES
   ------------------------------------------------------------------------------ */
@media screen and (max-width: 767px) {
  .services-goodsense-section,
  .deployments-section {
    padding: 45px 0 !important;
  }

  .service-card-modern {
    padding: 18px !important;
    border-radius: 12px !important;
    margin-bottom: 12px !important;
  }

  .service-icon-box {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.2rem !important;
    border-radius: 10px !important;
    margin-bottom: 12px !important;
  }

  .deployment-card {
    border-radius: 12px !important;
    margin-bottom: 12px !important;
  }

  .deployment-thumb {
    height: 165px !important;
  }
}

/* ------------------------------------------------------------------------------
   10. PRODUCT DETAILS PAGE ON PHONES (/product/:slug/)
   ------------------------------------------------------------------------------ */
@media screen and (max-width: 991px) {
  .details-banner {
    padding: 35px 0 25px !important;
  }

  .product-main-thumb-box {
    height: 280px !important;
    padding: 14px !important;
    margin-bottom: 18px !important;
    border-radius: 12px !important;
  }

  .product-action-bar {
    padding: 14px !important;
  }

  .btn-get-quote,
  .btn-whatsapp-quote {
    width: 100% !important;
    justify-content: center !important;
    padding: 12px !important;
    font-size: 0.92rem !important;
    margin-bottom: 8px !important;
  }

  /* Specification table on phones */
  .product-spec-table {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    font-size: 0.85rem !important;
  }

  .product-spec-table td,
  .product-spec-table th {
    padding: 8px 10px !important;
    white-space: nowrap !important;
  }
}

/* ------------------------------------------------------------------------------
   11. BLOG & KNOWLEDGE HUB READING LAYOUT ON PHONES (/blog/:slug/)
   ------------------------------------------------------------------------------ */
@media screen and (max-width: 991px) {
  .blog-single-title {
    font-size: 1.55rem !important;
    line-height: 1.28 !important;
  }

  .article-reading-body {
    font-size: 1rem !important;
    line-height: 1.75 !important;
  }

  .blog-toc-card {
    padding: 16px !important;
    margin-bottom: 24px !important;
  }

  .blog-toc-list {
    max-height: 240px !important;
    overflow-y: auto !important;
  }
}

/* ------------------------------------------------------------------------------
   12. SPARE PARTS & CATEGORY HUB (/spare-parts, /forklift-categories)
   ------------------------------------------------------------------------------ */
@media screen and (max-width: 576px) {
  .parts-category-card,
  .forklift-cat-card {
    padding: 14px !important;
    border-radius: 12px !important;
  }

  .parts-hero-search .form-control {
    font-size: 16px !important;
    height: 46px !important;
  }
}

/* ------------------------------------------------------------------------------
   13. MULTI-STEP QUOTATION MODAL ON PHONES
   ------------------------------------------------------------------------------ */
@media screen and (max-width: 576px) {
  .modal-dialog {
    margin: 10px auto !important;
    max-width: 95vw !important;
  }

  .quote-modal-header {
    padding: 14px 16px !important;
  }

  .modal-body {
    padding: 16px !important;
  }

  .modal-body input,
  .modal-body select,
  .modal-body textarea {
    font-size: 16px !important;
  }
}

/* ------------------------------------------------------------------------------
   14. FOOTER & MISCELLANEOUS INNER PAGES OPTIMIZATIONS (PHONES)
   ------------------------------------------------------------------------------ */
@media screen and (max-width: 991px) {
  .site-footer .footer-top {
    padding: 35px 0 15px !important;
  }

  .site-footer .widget {
    margin-bottom: 25px !important;
  }

  .site-footer .footer-title {
    font-size: 1.1rem !important;
    margin-bottom: 14px !important;
  }

  .site-footer .footer-bottom {
    padding: 16px 0 20px !important;
    text-align: center !important;
  }

  .site-footer .footer-bottom-logo {
    display: flex !important;
    justify-content: center !important;
    margin-bottom: 12px !important;
  }

  .site-footer .dlab-social-icon {
    display: flex !important;
    justify-content: center !important;
    margin-bottom: 12px !important;
  }

  /* Contact Page */
  .contact-page-map iframe {
    height: 250px !important;
  }

  .dez-post-title {
    font-size: 1.25rem !important;
  }

  /* Portfolio Details */
  .portfolio-single-title {
    font-size: 1.45rem !important;
  }
}
