﻿/* ============================================================
   PureGlow Wellness — Responsive Stylesheet
   ============================================================ */

/* ============================================================
   LARGE DESKTOP (1400px+)
   ============================================================ */
@media (min-width: 1400px) {
  .container { max-width: 1360px; }
}

/* ============================================================
   DESKTOP (1200px – 1399px)
   ============================================================ */
@media (max-width: 1199px) {
  .hero-content { gap: 2.5rem; }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 2rem; }
}

/* ============================================================
   TABLET LANDSCAPE (992px – 1199px)
   ============================================================ */
@media (max-width: 991px) {
  :root {
    --spacing-xl: 4.5rem;
    --spacing-lg: 2.75rem;
  }

  /* HEADER */
  .site-nav     { display: none; }
  .hamburger    { display: flex; }
  .header-actions .btn { display: none !important; }
  .header-actions .btn.btn-sm { display: none !important; }
  .header-actions { margin-left: auto; }
  .hamburger { display: flex !important; }

  /* HERO */
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 4rem 1.5rem;
    gap: 3rem;
  }
  .hero-text { padding-right: 0; }
  .hero-text .lead { margin: 0 auto 2rem; }
  .hero-buttons { justify-content: center; }
  .hero-stats   { justify-content: center; }
  .hero-visual  { display: none; }

  /* ABOUT */
  .about-story-grid,
  .about-story-grid.reverse { grid-template-columns: 1fr; direction: ltr; gap: 3rem; }
  .about-image-wrap .accent-img { display: none; }
  .mission-vision-grid { grid-template-columns: 1fr; }

  /* CONTACT */
  .contact-grid { grid-template-columns: 1fr; gap: 3rem; }

  /* AUTH */
  .auth-page { grid-template-columns: 1fr; min-height: 100vh; }
  .auth-visual {
    display: none;
  }
  .auth-form-panel { padding: 3rem 1.5rem; min-height: 100vh; }

  /* FOOTER */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
  .footer-brand { grid-column: 1 / -1; }

  /* OFFER */
  .offer-section { flex-direction: column; text-align: center; margin: 0 0; padding: 3rem 2rem; border-radius: 0; }

  /* GRIDS */
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }

  /* ADMIN */
  .admin-sidebar {
    position: fixed;
    transform: translateX(-100%);
    z-index: 200;
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .sidebar-overlay.active { display: block; }
  .admin-grid-2 { grid-template-columns: 1fr; }
  .admin-grid-2-1 { grid-template-columns: 1fr; }
  .admin-grid-3 { grid-template-columns: 1fr 1fr; }
  .topbar-search { display: none; }
}

/* ============================================================
   TABLET PORTRAIT (768px – 991px)
   ============================================================ */
@media (max-width: 767px) {
  :root {
    --spacing-xl: 3.5rem;
    --spacing-lg: 2.25rem;
  }

  /* TYPOGRAPHY */
  h1 { font-size: 2rem; }
  h2 { font-size: 1.65rem; }
  h3 { font-size: 1.3rem; }

  /* HEADER */
  .header-inner { height: 68px; }
  .brand-logo .logo-name { font-size: 1.3rem; }

  /* HERO */
  .hero-content { padding: 3.5rem 1rem; }
  .hero-stats { gap: 1.5rem; }
  .hero-float-card { display: none; }

  /* PRODUCTS */
  .products-grid { grid-template-columns: 1fr 1fr; gap: 1.25rem; }
  .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .testimonials-grid { grid-template-columns: 1fr; }
  .tips-grid { grid-template-columns: 1fr 1fr; }
  .team-grid { grid-template-columns: 1fr 1fr; }
  .quality-grid { grid-template-columns: 1fr 1fr; }

  /* NEWSLETTER */
  .newsletter-form { flex-direction: column; }

  /* FOOTER */
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-bottom-links { justify-content: center; }

  /* FORM CARD */
  .form-card { padding: 2rem 1.5rem; }

  /* GRIDS */
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }

  /* STATS */
  .stats-grid { grid-template-columns: 1fr 1fr; }

  /* ADMIN */
  .admin-stats-grid { grid-template-columns: 1fr 1fr; }
  .admin-grid-3 { grid-template-columns: 1fr; }
  .payout-summary-grid { grid-template-columns: 1fr 1fr; }
  .quick-actions { grid-template-columns: repeat(3, 1fr); }
  .admin-page-header { flex-direction: column; align-items: flex-start; }
  .admin-content { padding: 1.25rem; }

  /* PAGE BANNER */
  .page-banner { padding: 3.5rem 1rem; }
}

/* ============================================================
   MOBILE (max 576px)
   ============================================================ */
@media (max-width: 575px) {
  :root {
    --spacing-xl: 2.75rem;
    --spacing-lg: 2rem;
  }

  /* Prevent right-side gap/horizontal overflow on small screens */
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  #main-content,
  .site-header,
  .hero-section,
  .page-banner,
  .site-footer {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  .hero-content,
  .site-header .container,
  .container,
  .container-sm {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .container { padding: 0 1rem; }

  /* HEADER */
  .header-inner { height: 62px; }

  /* HERO */
  .hero-content { padding: 2.5rem 1rem; }
  .hero-badge { font-size: 0.72rem; padding: 0.3rem 0.85rem; }
  .hero-stats { flex-direction: column; gap: 1rem; padding-top: 1.5rem; }

  /* PRODUCTS */
  .products-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .product-card .card-body { padding: 1rem; }
  .product-card .card-title { font-size: 0.9rem; }

  /* CATEGORIES */
  .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
  .category-card { padding: 1.5rem 1rem; }

  /* FEATURES */
  .features-grid { grid-template-columns: 1fr; }

  /* TIPS */
  .tips-grid { grid-template-columns: 1fr; }

  /* TEAM */
  .team-grid { grid-template-columns: 1fr; }
  .quality-grid { grid-template-columns: 1fr; }

  /* OFFER */
  .offer-section { padding: 2rem 1.25rem; }

  /* NEWSLETTER */
  .newsletter-section { padding: 3rem 1rem; }

  /* FORM CARD */
  .form-card { padding: 1.75rem 1.25rem; }

  /* AUTH */
  .auth-form-panel { padding: 2rem 1rem; }

  /* INFO CARDS */
  .info-card { flex-direction: column; text-align: center; }
  .info-card .info-icon { margin: 0 auto; }

  /* GRIDS */
  .grid-4 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }

  /* ADMIN */
  .admin-stats-grid { grid-template-columns: 1fr; }
  .payout-summary-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .admin-filter-bar { flex-direction: column; align-items: stretch; }
  .filter-search { max-width: 100%; }
  .topbar-title { font-size: 1rem; }

  /* SECTION HEADER */
  .section-header { margin-bottom: 2.5rem; }

  /* BUTTONS */
  .hero-buttons { flex-direction: column; align-items: center; }
  .btn-lg { padding: 0.95rem 2rem; }
}

/* ============================================================
   MOBILE SMALL (max 380px)
   ============================================================ */
@media (max-width: 380px) {
  .products-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   RESPONSIVE ENHANCEMENTS (all pages)
   ============================================================ */
@media (max-width: 991px) {
  /* Admin table and topbar behavior on tablet/mobile */
  .admin-topbar {
    padding: 0.75rem 1rem;
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    align-items: center;
  }
  .topbar-left,
  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }
  .admin-table-wrap { overflow-x: auto; }
  .admin-table { min-width: 760px; }

  /* Keep settings tabs usable horizontally */
  .settings-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .settings-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* Ensure modals don't overflow viewport */
  .admin-modal {
    max-height: 90vh;
    overflow-y: auto;
  }
}

@media (max-width: 767px) {
  .topbar-breadcrumb,
  .topbar-profile .profile-name {
    display: none;
  }
  .topbar-actions {
    justify-content: flex-end;
    gap: 0.5rem;
  }

  /* About/contact media sizing */
  .about-image-wrap .main-img { height: 340px !important; }
  .map-placeholder img { height: 180px !important; }

  /* Handle inline two-column auth rows safely */
  .auth-form-card [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  .auth-form-card [style*="display:flex; align-items:center; justify-content:space-between"] {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.5rem;
  }
}

@media (max-width: 575px) {
  .admin-content { padding: 1rem; }
  .admin-card-header,
  .admin-card-body,
  .admin-card-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .admin-table { min-width: 680px; }

  .about-image-wrap .main-img { height: 260px !important; }

  /* Contact social cards with inline min-width */
  a[style*="min-width:160px"] {
    min-width: 100% !important;
  }

  /* Auth social buttons fallback */
  .auth-form-card [style*="display:grid; grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .site-header,
  .hamburger,
  .mobile-nav,
  .admin-sidebar,
  .admin-topbar,
  .newsletter-section { display: none !important; }
  body { background: #fff; color: #000; }
  .admin-main { margin-left: 0; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   DARK MODE CONSIDERATIONS (optional, minimal)
   ============================================================ */
@media (prefers-color-scheme: dark) {
  /* intentionally minimal — brand design uses light palette */
}

