/* ===== STYLES SPÉCIFIQUES AUX PAGES PRODUITS MODERNES ===== */

/* Section Produit Principal */
.product-main {
    padding: 2.5rem 4.5%; /* rapprocher le contenu du bord gauche */
    max-width: 1500px;
    margin: 0 auto;
}

.product-container {
    display: grid;
    grid-template-columns: 1.35fr 1fr; /* léger retrait supplémentaire */
    gap: 1.1rem;
    align-items: start;
}

/* Colonne Gauche - Image */
.product-image-section {
    position: static;
    top: auto;
}

.product-image-container {
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
    min-height: 360px;
    height: 380px; /* un petit cran de moins */
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-main-image {
    width: 100%;
    max-width: 100%;
    height: 100%; /* occupe toute la carte visuelle */
    max-height: 380px;
    border-radius: 12px;
    transition: transform 0.3s ease;
    object-fit: cover;
}

.product-main-image:hover {
    transform: scale(1.02);
}

.product-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--colorMain);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Colonne Droite - Détails */
.product-details-section {
    padding: 0.5rem 0 0 0; /* moins d'air à gauche */
    position: relative; /* pour positionner le prix */
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem; /* plus compact */
    padding-right: 240px; /* laisser la place pour le bloc prix à droite */
}

.product-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.2;
}

.product-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-indicator.good {
    background: #28a745;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
}

.status-text {
    color: var(--colorText);
    font-size: 0.9rem;
}

/* Prix et statut */
.product-price-section {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    text-align: right;
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

.main-price {
    font-size: 2rem;
    font-weight: 900;
    color: var(--colorMain);
    line-height: 1;
}

.stock-status {
    font-weight: 600;
    font-size: 0.9rem;
    opacity: 0.9;
    transition: color 0.3s ease;
}

/* Couleurs pour les différents statuts de stock */
.stock-status.in-stock {
    color: #28a745; /* Vert */
}

.stock-status.out-of-stock {
    color: #dc3545; /* Rouge */
}

.stock-status.low-stock {
    color: #ff9800; /* Orange */
}

.stock-status.preorder,
.stock-status.coming-soon {
    color: #17a2b8; /* Bleu */
}

/* Tag du produit */
.product-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(207, 22, 22, 0.1);
    color: var(--colorMain);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2rem;
    border: 1px solid rgba(207, 22, 22, 0.2);
}

/* Variantes du produit */
.product-variants {
    margin-bottom: 1rem;
}

.variants-title {
    color: white;
    font-size: 1.05rem;
    margin-bottom: 0.6rem;
    font-weight: 600;
}

.quantity-selector .variants-title {
    margin-bottom: 0;
    margin-top: 4px;
}

.variant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0.9rem; /* encore plus compacte */
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    margin-bottom: 0.45rem;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative; /* pour l'effet glow */
}

.variant-item.selected {
    border-color: rgba(255, 59, 59, 0.5);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 4px 12px rgba(255, 59, 59, 0.12);
}

/* Anneau rouge discret pour la sélection (un peu + fort que le hover) */
.variant-item.selected::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 1px rgba(255, 59, 59, 0.4), 0 0 10px rgba(255, 59, 59, 0.16);
    pointer-events: none;
}

.variant-item.selected::after {
    content: "✓";
    color: #fff;
    background: #2ecc71; /* tick vert comme l'écran */
    border-radius: 50%;
    width: 18px; height: 18px;
    display: inline-flex;
    align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800;
    position: relative;
    margin-left: 10px;
}

.variant-item.selected .variant-price { color: var(--colorMain); }

.variant-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(207, 22, 22, 0.25);
    box-shadow: 0 2px 8px rgba(255, 59, 59, 0.08);
}

/* fin survol: léger anneau */
.variant-item:hover::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 1px rgba(255, 59, 59, 0.25), 0 0 6px rgba(255, 59, 59, 0.10);
    pointer-events: none;
}

.variant-info {
    flex: 1;
}

.variant-name {
    color: white;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.variant-description {
    color: var(--colorText);
    font-size: 0.88rem;
}

.variant-price {
    color: var(--colorMain);
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0 1rem;
}

.variant-status {
    font-size: 0.8rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

/* Couleurs pour les statuts dans les variants */
.variant-status.in-stock {
    color: #28a745; /* Vert */
}

.variant-status.out-of-stock {
    color: #dc3545; /* Rouge */
}

.variant-status.low-stock {
    color: #ff9800; /* Orange */
}

.variant-status.preorder,
.variant-status.coming-soon {
    color: #17a2b8; /* Bleu */
}

/* Sélecteur de quantité */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.8rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(207, 22, 22, 0.1);
    color: var(--colorMain);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

.qty-btn:hover {
    background: rgba(207, 22, 22, 0.2);
    transform: scale(1.05);
}

.qty-value {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

/* Boutons d'action */
.action-buttons {
    display: flex;
    flex-direction: row; /* sur desktop, côte à côte comme le screen */
    gap: 0.8rem;
}

.add-to-cart-btn, .buy-now-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.25rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    flex: 1; /* occupe la largeur disponible */
}

.add-to-cart-btn {
    background: var(--colorMain);
    color: white;
}

.add-to-cart-btn:hover {
    background: #b31414;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(207, 22, 22, 0.3);
}

.buy-now-btn {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.buy-now-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Onglets d'information */
.product-tabs {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 3rem;
}

.tabs-header {
    display: flex;
    gap: 0;
    position: relative;
    margin-bottom: 2rem;
}

/* Persistent baseline under tabs */
.tabs-header::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--colorText);
    padding: 1rem 2rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    position: relative; /* for underline pseudo-element */
}

.tab-btn:hover {
    color: white;
}

.tab-btn.active {
    color: var(--colorMain);
}
.tab-btn.active::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 3px;
    background: var(--colorMain);
    border-radius: 2px 2px 0 0;
}

.tab-content {
    min-height: 300px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.tab-content-text {
    color: var(--colorText);
    line-height: 1.8;
    font-size: 1.1rem;
}

.tab-content-text h3 {
    color: white;
    margin-bottom: 1rem;
}

.tab-content-text ol {
    margin: 1.5rem 0;
    padding-left: 0;
    list-style: none;
    counter-reset: step-counter;
}

.tab-content-text li {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem 0.9rem 2.5rem;
    position: relative;
    counter-increment: step-counter;
    line-height: 1.7;
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid rgba(207, 22, 22, 0.3);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.tab-content-text li:hover {
    background: rgba(255, 255, 255, 0.04);
    border-left-color: rgba(207, 22, 22, 0.6);
}

.tab-content-text li::before {
    content: counter(step-counter) ".";
    position: absolute;
    left: 1rem;
    top: 0.9rem;
    color: var(--colorMain);
    font-weight: 700;
    font-size: 1rem;
}

.reviews-summary {
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.rating {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stars {
    font-size: 1.5rem;
}

.rating-text {
    color: white;
    font-weight: 600;
}

.review-date {
    color: var(--colorText);
    font-size: 0.9rem;
    text-align: right;
    margin-top: 1rem;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

/* Description area enhancements */
.desc-highlight {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-left: 4px solid var(--colorMain);
    border-radius: 12px;
    padding: 16px 18px;
    margin: 18px 0 24px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}

.desc-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 8px 0 22px;
}

.desc-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.desc-card .icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}

.desc-card .title { color: #fff; font-weight: 600; margin-bottom: 4px; }
.desc-card .text { color: var(--colorText); font-size: 0.95rem; }

.checklist { margin: 10px 0 6px; padding-left: 0; list-style: none; }
.checklist li {
    position: relative;
    padding-left: 28px;
    margin: 8px 0;
}
.checklist li::before {
    content: "";
    position: absolute;
    left: 0; top: 6px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #2ecc71, #1f9d57);
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.6);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .product-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .product-image-section {
        position: static;
    }
    
    .desc-cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .product-main {
        padding: 1.5rem 1rem;
    }

    .product-container { gap: 1.25rem; }
    .action-buttons { flex-direction: column; }
    .product-image-container { height: auto; min-height: 260px; }
    .product-main-image { max-height: 320px; }

    /* Revenir à un flux normal pour le prix sur mobile */
    .product-details-section { position: static; }
    .product-header { padding-right: 0; }
    .product-price-section {
        position: static;
        margin-bottom: 0.75rem;
        padding: 0;
        background: transparent;
        border: none;
        box-shadow: none;
        text-align: left;
        gap: 2px;
    }
    
    .product-tabs {
        padding: 0 1rem 2rem;
    }
    
    .tabs-header {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }
    
    .product-title {
        font-size: 1.6rem;
    }
    
    .main-price {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .product-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .variant-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .variant-price, .variant-status {
        margin: 0;
    }
    
    .action-buttons {
        gap: 0.8rem;
    }
    
    .add-to-cart-btn, .buy-now-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .desc-cards { grid-template-columns: 1fr; }
}

/* On product pages, avoid sticky navbar overlapping content */
.section__navbar {
    position: static;
    top: auto;
}

/* On product pages, let the footer scroll with content (no fixed) */
.section__footer {
    position: static;
    bottom: auto;
    left: auto;
    right: auto;
    z-index: auto;
}

/* Small cart indicator */
.navbar__cart {
    color: #fff;
    font-weight: 600;
}
.navbar__cart .cart-count {
    display: inline-block;
    min-width: 18px;
    padding: 2px 6px;
    margin-left: 4px;
    background: var(--colorMain);
    border-radius: 10px;
    font-size: 12px;
    line-height: 1;
}
