@charset "UTF-8";

/* ========================================
   STYLES POUR LA PAGE ARTICLE
   ======================================== */

/* Container principal */
.product-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ========================================
   BREADCRUMB
   ======================================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    font-size: 0.9rem;
    color: var(--color-gray);
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--color-gray);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--color-primary);
}

.breadcrumb .separator {
    color: #ccc;
}

.breadcrumb .current {
    color: var(--color-primary);
    font-weight: 500;
}

/* ========================================
   LAYOUT PRODUIT - CORRECTION DÉBORDEMENT
   ======================================== */
.product-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
    align-items: start;
    overflow: hidden;
}

/* ========================================
   GALERIE PHOTOS - CORRECTION DÉBORDEMENT
   ======================================== */
.product-gallery {
    position: relative;
    min-width: 0;
    overflow: hidden;
}

.main-image {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    box-sizing: border-box;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.gallery-image.active {
    opacity: 1;
}

/* Flèches de navigation */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(40, 63, 34, 0.8);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-nav:hover {
    background: var(--color-primary);
}

.gallery-nav.prev {
    left: 15px;
}

.gallery-nav.next {
    right: 15px;
}

/* Miniatures */
.thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 5px 0;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.6;
    transition: var(--transition);
    border: 2px solid transparent;
    border-radius: 5px;
    flex-shrink: 0;
}

.thumbnail.active,
.thumbnail:hover {
    opacity: 1;
    border-color: var(--color-accent);
}

/* Placeholder pour absence d'image */
.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
}

.no-image .placeholder {
    font-size: 3rem;
    color: #ccc;
    font-weight: bold;
}

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

.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.image-modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.modal-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    transition: var(--transition);
    user-select: none;
}

.modal-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.modal-prev {
    left: 30px;
}

.modal-next {
    right: 30px;
}

.modal-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========================================
   INFORMATIONS PRODUIT
   ======================================== */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.product-title {
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 10px;
}

.product-price {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--color-secondary);
    margin-bottom: 10px;
}

.product-summary {
    color: var(--color-gray);
    line-height: 1.6;
    padding: 15px;
    background: var(--color-gray-light);
    border-radius: var(--border-radius);
}

/* ========================================
   INDICATEUR DÉJÀ DANS LE PANIER
   ======================================== */
.already-in-cart {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.in-cart-info {
    color: #155724;
    font-weight: 500;
}

.view-cart-btn {
    background: var(--color-primary);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    transition: var(--transition);
}

.view-cart-btn:hover {
    background: var(--color-secondary);
}

/* ========================================
   FORMULAIRE AJOUT PANIER
   ======================================== */
.add-to-cart-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.quantity-section {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.quantity-section label {
    font-weight: 500;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.qty-btn {
    background: var(--color-gray-light);
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: var(--color-accent);
}

.qty-input {
    border: none;
    width: 60px;
    height: 40px;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
}

/* Retirer les flèches natives de l'input number */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.stock-info {
    color: var(--color-gray);
    font-size: 0.9rem;
}

.add-to-cart-btn {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.add-to-cart-btn:hover:not(:disabled) {
    background: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.add-to-cart-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ========================================
   MESSAGE PANIER
   ======================================== */
.cart-message {
    padding: 15px;
    border-radius: var(--border-radius);
    text-align: center;
    font-weight: 500;
    margin-top: 20px;
}

.cart-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.cart-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ========================================
   CONTENU BAS DE PAGE
   ======================================== */
.content-below {
    margin-top: 50px;
}

/* Caractéristiques */
.product-specs {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.product-specs h3 {
    color: var(--color-primary);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.specs-table {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.spec-name {
    font-weight: 500;
    color: var(--color-gray);
}

.spec-value {
    color: var(--color-text);
}

/* Description complète */
.product-description {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.product-description h2 {
    color: var(--color-primary);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.description-content {
    line-height: 1.8;
    color: var(--color-text);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .product-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .main-image {
        height: 300px;
    }
    
    .gallery-nav {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .gallery-nav.prev {
        left: 10px;
    }
    
    .gallery-nav.next {
        right: 10px;
    }
    
    .product-title {
        font-size: 1.5rem;
    }
    
    .product-price {
        font-size: 1.4rem;
    }
    
    .specs-table {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .thumbnail {
        width: 60px;
        height: 60px;
    }
    
    /* MODAL RESPONSIVE */
    .modal-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
        width: 40px;
        height: 40px;
    }
    
    .modal-nav {
        font-size: 24px;
        width: 50px;
        height: 50px;
    }
    
    .modal-prev {
        left: 15px;
    }
    
    .modal-next {
        right: 15px;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 85%;
    }
}

@media (max-width: 480px) {
    .product-container {
        padding: 15px;
    }
    
    .main-image {
        height: 250px;
    }
    
    .gallery-nav {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    
    .thumbnails {
        gap: 5px;
    }
    
    .quantity-section {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .add-to-cart-btn {
        width: 100%;
    }
    
    /* MODAL RESPONSIVE MOBILE */
    .modal-close {
        top: 5px;
        right: 10px;
        font-size: 25px;
        width: 35px;
        height: 35px;
    }
    
    .modal-nav {
        font-size: 20px;
        width: 45px;
        height: 45px;
    }
    
    .modal-prev {
        left: 10px;
    }
    
    .modal-next {
        right: 10px;
    }
}