/**
 * ============================================================================
 * WARAP Listing Detail Page CSS v3.2 (Premium Redesign + Mobile Fixes)
 * ============================================================================
 * Styles spécifiques à la page de détail produit (listing.html)
 * Design amélioré "Ultra Moderne"
 * Date: 2026-01-10
 * ============================================================================
 */

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    padding: 0 20px;
    max-width: 1280px;
    margin: 20px auto 0;
    overflow-x: auto;
    white-space: nowrap;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.breadcrumb::-webkit-scrollbar {
    display: none;
}

.breadcrumb a {
    color: var(--text-secondary);
    transition: color 0.2s;
    font-weight: 500;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb i {
    font-size: 0.7rem;
    opacity: 0.5;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
.listing-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px 20px 100px;
    /* Increased bottom padding for mobile nav */
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    position: relative;
    /* Prevent overflow on mobile */
    width: 100%;
    box-sizing: border-box;
}

/* ============================================
   PRODUCT GALLERY (Redesigned)
   ============================================ */
.product-gallery {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    /* Sticky on Desktop only */
    position: sticky;
    top: 90px;
    /* Below Header */
    height: fit-content;
    /* FIX: z-index réduit pour ne pas chevaucher les sections suivantes */
    z-index: 5;
}

.gallery-main {
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
    color: #fff;
    position: relative;
    background-size: cover;
    background-position: center;
    background-color: #f1f5f9;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-main:hover img {
    transform: scale(1.03);
}

/* Gradients dynamiques par catégorie */
.gallery-main.cat-product {
    background: linear-gradient(135deg, #FF6B6B, #EE5253);
}

.gallery-main.cat-service {
    background: linear-gradient(135deg, #4834d4, #686de0);
}

.gallery-main.cat-education {
    background: linear-gradient(135deg, #6ab04c, #badc58);
}

.gallery-main.cat-immo {
    background: linear-gradient(135deg, #f0932b, #ffbe76);
}

.gallery-badges {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2;
}

.gallery-badge {
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    letter-spacing: 0.3px;
}

.badge-verified {
    background: rgba(16, 185, 129, 0.95);
    color: #fff;
}

.badge-category {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gallery-actions {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
    z-index: 2;
}

.action-btn {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: #fff;
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.action-btn.fav-active {
    background: #fff;
    color: #ef4444;
    /* Red color specifically for favorite */
    box-shadow: 0 8px 16px rgba(239, 68, 68, 0.3);
}

/* ============================================
   PRODUCT INFO (Right Side)
   ============================================ */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.product-header {
    margin-bottom: 10px;
}

.product-category-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    background: rgba(245, 158, 11, 0.1);
    padding: 6px 12px;
    border-radius: 6px;
}

.product-title-lg {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.2;
    color: var(--text-primary);
}

.product-meta {
    display: flex;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.meta-item i {
    font-size: 1.1rem;
    color: var(--primary);
}

.meta-item.rating i {
    color: #f59e0b;
}

/* Description Box */
.product-description-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.product-description h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-description h4::before {
    content: '';
    display: block;
    width: 4px;
    height: 18px;
    background: var(--gradient-primary);
    border-radius: 4px;
}

.product-description p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1rem;
}

/* ============================================
   SIDEBAR & FLOATING CARD
   ============================================ */
.listing-sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Price Card - The "Star" */
.price-card {
    background: #1e1e2d;
    /* Dark theme default for contrast */
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease;
}

.price-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
}

.price-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.price-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 25px;
    display: flex;
    align-items: baseline;
    gap: 6px;
    line-height: 1;
}

.price-value small {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

/* Actions */
.listing-actions {
    display: grid;
    gap: 15px;
}

.btn-buy {
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
    width: 100%;
}

.btn-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.5);
    filter: brightness(1.1);
}

.btn-whatsapp-lg {
    background: #25d366;
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.btn-whatsapp-lg:hover {
    background: #20bd5a;
    box-shadow: 0 10px 20px rgba(37, 211, 102, 0.3);
    transform: translateY(-2px);
}

/* Seller Card */
.seller-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    transition: transform 0.2s;
}

.seller-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.seller-avatar-lg {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-gold);
    color: #000;
    font-weight: 800;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.seller-info {
    flex: 1;
}

.seller-info h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.seller-verified {
    color: var(--success);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

/* ============================================
   REVIEWS (Bottom - Full Width)
   ============================================ */
.reviews-section,
.reviews-wrapper {
    grid-column: 1 / -1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 30px;
    margin-top: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    /* FIX: S'assurer que les reviews sont au-dessus de la galerie sticky */
    position: relative;
    z-index: 20;
    clear: both;
}

/* Reviews in Sidebar */
.reviews-sidebar-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 12px);
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.reviews-sidebar-wrapper .reviews-component {
    font-size: 0.9rem;
}

.reviews-sidebar-wrapper .reviews-header h2 {
    font-size: 1.1rem;
}

.reviews-sidebar-wrapper .big-rating {
    font-size: 2rem;
}

.reviews-sidebar-wrapper .review-item {
    padding: 15px;
}

.reviews-sidebar-wrapper .reviewer-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.75rem;
}

.reviews-sidebar-wrapper .write-review-section {
    padding: 15px;
}

.reviews-sidebar-wrapper .star-rating-input i {
    font-size: 1.4rem;
}

/* Reset container margin for reviews-wrapper */
.reviews-wrapper.container {
    max-width: 100%;
    padding: 0;
}

.review-item {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
}

/* ============================================
   RESPONSIVE DESIGN (Crucial Fixes)
   ============================================ */
@media (max-width: 1024px) {
    .listing-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .product-gallery {
        position: static;
        /* Unstick on smaller screens */
        margin-bottom: 20px;
    }

    .gallery-main {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .listing-content {
        padding: 20px 15px 100px;
        /* More bottom padding for nav */
    }

    .product-title-lg {
        font-size: 1.8rem;
    }

    .price-value {
        font-size: 2rem;
    }

    .gallery-main {
        height: 300px;
        /* Smaller height for mobile */
        border-radius: 12px;
    }

    .product-gallery {
        border-radius: 16px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }

    .product-info {
        gap: 20px;
    }

    .product-meta {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    /* Stack buttons on very small screens */
    .listing-actions {
        grid-template-columns: 1fr;
    }

    .price-card {
        padding: 20px;
        margin-bottom: 15px;
    }

    .logo-badge {
        display: none;
        /* Simplify header */
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   AMAZON/FIVERR STYLE ENHANCEMENTS
   ============================================ */
/* Quantity Selector */
.qty-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.qty-selector label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 0.9rem;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: white;
    color: var(--primary);
}

.qty-value {
    font-size: 1.1rem;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
    color: white;
}

/* Trust Badges - Center and clean up */
.trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
    opacity: 0.8;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.03);
    padding: 4px 8px;
    border-radius: 4px;
}

/* Image Modal */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: fadeIn 0.3s ease;
}

.image-modal img {
    max-width: 95%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.image-modal .close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10001;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}