/* AnnoncesGratuites.eu — refonte mobile-first 2026 */

:root {
  --ag-primary: #c1272d;
  --ag-primary-dark: #8a1c20;
  --ag-accent: #ffd700;
  --ag-bg: #fafafa;
  --ag-text: #222;
  --ag-muted: #6c757d;
  --ag-border: #e3e3e3;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--ag-bg);
  color: var(--ag-text);
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
  padding: 0;
}

a { color: var(--ag-primary); text-decoration: none; }
a:hover { color: var(--ag-primary-dark); text-decoration: underline; }

/* ---- Navbar ---- */
.ag-navbar {
  background: #fff;
  border-bottom: 1px solid var(--ag-border);
  padding: .5rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.ag-navbar .navbar-brand img { max-height: 44px; width: auto; }
.ag-navbar .nav-link { color: var(--ag-text); font-weight: 500; }
.ag-navbar .nav-link:hover { color: var(--ag-primary); }

.ag-cta-saisir {
  background: var(--ag-primary);
  color: #fff !important;
  border-radius: 999px;
  padding: .4rem 1rem;
  font-weight: 600;
}
.ag-cta-saisir:hover { background: var(--ag-primary-dark); color: #fff !important; }

/* ---- Hero / breadcrumb ---- */
.ag-hero {
  background: linear-gradient(135deg, var(--ag-primary), var(--ag-primary-dark));
  color: #fff;
  padding: 1.5rem 1rem;
  margin-bottom: 1rem;
}
.ag-hero h1 { font-size: 1.4rem; margin: 0 0 .25rem 0; }
.ag-hero .lead { font-size: .9rem; opacity: .9; margin: 0; }

.ag-breadcrumb {
  font-size: .85rem;
  padding: .5rem 0;
  color: var(--ag-muted);
}
.ag-breadcrumb a { color: var(--ag-muted); }
.ag-breadcrumb a:hover { color: var(--ag-primary); }

/* ---- Grille catégories home ---- */
.ag-cat-grid { margin: 1rem 0; }
.ag-cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: 12px;
  padding: 1rem .5rem;
  height: 100%;
  color: var(--ag-text);
  transition: transform .15s ease, box-shadow .15s ease;
}
.ag-cat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  text-decoration: none;
  color: var(--ag-primary);
}
.ag-cat-card i { color: var(--ag-primary); }
.ag-cat-card .ag-cat-label { margin-top: .5rem; font-weight: 600; font-size: .9rem; }

/* ---- Card annonce listing ---- */
.ag-card {
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: 10px;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.ag-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.1);
}
.ag-card a { color: inherit; text-decoration: none; display: flex; flex-direction: column; height: 100%; }
.ag-card-photo {
  width: 100%;
  aspect-ratio: 4/3;
  background: #eee center/cover no-repeat;
  position: relative;
}
.ag-card-price {
  position: absolute;
  bottom: .35rem;
  right: .35rem;
  background: rgba(255,255,255,.95);
  color: var(--ag-primary);
  font-weight: 700;
  font-size: .85rem;
  padding: .2rem .5rem;
  border-radius: 6px;
}
.ag-card-body { padding: .65rem; flex: 1; }
.ag-card-title {
  font-weight: 600;
  font-size: .92rem;
  line-height: 1.3;
  margin: 0 0 .25rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ag-card-meta {
  font-size: .78rem;
  color: var(--ag-muted);
  margin: 0;
}

/* ---- Détail annonce ---- */
.ag-detail-title {
  font-size: 1.4rem;
  margin: 0 0 .5rem 0;
}
.ag-detail-meta {
  font-size: .85rem;
  color: var(--ag-muted);
  margin-bottom: 1rem;
}
.ag-detail-meta span { display: inline-block; margin-right: 1rem; }
.ag-detail-price {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ag-primary);
  margin: .5rem 0;
}
.ag-detail-photo {
  width: 100%;
  border-radius: 10px;
  margin-bottom: .5rem;
}
.ag-gallery {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: .5rem;
  margin-bottom: 1rem;
}
.ag-gallery img {
  flex: 0 0 auto;
  max-height: 90px;
  border-radius: 6px;
  scroll-snap-align: start;
  cursor: pointer;
  border: 1px solid var(--ag-border);
}
.ag-detail-desc {
  font-size: 1rem;
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.ag-specs {
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.ag-specs dt { font-weight: 600; color: var(--ag-muted); }
.ag-specs dd { margin-bottom: .5rem; }

.ag-cta {
  display: block;
  width: 100%;
  background: var(--ag-primary);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: .75rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: .5rem;
  cursor: pointer;
}
.ag-cta:hover { background: var(--ag-primary-dark); color: #fff; text-decoration: none; }
.ag-cta-secondary {
  background: #fff;
  color: var(--ag-primary);
  border: 1px solid var(--ag-primary);
}
.ag-cta-secondary:hover { background: var(--ag-primary); color: #fff; }

/* ---- Pagination ---- */
.ag-pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .25rem;
  margin: 1.5rem 0;
}
.ag-pagination a, .ag-pagination span {
  display: inline-block;
  padding: .4rem .7rem;
  border: 1px solid var(--ag-border);
  border-radius: 6px;
  color: var(--ag-text);
  background: #fff;
  font-size: .9rem;
}
.ag-pagination a:hover { background: var(--ag-primary); color: #fff; text-decoration: none; }
.ag-pagination .active { background: var(--ag-primary); color: #fff; border-color: var(--ag-primary); }

/* ---- Footer ---- */
.ag-footer {
  background: #2c2c2c;
  color: #ccc;
  padding: 2rem 1rem 1rem 1rem;
  margin-top: 2rem;
  font-size: .85rem;
}
.ag-footer a { color: #fff; }
.ag-footer a:hover { color: var(--ag-accent); }
.ag-footer h5 { color: #fff; font-size: .95rem; margin-bottom: .75rem; }
.ag-footer-bottom {
  border-top: 1px solid #444;
  margin-top: 1.5rem;
  padding-top: 1rem;
  text-align: center;
  font-size: .8rem;
  color: #999;
}

/* ---- Pubs ---- */
.ag-promo-block {
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: 10px;
  padding: 1rem;
  margin: 1rem 0;
}
.ag-promo-block h6 {
  font-size: .8rem;
  color: var(--ag-muted);
  font-weight: 400;
  text-align: center;
  margin: 0 0 .5rem 0;
}

/* ---- Responsive tweaks ---- */
@media (min-width: 768px) {
  .ag-hero h1 { font-size: 1.8rem; }
  .ag-detail-title { font-size: 1.7rem; }
}
@media (max-width: 575px) {
  .ag-card-title { font-size: .85rem; }
  .ag-card-meta { font-size: .72rem; }
}
