:root {
  --main: #20C997;
  --accent: #FF6B81;
  --text: #222;
  --bg: #fffbe7;
  --white: #fff;
  --highlight: #FFE066;
  --border: #eee;
  --font: 'Segoe UI', sans-serif;
}

/* === RESET === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

button, a, input {
  transition: all 0.2s ease;
}

button:focus,
a:focus,
input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* === HEADER === */
header {
  background: var(--main);
  padding: 1em 2em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  position: relative;
}

nav a {
  margin-left: 1.5em;
  text-decoration: none;
  color: white;
  font-weight: bold;
}

/* === MENU TOGGLE (Mobile) === */
.menu-toggle {
  display: none;
  font-size: 1.8em;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  nav.nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 70px;
    right: 20px;
    background: var(--main);
    padding: 1em;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
  }

  nav.nav-links.show {
    display: flex;
  }

  nav.nav-links a {
    margin: 0.5em 0;
    color: white;
  }
}

/* === SEARCH BAR === */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.search-bar input[type="text"] {
  padding: 6px 12px;
  font-size: 1em;
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 200px;
  background: var(--white);
  color: var(--text);
}

.search-bar input[type="text"]::placeholder {
  color: #aaa;
}

.search-bar button {
  padding: 6px 12px;
  font-size: 1em;
  background-color: var(--accent);
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.search-bar button:hover {
  background-color: #e95f74;
}

/* Centrée grande */
.search-bar.large-centered {
  margin: 2em auto 0;
  display: flex;
  justify-content: center;
  max-width: 600px;
}

.search-bar.large-centered input {
  flex: 1;
  padding: 14px 20px;
  font-size: 1.2em;
  border: 1px solid var(--border);
  border-radius: 6px 0 0 6px;
}

.search-bar.large-centered button {
  padding: 14px 20px;
  font-size: 1.2em;
  border-radius: 0 6px 6px 0;
}

.search-bar.large-centered input,
.search-bar.large-centered button {
  height: 56px;
}

/* === HERO === */
.hero {
  background: linear-gradient(to right, var(--main), #38e4b4);
  color: white;
  text-align: center;
  padding: 4em 2em;
}

.hero h1 {
  font-size: 2.5em;
  margin-bottom: 0.5em;
}

.hero p {
  font-size: 1.2em;
}

.hero button {
  margin-top: 2em;
  background: var(--accent);
  color: white;
  padding: 1em 2em;
  border: none;
  font-weight: bold;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.hero a:hover {
  background: var(--highlight);
  color: var(--text);
}

/* === CATEGORIES === */
.categories {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1em;
  padding: 3em 1em;
  background: var(--white);
}

.category-card {
  background: var(--highlight);
  width: 140px;
  height: 140px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
}

.category-card:hover {
  transform: translateY(-5px);
}

.category-card img {
  width: 40px;
  height: 40px;
  margin-bottom: 0.5em;
}

/* === PRODUCTS === */
.products {
  padding: 2em;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5em;
}

.products a.product-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.product-card {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 12px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.product-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.product-card .info {
  padding: 1em;
}

.product-card .info h3 {
  margin-bottom: 0.3em;
}

.info p {
  font-size: 0.9em;
  color: #666;
}

/* === HOW IT WORKS === */
.how-it-works {
  padding: 3em 1em;
  background: var(--white);
  text-align: center;
}

.how-it-works h2 {
  margin-bottom: 1em;
}

.how-it-works ol {
  list-style: decimal;
  padding-left: 1.2em;
  text-align: left;
  max-width: 500px;
  margin: 0 auto;
  font-size: 1.1em;
}

/* === CTA === */
.cta {
  text-align: center;
  padding: 3em 1em;
  background: var(--accent);
  color: white;
}

.cta a {
  background: white;
  color: var(--accent);
  padding: 1em 2em;
  text-decoration: none;
  border-radius: 20px;
  font-weight: bold;
  display: inline-block;
  margin-top: 1em;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.cta a:hover {
  background: var(--highlight);
  color: var(--text);
}

/* === FOOTER === */
footer {
  background: #222;
  color: #ccc;
  text-align: center;
  padding: 2em 1em;
}

footer a {
  color: #ccc;
  margin: 0 1em;
  text-decoration: none;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
  body {
    padding: 0 1em;
  }

  .search-bar.large-centered {
    flex-direction: column;
  }

  .search-bar.large-centered input,
  .search-bar.large-centered button {
    border-radius: 6px;
    width: 100%;
  }

  .search-bar.large-centered button {
    margin-top: 0.5em;
  }
}

/* === PAGE ANNONCE === */
.annonce-container {
  max-width: 960px;
  margin: 3em auto;
  background: var(--white);
  border-radius: 12px;
  padding: 2em;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.annonce-container h1 {
  font-size: 2.2em;
  margin-bottom: 0.5em;
  color: var(--text);
}

.annonce-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin-bottom: 1.5em;
}

.badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 0.4em 1em;
  font-size: 0.85em;
  border-radius: 20px;
  text-transform: capitalize;
}

.annonce-price {
  font-size: 1.8em;
  font-weight: bold;
  color: var(--accent);
  margin: 1em 0;
}

.annonce-image {
  width: 100%;
  max-height: 450px;
  object-fit: cover;
  border-radius: 8px;
  margin: 1.5em 0;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.annonce-description {
  font-size: 1.1em;
  line-height: 1.7;
  white-space: pre-wrap;
  margin-top: 1em;
  color: #444;
}

.annonce-footer {
  margin-top: 2em;
  font-size: 0.9em;
  color: #888;
}

.annonce-footer a {
  color: var(--main);
  text-decoration: none;
  font-weight: 500;
}

.annonce-footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .annonce-container {
    padding: 1.5em;
  }

  .annonce-container h1 {
    font-size: 1.6em;
  }

  .annonce-price {
    font-size: 1.4em;
  }
}

/* === PAGE PROFIL === */
.user-info,
.user-listings {
  max-width: 960px;
  margin: 3em auto;
  background: var(--white);
  border-radius: 12px;
  padding: 2em;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.user-info h2,
.user-listings h2 {
  margin-bottom: 1em;
  color: var(--main);
}

.user-info p,
.user-listings p {
  font-size: 1.05em;
  margin-bottom: 0.8em;
  line-height: 1.6;
}

.user-listings ul.annonces {
  list-style: none;
  padding-left: 0;
}

.user-listings ul.annonces li {
  background: var(--bg);
  padding: 1em;
  border-radius: 8px;
  margin-bottom: 1em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.user-listings ul.annonces li a {
  text-decoration: none;
  color: var(--text);
  font-weight: bold;
}

.user-listings ul.annonces li a:hover {
  color: var(--accent);
}

.user-listings img {
  margin-top: 0.5em;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  max-width: 100%;
  height: auto;
}

.annonce-actions {
  margin-top: 1em;
  display: flex;
  gap: 1em;
}

.btn {
  display: inline-block;
  padding: 0.5em 1em;
  border: none;
  text-decoration: none;
  font-size: 0.95em;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s ease;
}

.btn.edit {
  background: var(--main);
  color: white;
}

.btn.edit:hover {
  background: #18b184;
}

.btn.delete {
  background: var(--accent);
  color: white;
}

.btn.delete:hover {
  background: #e95f74;
}
