/* =====================================================
   OPANBOX MOBILE APP DESIGN SYSTEM (v2.1.0)
   Flipkart/Amazon PWA Native Mobile Experience
   ===================================================== */

@media (max-width: 768px) {
  /* Safe padding for bottom navigation */
  body {
    padding-bottom: 74px !important;
  }
  
  body.single-product {
    padding-bottom: 130px !important;
  }

  /* Top App Bar */
  .ob-header {
    box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
  }
  .ob-header-topbar {
    display: none !important;
  }
  .ob-header-main {
    padding: 8px 12px !important;
  }
  .ob-header-inner {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 0 !important;
  }
  
  /* Top Row on Mobile: Logo (Left) + Wishlist & Cart (Right) */
  .ob-logo {
    flex: 1 !important;
  }
  .ob-logo-text {
    font-size: 22px !important;
  }
  .ob-logo-subtag {
    font-size: 9px !important;
  }
  .ob-btn-header-login {
    display: none !important; /* Login is in bottom navigation bar */
  }
  .ob-action-txt {
    display: none !important;
  }
  .ob-header-actions {
    gap: 12px !important;
  }

  /* Full-Width Search Bar on Mobile */
  .ob-search-form {
    order: 3 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 2px !important;
  }
  .ob-search-inner {
    height: 38px !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1) !important;
    border: 1px solid #cbd5e1 !important;
  }
  /* Hide the bulky dropdown on mobile to give 100% space to text input */
  .ob-search-cat-wrap {
    display: none !important;
  }
  .ob-search-input {
    font-size: 13px !important;
    padding: 0 12px !important;
  }
  .ob-search-btn {
    padding: 0 12px !important;
  }

  /* Category Nav Strip on Mobile */
  .ob-cat-nav {
    display: none !important; /* Categories are showcased in homepage cards and bottom nav */
  }

  /* Hero Banner on Mobile (Clean 16:9 App-Like Carousel) */
  .ob-hero {
    max-height: 190px !important;
    margin: 8px 10px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
  }
  .ob-hero-showcase {
    padding: 24px 16px !important;
    border-radius: 12px !important;
    margin: 8px 10px !important;
  }
  .ob-hero-title {
    font-size: 22px !important;
  }
  .ob-hero-sub {
    font-size: 13px !important;
    margin-bottom: 16px !important;
  }
  .ob-btn-cta-primary, .ob-btn-cta-secondary {
    padding: 10px 18px !important;
    font-size: 13px !important;
  }
  .ob-hero-preview-card {
    display: none !important;
  }
  .ob-slide img {
    height: 180px !important;
    object-fit: cover !important;
    border-radius: 12px !important;
  }

  /* Trust Strip on Mobile */
  .ob-trust-strip {
    padding: 12px 0 !important;
  }
  .ob-trust-grid-hp {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .ob-trust-item-hp {
    gap: 8px !important;
  }
  .ob-trust-item-hp h4 {
    font-size: 12px !important;
  }
  .ob-trust-item-hp p {
    font-size: 10px !important;
  }

  /* Category Grid on Mobile (4 cols touch friendly) */
  .ob-cat-strip {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
  }
  .ob-cat-item {
    padding: 10px 4px !important;
    border-radius: 10px !important;
  }
  .ob-cat-emoji {
    font-size: 28px !important;
    margin-bottom: 4px !important;
  }
  .ob-cat-item span {
    font-size: 11px !important;
    line-height: 1.2 !important;
  }

  /* Product Cards Mobile (2 Column App Grid) */
  .ob-products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .ob-product-card {
    border-radius: 10px !important;
  }
  .ob-product-thumb img {
    height: 140px !important;
    object-fit: contain !important;
    background: #f8fafc !important;
    padding: 6px !important;
  }
  .ob-product-info {
    padding: 10px !important;
  }
  .ob-product-name {
    font-size: 12.5px !important;
    height: 34px !important;
    margin-bottom: 4px !important;
  }
  .ob-price-current {
    font-size: 15px !important;
  }
  .ob-price-original, .ob-price-discount {
    font-size: 11px !important;
  }
  .ob-product-actions {
    gap: 4px !important;
  }
  .ob-btn-cart, .ob-btn-buy {
    font-size: 11px !important;
    padding: 6px 4px !important;
    border-radius: 4px !important;
  }

  /* =====================================================
     NATIVE BOTTOM APP NAVIGATION (Flipkart App 5-Tabs)
     ===================================================== */
  .ob-bottom-app-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 58px !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-around !important;
    z-index: 9999 !important;
    box-shadow: 0 -3px 12px rgba(0,0,0,0.06) !important;
  }

  .ob-app-tab {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    color: #64748b !important;
    padding: 4px 0 !important;
    transition: all 0.15s ease !important;
    -webkit-tap-highlight-color: transparent !important;
    position: relative !important;
  }

  .ob-app-tab.active {
    color: #2874f0 !important;
  }

  .ob-app-tab.active .ob-app-tab-icon svg {
    stroke: #2874f0 !important;
    stroke-width: 2.4 !important;
  }

  .ob-app-tab-icon {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    margin-bottom: 2px !important;
  }

  .ob-app-tab-icon svg {
    width: 22px !important;
    height: 22px !important;
  }

  .ob-app-tab-label {
    font-size: 10px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
  }

  .ob-app-cart-badge {
    position: absolute !important;
    top: -5px !important;
    right: -8px !important;
    background: #e53935 !important;
    color: #ffffff !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    min-width: 16px !important;
    height: 16px !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 4px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2) !important;
  }

  /* Single Product Sticky Bar */
  .ob-product-sticky-bar {
    position: fixed !important;
    bottom: calc(58px + env(safe-area-inset-bottom, 0px)) !important;
    left: 0 !important;
    right: 0 !important;
    background: #ffffff !important;
    padding: 10px 14px !important;
    border-top: 1px solid #e2e8f0 !important;
    display: flex !important;
    gap: 10px !important;
    z-index: 9998 !important;
    box-shadow: 0 -4px 14px rgba(0,0,0,0.08) !important;
  }

  .ob-app-btn-cart {
    flex: 1 !important;
    background: #ffffff !important;
    color: #2874f0 !important;
    border: 1.5px solid #2874f0 !important;
    padding: 11px !important;
    border-radius: 8px !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
  }

  .ob-app-btn-buy {
    flex: 1 !important;
    background: #fb641b !important;
    color: #ffffff !important;
    border: none !important;
    padding: 11px !important;
    border-radius: 8px !important;
    font-size: 13.5px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
  }

  /* Pull to refresh */
  .ob-app-ptr {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-30px);
    background: #2874f0;
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 99999;
    opacity: 0;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  }
  .ob-app-ptr.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  .ob-ptr-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: obSpin 0.7s linear infinite;
  }
  @keyframes obSpin {
    to { transform: rotate(360deg); }
  }

  /* Footer on mobile */
  .ob-footer-main, .ob-footer-bottom {
    display: none !important;
  }
}