/* ==========================================================================
   Styles pour les pages Annonces - Mobile First
   ========================================================================== */

/* Page de liste des annonces - Mobile */
.page-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1.5rem 0;
}

.page-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 0.75rem;
  color: #333;
  line-height: 1.2;
}

.page-description {
  font-size: 1rem;
  color: #666;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Grille des annonces - Mobile */
.annonces-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 0 1rem;
}

/* Carte d'annonce - Mobile */
.annonce-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e5e5;
}

.annonce-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.annonce-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.annonce-card:hover .annonce-image img {
  transform: scale(1.05);
}

.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: #f5f5f5;
  color: #999;
}

.no-image .material-icons {
  font-size: 2.5rem;
}

.prix-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 15px;
  font-weight: 600;
  font-size: 0.9rem;
}

.annonce-content {
  padding: 1rem;
}

.annonce-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.annonce-meta span {
  background: #f0f0f0;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
  color: #666;
}

.annonce-title {
  margin-bottom: 0.75rem;
}

.annonce-title a {
  color: #333;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
}

.annonce-title a:hover {
  color: #007cba;
}

.annonce-description {
  color: #666;
  line-height: 1.5;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.annonce-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e5e5;
}

.date-publication {
  font-size: 0.8rem;
  color: #999;
}

.btn-voir-plus {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #007cba;
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.3s ease;
}

.btn-voir-plus:hover {
  background: #005a87;
  color: white;
}

.btn-voir-plus .material-icons {
  font-size: 1rem;
}

/* Aucune annonce - Mobile */
.no-annonces {
  text-align: center;
  padding: 2rem 1rem;
  color: #666;
}

.no-annonces .material-icons {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #ccc;
}

.no-annonces h2 {
  margin-bottom: 0.75rem;
  color: #333;
  font-size: 1.3rem;
}

.no-annonces p {
  font-size: 0.9rem;
}

/* Pagination - Mobile */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  padding: 0 1rem;
}

.pagination-wrapper .page-numbers {
  display: flex;
  list-style: none;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.pagination-wrapper .page-numbers li {
  margin: 0;
}

.pagination-wrapper .page-numbers a,
.pagination-wrapper .page-numbers span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.75rem;
  background: #f5f5f5;
  color: #333;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.pagination-wrapper .page-numbers a:hover {
  background: #007cba;
  color: white;
}

.pagination-wrapper .page-numbers .current {
  background: #007cba;
  color: white;
}

/* ==========================================================================
   Page détaillée d'une annonce - Mobile First
   ========================================================================== */

/* Breadcrumb - Mobile */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  font-size: 0.8rem;
  color: #666;
  padding: 0 1rem;
}

.breadcrumb a {
  color: #007cba;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb .material-icons {
  font-size: 1rem;
}

/* Contenu principal de l'annonce - Mobile */
.annonce-single-content {
  display: block;
  margin-bottom: 2rem;
  padding: 0 1rem;
}

/* Galerie d'images - Mobile */
.annonce-gallery {
  position: static;
  margin-bottom: 1.5rem;
}

.gallery-main {
  margin-bottom: 0.75rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.main-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.gallery-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 0.4rem;
}

.thumbnail {
  width: 100%;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.3s ease;
  border: 2px solid transparent;
}

.thumbnail:hover {
  opacity: 0.8;
  border-color: #007cba;
}

/* Informations de l'annonce */
.annonce-info {
  padding: 1rem 0;
}

.annonce-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e5e5;
}

.annonce-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #333;
  line-height: 1.2;
}

.annonce-price .price {
  font-size: 2rem;
  font-weight: 700;
  color: #007cba;
}

/* Grille des métadonnées */
.annonce-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #007cba;
}

.meta-item .material-icons {
  color: #007cba;
  font-size: 1.5rem;
}

.meta-item div {
  display: flex;
  flex-direction: column;
}

.meta-item strong {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.meta-item span {
  font-weight: 600;
  color: #333;
}

/* Description */
.annonce-description {
  margin-bottom: 2rem;
}

.annonce-description h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #333;
}

.description-content {
  line-height: 1.7;
  color: #555;
}

/* Caractéristiques */
.annonce-features {
  margin-bottom: 2rem;
}

.annonce-features h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #333;
}

.features-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.features-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.features-list li:last-child {
  border-bottom: none;
}

.features-list .material-icons {
  color: #28a745;
  font-size: 1.2rem;
}

/* Contact */
.annonce-contact {
  background: #f8f9fa;
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid #e5e5e5;
}

.annonce-contact h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #333;
}

.contact-info p {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: #555;
}

.contact-info .material-icons {
  color: #007cba;
  font-size: 1.2rem;
}

.contact-info a {
  color: #007cba;
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

/* Navigation entre annonces */
.annonce-navigation {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e5e5;
}

.nav-previous,
.nav-next {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  transition: all 0.3s ease;
  flex: 1;
  max-width: 300px;
}

.nav-next {
  flex-direction: row-reverse;
  text-align: right;
}

.nav-previous:hover,
.nav-next:hover {
  background: #007cba;
  color: white;
}

.nav-previous .material-icons,
.nav-next .material-icons {
  font-size: 1.5rem;
}

.nav-previous div,
.nav-next div {
  display: flex;
  flex-direction: column;
}

.nav-previous span,
.nav-next span {
  font-size: 0.9rem;
  color: #666;
}

.nav-previous strong,
.nav-next strong {
  font-weight: 600;
  line-height: 1.3;
}

.nav-previous:hover span,
.nav-next:hover span {
  color: rgba(255, 255, 255, 0.8);
}


/* États de chargement et d'erreur */
.filters-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  color: #666;
}

.loading-spinner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.loading-spinner .material-icons {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.filters-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem;
  color: #dc3545;
  text-align: center;
}

.filters-error .material-icons {
  font-size: 2rem;
}

/* ==========================================================================
   Media Queries - Mobile First
   ========================================================================== */

/* Tablette (768px et plus) */
@media (min-width: 768px) {
  .page-header {
    margin-bottom: 3rem;
    padding: 2rem 0;
  }
  
  .page-title {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
  }
  
  .page-description {
    font-size: 1.1rem;
    max-width: 600px;
    padding: 0;
  }
  
  .annonces-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 0;
  }
  
  .annonce-card {
    border-radius: 12px;
  }
    
  .annonce-image {
    height: 220px;
  }
  
  .annonce-content {
    padding: 1.25rem;
  }
  
  .annonce-meta span {
    font-size: 0.85rem;
    padding: 0.25rem 0.7rem;
  }
  
  .annonce-title a {
    font-size: 1.2rem;
  }
  
  .annonce-description {
    font-size: 0.95rem;
  }
  
  .btn-voir-plus {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
  }
  
  .pagination-wrapper {
    margin-top: 3rem;
    padding: 0;
  }
  
  .pagination-wrapper .page-numbers {
    gap: 0.5rem;
  }
  
  .pagination-wrapper .page-numbers a,
  .pagination-wrapper .page-numbers span {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }
   
  /* Page détaillée - Tablette */
  .breadcrumb {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    padding: 0;
  }
  
  .breadcrumb .material-icons {
    font-size: 1.1rem;
  }
  
  .annonce-single-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 0;
  }
  
  .annonce-gallery {
    position: sticky;
    top: 2rem;
  }
  
  .main-image {
    height: 350px;
  }
  
  .gallery-thumbnails {
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 0.5rem;
  }
  
  .thumbnail {
    height: 70px;
  }
  
  .annonce-info {
    padding: 0;
  }
  
  .annonce-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
  }
  
  .annonce-title {
    font-size: 2rem;
  }
  
  .annonce-price .price {
    font-size: 1.8rem;
  }
  
  .annonce-meta-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  
  .meta-item {
    padding: 1rem;
  }
  
  .meta-item .material-icons {
    font-size: 1.4rem;
  }
  
  .annonce-description h2,
  .annonce-features h2,
  .annonce-contact h2 {
    font-size: 1.4rem;
  }
  
  .annonce-contact {
    padding: 1.5rem;
  }
  
  .annonce-navigation {
    flex-direction: row;
    margin-top: 3rem;
    padding-top: 2rem;
  }
  
  .nav-previous,
  .nav-next {
    max-width: 300px;
  }
}

/* Desktop (1024px et plus) */
@media (min-width: 1024px) {
  .annonces-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }
  
  .annonce-image {
    height: 250px;
  }
  
  .annonce-content {
    padding: 1.5rem;
  }
  
  .annonce-meta span {
    font-size: 0.9rem;
    padding: 0.25rem 0.75rem;
  }
  
  .annonce-title a {
    font-size: 1.3rem;
  }
  
  .annonce-description {
    font-size: 1rem;
  }
  
  .btn-voir-plus {
    padding: 0.5rem 1rem;
    font-size: 1rem;
  }
  
  .btn-voir-plus .material-icons {
    font-size: 1.2rem;
  }
    
  /* Page détaillée - Desktop */
  .annonce-single-content {
    gap: 3rem;
  }
  
  .main-image {
    height: 400px;
  }
  
  .gallery-thumbnails {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  }
  
  .thumbnail {
    height: 80px;
  }
  
  .annonce-title {
    font-size: 2.5rem;
  }
  
  .annonce-price .price {
    font-size: 2rem;
  }
  
  .annonce-meta-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
  
  .meta-item .material-icons {
    font-size: 1.5rem;
  }
  
  .annonce-description h2,
  .annonce-features h2,
  .annonce-contact h2 {
    font-size: 1.5rem;
  }
  
  .annonce-contact {
    padding: 2rem;
  }
}

/* Grand écran (1200px et plus) */
@media (min-width: 1200px) {
  .annonces-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .annonce-meta-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
