/* Variables et reset optimisé */
:root {
  --primary: #ff0000;
  --primary-dark: #cc0000;
  --secondary: #2196f3;
  --dark: #333333;
  --light: #f8f9fa;
  --gray: #6c757d;
  --white: #ffffff;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--light);
  color: var(--dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Accessibilité - focus visible */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.btn {
  display: inline-block;
  padding: 14px 28px;
  background-color: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  text-align: center;
  text-decoration: none;
  min-height: 44px;
  font-size: 1rem;
}

.btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--secondary);
}

.btn-secondary:hover {
  background-color: #1976d2;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

section {
  padding: 5rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title h2 {
  font-size: 2.5rem;
  color: var(--dark);
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}

.section-title h2::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background-color: var(--primary);
}

.section-title p {
  color: var(--gray);
  max-width: 700px;
  margin: 0 auto;
  font-size: 1.1rem;
}

/* Header optimisé */
header {
  background-color: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

/* Logo (image + texte) */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  width: 45px;  /* Ajuste selon la taille voulue */
  height: auto;
}

/* Texte BEVE SOLAR TAMPOUY */
.logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--dark);
}

.logo h1 span {
  color: var(--primary);
}


nav ul {
  display: flex;
  list-style: none;
}

nav ul li {
  margin-left: 2rem;
}

nav ul li a {
  font-weight: 600;
  transition: var(--transition);
  position: relative;
  text-decoration: none;
  color: inherit;
}

nav ul li a:hover {
  color: var(--primary);
}

nav ul li a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: var(--transition);
}

nav ul li a:hover::after {
  width: 100%;
}

.mobile-menu {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--dark);
  min-height: 44px;
  min-width: 44px;
}

/* Hero Section optimisée */
.hero {
  background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
    url("https://images.unsplash.com/photo-1509391366360-2e959784a276?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1770&q=80");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--white);
  text-align: center;
  padding: 8rem 0;
}

.hero h2 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero p {
  font-size: 1.3rem;
  max-width: 700px;
  margin: 0 auto 2.5rem;
  opacity: 0.9;
}

.hero-btns {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Services Section */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.service-card {
  background-color: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-align: center;
  padding: 2.5rem 1.5rem;
  height: 100%;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.service-icon {
  font-size: 3.5rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.service-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--dark);
}

.service-card p {
  color: var(--gray);
  line-height: 1.7;
}

/* Products Section dynamique */
.category-title {
  text-align: center;
  margin: 4rem 0 2rem;
  position: relative;
}

.category-title h3 {
  font-size: 2.2rem;
  color: var(--dark);
  display: inline-block;
  background-color: var(--light);
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

.category-title::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #e0e0e0;
  z-index: 0;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.product-card {
  background-color: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.product-img {
  height: 220px;
  width: 100%;
  background-color: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.product-card:hover .product-img img {
  transform: scale(1.05);
}

.product-info {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-info h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.product-model {
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.product-info p {
  color: var(--gray);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  flex-grow: 1;
}

.product-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
}

.product-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

.product-actions .btn {
  flex: 1;
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
}

/* About Section */
.about {
  background-color: var(--white);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text h2 {
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  color: var(--dark);
}

.about-text p {
  margin-bottom: 1.5rem;
  color: var(--gray);
  line-height: 1.7;
}

.about-img {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.about-img:hover {
  transform: scale(1.02);
}

.about-img img {
  width: 100%;
  height: auto;
  display: block;
}

/* Stats Section */
.stats {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
  color: var(--white);
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.stat-item h3 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.stat-item p {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Contact Section optimisée */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.contact-card {
  background-color: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-align: center;
  padding: 2.5rem 1.5rem;
  height: 100%;
}

.contact-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.contact-icon {
  font-size: 3.5rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.contact-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--dark);
}

.contact-card p {
  color: var(--gray);
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.contact-card a {
  color: var(--secondary);
  text-decoration: none;
  transition: var(--transition);
  display: block;
  margin-top: 0.5rem;
}

.contact-card a:hover {
  color: var(--primary);
}

.contact-divider {
  grid-column: 1 / -1;
  text-align: center;
  margin: 2rem 0;
}

.contact-divider h3 {
  font-size: 1.8rem;
  color: var(--dark);
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}

.contact-divider h3::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
}

.opening-hours {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.hour-item {
  background-color: rgba(255, 0, 0, 0.1);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

.hour-item strong {
  color: var(--primary);
  display: block;
  margin-bottom: 0.5rem;
}

/* Footer optimisé */
footer {
  background-color: var(--dark);
  color: var(--white);
  padding: 4rem 0 1.5rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h3 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-col h3::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 2px;
  background-color: var(--primary);
}

.footer-col p {
  margin-bottom: 1.5rem;
  opacity: 0.8;
  line-height: 1.7;
}

.footer-links li {
  margin-bottom: 0.8rem;
}

.footer-links li a {
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  opacity: 0.8;
}

.footer-links li a:hover {
  color: var(--primary);
  padding-left: 5px;
  opacity: 1;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  width: 44px;
  height: 44px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}

.social-links a:hover {
  background-color: var(--primary);
  transform: translateY(-3px);
}

.copyright {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

/* États de chargement et erreur */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--primary);
}

.loading i {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.error-message {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
  padding: 1.5rem;
  border-radius: 6px;
  text-align: center;
  margin: 2rem 0;
}

/* Modal de détails produit */
.product-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1002;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.product-modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px);
  transition: var(--transition);
}

.product-modal.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

.modal-img {
  border-radius: 8px;
  overflow: hidden;
}

.modal-img img {
  width: 100%;
  height: auto;
  display: block;
}

.modal-details h3 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.modal-model {
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.modal-description {
  margin-bottom: 1.5rem;
  color: var(--gray);
  line-height: 1.7;
}

.modal-specs {
  margin-bottom: 1.5rem;
}

.modal-specs h4 {
  margin-bottom: 1rem;
  color: var(--dark);
}

.modal-specs ul {
  list-style: none;
}

.modal-specs li {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f0f0f0;
}

.modal-specs li span:first-child {
  font-weight: 600;
  color: var(--dark);
}

.modal-warranty {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  color: var(--gray);
}

.modal-warranty i {
  color: var(--primary);
  margin-right: 0.5rem;
}

.modal-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
}

/* Responsive Design */
@media (max-width: 992px) {
  .about-content,
  .modal-body {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .about-img {
    order: -1;
  }

  .hero h2 {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  section {
    padding: 3rem 0;
  }

  .header-container {
    flex-direction: column;
    padding: 1rem 0;
  }

  .logo {
    margin-bottom: 1rem;
  }

  nav ul {
    display: none;
    flex-direction: column;
    width: 100%;
    text-align: center;
    margin-top: 1rem;
  }

  nav ul.show {
    display: flex;
  }

  nav ul li {
    margin: 0.5rem 0;
  }

  .mobile-menu {
    display: block;
    position: absolute;
    top: 1rem;
    right: 1rem;
  }

  .hero {
    padding: 5rem 0;
    background-attachment: scroll;
  }

  .hero h2 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1.1rem;
  }

  .hero-btns {
    flex-direction: column;
    align-items: center;
  }

  .hero-btns .btn {
    width: 100%;
    max-width: 280px;
  }

  .section-title h2 {
    font-size: 2rem;
  }

  .product-actions {
    flex-direction: column;
  }

  .modal-actions {
    flex-direction: column;
  }

  .cookie-content {
    flex-direction: column;
    text-align: center;
  }

  .cookie-buttons {
    justify-content: center;
  }

  .contact-card {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 576px) {
  .container {
    width: 95%;
  }

  .hero {
    padding: 4rem 0;
  }

  .hero h2 {
    font-size: 1.8rem;
  }

  .section-title h2 {
    font-size: 1.8rem;
  }

  .category-title h3 {
    font-size: 1.8rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }

  .modal-content {
    padding: 1.5rem;
  }
}
