/* =========================================================================
   MRINGCO Mobile Styles — Bottom nav, mobile overrides, touch-first
   ========================================================================= */

/* =========================================================================
   Mobile Bottom Navigation Bar
   ========================================================================= */

.mobile-bottom-nav {
  display: none; /* shown below 768px */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-nav-height);
  background: var(--color-surface-1);
  border-top: 2px solid var(--color-yellow);
  z-index: var(--z-sticky);
  display: flex;
  align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom);
  /* Safe area for iPhone notch */
  padding-bottom: max(env(safe-area-inset-bottom), 0px);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
}

.mobile-bottom-nav__link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  transition: color var(--duration-fast);
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.mobile-bottom-nav__link:hover,
.mobile-bottom-nav__link.is-active {
  color: var(--color-yellow);
}
.mobile-bottom-nav__link.is-active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--color-yellow);
}

.mobile-bottom-nav__icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mobile-bottom-nav__badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  background: var(--color-yellow);
  color: var(--color-black);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}
.mobile-bottom-nav__label {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1;
}

/* =========================================================================
   Mobile Global Adjustments (max-width: 768px)
   ========================================================================= */

@media (max-width: 768px) {

  /* Show bottom nav */
  .mobile-bottom-nav { display: flex; }

  /* Add padding so page content doesn't hide behind bottom nav */
  body {
    padding-bottom: var(--mobile-nav-height);
  }
  body.admin-bar { padding-bottom: calc(var(--mobile-nav-height) + 32px); }

  /* Compact header on mobile */
  .site-header .header-top { display: none; }
  --header-total-height: var(--header-main-height);

  /* ---- Homepage mobile ---- */

  .hero__container {
    grid-template-columns: 1fr;
    text-align: center;
    padding-block: var(--space-16) var(--space-12);
  }
  .hero__visual { display: none; }
  .hero__scroll { display: none; }
  .hero__copy { align-items: center; }
  .hero__overline { justify-content: center; }
  .hero__title { align-items: center; }
  .hero__desc { text-align: left; }
  .hero__actions { justify-content: center; }
  .hero__stats {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-4);
  }
  .hero-stat { align-items: center; }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }
  .categories-grid .category-card { min-height: 180px; }

  .products-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }

  .home-products__header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }
  .home-products__tabs { width: 100%; overflow-x: auto; }

  .brand-strip__grid { grid-template-columns: 1fr; gap: var(--space-8); }
  .brand-strip__stats { grid-template-columns: repeat(2, 1fr); }

  /* ---- Shop mobile ---- */

  .shop-layout { grid-template-columns: 1fr; padding-top: var(--space-4); }
  .shop-toolbar { flex-wrap: wrap; }
  .shop-filter-btn { display: flex; }

  /* Mobile horizontal category chips */
  .mobile-category-chips {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    scrollbar-width: none;
    padding: var(--space-3) 0;
    border-bottom: var(--border-thin);
    margin-bottom: var(--space-4);
  }
  .mobile-category-chips::-webkit-scrollbar { display: none; }
  .mobile-category-chip {
    flex-shrink: 0;
    padding: var(--space-2) var(--space-4);
    background: var(--color-surface-2);
    border: var(--border-thin);
    border-radius: var(--radius-full);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--duration-fast);
  }
  .mobile-category-chip.is-active,
  .mobile-category-chip:hover {
    background: var(--color-yellow);
    border-color: var(--color-yellow);
    color: var(--color-black);
  }

  .shop-products-grid,
  .woocommerce ul.products,
  ul.products { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }

  /* ---- Product cards mobile ---- */

  .product-card {
    /* Remove left border accent on very small cards to save space */
    border-left-width: 2px;
  }
  .product-card__body { padding: var(--space-3); }
  .product-card__actions { padding: 0 var(--space-3) var(--space-3); }
  .product-card__title { font-size: var(--text-xs); -webkit-line-clamp: 3; }
  .product-card__price .price { font-size: var(--text-md); }

  /* ---- Single product mobile ---- */

  .product-layout { gap: var(--space-6); }
  .product-gallery__thumbs { gap: var(--space-1); }
  .product-gallery__thumb { width: 60px; height: 60px; }
  .product-info { gap: var(--space-4); }
  .product-info__title { font-size: var(--text-2xl); }
  .product-info__price { flex-wrap: wrap; }
  .product-info__add-to-cart {
    flex-direction: row;
    gap: var(--space-3);
  }
  .product-info__add-to-cart .btn { flex: 1; }

  .related-products-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }

  /* Sticky bar offset for mobile nav */
  .product-sticky-bar { bottom: var(--mobile-nav-height); }
  .product-sticky-bar.is-visible { display: flex; }

  /* ---- Checkout mobile ---- */

  .checkout-layout { grid-template-columns: 1fr; }
  .checkout-order-summary { position: static; }
  .woocommerce-billing-fields__field-wrapper,
  .woocommerce-shipping-fields__field-wrapper {
    grid-template-columns: 1fr;
  }

  /* ---- Footer mobile ---- */

  .footer-newsletter__inner { grid-template-columns: 1fr; gap: var(--space-6); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
  .footer-col--brand { grid-column: 1 / -1; }

  /* ---- Pagination mobile ---- */

  .woocommerce-pagination ul { flex-wrap: wrap; justify-content: center; }

}

/* =========================================================================
   Very small screens (max-width: 480px)
   ========================================================================= */

@media (max-width: 480px) {

  /* Single column products */
  .shop-products-grid,
  .woocommerce ul.products,
  ul.products { grid-template-columns: 1fr; }

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

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

  .checkout-progress .checkout-progress__label { display: none; }

  .hero__title { font-size: clamp(2.5rem, 10vw, 4rem); }
  .hero__actions { flex-direction: column; width: 100%; }
  .hero__actions .btn { width: 100%; justify-content: center; }

  /* Cart count badge larger touch target */
  .mobile-bottom-nav__link { padding: var(--space-1); }

  /* Product card in single column */
  .shop-products-grid .product-card {
    flex-direction: row;
    align-items: center;
  }
  .shop-products-grid .product-card__image-wrap {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    aspect-ratio: auto;
  }
  .shop-products-grid .product-card__body { padding: var(--space-4); }
  .shop-products-grid .product-card__title { -webkit-line-clamp: 2; }
}

/* =========================================================================
   Cart pulse animation
   ========================================================================= */

@keyframes cartPulse {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.3); }
  60%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.cart-pulse .cart-count {
  animation: cartPulse 0.5s var(--ease-out) forwards;
}

/* =========================================================================
   Sub-menu toggle button on mobile
   ========================================================================= */

.sub-menu-toggle {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  padding: var(--space-2) var(--space-4);
  display: flex;
  align-items: center;
  transition: color var(--duration-fast);
}
.sub-menu-toggle svg {
  transition: transform var(--duration-fast);
}
.sub-menu-toggle:hover { color: var(--color-yellow); }

/* =========================================================================
   Print styles
   ========================================================================= */

@media print {
  .site-header,
  .site-footer,
  .mobile-bottom-nav,
  .product-sticky-bar,
  .product-gallery__thumbs,
  .product-trust-badges,
  .home-cta { display: none !important; }

  body { background: white; color: black; }
  .product-layout { grid-template-columns: 1fr; }
}
