/* ===================================
   PAGE DÉTAIL ANNONCE
   =================================== */

.page-ad-detail {
    padding: 2rem 0;
    background: var(--color-bg);
}

.ad-detail-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.ad-detail-main {
    min-width: 0;
}

/* ===================================
   GALERIE D'IMAGES
   =================================== */

.ad-gallery {
    margin-bottom: 2rem;
}

.ad-gallery__main {
    position: relative;
    aspect-ratio: 16/10;
    background: #f5f5f5;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
}

.ad-gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.ad-gallery__badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.5rem 1rem;
    background: var(--color-primary);
    color: white;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    z-index: 2;
    text-transform: uppercase;
}

.ad-gallery__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.95);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.ad-gallery__nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: var(--shadow-lg);
}

.ad-gallery__nav--prev { left: 1rem; }
.ad-gallery__nav--next { right: 1rem; }

.ad-gallery__nav i {
    font-size: 1.2rem;
    color: var(--color-text);
}

/* Miniatures */
.ad-gallery__thumbs-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ad-gallery__thumbs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0.5rem 0;
    scrollbar-width: thin;
}

.ad-gallery__thumbs::-webkit-scrollbar {
    height: 6px;
}

.ad-gallery__thumbs::-webkit-scrollbar-track {
    background: var(--color-bg-light);
    border-radius: 3px;
}

.ad-gallery__thumbs::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 3px;
}

.ad-gallery__thumb {
    flex: 0 0 100px;
    height: 75px;
    border: 3px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    background: none;
    padding: 0;
}

.ad-gallery__thumb:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.ad-gallery__thumb--active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}

.ad-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-gallery__thumbs-nav {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    background: var(--color-bg-light);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.ad-gallery__thumbs-nav:hover {
    background: var(--color-primary);
    color: white;
}

/* ===================================
   HEADER ANNONCE
   =================================== */

.ad-header {
    padding: 1.5rem 0;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 2rem;
}

.ad-header__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 1rem;
}

.ad-header__title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    flex: 1;
    line-height: 1.3;
}

.ad-header__price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    white-space: nowrap;
}

.ad-header__meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    font-size: 0.95rem;
    color: var(--color-text-light);
}

.ad-header__meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ad-header__meta i {
    color: var(--color-primary);
    font-size: 1rem;
}

/* ===================================
   SPÉCIFICATIONS
   =================================== */

.ad-specs {
    background: var(--color-bg-light);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.ad-specs h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.ad-specs__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.ad-specs__list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.ad-specs__list i {
    color: var(--color-primary);
    font-size: 1.1rem;
    width: 20px;
    flex-shrink: 0;
}

/* ===================================
   DESCRIPTION
   =================================== */

.ad-description {
    margin-bottom: 2rem;
}

.ad-description h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.ad-description__content {
    line-height: 1.8;
    color: var(--color-text);
    font-size: 1rem;
}

/* ===================================
   SIDEBAR
   =================================== */

.ad-detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ad-sidebar-card {
    background: var(--color-bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.ad-sidebar-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

/* Carte interactive */
.ad-map {
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

/* ===================================
   VENDEUR
   =================================== */

.ad-seller {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.ad-seller__avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-primary);
}

.ad-seller__info {
    flex: 1;
}

.ad-seller__name {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    color: var(--color-text);
}

/* ===================================
   ANNONCES SIMILAIRES
   =================================== */

.ad-similar-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ad-similar-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.ad-similar-item:hover {
    background: var(--color-bg-light);
    border-color: var(--color-border);
    transform: translateX(4px);
}

.ad-similar-item img {
    width: 90px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.ad-similar-item__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ad-similar-item h4 {
    font-size: 0.95rem;
    margin: 0 0 0.5rem 0;
    color: var(--color-text);
    line-height: 1.4;
}

.ad-similar-item__price {
    font-weight: 700;
    color: var(--color-primary);
    font-size: 1rem;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 1024px) {
    .ad-detail-layout {
        grid-template-columns: 1fr;
    }
    
    .ad-detail-sidebar {
        order: 2;
    }
}

@media (max-width: 768px) {
    .page-ad-detail {
        padding: 1rem 0;
    }
    
    .ad-detail-layout {
        gap: 1.5rem;
    }
    
    .ad-header__top {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .ad-header__title {
        font-size: 1.5rem;
    }
    
    .ad-header__price {
        font-size: 1.75rem;
        align-self: flex-start;
    }
    
    .ad-header__meta {
        gap: 1rem;
        font-size: 0.875rem;
    }
    
    .ad-gallery__main {
        aspect-ratio: 4/3;
    }
    
    .ad-gallery__thumb {
        flex: 0 0 70px;
        height: 55px;
    }
    
    .ad-specs__list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .ad-header__title {
        font-size: 1.3rem;
    }
    
    .ad-header__price {
        font-size: 1.5rem;
    }
    
    .ad-sidebar-card {
        padding: 1rem;
    }
}
