:root {
  --primary-color: #991c37;
  --primary-dark: #7a152b;
  --secondary-color: #f4f4f4;
  --text-color: #333;
  --text-light: #666;
  --white: #ffffff;
  --black: #000000;
  --accent-color: #e6e6e6;
  --bg-light: #f9f9f9;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --transition: all 0.3s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Raleway', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--white);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

main {
  flex: 1;
}

/*--- HEADER ---*/
header {
  background-color: var(--white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0 2rem;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo img {
  height: 50px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-color);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background-color: var(--primary-color);
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--primary-color);
}

.nav-links a:hover::after {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Mobile Nav Overlay */
.sidenav {
  height: 100%;
  width: 0;
  position: fixed;
  z-index: 2000;
  top: 0;
  right: 0;
  background-color: #111;
  overflow-x: hidden;
  transition: 0.5s;
  padding-top: 60px;
}

.sidenav a {
  padding: 8px 8px 8px 32px;
  text-decoration: none;
  font-size: 25px;
  color: #818181;
  display: block;
  transition: 0.3s;
}

.sidenav a:hover {
  color: #f1f1f1;
}

.sidenav .closebtn {
  position: absolute;
  top: 0;
  right: 25px;
  font-size: 36px;
  margin-left: 50px;
}

/*--- HERO SECTION (General) ---*/
.hero {
  position: relative;
  height: 90vh;
  min-height: 600px;
  background-image: url('images/Mondial.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Page Headers (Short Hero) */
.page-header {
  position: relative;
  height: 40vh;
  min-height: 300px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
}

.page-header.produkter { background-image: url('images/fabrik.jpg'); }
.page-header.kontakt { background-image: url('images/telefon.jpg'); }
.page-header.villkor { background-image: url('images/stad.jpg'); }
.page-header.mer-info { background-image: url('images/service.jpg'); }

.page-header h1 {
  position: relative;
  z-index: 2;
  font-size: 3rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.7));
}

.hero-content {
  position: relative;
  z-index: 2;
  color: var(--white);
  max-width: 800px;
  padding: 2rem;
  animation: fadeIn 1s ease-out;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  font-weight: 300;
}

.btn-primary {
  display: inline-block;
  padding: 12px 30px;
  background-color: var(--primary-color);
  color: var(--white);
  border-radius: 5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 2px solid var(--primary-color);
}

.btn-primary:hover {
  background-color: transparent;
  color: var(--white);
  border-color: var(--white);
}

/*--- SECTIONS ---*/
.section {
  padding: 5rem 2rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: var(--text-color);
  position: relative;
  display: inline-block;
  border-bottom: 3px solid var(--primary-color);
  padding-bottom: 0.5rem;
}

.text-container {
  max-width: 800px;
  margin: 0 auto;
}

.text-container p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.image-wrapper {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.image-wrapper img {
  transition: transform 0.5s ease;
}

.image-wrapper:hover img {
  transform: scale(1.05);
}

/*--- PRODUCT CARDS ---*/
.bg-light {
  background-color: var(--bg-light);
}

.text-center {
  text-align: center;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.card {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.card-img {
  height: 200px;
  overflow: hidden;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover .card-img img {
  transform: scale(1.1);
}

.card-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.card p {
  color: var(--text-light);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.card-link {
  margin-top: auto;
  color: var(--primary-color);
  font-weight: 600;
  align-self: flex-start;
}

.card-link:hover {
  text-decoration: underline;
}

.btn-secondary {
  display: inline-block;
  margin-top: 3rem;
  padding: 12px 30px;
  border: 2px solid var(--text-color);
  color: var(--text-color);
  border-radius: 5px;
  font-weight: 600;
  text-transform: uppercase;
}

.btn-secondary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--white);
}

/*--- PARALLAX SECTION ---*/
.parallax-section {
  background-image: url('images/service.jpg');
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
  padding: 6rem 2rem;
  color: var(--white);
  text-align: center;
}

.parallax-section.mer-info-1 { background-image: url('images/stad.jpg'); }
.parallax-section.mer-info-2 { background-image: url('images/fabrik.jpg'); }
.parallax-section.mer-info-3 { background-image: url('images/moldow.jpg'); }
.parallax-section.mer-info-4 { background-image: url('images/anlagning.jpg'); }

.parallax-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
}

.parallax-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.parallax-content h2 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--primary-color);
  display: inline-block;
  padding-bottom: 10px;
}

/*--- TABS (Kontakt & Produkter) ---*/
.tabs-container {
  margin-top: 2rem;
}

.tabs {
  display: flex;
  justify-content: center;
  border-bottom: 1px solid #ddd;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.tablinks {
  background-color: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 14px 20px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-light);
  transition: var(--transition);
  border-bottom: 3px solid transparent;
}

.tablinks:hover {
  color: var(--primary-color);
}

.tablinks.active {
  color: var(--primary-color);
  border-bottom: 3px solid var(--primary-color);
}

.tabContent {
  display: none;
  animation: fadeEffect 0.5s;
}

@keyframes fadeEffect {
  from {opacity: 0;}
  to {opacity: 1;}
}

/*--- CONTACT GRID ---*/
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.contact-card {
  background: var(--white);
  border: 1px solid #eee;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.contact-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.contact-card h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

.contact-card p {
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.contact-card a {
  color: var(--text-color);
  font-weight: 500;
}

.contact-card a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/*--- PRODUCT LINKS LIST ---*/
.product-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.product-link-item {
  display: block;
  padding: 1rem;
  background-color: var(--white);
  border: 1px solid #eee;
  border-radius: 5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-link-item:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background-color: #fafafa;
}

.product-link-item::after {
  content: '→';
  font-size: 1.2rem;
}

/*--- FOOTER ---*/
footer {
  background-color: #2c3e50;
  color: #ecf0f1;
  padding: 4rem 2rem 1rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-col h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--white);
  border-bottom: 2px solid var(--primary-color);
  display: inline-block;
  padding-bottom: 5px;
}

.footer-col a {
  display: block;
  margin-bottom: 0.8rem;
  color: #bdc3c7;
}

.footer-col a:hover {
  color: var(--primary-color);
  padding-left: 5px;
}

.footer-col p {
  color: #bdc3c7;
  margin-bottom: 1rem;
}

.footer-certs {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.footer-certs img {
  height: 50px;
  background: white;
  padding: 5px;
  border-radius: 4px;
}

.copyright {
  text-align: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: #7f8c8d;
  font-size: 0.9rem;
}

/*--- MEDIA QUERIES ---*/
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .hero h1, .page-header h1 {
    font-size: 2.5rem;
  }
  
  .grid-2 {
    grid-template-columns: 1fr;
  }
  
  .section {
    padding: 3rem 1.5rem;
  }

  .parallax-section {
    background-attachment: scroll; 
  }
  
  .tabs {
    flex-direction: column;
  }
  
  .tablinks {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid #eee;
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
