/**
 * RedBangla Mobile App-Style Experience & Responsive Layouts
 * Inspired by modern marketplace apps (Daraz / Etsy mobile UX)
 */

/* ==========================================================================
   Mobile Fixed Bottom Navigation Bar
   ========================================================================== */
.rb-mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #FFFFFF;
  border-top: 1px solid var(--rb-border);
  box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.06);
  z-index: 9999;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.rb-mobile-bottom-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 56px;
}

.rb-mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--rb-text-muted);
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
  width: 20%;
  height: 100%;
  position: relative;
  transition: color 0.15s;
}

.rb-mobile-nav-item svg,
.rb-mobile-nav-item .rb-nav-icon {
  font-size: 18px;
  margin-bottom: 2px;
}

.rb-mobile-nav-item.is-active,
.rb-mobile-nav-item:hover {
  color: var(--rb-secondary);
}

.rb-mobile-nav-item .rb-badge-count {
  top: 4px;
  right: 18px;
}

/* Hide Mobile Bottom Bar on Checkout to prevent interference */
.woocommerce-checkout .rb-mobile-bottom-bar,
.rb-hide-mobile-nav .rb-mobile-bottom-bar {
  display: none !important;
}

/* ==========================================================================
   Slide-out Drawers (Mobile Menu & Mini-Cart)
   ========================================================================== */
.rb-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.rb-drawer-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.rb-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 320px;
  max-width: 85%;
  background: #FFFFFF;
  z-index: 10001;
  box-shadow: var(--rb-shadow-lg);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.rb-drawer-left {
  left: 0;
  transform: translateX(-100%);
}

.rb-drawer-right {
  right: 0;
  transform: translateX(100%);
}

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

.rb-drawer-header {
  padding: 16px 20px;
  background: var(--rb-primary);
  color: #FFFFFF;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rb-drawer-close {
  background: transparent;
  border: none;
  color: #FFFFFF;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
}

.rb-drawer-body {
  padding: 20px;
  overflow-y: auto;
  flex-grow: 1;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .rb-grid-4,
  .rb-grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }

  .rb-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .rb-single-product-wrap,
  .rb-checkout-container,
  .rb-dashboard-body {
    grid-template-columns: 1fr;
  }

  .rb-dashboard-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--rb-border);
  }
}

@media (max-width: 768px) {
  .rb-topbar {
    display: none;
  }

  .rb-mobile-bottom-bar {
    display: block;
  }

  .rb-header-inner {
    padding: 10px 0;
    gap: 12px;
  }

  .rb-header-actions .rb-action-text,
  .rb-search-cat-select {
    display: none;
  }

  .rb-search-wrapper {
    max-width: 100%;
  }

  .rb-search-form {
    height: 38px;
  }

  .rb-search-btn {
    padding: 0 14px;
  }

  .rb-nav-bar {
    display: none;
  }

  /* 2-Column High-Density Mobile Product Grid */
  .rb-product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }

  .rb-card-content {
    padding: 8px;
  }

  .rb-card-title {
    font-size: 13px;
    height: 34px;
  }

  .rb-current-price {
    font-size: 14px;
  }

  .rb-kpi-grid {
    grid-template-columns: 1fr;
  }

  .rb-footer-grid {
    grid-template-columns: 1fr;
  }

  .rb-footer-bottom {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
}
