/* ============================================
   Responsive Design
   ============================================ */

/* Tablets (768px and below) */
@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  h4 { font-size: 1.1rem; }

  .container {
    padding: 0 1rem;
  }

  .row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .row.two-columns,
  .row.three-columns,
  .row.four-columns {
    grid-template-columns: 1fr;
  }

  /* Hero Section */
  .hero-section {
    padding: 2rem 0;
  }

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

  .hero-search {
    flex-direction: column;
  }

  .hero-search input {
    width: 100%;
  }

  .hero-search button {
    width: 100%;
  }

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

  /* Navigation */
  .main-navigation {
    display: none;
  }

  .main-navigation.active {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid var(--border-color);
  }

  .main-navigation ul {
    flex-direction: column;
  }

  .main-navigation li {
    border-bottom: 1px solid var(--border-color);
  }

  /* Header */
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  .site-branding {
    width: 100%;
  }

  .header-actions {
    width: 100%;
  }

  /* Cards */
  .card {
    margin-bottom: 1rem;
  }

  /* Forms */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  /* Buttons */
  .btn {
    width: 100%;
    display: block;
    text-align: center;
  }

  .btn-small {
    padding: 0.5rem;
  }

  /* Footer */
  .footer-content {
    padding: 2rem 0;
  }

  .footer-column {
    margin-bottom: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
  }

  /* Sidebar */
  .sidebar {
    margin-top: 2rem;
  }

  /* Product/Supplier Cards */
  .product-card,
  .supplier-card {
    margin-bottom: 1rem;
  }

  /* Archive Header */
  .archive-header {
    padding: 1.5rem 0;
  }

  .archive-header h1 {
    font-size: 1.5rem;
  }

  /* Details Grid */
  .details-grid {
    grid-template-columns: 1fr;
  }

  .detail-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
  }

  /* CTA Section */
  .cta-section {
    padding: 2rem 0;
  }

  .cta-section h2 {
    font-size: 1.5rem;
  }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }
  h4 { font-size: 1rem; }

  .container {
    padding: 0 0.75rem;
  }

  .btn {
    padding: 0.5rem;
    font-size: 0.9rem;
  }

  .btn-large {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

  /* Hero Section */
  .hero-section {
    padding: 1.5rem 0;
  }

  .hero-content h1 {
    font-size: 1.5rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .hero-stats {
    gap: 1rem;
  }

  .stat h3 {
    font-size: 1.5rem;
  }

  .stat p {
    font-size: 0.85rem;
  }

  /* Card spacing */
  .card-body,
  .card-header,
  .card-footer {
    padding: 1rem;
  }

  /* Form elements */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  textarea,
  select {
    padding: 0.5rem;
    margin-bottom: 0.75rem;
  }

  label {
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
  }

  /* Spacing utilities */
  .mt-1 { margin-top: 0.35rem; }
  .mt-2 { margin-top: 0.75rem; }
  .mt-3 { margin-top: 1rem; }
  .mt-4 { margin-top: 1.5rem; }

  .mb-1 { margin-bottom: 0.35rem; }
  .mb-2 { margin-bottom: 0.75rem; }
  .mb-3 { margin-bottom: 1rem; }
  .mb-4 { margin-bottom: 1.5rem; }

  .p-1 { padding: 0.35rem; }
  .p-2 { padding: 0.75rem; }
  .p-3 { padding: 1rem; }
  .p-4 { padding: 1.5rem; }

  /* Footer */
  .footer-content {
    padding: 1.5rem 0;
  }

  .footer-column h3 {
    font-size: 1rem;
  }

  .footer-column p {
    font-size: 0.9rem;
  }

  /* Text alignment */
  .text-center {
    text-align: center;
  }

  /* Badge */
  .badge {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
  }

  /* Alignments */
  .alignleft,
  .alignright {
    float: none;
    margin-right: 0;
    margin-left: 0;
    margin-bottom: 1rem;
  }
}

/* Large screens (1200px and above) */
@media (min-width: 1200px) {
  .container {
    max-width: 1200px;
  }

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

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

  .row.four-columns {
    grid-template-columns: repeat(4, 1fr);
  }

  .col-lg-3 {
    grid-column: span 3;
  }

  .col-lg-4 {
    grid-column: span 4;
  }

  .col-lg-6 {
    grid-column: span 6;
  }

  .col-lg-8 {
    grid-column: span 8;
  }

  .col-lg-9 {
    grid-column: span 9;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    color: black;
  }

  .site-header,
  .site-footer,
  .sidebar,
  .btn,
  .widget-inquiry {
    display: none;
  }

  .container {
    max-width: 100%;
  }

  a {
    text-decoration: underline;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #1a1a1a;
    color: #e0e0e0;
  }

  .card {
    background-color: #2a2a2a;
    border-color: #444;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  textarea,
  select {
    background-color: #333;
    color: #e0e0e0;
    border-color: #555;
  }

  .hero-section {
    background-color: #1e40af;
  }
}
