/* ==========================================================================
   ZINGOBUY - RESPONSIVE STYLES & MOBILE BOTTOM BAR
   ========================================================================== */

/* Prevent horizontal page overflow without breaking sticky positioning */
html, body {
  overflow-x: clip;
  width: 100%;
}

/* Mobile Bottom App Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
  z-index: 1000;
  padding: 0.35rem 0;
}

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

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: var(--color-text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  position: relative;
  text-decoration: none;
  padding: 0.2rem 0.6rem;
}

.mobile-nav-item i {
  font-size: 1.25rem;
}

.mobile-nav-item.active, .mobile-nav-item:hover {
  color: #ED1C24;
}

.mobile-nav-item.active i {
  color: #ED1C24;
}

.mobile-nav-badge {
  position: absolute;
  top: 0;
  right: 6px;
  background: var(--color-accent-ruby);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tablet Breakpoints */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-side-widget {
    flex-direction: row;
  }

  .brand-logo-img {
    width: 185px !important;
    max-width: 195px !important;
    height: auto !important;
    max-height: 75px !important;
  }

  .footer-logo-img {
    width: 185px !important;
    max-width: 195px !important;
    height: auto !important;
    max-height: 75px !important;
  }

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

/* Mobile Breakpoints (<= 768px) */
@media (max-width: 768px) {
  body {
    padding-bottom: 60px; /* Space for mobile bottom bar */
  }

  .container {
    padding: 0 0.85rem;
  }

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

  /* Top Announcement Bar */
  .top-bar {
    padding: 0.35rem 0;
    font-size: 0.75rem;
  }

  .top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
  }

  .top-bar-left {
    gap: 0.35rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 0.72rem;
    flex: 1;
    min-width: 0;
  }

  .top-bar-left .tagline,
  .top-bar-sep {
    display: none;
  }

  .top-bar-right .top-bar-link {
    display: none; /* Hide desktop partner links on mobile header */
  }

  .currency-select {
    padding: 0.15rem 0.4rem;
    font-size: 0.72rem;
  }

  /* Main Header Sticky on Mobile */
  .main-header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0;
  }

  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.5rem 0.5rem;
    padding: 0.5rem 0;
  }

  .brand-logo-wrap {
    gap: 0.5rem;
    min-width: 0;
  }

  .brand-title {
    font-size: 1.25rem;
  }

  .brand-subtitle {
    font-size: 0.62rem;
    letter-spacing: 0.5px;
  }

  .brand-logo-img {
    width: 165px !important;
    max-width: 175px !important;
    height: auto !important;
    max-height: 68px !important;
    border-radius: 6px;
    padding: 3px 6px;
  }

  .footer-logo-img {
    width: 165px !important;
    max-width: 175px !important;
    height: auto !important;
    max-height: 68px !important;
    border-radius: 6px;
    padding: 3px 6px;
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
  }

  .supercoins-badge-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    gap: 0.25rem;
  }

  .header-action-btn {
    padding: 0.35rem 0.45rem;
    gap: 0.3rem;
  }

  .account-dropdown-wrap .header-action-btn div,
  .account-dropdown-wrap .header-action-btn .fa-chevron-down {
    display: none; /* Compact user profile icon without big text */
  }

  /* Search Engine Row (Full Width on Mobile) */
  .header-search-wrap {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 0.1rem;
    order: 3;
    max-width: 100%;
  }

  .search-form {
    width: 100%;
    box-sizing: border-box;
  }

  .search-input {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    min-width: 0;
  }

  .search-actions {
    gap: 0.2rem;
    padding-right: 0.35rem;
  }

  .search-icon-btn {
    padding: 0.35rem;
    font-size: 0.9rem;
  }

  .search-submit-btn {
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
  }

  .search-submit-btn span {
    display: none; /* Hide "Search" text on mobile to avoid overflow */
  }

  /* Category Navigation */
  .main-nav {
    padding: 0;
  }

  .nav-container-wrapper {
    padding: 0 0.35rem;
    gap: 0.25rem;
    width: 100%;
    box-sizing: border-box;
  }

  .nav-scroll-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 0.7rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  }

  .nav-list {
    gap: 0.35rem;
    padding: 0.25rem 0;
  }

  .nav-link {
    padding: 0.45rem 0.7rem;
    font-size: 0.82rem;
    gap: 0.35rem;
  }

  /* Hero & Content */
  .hero-banner-card {
    padding: 1.5rem;
    min-height: 280px;
  }

  .hero-banner-content {
    max-width: 100%;
  }

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

  .hero-banner-img {
    opacity: 0.15;
    right: 0;
  }

  .hero-side-widget {
    flex-direction: column;
  }

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

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

  .cart-drawer {
    max-width: 100%;
  }

  /* Chatbot Widget Mobile Floating Position */
  .chatbot-trigger {
    bottom: 72px !important;
    right: 14px !important;
    width: 48px !important;
    height: 48px !important;
    font-size: 1.25rem !important;
  }

  .chatbot-widget {
    bottom: 130px !important;
    right: 12px !important;
    left: 12px !important;
    width: auto !important;
    max-width: none !important;
    height: calc(100vh - 200px) !important;
    max-height: 520px !important;
  }

  /* Scroll to Top Button Mobile Position */
  .scroll-to-top-btn {
    bottom: 72px;
    left: 14px;
    right: auto;
    width: 42px;
    height: 42px;
    font-size: 0.95rem;
  }
}

/* Extra Small Phones (<= 480px) */
@media (max-width: 480px) {
  .header-actions .supercoins-badge-btn span {
    display: none; /* Icon only on extra small screens */
  }

  .header-actions .supercoins-badge-btn {
    padding: 0.35rem 0.45rem;
    border-radius: 50%;
  }

  .brand-title {
    font-size: 1.15rem;
  }

  .brand-logo-img {
    width: 155px !important;
    max-width: 160px !important;
    height: auto !important;
    max-height: 62px !important;
  }

  .footer-logo-img {
    width: 155px !important;
    max-width: 160px !important;
    height: auto !important;
    max-height: 62px !important;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Responsive Multi-Column Layout Grids (Desktop & Mobile Fallbacks)
   ========================================================================== */
.cart-page-grid,
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
}

.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  background: #ffffff;
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2.5rem;
}

.account-layout-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

.account-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 960px) {
  .cart-page-grid,
  .checkout-grid,
  .account-layout-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .product-detail-grid {
    grid-template-columns: 1fr !important;
    gap: 1.75rem !important;
    padding: 1.25rem !important;
  }
}

@media (max-width: 640px) {
  .account-stats-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .cart-page-grid .cart-item-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }
}

