/* Responsive Design - Mobile First */

/* Large Desktop */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
}

/* Desktop */
@media (max-width: 1199px) {
  .grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .sidebar-layout {
    grid-template-columns: 1fr 260px;
  }
}

/* Tablet */
@media (max-width: 991px) {
  :root {
    --container-padding: var(--space-4);
  }
  
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-2xl); }
  
  .section {
    padding: var(--space-16) 0;
  }
  
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .hero {
    padding: calc(72px + var(--space-16)) 0 var(--space-16);
  }
  
  .hero-title {
    font-size: var(--text-4xl);
  }
  
  .hero-subtitle {
    font-size: var(--text-lg);
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
  
  .sidebar-layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    position: static;
    order: 2;
  }
}

/* Mobile */
@media (max-width: 767px) {
  :root {
    --container-padding: var(--space-4);
  }
  
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
  h4 { font-size: var(--text-lg); }
  
  .section {
    padding: var(--space-12) 0;
  }
  
  .section-title {
    margin-bottom: var(--space-8);
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  /* Mobile Navigation */
  .navbar-toggle {
    display: flex;
  }
  
  .navbar-nav {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-surface);
    flex-direction: column;
    padding: var(--space-6);
    gap: var(--space-2);
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
    box-shadow: var(--shadow-xl);
  }
  
  .navbar-nav.active {
    transform: translateX(0);
  }
  
  .nav-link {
    padding: var(--space-4);
    font-size: var(--text-base);
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
  }
  
  /* Hero Mobile */
  .hero {
    padding: calc(72px + var(--space-12)) 0 var(--space-12);
  }
  
  .hero-title {
    font-size: var(--text-3xl);
  }
  
  .hero-subtitle {
    font-size: var(--text-base);
  }
  
  .hero-cta {
    flex-direction: column;
  }
  
  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }
  
  /* Footer Mobile */
  .footer {
    padding: var(--space-12) 0 var(--space-6);
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  
  /* Cards Mobile */
  .card {
    padding: var(--space-4);
  }
  
  .feature-card {
    padding: var(--space-6);
  }
  
  /* Tables Mobile */
  .table-container {
    margin: 0 calc(-1 * var(--container-padding));
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  .data-table {
    font-size: var(--text-xs);
  }
  
  .data-table th,
  .data-table td {
    padding: var(--space-3);
  }
  
  /* Page Header Mobile */
  .page-header {
    padding: calc(72px + var(--space-8)) 0 var(--space-6);
  }
  
  /* CTA Section Mobile */
  .cta-section {
    padding: var(--space-16) 0;
  }
  
  /* Breadcrumb Mobile */
  .breadcrumb {
    font-size: var(--text-xs);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
}

/* Small Mobile */
@media (max-width: 375px) {
  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }
  
  .hero-title {
    font-size: var(--text-2xl);
  }
  
  .btn {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
  }
}

/* Touch Device Optimizations */
@media (hover: none) {
  .card:hover {
    transform: none;
    box-shadow: var(--shadow-md);
  }
  
  .btn:hover {
    transform: none;
  }
  
  .product-card:hover {
    transform: none;
    box-shadow: var(--shadow-md);
  }
}

/* Reduced Motion */
@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;
  }
}

/* Print Styles */
@media print {
  .navbar,
  .footer,
  .sidebar,
  .breadcrumb,
  .cta-section,
  .hero-cta {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
  }
  
  .container {
    max-width: 100%;
  }
  
  a {
    text-decoration: underline;
    color: #000;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --color-border: #000;
    --color-text-secondary: #000;
  }
  
  .card,
  .sidebar-widget {
    border-width: 2px;
  }
}
