/* 
 * Mitsubishi Electric Distributor Website - Main Styles
 * CSS3 with responsive design using Grid and Flexbox
 */

/* CSS Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Color Palette */
  --mitsubishi-red: #E60012;
  --tech-blue: #004C97;
  --dark-gray: #2C3E50;
  --medium-gray: #7F8C8D;
  --light-gray: #ECF0F1;
  --off-white: #FAFAFA;
  --white: #FFFFFF;
  
  /* Typography */
  --font-primary: 'Roboto', Arial, sans-serif;
  --font-mono: 'Roboto Mono', monospace;
  
  /* Spacing */
  --base-unit: 8px;
  --space-xs: calc(var(--base-unit) * 1); /* 8px */
  --space-sm: calc(var(--base-unit) * 2); /* 16px */
  --space-md: calc(var(--base-unit) * 3); /* 24px */
  --space-lg: calc(var(--base-unit) * 4); /* 32px */
  --space-xl: calc(var(--base-unit) * 5); /* 40px */
  
  /* Breakpoints */
  --mobile: 768px;
  --tablet: 1024px;
}

body {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.5;
  color: var(--dark-gray);
  background-color: var(--white);
}

/* Layout Components */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Typography */
h1 {
  font-size: 2rem;
  margin-bottom: var(--space-md);
  color: var(--dark-gray);
}

h2 {
  font-size: 1.75rem;
  margin-bottom: var(--space-md);
  color: var(--dark-gray);
}

h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
  color: var(--dark-gray);
}

p {
  margin-bottom: var(--space-md);
}

a {
  color: var(--tech-blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: #003a75;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 4px;
  text-align: center;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: var(--mitsubishi-red);
  color: white;
}

.btn-primary:hover {
  background-color: #c0000f;
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--tech-blue);
  border: 2px solid var(--tech-blue);
}

.btn-secondary:hover {
  background-color: var(--tech-blue);
  color: white;
  transform: translateY(-2px);
}

/* Header Styles */
.main-header {
  background-color: var(--white);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.main-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
}

.logo-container {
  flex-shrink: 0;
}

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

.main-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: var(--space-lg);
}

.nav-list a {
  color: var(--dark-gray);
  text-decoration: none;
  font-weight: 500;
  padding: var(--space-sm) 0;
  position: relative;
}

.nav-list a:hover {
  color: var(--tech-blue);
}

.nav-list a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--tech-blue);
  transition: width 0.3s ease;
}

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

.contact-icons {
  display: flex;
  gap: var(--space-md);
  margin-right: var(--space-md);
}

.contact-icon {
  width: 30px;
  height: 30px;
  transition: transform 0.3s ease;
}

.contact-icon:hover {
  transform: scale(1.1);
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
}

.hamburger {
  width: 25px;
  height: 3px;
  background-color: var(--dark-gray);
  margin: 3px 0;
  transition: 0.3s;
}

/* Hero Banner */
.hero-banner {
  background: linear-gradient(rgba(0, 76, 151, 0.8), rgba(0, 76, 151, 0.8)), 
              url('../images/backgrounds/hero-bg.svg') center/cover no-repeat;
  color: white;
  padding: calc(var(--space-xl) * 3) var(--space-md) var(--space-xl);
  text-align: center;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-content h1 {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  animation: fadeInDown 1s ease;
}

.hero-content p {
  font-size: 1.25rem;
  margin-bottom: var(--space-xl);
  animation: fadeInUp 1s ease;
}

.hero-buttons {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* Core Advantages */
.core-advantages {
  padding: var(--space-xl) 0;
  background-color: var(--off-white);
}

.core-advantages .container {
  text-align: center;
}

.advantages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.advantage-card {
  background: white;
  padding: var(--space-lg);
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.advantage-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.advantage-icon {
  margin-bottom: var(--space-md);
}

.advantage-icon img {
  width: 60px;
  height: 60px;
  margin-bottom: var(--space-sm);
}

.advantage-card h3 {
  margin-bottom: var(--space-sm);
  color: var(--dark-gray);
}

/* Product Areas */
.product-areas {
  padding: var(--space-xl) 0;
}

.product-areas .container {
  text-align: center;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.product-category {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  text-align: center;
  height: 200px;
}

.product-category:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  text-decoration: none;
  color: var(--dark-gray);
}

.product-category img {
  width: 60px;
  height: 60px;
  margin-bottom: var(--space-md);
}

.product-category h3 {
  margin-bottom: var(--space-xs);
  color: var(--dark-gray);
}

/* Solutions Showcase */
.solutions-showcase {
  padding: var(--space-xl) 0;
  background-color: var(--off-white);
}

.solutions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.solution-card {
  background: white;
  padding: var(--space-lg);
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
  color: var(--dark-gray);
}

.solution-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.solution-card h3 {
  margin-bottom: var(--space-sm);
  color: var(--dark-gray);
}

/* Latest News */
.latest-news {
  padding: var(--space-xl) 0;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.news-item {
  background: white;
  padding: var(--space-lg);
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.news-item h3 {
  margin-bottom: var(--space-xs);
}

.news-item h3 a {
  color: var(--dark-gray);
  text-decoration: none;
}

.news-item h3 a:hover {
  color: var(--tech-blue);
  text-decoration: none;
}

.news-date {
  color: var(--medium-gray);
  font-size: 0.9rem;
  margin-bottom: var(--space-sm);
}

/* Footer CTA */
.footer-cta {
  background: linear-gradient(to right, var(--tech-blue), var(--mitsubishi-red));
  color: white;
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  margin: var(--space-xl) 0;
}

.footer-cta h2 {
  margin-bottom: var(--space-sm);
  color: white;
}

.footer-cta p {
  margin-bottom: var(--space-lg);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Footer */
.main-footer {
  background-color: var(--dark-gray);
  color: white;
  padding: var(--space-xl) 0 var(--space-md);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.footer-section h3 {
  color: white;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--medium-gray);
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: var(--space-xs);
}

.footer-section ul li a {
  color: var(--light-gray);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section ul li a:hover {
  color: white;
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid var(--medium-gray);
  padding-top: var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-bottom p {
  color: var(--light-gray);
  margin: 0;
}

.social-links {
  display: flex;
  gap: var(--space-md);
}

.social-links a {
  color: var(--light-gray);
  text-decoration: none;
}

.social-links a:hover {
  color: white;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .hero-content h1 {
    font-size: 2.5rem;
  }
  
  .nav-list {
    gap: var(--space-md);
  }
}

@media (max-width: 768px) {
  :root {
    --space-md: calc(var(--base-unit) * 2); /* 16px */
    --space-lg: calc(var(--base-unit) * 3); /* 24px */
    --space-xl: calc(var(--base-unit) * 4); /* 32px */
  }
  
  .container {
    padding: 0 var(--space-sm);
  }
  
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: var(--space-md);
  }
  
  .nav-list {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .main-header .container {
    padding: var(--space-sm);
  }
  
  .hero-banner {
    padding: calc(var(--space-xl) * 2) var(--space-md);
  }
  
  .hero-content h1 {
    font-size: 2rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 300px;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  
  .social-links {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 1.75rem;
  }
  
  .hero-content p {
    font-size: 1.1rem;
  }
  
  .advantages-grid,
  .products-grid,
  .solutions-grid,
  .news-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus styles for accessibility */
button:focus,
a:focus,
input:focus {
  outline: 2px solid var(--tech-blue);
  outline-offset: 2px;
}