/* ========================================
   MOBILE FIRST RESPONSIVE DESIGN
   ======================================== */

/* Base styles are mobile-first (above 320px) */

/* ========================================
   TABLET (768px and up)
   ======================================== */

@media (max-width: 768px) {
  /* Header adjustments */
  .header {
    padding: var(--spacing-sm);
  }
  
  .logo {
    font-size: 1.2rem;
  }
  
  .language-switcher {
    gap: 0.3rem;
  }
  
  .lang-link {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
  }
  
  /* Split screen becomes stacked */
  .split-screen {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }
  
  .split-panel {
    min-height: 50vh;
    padding: var(--spacing-md);
  }
  
  /* Hero sections */
  .hero {
    min-height: 70vh;
    padding: var(--spacing-lg) var(--spacing-sm);
    background-attachment: scroll; /* Better performance on mobile */
  }
  
  .hero-content h1 {
    font-size: 2rem;
  }
  
  .hero-content .subtitle {
    font-size: 1.1rem;
  }
  
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  
  .hero-cta .btn {
    width: 100%;
  }
  
  /* Sections */
  .section {
    padding: var(--spacing-lg) var(--spacing-sm);
  }
  
  /* Services grid */
  .services-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }
  
  .service-card {
    padding: var(--spacing-sm);
  }
  
  /* Before/After slider */
  .slider-container {
    margin: var(--spacing-md) 0;
  }
  
  .slider-handle::before {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .compare-thumbnails {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
  }

  .compare-thumb-label {
    font-size: 0.78rem;
    padding: 0.45rem 0.5rem 0.55rem;
  }

  .compare-gallery-hint {
    margin-top: 0;
  }
  
  /* Area list */
  .area-list {
    grid-template-columns: 1fr;
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .footer-legal {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
  
  /* Show mobile action bar */
  .mobile-action-bar {
    display: grid;
  }
  
  /* Add padding to body to prevent content being hidden behind action bar */
  body {
    padding-bottom: 80px;
  }
  
  /* Cookie banner mobile */
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
  }
  
  .cookie-accept {
    width: 100%;
  }
}

/* ========================================
   SMALL MOBILE (480px and down)
   ======================================== */

@media (max-width: 480px) {
  :root {
    --spacing-lg: 2.5rem;
    --spacing-xl: 3rem;
  }
  
  h1 {
    font-size: 1.8rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.3rem;
  }
  
  .btn {
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
  }
  
  .split-content h2 {
    font-size: 1.8rem;
  }
  
  .split-content p {
    font-size: 1rem;
  }
  
  .service-icon {
    font-size: 2.5rem;
  }
  
  .logo {
    font-size: 1.1rem;
  }
  
  .lang-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }

  .compare-thumbnails {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ========================================
   DESKTOP (1024px and up)
   ======================================== */

@media (min-width: 1024px) {
  /* Larger spacing on desktop */
  .section {
    padding: var(--spacing-xl) var(--spacing-md);
  }
  
  /* Services grid - enforce 2x2 layout on desktop for moving page */
  .services-grid-2x2 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
  }
  
  /* Hover effects are more pronounced on desktop */
  .service-card:hover {
    transform: translateY(-8px);
  }
  
  .split-panel:hover::before {
    transform: scale(1.08);
  }
}

/* ========================================
   LARGE DESKTOP (1440px and up)
   ======================================== */

@media (min-width: 1440px) {
  .container {
    max-width: 1400px;
  }
  
  .hero-content {
    max-width: 900px;
  }
  
  .section-title p {
    max-width: 800px;
  }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  .header,
  .mobile-action-bar,
  .cookie-banner,
  .btn-whatsapp,
  .language-switcher {
    display: none !important;
  }
  
  .hero {
    min-height: auto;
    background: none !important;
    padding: 2rem 1rem;
  }
  
  .hero::before {
    display: none;
  }
  
  .hero-content {
    color: var(--text-dark);
  }
  
  .hero-content h1 {
    color: var(--deep-forest);
  }
  
  * {
    box-shadow: none !important;
  }
}

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

/* ========================================
   HIGH CONTRAST MODE
   ======================================== */

@media (prefers-contrast: high) {
  :root {
    --primary-green: #00AA00;
    --deep-forest: #004400;
  }
  
  .btn-primary,
  .btn-whatsapp {
    border: 2px solid var(--text-dark);
  }
  
  .service-card {
    border: 2px solid var(--text-light);
  }
}

/* ========================================
   LANDSCAPE MOBILE OPTIMIZATION
   ======================================== */

@media (max-height: 600px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: var(--spacing-md) var(--spacing-sm);
  }
  
  .split-panel {
    min-height: 100vh;
  }
  
  .mobile-action-bar {
    padding: 0.5rem;
  }
  
  .mobile-action-bar .btn {
    padding: 0.6rem;
    font-size: 0.85rem;
  }
}
