@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ===== BASE ===== */
body {
  font-family: 'Poppins', sans-serif;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

/* ===== HEADER ===== */
header {
  transition: all 0.3s ease;
}

header.scrolled {
  padding-top: 0;
  padding-bottom: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

header.scrolled img.header-logo {
  height: 2.5rem;
  transition: height 0.3s ease;
}

.header-logo {
  transition: height 0.3s ease;
}

/* Active nav link */
nav a.active-link {
  color: #16a34a !important;
  position: relative;
}

nav a.active-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: #16a34a;
  border-radius: 2px;
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.65), rgba(0, 50, 0, 0.55)), url('../images/background.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to top, #f9fafb, transparent);
}

/* ===== SECTION TRANSITIONS ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger children animation */
.stagger-children .reveal {
  transition-delay: calc(var(--i, 0) * 0.1s);
}

/* ===== SERVICE CARDS ===== */
.service-card {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: default;
}

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

.service-card .service-icon {
  transition: all 0.4s ease;
}

.service-card:hover .service-icon {
  transform: scale(1.15);
}

/* ===== GALLERY ===== */
.gallery-item {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  overflow: hidden;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
  transition: transform 0.6s ease;
}

.gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-item .gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  cursor: zoom-out;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.lightbox.active img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.3s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ===== MOBILE MENU ===== */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-menu.open {
  max-height: 500px;
}

/* ===== TESTIMONIALS ===== */
.testimonial-container {
  display: flex;
  overflow-x: hidden;
  scroll-behavior: smooth;
  padding-bottom: 4px;
}

.testimonial-item {
  flex: 0 0 33.333%;
  padding: 0 15px;
  box-sizing: border-box;
  animation: fadeInUp 0.5s ease-out;
}

@media (max-width: 1024px) {
  .testimonial-item {
    flex: 0 0 50%;
  }
}

@media (max-width: 768px) {
  .testimonial-item {
    flex: 0 0 100%;
  }
}

.testimonial-card {
  transition: all 0.3s ease;
  position: relative;
}

.testimonial-card::before {
  content: '\201C';
  position: absolute;
  top: 15px;
  left: 20px;
  font-size: 4rem;
  color: rgba(22, 163, 74, 0.1);
  font-family: Georgia, serif;
  line-height: 1;
}

/* ===== STAR RATING ===== */
#star-rating i {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  line-height: 1.2em;
  text-align: center;
  cursor: pointer;
  pointer-events: auto;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  transition: transform 0.15s ease;
}

#star-rating i:hover {
  transform: scale(1.25);
}

/* ===== COUNTER ANIMATION ===== */
.counter-value {
  display: inline-block;
}

/* ===== BEFORE/AFTER SLIDER ===== */
.ba-slider {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  cursor: ew-resize;
  user-select: none;
}

.ba-slider img {
  display: block;
  width: 100%;
  pointer-events: none;
}

.ba-after {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
}

.ba-after img {
  width: 0;
  min-width: 0;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  object-fit: cover;
}

.ba-handle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background: white;
  transform: translateX(-50%);
  z-index: 10;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.ba-handle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.ba-handle::before {
  content: '\f0d9  \f0da';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 11;
  color: #166534;
  font-size: 0.75rem;
  letter-spacing: 8px;
}

.ba-label {
  position: absolute;
  bottom: 15px;
  padding: 6px 16px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 20px;
  z-index: 5;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ba-label-before {
  right: 15px;
}

.ba-label-after {
  left: 15px;
}

/* ===== WHATSAPP BUTTON ===== */
.whatsapp-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.8rem;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  transition: all 0.3s ease;
  animation: pulse-whatsapp 2s infinite;
}

.whatsapp-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(37, 211, 102, 0.5);
}

@keyframes pulse-whatsapp {
  0%, 100% {
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  }
  50% {
    box-shadow: 0 4px 25px rgba(37, 211, 102, 0.6);
  }
}

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 45px;
  height: 45px;
  background: #166534;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  cursor: pointer;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: #15803d;
  transform: translateY(-3px);
}

/* ===== CTA BANNER ===== */
.cta-banner {
  background: linear-gradient(135deg, #166534, #15803d, #16a34a);
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}

.cta-banner::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}

/* ===== PROCESS / POURQUOI NOUS ===== */
.process-step {
  position: relative;
  transition: all 0.3s ease;
}

.process-step:hover {
  transform: translateY(-5px);
}

.process-number {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #166534, #16a34a);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 1rem;
  box-shadow: 0 4px 15px rgba(22, 101, 52, 0.3);
}

/* ===== SECTION DIVIDERS ===== */
.section-subtitle {
  display: inline-block;
  background: linear-gradient(135deg, #166534, #16a34a);
  color: white;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

/* ===== KEYFRAMES ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero {
    background-attachment: scroll;
  }

  .whatsapp-btn {
    bottom: 20px;
    right: 20px;
    width: 55px;
    height: 55px;
    font-size: 1.6rem;
  }

  .back-to-top {
    bottom: 85px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}
