/* ===================================================================
   Bernards Office Furniture - Responsive Stylesheet
   Description: Media queries for mobile and tablet devices
   Version: 1.0
   =================================================================== */

/* ===================================================================
   Large Desktop (1440px+)
   =================================================================== */

@media (min-width: 1440px) {
  .container {
    max-width: 1400px;
  }
  
  .hero h1 {
    font-size: 4rem;
  }
}

/* ===================================================================
   Desktop (1024px - 1439px)
   =================================================================== */

@media (max-width: 1439px) {
  :root {
    --h1-size: 2.75rem;
    --h2-size: 2.25rem;
  }
}

/* ===================================================================
   Tablet (768px - 1023px)
   =================================================================== */

@media (max-width: 1023px) {
  :root {
    --h1-size: 2.5rem;
    --h2-size: 2rem;
    --h3-size: 1.75rem;
    --space-xl: 3rem;
    --container-padding: 1.5rem;
  }
  
  /* Header */
  .header-main .container {
    flex-wrap: wrap;
  }
  
  .logo {
    font-size: 1.25rem;
  }
  
  .nav-main ul {
    gap: var(--space-sm);
  }
  
  .nav-main a {
    padding: 0.5rem 0.75rem;
    font-size: var(--small-size);
  }
  
  /* Hero */
  .hero {
    padding: 6rem 0;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  /* Grid Layouts */
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* About Section */
  .about-preview {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  /* Services */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Categories */
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===================================================================
   Mobile (320px - 767px)
   =================================================================== */

@media (max-width: 767px) {
  :root {
    --h1-size: 2rem;
    --h2-size: 1.75rem;
    --h3-size: 1.5rem;
    --h4-size: 1.25rem;
    --space-lg: 2rem;
    --space-xl: 2.5rem;
    --container-padding: 1rem;
  }
  
  /* Header */
  .header-top .container {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  
  .header-top a {
    margin-left: 0;
    margin-right: var(--space-sm);
  }
  
  .header-main .container {
    justify-content: space-between;
  }
  
  .logo {
    font-size: 1.125rem;
  }
  
  /* Mobile Navigation */
  .mobile-menu-toggle {
    display: block;
  }
  
  .nav-main {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background-color: var(--primary-light);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-lg) var(--space-md);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1001;
    overflow-y: auto;
  }
  
  .nav-main.active {
    right: 0;
  }
  
  .nav-main ul {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }
  
  .nav-main a {
    display: block;
    width: 100%;
    padding: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
  }
  
  .nav-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 3px solid var(--accent-color);
    margin-left: var(--space-sm);
    margin-top: 0.5rem;
  }
  
  .nav-dropdown-menu a {
    padding-left: var(--space-md);
  }
  
  .cart-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }
  
  /* Mobile Menu Overlay */
  .mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
  }
  
  .mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
  }
  
  /* Hero */
  .hero {
    padding: 4rem 0;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  /* Buttons */
  .btn {
    padding: 0.625rem 1.5rem;
    font-size: var(--small-size);
  }
  
  .btn-large {
    padding: 0.75rem 2rem;
    font-size: 1rem;
  }
  
  /* Grid Layouts */
  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  
  /* Services */
  .services-grid {
    grid-template-columns: 1fr;
  }
  
  .service-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
  
  /* Categories */
  .categories-grid {
    grid-template-columns: 1fr;
  }
  
  .category-card {
    height: 250px;
  }
  
  /* About Section */
  .about-preview {
    grid-template-columns: 1fr;
  }
  
  .about-image {
    order: -1;
  }
  
  /* Stats */
  .stats {
    grid-template-columns: 1fr;
  }
  
  .stat-item h3 {
    font-size: 2.5rem;
  }
  
  /* CTA Section */
  .cta-section {
    padding: var(--space-lg) 0;
  }
  
  .cta-section h2 {
    font-size: 1.75rem;
  }
  
  /* Footer */
  .footer {
    padding: var(--space-lg) 0 var(--space-md);
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .footer-legal {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  /* Cards */
  .card {
    padding: var(--space-sm);
  }
  
  .card-image {
    height: 180px;
  }
  
  /* Section Spacing */
  .section {
    padding: var(--space-lg) 0;
  }
}

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

@media (max-width: 480px) {
  :root {
    --h1-size: 1.75rem;
    --h2-size: 1.5rem;
    --container-padding: 0.875rem;
  }
  
  .hero h1 {
    font-size: 1.75rem;
  }
  
  .hero {
    padding: 3rem 0;
  }
  
  .category-card {
    height: 200px;
  }
  
  .stat-item h3 {
    font-size: 2rem;
  }
}

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

@media print {
  .header,
  .footer,
  .nav-main,
  .mobile-menu-toggle,
  .cart-icon,
  .btn,
  .cta-section {
    display: none;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
  }
  
  a {
    text-decoration: underline;
    color: #000;
  }
  
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }
  
  img {
    max-width: 100%;
    page-break-inside: avoid;
  }
}

/* ===================================================================
   Landscape Orientation (Mobile/Tablet)
   =================================================================== */

@media (max-width: 1023px) and (orientation: landscape) {
  .hero {
    padding: 3rem 0;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .category-card {
    height: 200px;
  }
}

/* ===================================================================
   High DPI Displays
   =================================================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Optimize images and icons for retina displays */
  .service-icon,
  .logo {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* ===================================================================
   Reduced Motion (Accessibility)
   =================================================================== */

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

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

@media (prefers-color-scheme: dark) {
  /* Keep light mode as default for professional appearance */
  /* This can be enabled later if needed */
}

/* ===================================================================
   Hover Support
   =================================================================== */

@media (hover: none) {
  /* Remove hover effects on touch devices */
  .card:hover,
  .nav-main a:hover,
  .btn:hover {
    transform: none;
  }
  
  /* Add active states for better touch feedback */
  .card:active,
  .btn:active {
    transform: scale(0.98);
  }
}