/* ==========================================================================
   AFRIPIMALL — Responsive Media Queries & Mobile Header Architecture
   ========================================================================== */

/* 1. Mobile Bottom Navigation Bar (Visible only on mobile devices <= 768px) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid #E5E7EB;
  z-index: 1000;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
  transform: translateZ(0);
  will-change: transform;
}

.mobile-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding: 0 0.5rem;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #6B7280;
  text-decoration: none;
  position: relative;
  flex: 1;
  transition: color 0.15s ease;
}

.bottom-nav-item.active, .bottom-nav-item:hover {
  color: var(--primary);
}

.bottom-nav-item i {
  font-size: 1.15rem;
}

/* 2. Mobile Drawer Menu */
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 85%;
  max-width: 320px;
  background: #FFFFFF;
  z-index: 2001;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: 10px 0 25px rgba(0, 0, 0, 0.15);
}

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

.drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #F3F4F6;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-links {
  list-style: none;
  padding: 0.75rem 0;
  margin: 0;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.85rem 1.5rem;
  font-weight: 700;
  font-size: 0.9375rem;
  color: #1F2937;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.drawer-link:hover, .drawer-link.active {
  background: var(--primary-light);
  color: var(--primary);
}

.drawer-link i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  color: #6B7280;
}

.drawer-link:hover i, .drawer-link.active i {
  color: var(--primary);
}

.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: #F3F4F6;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 1.125rem;
  color: #111827;
  cursor: pointer;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ==========================================================================
   Breakpoints
   ========================================================================== */

/* Laptop / Desktop (max-width: 1024px) */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .grid-cols-6 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

/* Tablet & Mobile (max-width: 768px) */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    width: 100%;
  }

  body {
    padding-bottom: 70px; /* Space for sticky bottom navigation */
  }

  /* 1. Header Polish on Mobile */
  .top-announcement-bar {
    display: none !important;
  }

  .main-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid #EAEAEA;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  }

  .header-inner {
    height: 58px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.25rem;
    gap: 0.5rem;
  }

  .header-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
  }

  .hamburger-btn {
    display: inline-flex !important;
  }

  .brand-logo {
    font-size: 1.25rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-nav {
    display: none !important;
  }

  .header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
  }

  .desktop-only {
    display: none !important;
  }

  .wallet-badge-btn {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem !important;
    gap: 3px !important;
    border-radius: 9999px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .mobile-bottom-nav {
    display: block !important;
  }

  /* 2. Hero & Sections Mobile Adjustments */
  .hero-wrap {
    padding: 2.5rem 0 3.5rem 0;
  }

  .hero-heading {
    font-size: 2.25rem !important;
    line-height: 1.15;
  }

  .hero-description {
    font-size: 0.9375rem;
  }

  .hero-visual-stage {
    max-width: 380px;
    margin: 0 auto;
  }

  .value-props-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .grid-cols-6 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem;
  }

  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem;
  }

  .grid-cols-3 {
    grid-template-columns: 1fr !important;
  }

  .promo-banners-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .promo-card-coral, .promo-card-dark {
    padding: 1.75rem 1.25rem;
  }

  .footer-inner-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Small Smartphone (max-width: 480px) */
@media (max-width: 480px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .brand-logo {
    font-size: 1.15rem !important;
  }

  .wallet-badge-btn {
    font-size: 0.6875rem !important;
    padding: 0.2rem 0.45rem !important;
  }

  .hero-heading {
    font-size: 1.95rem !important;
  }

  .hero-cta-group {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-hero-primary, .btn-hero-secondary {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .value-props-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .vendor-stores-grid {
    grid-template-columns: 1fr !important;
  }

  /* Shop Banner Search Mobile Optimization */
  .shop-banner-search .shop-banner-search-input,
  .shop-banner-search-input {
    height: 48px !important;
    padding-left: 2.75rem !important;
    padding-right: 5.25rem !important;
    font-size: 0.8125rem !important;
  }

  .shop-banner-search .shop-banner-search-icon,
  .shop-banner-search-icon {
    left: 1rem !important;
    font-size: 1rem !important;
  }

  .shop-banner-search .shop-banner-search-btn,
  .shop-banner-search-btn {
    padding: 0.45rem 0.85rem !important;
    font-size: 0.75rem !important;
    right: 0.35rem !important;
  }

  .shop-banner-search-btn .btn-search-label {
    display: none;
  }
}

/* ==========================================================================
   Pi Browser & Native App Enhancements
   ========================================================================== */
.is-pi-browser .mobile-bottom-nav {
  border-top: 2px solid #EAB308;
  background: rgba(255, 255, 255, 0.98);
}

.is-pi-browser .bottom-nav-item.active {
  color: #7c3aed;
}

/* Safe area support for notch & modern mobile navigation bars */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .mobile-bottom-nav {
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  @media (max-width: 768px) {
    body {
      padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)) !important;
    }
  }
}

/* Ensure minimum 44px touch targets on interactive elements */
@media (max-width: 768px) {
  .bottom-nav-item {
    min-height: 48px;
    min-width: 48px;
  }

  .btn, button, .action-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}
