/* =============================================
   स्वर्णी पशु आहार - Responsive Styles
   Mobile-first breakpoints
   ============================================= */

/* Box sizing globally */
*,
*::before,
*::after {
  box-sizing: border-box;
}

.app-shell, body:not(.admin-body) {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--off-white);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50% !important;
  transform: translateX(-50%);
  width: 100% !important;
  max-width: 430px;
  z-index: 999;
}

/* TABLET: 768px */
@media (max-width: 1024px) {
  .hero-container { gap: var(--space-xl); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-xl); }
  .dashboard-layout { grid-template-columns: 200px 1fr; }
  .why-us-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .nav-menu { display: none; }
  .hamburger { display: flex; }
  .nav-actions .btn-login span { display: none; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-sidebar { position: static; }
}

@media (max-width: 768px) {
  /* Hero */
  .hero { padding: var(--space-xl) 0 var(--space-2xl); min-height: auto; }
  .hero-container { grid-template-columns: 1fr; gap: var(--space-xl); }
  .hero-image-wrap { order: -1; }
  .hero-image-wrap img { height: 280px; }
  .hero-image-badge { display: none; }
  .hero-stats { gap: var(--space-lg); }
  .hero-actions .btn { flex: 1; justify-content: center; }

  /* Grid */
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

  /* Bottom Nav */
  .bottom-nav { display: block; }
  body:not(.admin-body) { padding-bottom: 84px; }

  /* Section spacing */
  .section { padding: var(--space-2xl) 0; }
  .section-header { margin-bottom: var(--space-xl); }

  /* Why us */
  .why-us-grid { grid-template-columns: repeat(2, 1fr); }

  /* Cart item */
  .cart-item { grid-template-columns: 64px 1fr; }
  .cart-item-actions { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }

  /* Order tracker */
  .tracker-steps { flex-direction: column; gap: var(--space-sm); }
  .tracker-steps::before { display: none; }
  .tracker-step { flex-direction: row; gap: var(--space-md); }
  .tracker-dot { margin-bottom: 0; flex-shrink: 0; }

  /* Booking details */
  .booking-detail-grid { grid-template-columns: 1fr; }

  /* Filter tabs scroll */
  .filter-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .filter-tabs::-webkit-scrollbar { height: 0; }

  /* Stats */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Slot grid */
  .slot-grid { grid-template-columns: repeat(2, 1fr); }

  /* Modal */
  .modal { max-height: 85vh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
}

@media (max-width: 480px) {
  /* Smaller screens */
  .container { padding: 0 12px; }
  .hero-title { font-size: 1.8rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .why-us-grid { grid-template-columns: 1fr; }
  .search-bar { max-width: 100%; }
  .nav-container { height: 60px; }
  .bottom-nav { display: block; }

  /* Product cards */
  .product-card-actions { flex-direction: column; }
  .slot-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 375px) {
  .hero-title { font-size: 1.6rem; }
  .hero-stats { gap: var(--space-md); }
  .hero-stat-value { font-size: 1.2rem; }
}

/* =============================================
   PRINT STYLES
   ============================================= */
@media print {
  .navbar, .bottom-nav, .footer, .btn, .toast-container { display: none !important; }
  body { background: white; color: black; padding: 0; }
}

/* =============================================
   DARK MODE (future enhancement)
   ============================================= */
/* @media (prefers-color-scheme: dark) { } */

/* Force mobile boundaries */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

#admin-app, .page-header, .section, .bottom-nav {
    max-width: 100vw;
    box-sizing: border-box;
}

/* Ensure images don't overflow */
img {
    max-width: 100%;
    height: auto;
}
