/**
 * Page de détail produit - Design moderne et professionnel
 * Style UMOA avec couleurs bleues
 * 
 * @package UMOA
 */

/* ============================================================================
   VARIABLES
   ============================================================================ */

:root {
    --product-primary: #4A90E2;
    --product-primary-hover: #1E3A8A;
    --product-primary-light: #6BB6FF;
    --product-bg: #FFFFFF;
    --product-bg-light: #F8FAFC;
    --product-border: #E5E7EB;
    --product-text: #1F2937;
    --product-text-light: #6B7280;
    --product-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --product-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --product-radius: 12px;
    --product-radius-lg: 16px;
}

/* ============================================================================
   CONTAINER PRINCIPAL
   ============================================================================ */

.marketplace-show-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.marketplace-show-header {
    margin-bottom: 1.5rem;
}

.marketplace-show-header .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--product-bg);
    color: var(--product-text);
    border: 1px solid var(--product-border);
    border-radius: var(--product-radius);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: var(--product-shadow);
}

.marketplace-show-header .btn:hover {
    background: var(--product-primary);
    color: white;
    border-color: var(--product-primary);
    transform: translateX(-3px);
    box-shadow: var(--product-shadow-hover);
}

/* ============================================================================
   LAYOUT
   ============================================================================ */

.marketplace-show-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 1rem 1.25rem; /* réduit: moins d’espace vertical et horizontal entre les 2 blocs */
    align-items: start;
}

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

.article-gallery {
    background: var(--product-bg);
    border-radius: var(--product-radius-lg);
    box-shadow: var(--product-shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.gallery-main {
    position: relative;
    width: 100%;
    max-width: 500px; /* Limiter la taille maximale sur desktop */
    aspect-ratio: 1;
    border-radius: var(--product-radius);
    overflow: hidden;
    background: var(--product-bg-light);
    margin: 0 auto 1rem auto; /* Centrer l'image avec marge inférieure */
}

.gallery-main img {
    width: 100%;
    height: 100%;
    max-height: 500px; /* Limiter la hauteur maximale */
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.gallery-main:hover img {
    transform: scale(1.02);
}

/* Boutons flottants de navigation */
.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.gallery-nav-btn:hover {
    background: var(--product-primary);
    color: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.gallery-nav-btn.prev {
    left: 1rem;
}

.gallery-nav-btn.next {
    right: 1rem;
}

.gallery-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.gallery-nav-btn svg {
    width: 24px;
    height: 24px;
}

/* Indicateur d'image */
.gallery-indicator {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.gallery-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
    cursor: pointer;
}

.gallery-indicator-dot.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}

/* Miniatures */
.gallery-thumbnails {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: all 0.2s ease;
    background: var(--product-bg-light);
}

.thumbnail:hover {
    opacity: 1;
    border-color: var(--product-primary-light);
    transform: scale(1.05);
}

.thumbnail.active {
    border-color: var(--product-primary);
    opacity: 1;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

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

.article-description.card {
    background: var(--product-bg);
    border-radius: var(--product-radius-lg);
    box-shadow: var(--product-shadow);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.article-description h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--product-text);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--product-border);
}

.article-description p {
    color: var(--product-text-light);
    line-height: 1.7;
    font-size: 0.95rem;
}

.article-description .city-highlight {
    font-size: 1.3rem;
    font-weight: 700;
    display: inline-block;
    margin: 0 0.25rem;
}

.article-description .departure-city {
    color: var(--product-primary);
}

.article-description .destination-city {
    color: var(--product-primary-hover);
}

/* ============================================================================
   SIDEBAR - INFORMATIONS PRODUIT
   ============================================================================ */

.marketplace-show-sidebar {
    position: sticky;
    top: 80px;
    margin-top: 0;
    padding-top: 0;
}

/* Aligner le bloc infos en haut pour éviter le grand vide au-dessus de la sidebar */
.marketplace-show-main {
    padding-top: 0;
}

.marketplace-show-sidebar .seller-articles {
    margin-top: 1.5rem;
}

.article-info.card {
    background: var(--product-bg);
    border-radius: var(--product-radius-lg);
    box-shadow: var(--product-shadow-hover);
    padding: 1.75rem;
    border: 1px solid var(--product-border);
    margin-top: 0;
    margin-bottom: 0;
}

.article-info.card h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--product-text);
    margin-bottom: 1rem;
    line-height: 1.3;
}

/* Prix */
.article-price {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: linear-gradient(135deg, #F0F7FF 0%, #E0EFFF 100%);
    border-radius: var(--product-radius);
    border: 2px solid var(--product-primary-light);
}

.price-value {
    font-size: 2.25rem;
    font-weight: 900;
    color: var(--product-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.price-with-discount.price-promo-detail {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #FFF5F5 0%, #FFE5E5 100%);
    border-radius: var(--product-radius);
    border: 2px solid #FF6B6B;
}

.price-final {
    font-size: 2.5rem;
    font-weight: 900;
    color: #28A745;
    line-height: 1;
}

.price-original {
    font-size: 1.25rem;
    color: var(--product-text-light);
    text-decoration: line-through;
    opacity: 0.7;
}

.price-discount-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 700;
    margin-left: 0.5rem;
}

/* Métadonnées */
.article-meta {
    margin: 1.5rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--product-border);
    border-bottom: 1px solid var(--product-border);
}

.meta-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    font-size: 0.9rem;
}

.meta-item strong {
    color: var(--product-text);
    font-weight: 600;
}

.meta-item span {
    color: var(--product-text-light);
    text-align: right;
}

/* Vendeur */
.seller-info {
    margin: 1.5rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--product-border);
}

.seller-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--product-text);
    margin-bottom: 1rem;
}

.seller-details {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.seller-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--product-border);
}

.seller-details strong a {
    color: var(--product-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.seller-details strong a:hover {
    color: var(--product-primary-hover);
}

/* ============================================================================
   BOUTONS D'ACTION
   ============================================================================ */

.article-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    box-sizing: border-box;
}

/* Sur les grands écrans, les boutons s'adaptent automatiquement */
@media (min-width: 1024px) {
    .article-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    
    .article-actions .btn {
        flex: 0 1 auto;
        min-width: fit-content;
    }
    
    /* Si seulement 2 boutons, ils peuvent être côte à côte */
    .article-actions .btn:only-of-type {
        flex: 1 1 auto;
    }
    
    /* S'assurer que les limites de taille sont bien appliquées sur desktop */
    .gallery-main {
        max-height: 500px; /* La max-width est déjà définie dans la règle de base */
    }
    
    .gallery-main img {
        max-height: 500px; /* Limite la hauteur de l'image */
    }
}

.article-actions .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 24px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    flex: 0 1 auto;
    min-width: fit-content;
    max-width: 100%;
}

.article-actions .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.article-actions .btn:hover::before {
    width: 300px;
    height: 300px;
}

.article-actions .btn-primary {
    background: linear-gradient(135deg, var(--product-primary) 0%, var(--product-primary-hover) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.25);
}

.article-actions .btn-primary:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.article-actions .btn-primary:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.article-actions .btn-secondary {
    background: var(--product-bg);
    color: var(--product-text);
    border: 2px solid var(--product-border);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.article-actions .btn-secondary:hover:not(:disabled) {
    background: var(--product-primary-light);
    color: white;
    border-color: var(--product-primary-light);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.25);
}

.article-actions .btn-secondary:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.article-actions .btn-outline {
    background: transparent;
    color: var(--product-primary);
    border: 2px solid var(--product-primary);
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.1);
}

.article-actions .btn-outline:hover:not(:disabled) {
    background: var(--product-primary);
    color: white;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.article-actions .btn-outline:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.article-actions .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.article-actions .btn span,
.article-actions .btn svg {
    position: relative;
    z-index: 1;
}

/* Sélecteur de quantité kilos */
.kilo-quantity-selector {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--product-bg-light);
    border-radius: var(--product-radius);
    border: 1px solid var(--product-border);
}

.kilo-quantity-selector label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--product-text);
    font-size: 0.9rem;
}

.kilo-quantity-selector input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--product-border);
    border-radius: var(--product-radius);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    transition: border-color 0.2s ease;
}

.kilo-quantity-selector input:focus {
    outline: none;
    border-color: var(--product-primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

#kilo-total-price {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: var(--product-radius);
    font-weight: 700;
    color: var(--product-primary);
    text-align: center;
    font-size: 1.125rem;
}

/* ============================================================================
   AUTRES ARTICLES DU VENDEUR
   ============================================================================ */

.seller-articles {
    background: var(--product-bg);
    border-radius: var(--product-radius-lg);
    box-shadow: var(--product-shadow);
    padding: 1.5rem;
}

.seller-articles h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--product-text);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--product-border);
}

.articles-grid-mini {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.article-card-mini {
    text-decoration: none;
    color: inherit;
    background: var(--product-bg-light);
    border-radius: var(--product-radius);
    overflow: hidden;
    transition: all 0.2s ease;
    border: 1px solid var(--product-border);
}

.article-card-mini:hover {
    transform: translateY(-4px);
    box-shadow: var(--product-shadow-hover);
    border-color: var(--product-primary-light);
}

.article-card-mini img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.article-card-mini h4 {
    padding: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--product-text);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-mini .price {
    padding: 0 0.75rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--product-primary);
}

/* ============================================================================
   BADGES
   ============================================================================ */

.stock-out-badge {
    display: inline-block;
    background: linear-gradient(135deg, #DC3545 0%, #C82333 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 700;
    margin: 0.5rem 0;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

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

@media (max-width: 1024px) {
    .marketplace-show-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .marketplace-show-sidebar {
        position: static;
    }
    
    .gallery-nav-btn {
        width: 40px;
        height: 40px;
    }
    
    .gallery-nav-btn svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 768px) {
    .marketplace-show-container {
        padding: 1rem 0.75rem;
    }
    
    .gallery-main {
        aspect-ratio: 4/3;
    }
    
    .gallery-nav-btn {
        width: 36px;
        height: 36px;
    }
    
    .gallery-nav-btn.prev {
        left: 0.5rem;
    }
    
    .gallery-nav-btn.next {
        right: 0.5rem;
    }
    
    .thumbnail {
        width: 60px;
        height: 60px;
    }
    
    .article-info.card h1 {
        font-size: 1.5rem;
    }
    
    .price-value,
    .price-final {
        font-size: 1.75rem;
    }
    
    .articles-grid-mini {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }
    
    /* Boutons adaptatifs sur tablette */
    .article-actions {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.625rem;
        width: 100%;
    }
    
    .article-actions .btn {
        flex: 1 1 auto;
        min-width: calc(50% - 0.3125rem);
        max-width: 100%;
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
        justify-content: center;
    }
    
    /* Si seulement 2 boutons, ils prennent chacun 50% */
    .article-actions .btn:only-child {
        min-width: 100%;
    }
    
    .article-actions .btn:nth-child(2):last-child {
        min-width: calc(50% - 0.3125rem);
    }
}

@media (max-width: 640px) {
    .article-actions {
        flex-direction: column;
        gap: 0.625rem;
    }
    
    .article-actions .btn {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        padding: 0.875rem 1.25rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .article-actions .btn {
        padding: 0.75rem 1rem;
        font-size: 0.8125rem;
        gap: 0.375rem;
    }
    
    .article-actions .btn svg {
        width: 16px;
        height: 16px;
    }
}

