/* Global */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  background: #d99b84;
  color: #333;
  line-height: 1.5;
  padding-top: 90px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Nouvelle section pour image de fond */
.background-section {
  background-image: url('../src/bgtiramisu.jpeg'); /* adapte le chemin si nécessaire */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  width: 100%;
  height: 100vh;
}

/* Header */
header {
  background-color: #65433a;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  flex-wrap: wrap;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 45px;
  margin-right: 8px;
}

nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

nav a {
  color: white;
  text-decoration: none;
  position: relative;
  font-weight: bold;
  white-space: nowrap;
}

nav i {
  font-size: 1.2em;
}

#cart-count {
  background-color: white;
  color: #000000;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 0.8em;
  position: absolute;
  top: -8px;
  right: -10px;
  border: 2px solid #000000;
  min-width: 20px;
  text-align: center;
  line-height: 1;
}

/* Hero section */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem;
  flex-wrap: wrap;
}

.hero-image {
  width: 50%;
  border-radius: 10px;
}

.hero-content {
  max-width: 45%;
}

/* Buttons */
.btn {
  background-color: #65433a;
  color: white;
  padding: 0.8rem 1.5rem;
  border: none;
  text-decoration: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: inline-block;
}

.btn:hover {
  background-color: #3f2b25;
}

/* Products */
.products {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  padding: 2rem;
  flex-wrap: wrap;
}

.product {
  background: white;
  border-radius: 10px;
  padding: 0.8rem;
  text-align: center;
  width: 120px;
  box-shadow: 0 0 8px #bbb;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.9rem;
}

.product img {
  width: 100%;
  border-radius: 10px;
  object-fit: contain;
}

.product h3 {
  margin: 0.4rem 0;
  font-size: 1rem;
}

.product p {
  font-weight: bold;
  margin-bottom: 0.4rem;
}

/* Quantity controls */
.quantity-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.quantity-controls button {
  background-color: #65433a;
  color: white;
  border: none;
  padding: 0.4rem;
  border-radius: 4px;
  cursor: pointer;
}

.quantity-controls button:hover {
  background-color: #3f2b25;
}

/* Footer */
.footer {
  background-color: #65433a;
  color: white;
  text-align: center;
  padding: 15px;
  font-size: 0.9em;
}

/* Validate order */
.validate-order {
  text-align: center;
  margin-top: 40px;
}

.validate-order .btn {
  background-color: #65433a;
  color: #fff;
  padding: 12px 24px;
  border: none;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  font-size: 16px;
  transition: background-color 0.3s ease;
}

.validate-order .btn:hover {
  background-color: #3f2b25;
}

/* Panier listé */
#liste-panier li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 1rem;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 0.8rem;
  list-style: none;
  font-size: 0.9rem;
}

#liste-panier button {
  margin-left: 1rem;
  background-color: #65433a;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
}

#liste-panier button:hover {
  background-color: #3f2b25;
}

/* Formulaire panier */
form input,
form textarea {
  width: 100%;
  padding: 0.6rem;
  margin-bottom: 1rem;
  border-radius: 4px;
  border: 1px solid #aaa;
  font-size: 16px;
}

form button {
  background-color: #65433a;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
}

form button:hover {
  background-color: #3f2b25;
}

/* --- Adaptation mobile --- */
@media (max-width: 768px) {
  body {
    padding-top: 110px;
  }

  .background-section {
    height: 60vh;
    background-position: center;
    background-size: cover;
  }

  header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.8rem;
    gap: 10px;
  }

  .logo img {
    height: 38px;
  }

  nav {
    flex-direction: row;
    gap: 12px;
    overflow-x: auto;
    white-space: nowrap;
  }

  nav a {
    font-size: 0.85rem;
  }

  #cart-count {
    top: -6px;
    right: -6px;
    font-size: 0.7em;
    padding: 2px 5px;
    border-width: 1px;
  }

  .hero {
    flex-direction: column;
    padding: 1rem;
    text-align: center;
  }

  .hero-image {
    width: 50%;
    margin-top: 1rem;
  }

  .hero-content {
    max-width: 100%;
  }

  .products {
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
  }

  .product {
    width: 100%;
    max-width: 280px;
    font-size: 0.9rem;
  }

  .product img {
    max-height: 160px;
    object-fit: cover;
  }

  .container {
    padding: 1rem;
  }

  form {
    padding: 0;
  }

  #liste-panier li {
    flex-direction: column;
    align-items: flex-start;
    font-size: 0.9rem;
  }

  #liste-panier li button {
    margin-left: 0;
    margin-top: 0.5rem;
  }

  .form-section {
    padding: 1rem;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .validate-order {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    width: calc(100% - 40px);
    max-width: 300px;
    margin-top: 0;
  }

  .validate-order .btn {
    background-color: #d89a84;
    border-radius: 50px;
    font-size: 14px;
    padding: 12px 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }

  .validate-order .btn:hover {
    background-color: #3f2b25;
  }
}

/* Très petits écrans */
@media (max-width: 480px) {
  body {
    padding-top: 115px;
  }

  header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding:8px 10px;;
    flex-wrap: nowrap;
  }

  .logo img {
    height: 28px;
  }

  nav {
    flex-direction: row;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
  }

  nav a {
    font-size: 0.8rem;
    padding: 6px 8px;
  }

  #cart-count {
    top: -5px;
    right: -5px;
    font-size: 0.65em;
    padding: 2px 4px;
  }

  .hero {
    padding: 0.5rem;
  }

  .product {
    width: 100%;
    font-size: 0.85rem;
  }

  .product img {
    max-height: 140px;
  }

  .btn {
    font-size: 14px;
    padding: 10px 15px;
  }

  #liste-panier li {
    font-size: 0.85rem;
  }
}