/* ===================================
   Dunamis Carpet and Seams Services
   Responsive Stylesheet
   =================================== */

/* ===================================
   Mobile Styles (< 640px)
   Base styles are mobile-first
   =================================== */

/* ===================================
   Tablet Styles (640px - 1024px)
   =================================== */

@media (min-width: 640px) {
  /* Typography */
  h1 {
    font-size: var(--text-5xl);
  }

  h2 {
    font-size: var(--text-4xl);
  }

  h3 {
    font-size: var(--text-3xl);
  }

  /* Container */
  .container {
    padding: 0 var(--space-6);
  }

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

  /* Hero */
  .hero {
    min-height: 500px;
  }

  .hero-title {
    font-size: 3.5rem;
  }

  .hero-subtitle {
    font-size: var(--text-xl);
  }

  /* Cards */
  .card {
    padding: var(--space-8);
  }

  /* Footer */
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Cookie Banner */
  .cookie-banner-content {
    flex-wrap: nowrap;
  }
}

/* ===================================
   Desktop Styles (1024px+)
   =================================== */

@media (min-width: 1024px) {
  /* Typography */
  h1 {
    font-size: 4rem;
  }

  h2 {
    font-size: var(--text-4xl);
  }

  /* Container */
  .container {
    padding: 0 var(--space-8);
  }

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

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

  /* Hero */
  .hero {
    min-height: 600px;
  }

  .hero-title {
    font-size: var(--text-5xl);
  }

  /* Footer */
  .footer-content {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Sections */
  .section {
    padding: var(--space-24) 0;
  }
}

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

@media (min-width: 1280px) {
  /* Hero */
  .hero-title {
    font-size: 4.5rem;
  }

  .hero-subtitle {
    font-size: var(--text-2xl);
  }
}

/* ===================================
   Mobile Navigation (< 1024px)
   =================================== */

@media (max-width: 1023px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background-color: var(--color-white);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-4);
    box-shadow: var(--shadow-lg);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base);
  }

  .nav-menu.active {
    max-height: 500px;
  }

  .nav-link {
    padding: var(--space-4);
    border-bottom: 1px solid var(--color-light-gray);
  }

  .nav-link:last-child {
    border-bottom: none;
  }

  .nav-link.active::after {
    display: none;
  }
}

/* ===================================
   Mobile Adjustments
   =================================== */

@media (max-width: 639px) {
  /* Typography */
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.5rem;
  }

  h4 {
    font-size: 1.25rem;
  }

  /* Sections */
  .section {
    padding: var(--space-12) 0;
  }

  .section-lg {
    padding: var(--space-16) 0;
  }

  /* Hero */
  .hero {
    min-height: 400px;
    padding: var(--space-8) 0;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: var(--text-base);
  }

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

  .hero-cta .btn {
    width: 100%;
  }

  /* Buttons */
  .btn {
    width: 100%;
    justify-content: center;
  }

  .btn-group .btn {
    width: 100%;
  }

  /* Cards */
  .card {
    padding: var(--space-4);
  }

  .service-card {
    padding: var(--space-6);
  }

  /* Grid */
  .grid {
    gap: var(--space-4);
  }

  /* Footer */
  .footer {
    padding: var(--space-12) 0 var(--space-6);
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  /* Cookie Banner */
  .cookie-banner {
    padding: var(--space-4);
  }

  .cookie-banner-content {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-banner-actions {
    flex-direction: column;
  }

  .cookie-banner-actions .btn {
    width: 100%;
  }

  /* Cookie Modal */
  .cookie-modal {
    padding: var(--space-2);
  }

  .cookie-modal-content {
    padding: var(--space-6);
  }

  .cookie-modal-actions {
    flex-direction: column;
  }

  .cookie-modal-actions .btn {
    width: 100%;
  }

  /* Forms */
  .form-group {
    margin-bottom: var(--space-4);
  }

  /* Contact Info */
  .contact-info-card {
    flex-direction: column;
    text-align: center;
  }

  .contact-info-icon {
    margin: 0 auto;
  }

  /* Map */
  .map-container {
    height: 300px;
  }

  /* Section Headers */
  .section-header {
    margin-bottom: var(--space-8);
  }

  .section-title {
    font-size: var(--text-3xl);
  }

  .section-subtitle {
    font-size: var(--text-base);
  }

  /* Logo */
  .logo {
    font-size: var(--text-lg);
  }

  .logo img {
    height: 40px;
  }

  /* Header */
  .header-container {
    padding: var(--space-3) var(--space-4);
  }
}

/* ===================================
   Tablet Specific Adjustments
   =================================== */

@media (min-width: 640px) and (max-width: 1023px) {
  /* Hero */
  .hero {
    min-height: 500px;
  }

  .hero-title {
    font-size: 3rem;
  }

  .hero-subtitle {
    font-size: var(--text-lg);
  }

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

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

  /* Footer */
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Cookie Banner */
  .cookie-banner-actions {
    flex-direction: row;
  }

  .cookie-banner-actions .btn {
    width: auto;
  }
}

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

@media print {
  .header,
  .footer,
  .cookie-banner,
  .cookie-modal,
  .mobile-menu-toggle,
  .btn,
  form {
    display: none !important;
  }

  .hero {
    min-height: auto;
    padding: var(--space-8) 0;
  }

  .section {
    padding: var(--space-8) 0;
  }

  .card {
    box-shadow: none;
    border: 1px solid var(--color-light-gray);
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }
}

/* ===================================
   Landscape Mobile
   =================================== */

@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: 300px;
  }

  .cookie-banner {
    max-height: 80vh;
    overflow-y: auto;
  }
}

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

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Optimize for retina displays */
  .logo img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* ===================================
   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;
  }
}

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

@media (prefers-color-scheme: dark) {
  /* Currently not implemented, but structure is here for future */
  /* Uncomment and customize if dark mode is needed */
  
  /*
  :root {
    --color-white: #1e293b;
    --color-off-white: #334155;
    --color-dark-gray: #f1f5f9;
    --color-medium-gray: #cbd5e1;
    --color-light-gray: #475569;
  }
  */
}

/* ===================================
   Touch Device Optimizations
   =================================== */

@media (hover: none) and (pointer: coarse) {
  /* Increase touch targets */
  .btn {
    min-height: 44px;
    padding: 14px 24px;
  }

  .nav-link {
    min-height: 44px;
    padding: var(--space-3) var(--space-4);
  }

  .form-input,
  .form-select,
  .form-textarea {
    min-height: 44px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  /* Remove hover effects on touch devices */
  .card:hover {
    transform: none;
  }

  .btn:hover {
    transform: none;
  }
}

/* ===================================
   Accessibility - Focus Visible
   =================================== */

@media (prefers-reduced-motion: no-preference) {
  *:focus-visible {
    outline: 2px solid var(--color-sky-blue);
    outline-offset: 2px;
    transition: outline-offset 0.2s ease;
  }
}

/* ===================================
   Container Queries (Future-proof)
   =================================== */

/* When container queries are widely supported, add them here */
/* @container (min-width: 400px) { ... } */
