/* ── Products listing layout ─────────────────────────────────────── */

.products-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem;
    align-items: start;
}

/* ── Filters sidebar ─────────────────────────────────────────────── */

.filters-sidebar {
    position: sticky;
    top: 80px;
    background: #fff;
    border: 1.5px solid var(--border, #e5e7eb);
    border-radius: 12px;
    overflow: hidden;
}

.filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .875rem 1rem;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.filters-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--gray-900, #111);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.filters-clear-all {
    font-size: .775rem;
    color: var(--primary, #2563eb);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-weight: 500;
}
.filters-clear-all:hover { text-decoration: underline; }

/* Filter sections */
.filter-section {
    border-bottom: 1px solid var(--border, #e5e7eb);
}
.filter-section:last-child { border-bottom: none; }

.filter-section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: .875rem;
    font-weight: 600;
    color: var(--gray-800, #1f2937);
    text-align: left;
}
.filter-section-toggle span:first-child { flex: 1; }
.filter-section-toggle:hover { background: var(--gray-50, #f9fafb); }

.filter-chevron {
    flex-shrink: 0;
    transition: transform .2s;
    color: var(--text-muted, #9ca3af);
}
.filter-section.open .filter-chevron { transform: rotate(180deg); }

.filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--primary, #2563eb);
    color: #fff;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    line-height: 1;
}

.filter-options {
    display: none;
    padding: .25rem 0 .75rem;
}
.filter-section.open .filter-options { display: block; }

/* Checkboxes */
.filter-option {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .35rem 1rem;
    cursor: pointer;
    font-size: .875rem;
    color: var(--gray-700, #374151);
    transition: background .1s;
    user-select: none;
}
.filter-option:hover { background: var(--gray-50, #f9fafb); }
.filter-option input[type=checkbox] {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    accent-color: var(--primary, #2563eb);
    cursor: pointer;
}
.filter-option-label { flex: 1; }
.filter-option-count {
    font-size: .775rem;
    color: var(--text-muted, #9ca3af);
}

/* Brand search */
.filter-brand-search-wrap {
    padding: .5rem .875rem;
}
.filter-brand-search {
    width: 100%;
    font-size: .8rem;
    padding: .35rem .625rem;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 6px;
    outline: none;
    background: var(--gray-50, #f9fafb);
    color: var(--gray-800, #1f2937);
    box-sizing: border-box;
}
.filter-brand-search:focus { border-color: var(--primary, #2563eb); background: #fff; }

.filter-options-list { max-height: 220px; overflow-y: auto; }

/* Price range slider */
.price-slider-wrap { padding: .5rem 1rem .75rem; }

.price-slider-display {
    display: flex;
    justify-content: space-between;
    margin-bottom: .75rem;
}
.price-slider-val {
    font-size: .8rem;
    font-weight: 600;
    color: var(--gray-800, #1f2937);
    background: var(--gray-100, #f3f4f6);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 6px;
    padding: .2rem .5rem;
}

.price-slider-track {
    position: relative;
    height: 4px;
    background: var(--gray-200, #e5e7eb);
    border-radius: 2px;
    margin: 16px 0;
}

.price-slider-fill {
    position: absolute;
    top: 0; bottom: 0;
    background: var(--primary, #2563eb);
    border-radius: 2px;
    pointer-events: none;
}

.price-range-thumb {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 4px;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
    outline: none;
    margin: 0;
}

.price-range-thumb::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--primary, #2563eb);
    box-shadow: 0 1px 4px rgba(0,0,0,.18);
    cursor: pointer;
    pointer-events: all;
    transition: transform .1s, box-shadow .1s;
}
.price-range-thumb::-webkit-slider-thumb:hover,
.price-range-thumb:active::-webkit-slider-thumb {
    transform: scale(1.15);
    box-shadow: 0 0 0 4px rgba(37,99,235,.15);
}

.price-range-thumb::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--primary, #2563eb);
    box-shadow: 0 1px 4px rgba(0,0,0,.18);
    cursor: pointer;
    pointer-events: all;
}
.price-range-thumb::-moz-range-track { background: transparent; }

/* Skeleton loaders */
.filter-skeleton-list { padding: .25rem 1rem; }
.filter-skeleton {
    height: 14px;
    background: linear-gradient(90deg, var(--gray-100, #f3f4f6) 25%, var(--gray-200, #e5e7eb) 50%, var(--gray-100, #f3f4f6) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 4px;
    margin-bottom: .6rem;
}
.filter-skeleton:nth-child(2) { width: 80%; }
.filter-skeleton:nth-child(3) { width: 60%; }
.filter-skeleton:nth-child(4) { width: 75%; }
.filter-skeleton:nth-child(5) { width: 50%; }

/* ── Main content area ───────────────────────────────────────────── */

.products-main { min-width: 0; }

.products-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.toolbar-left { display: flex; align-items: center; gap: .75rem; }
.toolbar-right { display: flex; align-items: center; gap: .75rem; }

.products-count { font-size: .875rem; color: var(--text-muted, #6b7280); }

.filters-mobile-toggle { position: relative; }
.filters-mobile-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--primary, #2563eb);
    color: #fff;
    border-radius: 999px;
    font-size: .65rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.search-box {
    display: flex;
    align-items: center;
    gap: .5rem;
    border: 1.5px solid var(--border, #e5e7eb);
    border-radius: 8px;
    padding: .4rem .75rem;
    background: #fff;
    color: var(--text-muted, #9ca3af);
}
.search-box input {
    border: none;
    outline: none;
    font-size: .875rem;
    background: transparent;
    color: var(--gray-800, #1f2937);
    width: 180px;
}
.search-box:focus-within { border-color: var(--primary, #2563eb); }

.sort-select {
    font-size: .875rem;
    padding: .4rem .625rem;
    border: 1.5px solid var(--border, #e5e7eb);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

/* Active filter chips */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: 1rem;
}

.active-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .275rem .625rem;
    background: var(--primary-50, #eff6ff);
    color: var(--primary, #2563eb);
    border: 1px solid var(--primary-100, #bfdbfe);
    border-radius: 999px;
    font-size: .775rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: background .1s;
}
.active-chip:hover { background: var(--primary-100, #dbeafe); }
.chip-remove { font-size: .9rem; line-height: 1; color: var(--primary, #2563eb); opacity: .7; }

/* States */
.state-loading {
    display: flex;
    justify-content: center;
    padding: 3rem;
}
.state-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border, #e5e7eb);
    border-top-color: var(--primary, #2563eb);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.state-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 4rem 1rem;
    color: var(--text-muted, #6b7280);
    text-align: center;
}
.state-empty p { margin: 0; font-size: .95rem; }

/* Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1.25rem;
    transition: opacity .15s;
}
.products-grid.loading-dim { opacity: .45; pointer-events: none; }

/* ── Product cards ───────────────────────────────────────────────── */

.product-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
    transition: box-shadow .2s, transform .2s;
}
.product-card:hover {
    box-shadow: 0 10px 28px rgba(0,0,0,.12), 0 4px 10px rgba(0,0,0,.07);
    transform: translateY(-3px);
}

/* Image area — white so product photos blend naturally */
.product-card-img {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #fff;
    overflow: hidden;
    border-bottom: 1px solid var(--border, #f0f0f0);
}
.product-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    transition: transform .3s ease;
}
.product-card:hover .product-card-img img { transform: scale(1.04); }
.product-card-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-300, #d1d5db);
}

/* Condition badge — top-left */
.product-card-badge {
    position: absolute;
    top: .6rem;
    left: .6rem;
    font-size: .7rem;
    font-weight: 600;
    padding: .2rem .5rem;
    border-radius: 4px;
    background: rgba(255,255,255,.9);
    color: var(--gray-700, #374151);
    border: 1px solid var(--border, #e5e7eb);
    backdrop-filter: blur(4px);
}

/* Discount badge — top-right */
.product-card-discount {
    position: absolute;
    top: .6rem;
    right: .6rem;
    font-size: .7rem;
    font-weight: 700;
    padding: .2rem .45rem;
    border-radius: 4px;
    background: #ef4444;
    color: #fff;
}

/* Body */
.product-card-body {
    padding: .875rem 1rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.product-card-brand {
    font-size: .7rem;
    color: var(--primary, #2563eb);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.product-card-title {
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
    color: var(--gray-800, #1f2937);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card-category {
    font-size: .7rem;
    color: var(--text-muted, #9ca3af);
    background: var(--gray-100, #f3f4f6);
    border-radius: 4px;
    padding: .15rem .4rem;
    align-self: flex-start;
    margin-top: .1rem;
}

/* Price row */
.product-card-price {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    margin-top: .625rem;
}
.product-card-price strong {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-900, #111827);
}
.product-card-compare {
    font-size: .8rem;
    color: var(--text-muted, #9ca3af);
    text-decoration: line-through;
}

/* Pagination */
.products-pagination { padding: 2rem 0; }
.pagination { display: flex; justify-content: center; gap: .4rem; flex-wrap: wrap; }

/* ── Single product page ─────────────────────────────────────────── */

.product-page { max-width: 1280px; margin: 0 auto; padding: 2rem; }

.product-breadcrumb { display: flex; gap: .5rem; align-items: center; font-size: .875rem; color: var(--text-muted, #6b7280); margin-bottom: 2rem; flex-wrap: wrap; }
.product-breadcrumb a { color: var(--primary, #2563eb); text-decoration: none; }
.product-breadcrumb a:hover { text-decoration: underline; }

.product-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }

.product-gallery-main {
    aspect-ratio: 4/3;
    background: #fff;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

/* Slide track */
.gallery-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform .35s ease;
}
.gallery-slide {
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}
.gallery-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 1.5rem;
}
.gallery-zoomable { cursor: zoom-in; }
.product-no-image { color: var(--text-muted, #9ca3af); display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }

/* Dots indicator (mobile) */
.gallery-dots {
    position: absolute;
    bottom: .75rem;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    gap: .375rem;
    z-index: 3;
}
.gallery-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(0,0,0,.2);
    cursor: pointer;
    transition: background .2s, transform .2s;
}
.gallery-dot.active {
    background: #193153;
    transform: scale(1.25);
}
@media (max-width: 768px) {
    .gallery-dots { display: flex; }
    .gallery-arrow { display: none !important; }
    .gallery-slide img { padding: 1rem; }
}

/* Gallery arrows */
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    border: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #374151;
    opacity: 0;
    transition: opacity .2s, background .15s;
    z-index: 2;
}
.gallery-arrow-prev { left: .5rem; }
.gallery-arrow-next { right: .5rem; }
.product-gallery-main:hover .gallery-arrow { opacity: 1; }
.gallery-arrow:hover { background: #fff; color: #193153; }

/* Zoom button */
.gallery-zoom-btn {
    position: absolute;
    bottom: .5rem; right: .5rem;
    width: 30px; height: 30px;
    border-radius: 6px;
    background: rgba(255,255,255,.85);
    border: 1px solid rgba(0,0,0,.08);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #6b7280;
    opacity: 0;
    transition: opacity .2s;
    z-index: 2;
}
.product-gallery-main:hover .gallery-zoom-btn { opacity: 1; }
.gallery-zoom-btn:hover { color: #193153; background: #fff; }

.product-gallery-thumbs { display: flex; gap: .5rem; margin-top: .75rem; flex-wrap: wrap; }
.product-thumb {
    width: 72px; height: 72px;
    object-fit: contain;
    border: 2px solid var(--border, #e5e7eb);
    border-radius: 8px;
    cursor: pointer;
    padding: .375rem;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.product-thumb.active, .product-thumb:hover {
    border-color: #193153;
    box-shadow: 0 0 0 1px #193153;
}

/* ── Lightbox ───────────────────────────────────────────────────── */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn .2s ease;
}
.gallery-lightbox.hidden { display: none; }
.gallery-lightbox img {
    max-width: 90vw;
    max-height: 88vh;
    object-fit: contain;
    background: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 8px 40px rgba(0,0,0,.4);
    border-radius: 4px;
    user-select: none;
}
.lightbox-close {
    position: absolute;
    top: 1rem; right: 1.25rem;
    font-size: 2rem;
    line-height: 1;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    opacity: .7;
    transition: opacity .15s;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.lightbox-arrow:hover { background: rgba(255,255,255,.25); }
.lightbox-prev { left: 1.25rem; }
.lightbox-next { right: 1.25rem; }
.lightbox-counter {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.6);
    font-size: .85rem;
    pointer-events: none;
}

.product-brand { font-size: .8rem; color: var(--primary, #2563eb); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; text-decoration: none; }
.product-title { font-size: 1.6rem; font-weight: 700; margin: .5rem 0; line-height: 1.25; }
.product-ref { font-size: .875rem; margin-bottom: 1rem; }
/* État "capteur de demande" (fiche sans offre / en rupture) — Module 1 */
.product-state-badge { display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .75rem; border-radius: 8px; font-weight: 600; font-size: .9rem; margin: .75rem 0 .25rem; }
.product-state-badge.product-state-sold { background: #fef2f2; color: #b91c1c; }
.product-state-badge.product-state-unavailable { background: #fffbeb; color: #b45309; }
.product-similar-link a { display: inline-flex; align-items: center; gap: .35rem; color: #6b7280; text-decoration: none; }
.product-similar-link a:hover { text-decoration: underline; }
.product-price-block { display: flex; align-items: baseline; gap: .75rem; margin: 1rem 0; flex-wrap: wrap; }
.product-price { font-size: 1.75rem; font-weight: 700; color: var(--gray-900, #111); }
.product-compare-price { font-size: 1.1rem; color: var(--text-muted, #9ca3af); text-decoration: line-through; }
.product-meta-row { display: flex; align-items: center; gap: .5rem; font-size: .9rem; margin: .4rem 0; color: var(--text-muted, #4b5563); }
.product-short-desc { font-size: .95rem; line-height: 1.6; margin: 1.25rem 0; color: var(--gray-700, #374151); }
.product-actions { display: flex; gap: .75rem; margin: 1.5rem 0; flex-wrap: wrap; }
.product-actions .btn { flex: 1; min-width: 180px; justify-content: center; }

/* Reassurance badges */
.product-reassurance {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 1.25rem 0;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    overflow: hidden;
}
.reassurance-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border, #f0f0f0);
}
.reassurance-item:last-child { border-bottom: none; }
.reassurance-item svg {
    flex-shrink: 0;
    color: var(--primary, #2563eb);
}
.reassurance-item div {
    display: flex;
    flex-direction: column;
}
.reassurance-item strong {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--gray-800, #1f2937);
}
.reassurance-item span {
    font-size: .75rem;
    color: var(--text-muted, #6b7280);
}

/* Merchant card */
.product-merchant-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .875rem 1rem;
    background: var(--gray-50, #f9fafb);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    margin-bottom: 1rem;
}
.merchant-card-header {
    display: flex;
    align-items: center;
    gap: .625rem;
}
.merchant-card-header div {
    display: flex;
    flex-direction: column;
}
.merchant-card-header strong {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted, #6b7280);
    font-weight: 500;
}
.merchant-name {
    font-size: .9rem;
    font-weight: 600;
    color: var(--gray-900, #111);
}
.merchant-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary, #2563eb);
    color: #fff;
    font-weight: 700;
    font-size: .875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Related products */
.product-related-section { margin-top: 1rem; }
.related-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

/* Skeleton for related products */
.product-card-skeleton {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border, #e5e7eb);
}
.product-card-skeleton .skeleton-img {
    aspect-ratio: 1/1;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}
.product-card-skeleton .skeleton-text {
    height: 12px;
    margin: .75rem 1rem .5rem;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 4px;
}
.product-card-skeleton .skeleton-text.short { width: 50%; margin-top: 0; margin-bottom: 1rem; }

.product-dims { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: 1rem; }
.product-dim { background: var(--gray-50, #f9fafb); border: 1px solid var(--border, #e5e7eb); border-radius: 6px; padding: .5rem; text-align: center; font-size: .8rem; display: flex; flex-direction: column; gap: .2rem; }
.product-dim span { color: var(--text-muted, #6b7280); }
.product-section { margin-bottom: 3rem; }
.product-section h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border, #e5e7eb); }
.product-description { font-size: .95rem; line-height: 1.7; color: var(--gray-700, #374151); }
.specs-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.product-specs-table { width: 100%; min-width: 0; border-collapse: collapse; }
.product-specs-table td { word-break: break-word; overflow-wrap: break-word; white-space: normal; vertical-align: top; padding: .35rem .5rem; }
.product-specs-table td.spec-key { font-weight: 500; color: var(--gray-700, #374151); width: 40%; }
.product-documents, .product-links { display: flex; flex-wrap: wrap; gap: .75rem; }
.product-doc-link, .product-ext-link { display: flex; align-items: center; gap: .4rem; padding: .5rem .875rem; border: 1px solid var(--border, #e5e7eb); border-radius: 6px; text-decoration: none; color: var(--gray-800, #111); font-size: .875rem; transition: border-color .15s; }
.product-doc-link:hover, .product-ext-link:hover { border-color: var(--primary, #2563eb); color: var(--primary, #2563eb); }

/* ── Contact modal ───────────────────────────────────────────────── */

.pmodal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(3px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    animation: fadeIn .15s ease;
}
.pmodal-overlay.hidden { display: none; }

@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.pmodal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0,0,0,.22);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    animation: slideUp .18s ease;
}

.pmodal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f0f0f0;
}
.pmodal-header-info {
    display: flex;
    align-items: flex-start;
    gap: .875rem;
}
.pmodal-icon {
    width: 42px;
    height: 42px;
    background: rgba(37,99,235,.08);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary, #2563eb);
    flex-shrink: 0;
}
.pmodal-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #111827;
    margin: .1rem 0 .2rem;
}
.pmodal-sub {
    font-size: .8375rem;
    color: #6b7280;
    margin: 0;
}
.pmodal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .1s, color .1s;
}
.pmodal-close:hover { background: #e5e7eb; color: #111; }

.pmodal-ref {
    display: flex;
    align-items: center;
    gap: .375rem;
    font-size: .8rem;
    color: #6b7280;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: .5rem .75rem;
    margin-bottom: 1.25rem;
}

.pmodal-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.pmodal-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f0f0f0;
}

.product-contact-success {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.25rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    color: #15803d;
    font-size: .9rem;
    font-weight: 500;
    margin-top: .5rem;
}
.product-contact-error {
    padding: .75rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    font-size: .875rem;
    margin-top: .75rem;
}

.form-label-optional { font-size: .75rem; color: #9ca3af; font-weight: 400; }
.required { color: #ef4444; }

@media (max-width: 600px) {
    .pmodal { padding: 1.25rem; }
    .pmodal-row { grid-template-columns: 1fr; }
    .pmodal-actions { flex-direction: column-reverse; }
    .pmodal-actions .btn { width: 100%; justify-content: center; }
}

/* ── Animations ──────────────────────────────────────────────────── */
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 960px) {
    .products-layout { grid-template-columns: 1fr; }

    .filters-sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100vh;
        width: 280px;
        z-index: 300;
        transform: translateX(-100%);
        transition: transform .25s ease;
        border-radius: 0;
        overflow-y: auto;
    }
    .filters-sidebar.open { transform: translateX(0); box-shadow: 4px 0 32px rgba(0,0,0,.18); }

    .filters-mobile-toggle { display: inline-flex !important; }
}

@media (min-width: 961px) {
    .filters-mobile-toggle { display: none !important; }
}

@media (max-width: 768px) {
    .related-products-grid { grid-template-columns: repeat(2, 1fr); }
    .product-actions .btn { min-width: 0; }
}

@media (max-width: 600px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
    .products-layout { padding: 1rem; }
    .product-layout { grid-template-columns: 1fr; gap: 1.5rem; }
    .product-dims { grid-template-columns: repeat(2, 1fr); }
    .search-box input { width: 120px; }
    .product-specs-table td,
    .product-specs-table td.spec-key { display: block; width: 100%; }
    .product-specs-table td.spec-key { padding-bottom: .1rem; border-bottom: none; }
    .product-specs-table tr { display: block; border-bottom: 1px solid var(--border, #e5e7eb); padding: .4rem 0; }
    .product-actions { flex-direction: column; }
    .product-actions .btn { width: 100%; }
    .product-merchant-card { flex-direction: column; align-items: flex-start; gap: .5rem; }
}


/* === Variantes & offres (style marketplace) === */
/* Prix + "À partir de" */
.product-price-from-label {
  flex-basis: 100%;
  font-size: .8rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: -.35rem;
}

/* Sélecteurs de variantes (état / couleur / capacité) */
.product-variants { display: flex; flex-direction: column; gap: var(--space-4); margin: var(--space-4) 0; }
.product-variant-axis { display: flex; flex-direction: column; gap: var(--space-2); }
.variant-axis-label {
  font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--gray-700);
}
.variant-options { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.variant-option {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: .55rem; text-align: left;
  background: #fff; color: var(--gray-900);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: .55rem .85rem;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.variant-option .vo-text { display: flex; flex-direction: column; gap: .12rem; line-height: 1.15; }
.variant-option .vo-name { font-size: .9rem; font-weight: 600; }
.variant-option .vo-price { font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.variant-option.active .vo-price { color: var(--primary); }
.vo-swatch {
  width: 18px; height: 18px; border-radius: 50%; flex: none; display: inline-block;
  border: 1px solid rgba(0,0,0,.18);
}
.variant-option.active .vo-swatch { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary); }
.product-meta-row .vo-swatch { width: 16px; height: 16px; }
.variant-condition-desc { font-size: .82rem; color: var(--text-muted); margin: .15rem 0 0; line-height: 1.35; }
.variant-condition-desc:empty { display: none; }
.variant-option:hover:not(.variant-option-disabled):not(.active) { border-color: var(--gray-500); }
.variant-option.active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
  background: var(--primary-light); color: var(--primary);
}
.variant-option-disabled {
  opacity: .45; cursor: not-allowed; text-decoration: line-through;
  background: var(--gray-50);
}

/* Valeur unique (pas de choix) : ligne discrète */
.product-meta-row { color: var(--gray-700); }
.product-meta-row strong { color: var(--gray-900); }

/* Liste des offres concurrentes */
.product-offers { margin-top: var(--space-4); border-top: 1px solid var(--border); padding-top: var(--space-4); }
.product-offers-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 var(--space-3); color: var(--gray-900); }
.offer-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4); margin-bottom: var(--space-2);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.offer-row:hover { border-color: var(--gray-500); }
.offer-row-selected { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--primary-light); }
.offer-row-info { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); }
.offer-row-price { font-size: 1.15rem; font-weight: 700; color: var(--gray-900); }
.offer-row-meta { font-size: .85rem; color: var(--gray-700); }
.offer-row-merchant { font-size: .8rem; color: var(--text-muted); }
.offer-row-merchant::before { content: "\00b7\00a0"; color: var(--gray-500); }
.offer-unavailable { opacity: .55; }
.offer-merchant-desc {
  margin: .75rem 0;
  padding: .75rem 1rem;
  background: #f8fafc;
  border-left: 3px solid var(--primary, #4f46e5);
  border-radius: 0 6px 6px 0;
  font-size: .875rem;
  color: var(--gray-800);
}
.offer-merchant-desc strong { display: block; margin-bottom: .25rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.offer-merchant-desc p { margin: 0; line-height: 1.6; }
.offer-select-btn {
  white-space: nowrap; cursor: pointer;
  border: 1.5px solid var(--primary); background: #fff; color: var(--primary);
  border-radius: var(--radius); padding: .5rem 1.1rem; font-size: .85rem; font-weight: 700;
  transition: background .15s ease, color .15s ease;
}
.offer-select-btn:hover:not(:disabled) { background: var(--primary); color: #fff; }
.offer-select-btn:disabled { border-color: var(--border); color: var(--text-muted); cursor: not-allowed; }
.offer-row-selected .offer-select-btn { background: var(--primary); color: #fff; }

/* ── Options payantes (add-ons) ────────────────────────────────── */
.product-addons-block {
  margin: 1rem 0;
  padding: .875rem 1rem;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: var(--radius, 8px);
  background: #f9fafb;
}
.addons-header {
  display: flex; align-items: center; gap: .4rem;
  font-size: .9rem; margin-bottom: .6rem;
  color: var(--gray-900, #111);
}
.addons-header svg { color: var(--gray-600, #4b5563); flex-shrink: 0; }
.addon-choice {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .5rem .75rem;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 6px;
  cursor: pointer;
  font-size: .875rem;
  background: #fff;
  margin-bottom: .4rem;
  transition: border-color .15s ease, background .15s ease;
  user-select: none;
}
.addon-choice:has(input:checked) {
  border-color: var(--primary, #2563eb);
  background: var(--primary-light, #eff6ff);
}
.addon-choice input[type="checkbox"] { margin-top: .15rem; accent-color: var(--primary, #2563eb); flex-shrink: 0; }
.addon-choice-body { flex: 1; display: flex; flex-direction: column; gap: .1rem; }
.addon-choice-label { font-weight: 600; color: var(--gray-900, #111); }
.addon-choice:has(input:checked) .addon-choice-label { color: var(--primary, #2563eb); }
.addon-choice-notes { font-size: .78rem; color: var(--text-muted, #6b7280); }
.addon-choice-price { font-weight: 700; color: var(--primary, #2563eb); white-space: nowrap; margin-left: auto; padding-left: .5rem; }
/* Merchant form editor */
.addon-editor-row { background: #f9fafb; border: 1px solid var(--border, #e5e7eb); border-radius: 6px; padding: .6rem .75rem; margin-bottom: .5rem; }
