/* Bouton scroll to top */
#scrollToTopBtn {
  position: fixed;
  right: 25px;
  bottom: 25px;
  z-index: 9999;
  background: #5043c9;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s;
  opacity: 0.85;
}
#scrollToTopBtn:hover {
  opacity: 1;
  background: #7e73cc;
}
header {
  min-height: 100vh;
}

main {
  top: 100px;
  margin: auto;
}

.test {
  height: auto;
  min-height: 70vh;
  padding-bottom: 100px;
}

/* Mobile Styles (base) */
header h1 {
  font-size: 2rem;
  color: #ffffff;
  text-align: center;
  margin-top: 20px;
  padding: 0 15px;
}

header p {
  font-size: 1.2rem;
  color: #ffffff;
  text-align: center;
  margin-top: 20px;
  padding: 0 15px;
}

.w-100-m {
  width: 100% !important;
}

.bottom-0-m {
  position: absolute;
  bottom: -30px;
  /* margin-top: 55vh; */
  z-index: 1;
}

header h1 {
  /*font-size: 3vw;*/
  color: #ffffff;
  text-align: center;
  margin-top: 20px;
}

header p {
  font-size: 2rem;
  color: #ffffff;
  text-align: center;
  margin-top: 20px;
}

header li {
  color: #ffffff;
  text-decoration: none;
  margin: 10px;
  font-size: clamp(20px, 1.2vw, 90px);
}

header img {
  width: clamp(30px, 20vw, 100px);
}

.title-menu {
  color: #ffffff;
  text-decoration: none;
  font-size: clamp(15px, 1.2vw, 90px);
  margin: 10px;
}

.navbar-toggler {
  border: none;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(255, 255, 255, 1)' stroke-width='2' stroke-linecap='round' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
  transition: transform 0.4s ease;
}

.navbar-toggler-icon:hover {
  transform: scale(1.1);
}

.navbar-toggler:focus .navbar-toggler-icon {
  transform: scale(0.8);
}

.navbar-toggler.collapsed .navbar-toggler-icon {
  transform: scale(1.2);
}

.header nav {
  /*background-color: rgba(0, 0, 0, 0.1);*/
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.4) 60%,
    rgba(0, 0, 0, 0)
  );
  padding-bottom: 80px;
}

header hr {
  width: clamp(50px, 50%, 450px);
}

.round-1 {
  border-radius: 25px;
}

.round-2 {
  border-radius: 25px;
}

.widget-left {
  background: #5043c9;
  margin-left: 0;
  border-radius: 20px;
  padding: 30px 15px;
  box-shadow:
    0 8px 48px 0 rgba(80, 67, 201, 0.35),
    0 4px 24px 0 rgba(0, 0, 0, 0.18);
}

.ml-800 {
  margin-left: 0;
}

.widget {
  background: #5043c9;
  border-radius: 20px;
  padding: 30px 15px;
  margin: 20px 0;
  box-shadow:
    0 8px 48px 0 rgba(80, 67, 201, 0.35),
    0 4px 24px 0 rgba(0, 0, 0, 0.18);
}

.bottom-m {
  /*position: absolute;*/
  margin-bottom: -2px;
}

.m-m {
  margin: 200px 0 200px 0;
}

article img {
  /* filter: saturate(30%); */
  transition: filter 0.2s ease-in-out;
}

.size-img {
  width: 80vw;
  min-width: 200px;
  max-width: 400px;
}

p,
ul {
  font-size: 1rem;
  line-height: 1.6;
  margin-top: 15px;
  font-family: "Mukta", sans-serif;
  font-weight: 500;
  font-style: normal;
}

main img:hover {
  filter: saturate(100%);
  /* met la souris en main */
  cursor: pointer;
}

/* Service Widgets Styles */
.service-widget {
  border-radius: 20px;
  transition: all 0.3s ease;
  cursor: pointer;
  min-height: 240px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  z-index: 10;
}

.z-index-1 {
  z-index: 1;
}

.service-widget::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.service-widget:hover::before {
  left: 100%;
}

.service-widget:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 35px rgba(80, 67, 201, 0.3);
  background: linear-gradient(135deg, #5043c9, #7e73cc);
}

.service-icon {
  width: 60px;
  height: 60px;
  filter: brightness(0) invert(1);
  transition: all 0.3s ease;
  object-fit: contain;
}

.service-widget:hover .service-icon {
  transform: scale(1.1) rotate(5deg);
  filter: brightness(0) invert(1);
}

.service-widget h3 {
  font-size: 1.2rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.service-widget:hover h3 {
  transform: scale(1.05);
}

.service-widget p {
  font-size: 0.85rem;
  opacity: 0.9;
  transition: all 0.3s ease;
}

.service-widget:hover p {
  opacity: 1;
}

/* Navigation and widgets container */
nav .container {
  position: relative;
  z-index: 10;
}

/* Responsive adjustments for service widgets */
@media (max-width: 768px) {
  .service-widget {
    min-height: 200px;
  }

  .service-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
  }

  .service-widget h3 {
    font-size: 1.1rem;
  }

  .service-widget p {
    font-size: 0.8rem;
  }
}

@media (max-width: 576px) {
  .service-widget {
    min-height: 180px;
    margin-bottom: 1rem;
  }

  .service-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
  }
}

/* Responsiveness */
@media (max-width: 767px) {
  header {
    font-size: 1.5rem;
  }
}

/* Tablet Styles */
@media (min-width: 768px) and (max-width: 991px) {
  .test {
    height: auto;
    min-height: 70vh;
    /* Ajout d'un padding bottom pour Ã©viter le chevauchement */
    padding-bottom: 150px;
  }

  header h1 {
    font-size: 2.5rem;
    margin-top: 30px;
  }

  header p {
    font-size: 1.5rem;
    margin-top: 25px;
  }

  /* Espacement spÃ©cial pour les widgets en mode tablette */
  .container.my-5 {
    margin-bottom: 5rem !important;
    padding-bottom: 2rem;
  }

  /* Ajout d'espacement pour le main */
  main.container {
    margin-top: 4rem !important;
  }

  /* Ajustement de la vague pour tablette */
  .bottom-0-m {
    bottom: -20px;
  }

  .widget-left {
    margin-left: -200px;
    border-radius: 0 60px 60px 0;
    padding: 40px 20px;
  }

  .ml-800 {
    margin-left: 200px;
  }

  .widget {
    border-radius: 20px;
    padding: 40px 30px;
  }

  .size-img {
    width: 60vw;
    min-width: 250px;
    max-width: 500px;
  }

  p,
  ul {
    font-size: 1.05rem;
  }

  h2 {
    font-size: 2rem;
  }

  h3 {
    font-size: 1.5rem;
  }
}

/* Desktop Styles */
@media (min-width: 992px) {
  .test {
    height: 50vh;
    min-height: 600px;
  }

  header h1 {
    font-size: 3rem;
    margin-top: 40px;
  }

  header p {
    font-size: 2rem;
    margin-top: 30px;
  }

  .widget-left {
    margin-left: -600px;
    border-radius: 0 80px 80px 0;
    padding: 50px 0;
  }

  .ml-800 {
    margin-left: 600px;
  }

  .widget {
    border-radius: 20px;
    padding: 50px;
  }

  .size-img {
    width: 50vw;
    min-width: 300px;
    max-width: 600px;
  }

  p,
  ul {
    font-size: 1.1rem;
  }

  h2 {
    font-size: 2.2rem;
  }

  h3 {
    font-size: 1.6rem;
  }
}

/* Large Desktop */
@media (min-width: 1200px) {
  .widget-left {
    margin-left: -800px;
  }

  .ml-800 {
    margin-left: 800px;
  }

  header h1 {
    font-size: 3.5rem;
  }

  header p {
    font-size: 2.2rem;
  }
}

/* Extra responsive improvements */
@media (max-width: 576px) {
  .navbar-brand img {
    width: 30px;
    height: 30px;
  }

  .navbar-brand {
    font-size: 0.9rem;
  }

  .container {
    padding-left: 10px;
    padding-right: 10px;
  }

  .service-widget {
    margin-bottom: 15px;
  }

  .carousel-control-prev,
  .carousel-control-next {
    width: 35px;
  }
  /* RÃ©duction des marges et padding pour la section plomberie sur mobile */
  #plomberie.widget-left {
    margin-left: 0 !important;
    padding: 10px 5px !important;
  }
  #plomberie .ml-800 {
    margin-left: 0 !important;
    padding: 0 !important;
  }
  #plomberie .row.m-3 {
    margin: 0 !important;
    padding: 0 !important;
  }

  .m-m {
    margin: 100px 0;
  }

  footer .container .row .col-md-4 {
    margin-bottom: 20px;
  }

  /* Hide decorative elements on very small screens */
  .bottom-0-m {
    display: none;
  }
}

/* Additional responsive improvements for better UX */

/* Smooth scrolling for anchor links */
html {
  scroll-behavior: smooth;
}

/* Better spacing for mobile */
@media (max-width: 767px) {
  .container {
    max-width: 100%;
  }

  article {
    padding: 0 10px;
  }

  .carousel-control-prev-icon,
  .carousel-control-next-icon {
    border-radius: 10px !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    padding: 18px !important;
    width: 20px !important;
    height: 20px !important;
    box-sizing: content-box !important;
  }

  .widget-left .ml-800 {
    padding: 20px 15px;
  }

  .widget .row {
    margin: 0;
  }

  hr {
    margin: 20px auto;
  }

  .carousel-control-prev {
    left: 10px;
  }

  .carousel-control-next {
    right: 10px;
  }

  /* Better footer on mobile */
  footer .row .col-md-4 {
    text-align: center;
    margin-bottom: 30px;
  }

  footer h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
  }

  footer a {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  .service-widget {
    transform: none;
  }

  .service-widget:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }

  .carousel-control-prev,
  .carousel-control-next {
    opacity: 1;
  }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .service-icon {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Print styles */
@media print {
  .service-widget {
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }

  .carousel-control-prev,
  .carousel-control-next,
  .bottom-0-m {
    display: none;
  }
}

/* Harmonisation des images des carrousels */
.carousel-inner img {
  width: 350px;
  height: 700px;
  object-fit: cover;
  display: block;
  margin-left: auto;
  margin-right: auto;
  border-radius: 25px;
}

/* SpÃ©cifique au carrousel chauffage sur mobile */
@media (max-width: 576px) {
  /* Chauffage et plomberie en 16:9 sur mobile */
  #carouselChauffage .carousel-inner img,
  #carouselPlomberie .carousel-inner img {
    width: 95vw;
    max-width: 400px;
    height: calc(95vw * 9 / 16);
    max-height: 320px;
    object-fit: cover;
    border-radius: 20px;
  }

  /* Salle de bain et climatisation : ancien style */
  #carouselSalleDeBain .carousel-inner img,
  #carouselClimatisation .carousel-inner img {
    width: 350px;
    height: 700px;
    object-fit: cover;
    display: block;
    margin-left: auto;
    margin-right: auto;
    border-radius: 25px;
  }

  /* Taille fixe pour les images du carrousel plomberie sur mobile */
  #carouselPlomberie .carousel-inner img {
    width: 350px;
    height: 700px;
    object-fit: cover;
    display: block;
    margin-left: auto;
    margin-right: auto;
    border-radius: 25px;
  }
}

/* Espacement uniquement pendant la transition du carrousel */
.carousel-item.carousel-item-next img {
  margin-left: 20px;
  margin-right: 20px;
}

.carousel-item.carousel-item-prev img {
  margin-left: -20px;
  margin-right: -20px;
}

#carouselChauffage .carousel-item.carousel-item-next img,
#carouselPlomberie .carousel-item.carousel-item-next img,
#carouselSalleDeBain .carousel-item.carousel-item-next img,
#carouselClimatisation .carousel-item.carousel-item-next img {
  margin-left: 20px;
  margin-right: 20px;
}
#carouselChauffage .carousel-item.carousel-item-prev img,
#carouselPlomberie .carousel-item.carousel-item-prev img,
#carouselSalleDeBain .carousel-item.carousel-item-prev img,
#carouselClimatisation .carousel-item.carousel-item-prev img {
  margin-left: -20px;
  margin-right: -20px;
}

/* Dark mode styles */
@media (prefers-color-scheme: dark) {
  body,
  main,
  .test {
    background-color: #181828 !important;
    color: #f3f3f3 !important;
  }

  header {
    background: linear-gradient(135deg, #161622, #161622, #161622) !important;
    color: #f3f3f3 !important;
  }

  .navbar,
  .bg-primary-m {
    background-color: #161622 !important;
    color: #f3f3f3 !important;
    /* box-shadow: 0 8px 48px 0 rgba(80, 67, 201, 0.15), 0 4px 24px 0 rgba(0,0,0,0.18); */
  }

  .widget,
  .widget-left,
  .service-widget {
    background-color: #232347 !important;
    color: #f3f3f3 !important;
    /* box-shadow: 0 8px 48px 0 rgba(80, 67, 201, 0.15), 0 4px 24px 0 rgba(0,0,0,0.18); */
  }

  .navbar-brand,
  .nav-link,
  .title-menu,
  h1,
  h2,
  h3,
  h4,
  p,
  ul,
  li {
    color: #f3f3f3 !important;
  }

  .c-primary,
  .c-w {
    color: #f3f3f3 !important;
  }

  /* Waves SVG dark mode */
  header svg path,
  .bottom-wave path {
    fill: #181828 !important;
    /* Optionally, you can add a slight opacity for a softer effect: */
    /* fill-opacity: 0.95 !important; */
  }

  /* Footer */
  footer.bg-dark,
  footer {
    background-color: #161622 !important;
    color: #f3f3f3 !important;
  }

  footer a {
    color: #f3f3f3 !important;
  }

  footer hr.bg-white {
    background-color: #444 !important;
  }
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  background-color: rgba(0, 0, 0, 0.5);
  /* Cercle noir transparent */
  border-radius: 10%;
  padding: 18px;
  /* Agrandit le cercle autour de la flÃ¨che */
  width: 20px;
  /* Taille originale de la flÃ¨che */
  height: 20px;
  /* Taille originale de la flÃ¨che */
  box-sizing: content-box;
}

/* Center nav links in hamburger menu (mobile) */
@media (max-width: 991px) {
  #carouselClimatisation .carousel-inner img {
    width: 95vw;
    max-width: 500px;
    height: auto;
    max-height: 320px;
    object-fit: cover;
    display: block;
    margin-left: auto;
    margin-right: auto;
    border-radius: 20px !important;
    background: rgba(255, 255, 255, 0);
    overflow: hidden;
  }

  .navbar-nav .nav-link {
    display: block;
    width: 100%;
    text-align: center;
  }
}

#carouselChauffage img[src*="chaudiÃ¨re_fioul.jpeg"] {
  object-position: right !important;
  /* object-fit: none; */
}
