/* ==========================================
  RESPONSIVE DESIGN FÖR AROS SNICKERI
  Här ligger alla media queries för olika skärmstorlekar
  ========================================== */

/* --- Stora skärmar (max 1200px) ---
  Minskar sidmarginaler och mellanrum för breda layouter
*/

@media (max-width: 1200px) {
  .main-header,
  .header-wrapper,
  .info-section,
  .about-section,
  .footer-content {
    padding-left: 16px;
    padding-right: 16px;
  }
  .product-highlight {
    gap: 20px;
  }
}

/* --- Mellanstora skärmar (max 900px) ---
   Staplar om about-section och justerar loggor/footer
*/

/* --- Mellanstora skärmar (max 900px) --- */
@media (max-width: 900px) {
  /* Gemensam layout-ändring för sidor med sidebar */
  .service-detail-layout,
  .services-layout {
    flex-direction: column;
    margin: 30px auto;
    padding: 0 20px;
  }

  .about-section {
    flex-direction: column;
    gap: 30px;
    padding: 40px 10px;
  }
  .footer-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

/* --- Mobiler (max 768px) --- */
@media (max-width: 768px) {
  .header-wrapper {
    flex-direction: column;
    gap: 15px;
  }

  /* Gör alla "grid-kolumner" till en kolumn */
  .links-grid,
  .content-grid,
  .two-column {
    grid-template-columns: 1fr !important;
  }

  /* Justera knappar för tumvänlighet */
  .btn,
  .read-more {
    width: 100%;
    text-align: center;
  }
}

/* --- MOBILANPASSNING FÖR HERO --- */
@media screen and (max-width: 768px) {
  .hero-section {
    height: 80vh;
    min-height: 450px;
  }

  .hero-overlay {
    padding: 20px;
    align-items: flex-start; /* Centrerar texten vertikalt på mobilen */
    justify-content: flex-start;
    text-align: left;
  }

  .hero-text {
    max-width: 100%;
    padding: 0 10px;
  }

  .hero-text .tagline {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    margin-bottom: 10px;
  }

  .hero-text h1 {
    /* Mindre textstorlek så den inte täcker allt */
    font-size: 1.8rem;
    line-height: 1.3;
    margin-bottom: 15px;
  }

  .hero-text h1 em {
    display: block; /* Sätter "håller i generationer" på en egen rad */
    font-size: 1.4rem;
    font-style: italic;
    margin-top: 5px;
  }

  .hero-text p {
    /* Vi visar texten men gör den mindre, eller behåll 'display: none' om du vill ha det extremt stilrent */
    display: block;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 25px;
    padding: 0 15px;
  }

  .hero-cta {
    width: 100%; /* Knappen tar hela bredden på mobilen för enklare klick */
    justify-content: center;
    padding: 16px 20px;
    font-size: 0.9rem;
  }
}

/* --- Surfplattor och små laptops (max 700px) ---
   Gör layouten mer kompakt och staplar sektioner vertikalt
*/

@media (max-width: 700px) {
  .main-header {
    padding: 10px 0;
  }
  .header-wrapper {
    flex-direction: column;
    gap: 10px;
    padding: 0 8px;
  }
  .logo-container img {
    height: 60px;
  }
  .info-section {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 8px;
  }
  .specialty-section,
  .about-section {
    padding: 30px 8px;
  }
  .product-highlight {
    flex-direction: column;
    gap: 10px;
    padding: 0;
  }
  .product-highlight img {
    width: 100%;
    height: 220px;
  }
  .product-info {
    padding: 20px 0 20px 0;
  }
  .footer-content {
    padding: 0 8px 20px;
  }
}

/* --- Mobiler (max 500px) ---
   Extra små marginaler och mindre text/bilder
*/

@media (max-width: 500px) {
  .main-header {
    padding: 4px 0;
  }
  .logo-container img {
    height: 40px;
  }
  .info-section h3 {
    font-size: 1.1rem;
    min-width: unset;
    width: 100%;
  }
  .specialty-section h2,
  .about-text h2 {
    font-size: 1.3rem;
  }
  .footer-bottom {
    font-size: 0.8rem;
    padding: 10px 0;
  }
}

/* Säkerställ att scroll-to-top-knappen alltid syns på små skärmar */
@media (max-width: 900px) {
  #backToTop.show {
    display: flex !important;
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
    z-index: 2000;
  }
}

@media (max-width: 900px) {
  /* Layout för sidor med sidebar */
  .service-detail-layout,
  .services-layout {
    flex-direction: column;
    margin: 30px auto;
    padding: 0 20px;
  }

  /* About section */
  .about-section {
    flex-direction: column;
    gap: 30px;
    padding: 40px 10px;
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 0 8px 20px;
  }

  /* 🔥 VIKTIG FIX – dölj bara header navigation */
  .main-header .navigation {
    display: none;
  }

  /* 🔥 Se till att footer-nav ALLTID syns */
  .footer-nav {
    display: block;
  }

  /* Hamburgarmeny */
  .mobile-menu-toggle {
    display: flex;
  }

  .mobile-navigation[hidden] {
    display: none;
  }

  .mobile-navigation:not([hidden]) {
    display: block;
  }

  /* Scroll-to-top knapp */
  #backToTop.show {
    display: flex !important;
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
    z-index: 2000;
  }

  /* Logga storlek */
  .mobile-navigation:not([hidden]) ~ .logo-container img,
  .main-header .logo-container img {
    height: 80px !important;
    max-width: 220px;
    transition: height 0.3s;
  }

  /* Om oss */
  .contact-info {
    display: none;
  }

  .footer-nav {
    display: block;
  }

  .footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .footer-nav li {
    margin-bottom: 10px;
  }
}

/* --- iPad Air (820px x 1180px) ---
   Hero-höjd och centrerad logga i header
*/
@media (min-width: 769px) and (max-width: 820px) {
  /* Centrerar loggan – hamburgaren är absolut positionerad så loggan
     hamnar annars förskjuten till höger */
  .header-wrapper {
    position: relative;
    justify-content: center;
  }

  .logo-container {
    flex: 0 0 auto;
    text-align: center;
    margin: 0 auto;
  }

  /* Hero */
  .hero-section,
  .slideshow-container {
    height: 380px;
    margin: 20px auto 0;
  }

  .hero-overlay {
    padding: 0 0 45px 50px;
    align-items: flex-end;
  }

  .hero-text h1 {
    font-size: 2.2rem;
    line-height: 1.25;
  }

  .hero-text p {
    font-size: 1rem;
    margin-bottom: 22px;
  }

  .hero-cta {
    padding: 13px 26px;
    font-size: 0.92rem;
  }
}
