/* ===================================
   OG Pharmacy - Responsive Styles
   Mobile-First Approach
   =================================== */

/* ===================================
   Mobile Devices (320px - 480px)
   =================================== */

@media (max-width: 480px) {
  /* Remove body padding-top on mobile to fix white space above header */
  body {
    padding-top: 0 !important;
  }

  /* Typography adjustments */
  html {
    font-size: 14px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  /* Container */
  .container {
    padding: 0 var(--spacing-md);
  }

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

  /* Header */
  .header-content {
    padding: var(--spacing-sm) 0;
  }

  .logo {
    font-size: 1.25rem;
  }

  .logo img {
    height: 36px;
  }

  /* Show mobile menu toggle */
  .mobile-menu-toggle {
    display: block;
  }

  /* Hide desktop navigation and CTAs */
  .nav {
    display: none;
  }

  .header-ctas {
    display: none;
  }

  /* Hero */
  .hero {
    padding: var(--spacing-2xl) 0;
    margin-top: 60px; /* Space for fixed header */
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
    text-align: center;
  }

  .hero-text {
    order: 1;
    text-align: center;
  }

  .hero-text h1 {
    font-size: 1.75rem;
    line-height: 1.3;
    margin-bottom: var(--spacing-md);
  }

  .hero-text p {
    font-size: 1rem;
    margin-bottom: var(--spacing-lg);
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
    gap: var(--spacing-sm);
  }

  .hero-buttons .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-image {
    order: 2;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .hero-image img {
    max-width: 80%;
    height: auto;
    max-height: 250px;
    object-fit: contain;
  }

  /* Trust badges in hero */
  .trust-badges {
    justify-content: center;
    margin-top: var(--spacing-lg) !important;
  }

  /* Product Cards */
  .product-image {
    height: 200px;
  }

  .product-name {
    font-size: 1rem;
  }

  /* Forms */
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px; /* Prevent zoom on iOS */
  }

  /* Footer */
  .footer {
    padding: var(--spacing-2xl) 0 var(--spacing-lg);
  }

  .footer-content {
    gap: var(--spacing-2xl);
  }

  /* Floating WhatsApp */
  .whatsapp-float {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    bottom: 20px;
    right: 20px;
    z-index: 999;
  }

  /* Show phone float on mobile */
  .phone-float {
    display: flex;
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
    bottom: 20px;
    left: 20px;
    z-index: 999;
  }

  /* Adjust tooltip on mobile */
  .phone-float::before {
    font-size: 0.75rem;
    padding: 4px 10px;
    bottom: calc(100% + 8px);
  }

  /* Modals */
  .modal-content {
    margin: var(--spacing-md);
    padding: var(--spacing-lg);
  }
}

/* ===================================
   Phablets (481px - 768px)
   =================================== */

@media (min-width: 481px) and (max-width: 768px) {
  /* Remove body padding-top on mobile to fix white space above header */
  body {
    padding-top: 0 !important;
  }

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

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

  /* Hero */
  .hero {
    margin-top: 60px; /* Space for fixed header */
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
    text-align: center;
  }

  .hero-text {
    text-align: center;
  }

  .hero-text h1 {
    font-size: 2.25rem;
  }

  .hero-image {
    max-width: 100%;
    display: flex;
    justify-content: center;
  }

  .hero-image img {
    max-width: 70%;
    height: auto;
    max-height: 300px;
  }

  /* Product Grid */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===================================
   Tablets (769px - 1024px)
   =================================== */

@media (min-width: 769px) and (max-width: 1024px) {
  /* Container */
  .container {
    max-width: 960px;
  }

  /* Navigation */
  .nav {
    position: static;
    width: auto;
    height: auto;
    background: none;
    box-shadow: none;
    padding: 0;
  }

  .nav-list {
    flex-direction: row;
  }

  .mobile-menu-toggle {
    display: none;
  }

  .header-ctas {
    display: flex;
  }

  /* Hero */
  .hero-content {
    grid-template-columns: 1fr 1fr;
  }

  .hero-text {
    text-align: left;
  }

  .hero-text h1 {
    font-size: 2.5rem;
  }

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

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

  /* Footer */
  .footer-content {
    grid-template-columns: 2fr 1fr 1fr;
    text-align: left;
  }
}

/* ===================================
   Laptops (1025px - 1280px)
   =================================== */

@media (min-width: 1025px) and (max-width: 1280px) {
  /* Container */
  .container {
    max-width: 1140px;
  }

  /* Hero */
  .hero-text h1 {
    font-size: 2.75rem;
  }
}

/* ===================================
   Desktops (1281px - 1920px)
   =================================== */

@media (min-width: 1281px) {
  /* Container */
  .container {
    max-width: 1280px;
  }

  /* Hero */
  .hero {
    padding: 5rem 0;
  }

  .hero-text h1 {
    font-size: 3.5rem;
  }

  .hero-text p {
    font-size: 1.375rem;
  }

  /* Product Grid */
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Section spacing */
  .section {
    padding: 5rem 0;
  }
}

/* ===================================
   Large Desktops (1920px+)
   =================================== */

@media (min-width: 1921px) {
  /* Container */
  .container {
    max-width: 1440px;
  }

  /* Typography scale up */
  html {
    font-size: 18px;
  }

  /* Hero */
  .hero-text h1 {
    font-size: 4rem;
  }

  .hero-text p {
    font-size: 1.5rem;
  }
}

/* ===================================
   Print Styles
   =================================== */

@media print {
  /* Hide non-essential elements */
  .header,
  .footer,
  .whatsapp-float,
  .mobile-menu-toggle,
  .hero-buttons,
  .btn,
  .product-actions {
    display: none !important;
  }

  /* Adjust layout */
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  /* Ensure images print */
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  /* Page breaks */
  .product-card,
  .card {
    page-break-inside: avoid;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }

  /* Links */
  a[href^="http"]:after {
    content: " (" attr(href) ")";
  }
}

/* ===================================
   Accessibility & High Contrast
   =================================== */

@media (prefers-contrast: high) {
  /* Increase contrast for better readability */
  body {
    background: #fff;
    color: #000;
  }

  .btn-primary {
    background-color: #004080;
  }

  .btn-secondary {
    background-color: #cc0033;
  }

  a {
    color: #0000ee;
    text-decoration: underline;
  }

  .card {
    border: 2px solid #000;
  }
}

/* ===================================
   Reduced Motion
   =================================== */

@media (prefers-reduced-motion: reduce) {
  /* Disable animations for users who prefer reduced motion */
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===================================
   Dark Mode Support (Future)
   =================================== */

@media (prefers-color-scheme: dark) {
  /* Add dark mode styles here if needed in future */
  /* Currently keeping light theme as per B2B professional requirement */
}

/* ===================================
   Orientation-Specific Styles
   =================================== */

/* Landscape phones */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    padding: var(--spacing-xl) 0;
  }

  .hero-text h1 {
    font-size: 1.75rem;
  }

  .hero-content {
    grid-template-columns: 1fr 1fr;
  }

  .hero-image {
    max-height: 300px;
  }
}

/* Portrait tablets */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}