body {
    margin: 0;
    background: var(--main-background);
    padding: 0;
}

header {
    display: flex;
    justify-content: space-between;
    padding: 20px;
}

main {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    padding: 20px;
}

.image-wrapper {
    position: relative;
    padding: 20px;
    background: white;
}

.product-image {
    width: 100%;
    height: 400px;
    object-fit: contain;
    background: white;
    border-radius: 10px;
}

.product-subtitles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 35px;
}

.product-subtitle {
    color: #de3d41;
    padding: 4px 12px;
    font-size: 1em;
    font-weight: 500;
    margin-bottom: 35px;
}

.arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 2;
    width: 32px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.arrow:hover {
    transform: translateY(-50%) scale(0.95);
}

.arrow:active {
    transform: translateY(-50%) scale(1.1);
}

.arrow img {
    height: 24px;
    width: auto;
}

.arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

.arrow.left {
    left: 10px;
}

.arrow.right {
    right: 10px;
}

.thumbnail-bar {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    overflow-x: auto;
    justify-content: center;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.thumbnail-bar img {
    height: 60px;
    cursor: pointer;
    border-radius: 5px;
    border: 2px solid transparent;
    scroll-snap-align: start;
}

.thumbnail-bar img.active {
    border-color: #de3d41;
}

#cart-icon {
    position: relative;
    font-size: 24px;
    cursor: pointer;
}

.details-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 280px;
    background: #f1f1f1;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

#product-name {
    color: #de3d41;
    font-size: 2.5em;
    margin: -5px 0 5px 0;
}

#product-price {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    color: black;
    font-weight: bold;
    font-size: 2.7em;
}

.product-price-taxe{
    font-size:.7em;
}

.ht-label {
    font-size: 0.7em;
    font-weight: lighter;
    margin-left: 4px;
}

#add-to-cart-btn {
    background: #FFD500;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#add-to-cart-btn:hover {
    background-color: #de3d41;
    color: white;
}

.product-price {
    margin:0;
}

.quantity-input {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 15px 0;
}

.quantity-input input {
    width: 50px;
    height: 40px;
    text-align: center;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.quantity-input input::-webkit-inner-spin-button,
.quantity-input input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

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

.quantity-input button {
    width: 40px;
    height: 40px;
    font-size: 20px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
}

.quantity-input button:hover {
    background: #eee;
}

section {
    padding: 20px;
}

/* ===================== Produits Associés ===================== */
.associated-products {
    margin-top: 40px;
    padding: 0;
    background: transparent;
}

.associated-products__title {
    font-size: 1.5em;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #de3d41;
}

.associated-products__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.associated-product {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.associated-product:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateX(4px);
}

.associated-product__link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    gap: 16px;
    height: 100%;
}

.associated-product__thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
}

.associated-product__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.associated-product__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.associated-product__name {
    font-weight: 600;
    font-size: 1em;
    color: #333;
}

.associated-product:hover .associated-product__name {
    color: #de3d41;
}

.associated-product__ref {
    font-size: 0.85em;
    color: #888;
}

/* Produits enfants (sous-niveaux) */
.associated-product__children {
    padding: 0 0 12px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.associated-product--child {
    background: #f9f9f9;
    border-left: 3px solid #de3d41;
}

.associated-product--child .associated-product__link {
    padding: 10px 14px;
}

.associated-product--child .associated-product__thumb {
    width: 50px;
    height: 50px;
}

.associated-product--child .associated-product__name {
    font-size: 0.95em;
}

/* Responsive */
@media (max-width: 600px) {
    .associated-product__thumb {
        width: 50px;
        height: 50px;
    }

    .associated-product__children {
        padding-left: 16px;
    }
}
