/* ==========================================================================
   Mobile Optimization & App Inventor WebViewer Adaptations
   Matches Screen 7 in UI Mockup: Bottom Navigation & Clean Mobile Layout
   ========================================================================== */

/* Mobile Bottom Navigation Bar */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  z-index: 60;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
  padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
}

.bottom-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
}

.bottom-nav-item .nav-icon {
  font-size: 1.25rem;
  line-height: 1;
}

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

.bottom-nav-badge {
  position: absolute;
  top: 2px;
  right: 14px;
  background: var(--primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .books-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .detail-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.5rem;
  }

  .detail-main-img {
    max-width: 320px;
    margin: 0 auto;
  }

  .detail-thumbnails {
    justify-content: center;
  }
}

@media (max-width: 680px) {
  /* Show Mobile Bottom Nav */
  .bottom-nav {
    display: block;
  }

  .site-header .nav-links {
    display: none;
  }

  .main-content {
    padding: 1.25rem 1rem 5.5rem;
  }

  .hero-banner {
    flex-direction: column-reverse;
    text-align: center;
    padding: 2rem 1.25rem;
    gap: 1.5rem;
  }

  .hero-title {
    font-size: 1.65rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
  }

  .hero-graphic {
    max-width: 220px;
  }

  .books-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .book-card {
    padding: 1.25rem;
  }

  .stepper {
    gap: 0.6rem;
    font-size: 0.82rem;
  }

  .step-divider {
    width: 25px;
  }

  .step-text {
    display: none;
  }

  .step-item.active .step-text {
    display: inline;
  }

  .checkout-box,
  .payment-card,
  .tracking-card,
  .success-card {
    padding: 1.5rem 1.2rem;
  }

  .quantity-add-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-add-cart {
    width: 100%;
  }

  .quantity-picker {
    align-self: center;
  }
}
