/**
 * Sections page produit Nutriforce FR
 * Related products, upsells, standalone reviews
 */

/* ========================================
   RELATED / UPSELLS PRODUCT CARDS
   ======================================== */

.nf-products-section {
    margin: 40px 0 0;
    padding: 40px 0;
    border-top: 1px solid #eee;
}

.nf-products-section-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 24px;
    text-align: center;
}

.nf-products-swiper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.nf-product-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.2s ease;
}

.nf-product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.nf-product-card-image {
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f8f8f8;
}

.nf-product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.nf-product-card:hover .nf-product-card-image img {
    transform: scale(1.05);
}

.nf-product-card-info {
    padding: 12px 14px 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nf-product-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.nf-product-card-title:hover {
    color: #1a472a;
}

.nf-product-card-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.nf-product-card-stars {
    display: flex;
    align-items: center;
    gap: 1px;
}

.nf-product-card-stars svg {
    display: block;
    border-radius: 2px;
}

.nf-product-card-count {
    color: #999;
}

.nf-product-card-price {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin-top: auto;
}

.nf-product-card-price del {
    color: #999;
    font-weight: 400;
    font-size: 13px;
}

.nf-product-card-price ins {
    text-decoration: none;
    color: #1a472a;
}

.nf-product-card-atc,
.nf-product-card-atc.button,
.nf-product-card-atc.button.add_to_cart_button {
    display: block !important;
    text-align: center !important;
    padding: 12px 14px !important;
    margin: 8px 14px 14px !important;
    background: #1a472a !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    transition: background 0.2s ease, transform 0.2s ease !important;
    cursor: pointer !important;
    border: none !important;
    line-height: 1.4 !important;
    width: auto !important;
}

.nf-product-card-atc:hover {
    background: #245a35 !important;
}

.nf-product-card-atc.added::after {
    content: ' ✓';
}

/* ========================================
   STANDALONE REVIEWS SECTION
   ======================================== */

.nf-standalone-reviews {
    width: 100%;
    clear: both;
    padding: 40px 0 0;
    border-top: 1px solid #eee;
    margin-top: 24px;
}

.nf-reviews-section .woocommerce-Reviews-title {
    display: none;
}

/* Summary header */
.nf-rv-summary {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px;
    background: #f9f8f6;
    border-radius: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.nf-rv-score {
    text-align: center;
    min-width: 80px;
}

.nf-rv-number {
    font-size: 42px;
    font-weight: 800;
    color: #1a472a;
    line-height: 1;
}

.nf-rv-stars-summary {
    display: flex;
    gap: 2px;
    justify-content: center;
    margin-top: 6px;
}
.nf-rv-stars-summary svg { width: 16px; height: 16px; }

.nf-rv-total {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

/* Rating bars */
.nf-rv-bars {
    flex: 1;
    min-width: 200px;
}

.nf-rv-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.15s;
}
.nf-rv-bar-row:hover { background: rgba(26, 71, 42, 0.04); }
.nf-rv-bar-row.active { background: rgba(26, 71, 42, 0.08); }

.nf-rv-bar-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    width: 12px;
    text-align: right;
}

.nf-rv-bar-star { flex-shrink: 0; }

.nf-rv-bar-track {
    flex: 1;
    height: 6px;
    background: #e8e8e8;
    border-radius: 3px;
    overflow: hidden;
}

.nf-rv-bar-fill {
    height: 100%;
    background: #1a472a;
    border-radius: 3px;
}

.nf-rv-bar-count {
    font-size: 11px;
    color: #999;
    width: 28px;
}

/* Filter pills */
.nf-rv-filters {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.nf-rv-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    background: #fff;
    transition: all 0.15s;
    text-decoration: none;
}
.nf-rv-pill:hover {
    border-color: #1a472a;
    color: #1a472a;
}
.nf-rv-pill.active {
    background: #1a472a;
    border-color: #1a472a;
    color: #fff;
}
.nf-rv-pill.active svg { fill: #fff; }
.nf-rv-pill svg { width: 12px; height: 12px; flex-shrink: 0; }
.nf-rv-pill-count {
    font-weight: 400;
    opacity: 0.7;
}

/* Masonry grid */
.nf-rv-masonry {
    columns: 2;
    column-gap: 12px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nf-rv-masonry > li {
    break-inside: avoid;
    margin-bottom: 12px;
}

/* Review cards individuelles (trustpilot style) */
.nf-rv-masonry li {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 12px 0 !important;
    border: 0 !important;
    background: transparent !important;
}

.nf-rv-masonry li::before {
    display: none !important;
}

.trustpilot-review-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: #f9f8f6;
    border: none;
    border-radius: 12px;
    align-items: flex-start;
}

.trustpilot-avatar-wrapper {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
}

.trustpilot-avatar {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
    text-transform: uppercase;
    line-height: 1;
}

.trustpilot-review-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.trustpilot-review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 12px;
}

.trustpilot-author-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.trustpilot-author-name {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.trustpilot-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #1a472a;
    font-weight: 600;
    white-space: nowrap;
}

.trustpilot-verified-badge svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.trustpilot-stars {
    flex-shrink: 0;
    margin-left: auto;
}

.trustpilot-stars-wrapper {
    display: flex;
    gap: 2px;
    align-items: center;
}

.trustpilot-stars-wrapper svg {
    display: block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.trustpilot-review-meta {
    margin-bottom: 10px;
}

.trustpilot-review-meta time {
    font-size: 13px;
    color: #888;
}

.trustpilot-review-text {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.trustpilot-review-text p {
    margin: 0 0 8px 0;
}

.trustpilot-review-text p:last-child {
    margin-bottom: 0;
}

/* Responsive review cards */
@media (max-width: 768px) {
    .trustpilot-review-card {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }

    .trustpilot-review-header {
        flex-direction: column;
        gap: 8px;
    }

    .trustpilot-stars {
        margin-left: 0;
    }

    .trustpilot-stars-wrapper svg {
        width: 18px;
        height: 18px;
    }
}

/* Pagination */
.nf-rv-pagination {
    text-align: center;
    margin-top: 24px;
}

.nf-rv-pagination ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 0;
    margin: 0;
}

.nf-rv-pagination li {
    display: inline;
}

.nf-rv-pagination a,
.nf-rv-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}

.nf-rv-pagination a {
    color: #666;
    border: 1.5px solid #e0e0e0;
    background: #fff;
}

.nf-rv-pagination a:hover {
    border-color: #1a472a;
    color: #1a472a;
}

.nf-rv-pagination span.current {
    background: #1a472a;
    color: #fff;
    border: 1.5px solid #1a472a;
}

/* Footer & no reviews */
.nf-rv-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    font-size: 12px;
    color: #999;
}

.nf-rv-no-reviews {
    text-align: center;
    color: #999;
    font-size: 14px;
    padding: 40px 0;
}

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

@media (min-width: 769px) {
    .nf-products-section {
        padding-left: 40px;
        padding-right: 40px;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .nf-products-swiper {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .nf-products-section {
        padding: 32px 0 32px 16px;
        margin: 24px 0 0;
    }

    .nf-products-section-title {
        font-size: 18px;
        margin-bottom: 16px;
        text-align: left;
    }

    .nf-products-swiper {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 12px;
        padding-right: 16px;
        scrollbar-width: none;
    }

    .nf-products-swiper::-webkit-scrollbar {
        display: none;
    }

    .nf-product-card {
        min-width: 200px;
        max-width: 200px;
        scroll-snap-align: start;
        flex-shrink: 0;
    }

    .nf-product-card-info {
        padding: 10px 12px 6px;
    }

    .nf-product-card-title {
        font-size: 13px;
    }

    .nf-product-card-price {
        font-size: 14px;
    }

    .nf-product-card-atc,
    .nf-product-card-atc.button,
    .nf-product-card-atc.button.add_to_cart_button {
        margin: 6px 12px 12px !important;
        padding: 8px 12px !important;
        font-size: 12px !important;
    }

    /* Reviews mobile */
    .nf-rv-summary {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 20px 16px;
    }

    .nf-rv-score {
        display: flex;
        align-items: center;
        gap: 12px;
        text-align: left;
    }

    .nf-rv-number { font-size: 36px; }
    .nf-rv-stars-summary { justify-content: flex-start; margin-top: 0; }
    .nf-rv-total { margin-top: 0; }

    /* Reviews masonry → horizontal swipe on mobile */
    .nf-rv-masonry {
        columns: unset;
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 12px;
        padding-bottom: 8px;
    }
    .nf-rv-masonry::-webkit-scrollbar { display: none; }

    .nf-rv-masonry > li {
        flex: 0 0 80%;
        scroll-snap-align: start;
        margin-bottom: 0;
    }

    .nf-rv-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .nf-rv-filters::-webkit-scrollbar { display: none; }
    .nf-rv-pill { flex-shrink: 0; }

    .nf-rv-pagination ul {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .nf-rv-pagination ul::-webkit-scrollbar { display: none; }

    .nf-rv-pagination li {
        flex-shrink: 0;
    }

    .nf-rv-pagination a,
    .nf-rv-pagination span {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }
}
