/* =================================== */
/* VARIABLES & STYLE GLOBAL            */
/* =================================== */
:root {
  --primary: #3f4f44;
  --accent: #b17f59;
  --light: #ffffff;
  --dark: #333333;
  --background: #f8f9fa;
  --border-color: #e9ecef;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
  --transition: all 0.3s ease;
}

html {
  height: 100%;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  color: inherit;
}

footer {
  background-color: #3f4f44 !important;
}

body {
  font-family: "PT Sans", sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--background);
  color: var(--dark);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.page-wrapper {
  flex: 1;
}

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* =================================== */
/* HEADER DE LA PAGE SERVICES          */
/* =================================== */
.services-header {
  background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
    url("../Image/b1.jpeg") center/cover no-repeat;
  color: var(--light);
  padding: 80px 20px;
  text-align: center;
  height: 500px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.services-header h1 {
  font-family: "Marcellus", serif;
  font-size: 2.8rem;
  margin-bottom: 10px;
}

.services-header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* =================================== */
/* FILTRES ET RECHERCHE (NOUVEAU)      */
/* =================================== */
.filters-container {
  background-color: #3f4f44;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.search-bar {
  position: relative;
  width: 100%;
}

.search-bar i {
  position: absolute;
  top: 50%;
  left: 15px;
  transform: translateY(-50%);
  color: var(--primary);
  opacity: 0.5;
}

#searchInput {
  width: 100%;
  padding: 12px 20px 12px 45px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: "PT Sans", sans-serif;
  font-size: 1rem;
  transition: var(--transition);
}

#searchInput:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(177, 127, 89, 0.2);
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

.filter-btn {
  background-color: #f1f3f5;
  color: var(--dark);
  border: none;
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover {
  background-color: #e9ecef;
}

.filter-btn.active {
  background-color: var(--primary);
  color: var(--light);
  border: 1px solid white;
}

/* =================================== */
/* GRILLE ET CARTES DE SERVICES (MODIFIÉ) */
/* =================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.service-card {
  background: var(--light);
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.card-image-container {
  height: 170px; /* MODIFIÉ : Hauteur d'image réduite */
  position: relative;
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.service-card:hover .card-image {
  transform: scale(1.05);
}

.card-content {
  padding: 15px;
  /* flex-grow a été retiré, la zone de contenu ne s'étire plus inutilement */
  display: flex;
  flex-direction: column;
}

.card-category {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.card-title {
  font-family: "Marcellus", serif;
  font-size: 1.15rem;
  color: var(--primary);
  margin-bottom: 12px; /* MODIFIÉ : Espace ajusté avant le pied de carte */
  line-height: 1.3;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* margin-top: auto; est retiré car la carte n'a plus de hauteur fixe */
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.card-price {
  font-family: "Marcellus", serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
}

/* Style du bouton "Ajouter" modifié et repositionné */
.add-to-cart-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background-color: rgba(63, 79, 68, 0.8);
  color: var(--light);
  border: 1px solid rgba(255, 255, 255, 0.5);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 0;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.add-to-cart-btn .fa-plus,
.add-to-cart-btn .fa-check {
  font-size: 1rem;
}

.add-to-cart-btn:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  transform: scale(1.1);
}

.add-to-cart-btn.added {
  background-color: #27ae60;
  border-color: #27ae60;
  cursor: default;
}

.add-to-cart-btn.added .fa-plus {
  display: none;
}

.add-to-cart-btn .fa-check {
  display: none;
}

.add-to-cart-btn.added .fa-check {
  display: inline-block;
}

.no-results-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  font-size: 1.1rem;
  color: #6c757d;
}

/* =================================== */
/* PANIER FLOTTANT                     */
/* =================================== */
.floating-cart-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: var(--primary);
  color: var(--light);
  border-radius: 50px;
  display: flex;
  align-items: center;
  padding: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  transform: translateY(200%);
  transition: transform 0.4s ease;
  z-index: 100;
}

.floating-cart-container.active {
  transform: translateY(0);
}

.cart-icon {
  position: relative;
  background-color: var(--light);
  color: var(--primary);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--accent);
  color: var(--light);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-details {
  display: flex;
  align-items: center;
  margin: 0 20px;
  gap: 20px;
}

.cart-total-price {
  font-size: 1.1rem;
  font-weight: 700;
}

.checkout-btn {
  background-color: var(--accent);
  color: var(--light);
  border: none;
  padding: 12px 25px;
  border-radius: 50px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.checkout-btn:hover:not(:disabled) {
  background-color: #c88e6a;
}
.checkout-btn:disabled {
  background-color: #999;
  cursor: not-allowed;
}
