/* ===================================================
 * ABCISSE SINGLE PRODUCT WIDGET
 * =================================================== */
.psingle-wrapper {
    --psingle-accent: #0073e6;
    --psingle-sale: #ef4444;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
}

.psingle-notice {
    text-align: center;
    padding: 40px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    color: #92400e;
}

/* ===== MAIN LAYOUT ===== */
.psingle-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}

/* ===== GALLERY ===== */
.psingle-gallery {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.psingle-main-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 12px;
    background: #f8fafc;
    cursor: zoom-in;
}
.psingle-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease, transform 0.6s ease;
}
.psingle-main-image:hover .psingle-main-img { transform: scale(1.03); }

.psingle-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--psingle-sale);
    color: #fff;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.psingle-thumbs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}
.psingle-thumb {
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #f8fafc;
    padding: 0;
    transition: border-color 0.3s ease, transform 0.3s ease;
}
.psingle-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.7;
    transition: opacity 0.3s;
}
.psingle-thumb:hover { transform: translateY(-2px); }
.psingle-thumb:hover img,
.psingle-thumb.is-active img { opacity: 1; }
.psingle-thumb.is-active { border-color: var(--psingle-accent); }

/* Thumbs à gauche */
.psingle-thumbs-left .psingle-gallery {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 14px;
}
.psingle-thumbs-left .psingle-thumbs {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(5, 1fr);
    max-height: 500px;
    overflow-y: auto;
}

/* ===== INFO ===== */
.psingle-info { display: flex; flex-direction: column; }
.psingle-cat {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--psingle-accent);
    margin-bottom: 10px;
}
.psingle-title {
    font-size: 36px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 16px;
    line-height: 1.2;
    letter-spacing: -0.015em;
}
.psingle-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 16px;
    font-size: 18px;
    color: #f59e0b;
    line-height: 1;
}
.psingle-star-empty { color: #e5e7eb; }
.psingle-star-half {
    background: linear-gradient(90deg, currentColor 50%, #e5e7eb 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.psingle-rating-count {
    margin-left: 10px;
    font-size: 13px;
    color: #5a6068;
    font-weight: 500;
}

.psingle-price {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 20px;
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}
.psingle-price del { color: #94a3b8; font-size: 0.7em; font-weight: 500; text-decoration: line-through; opacity: 0.8; }
.psingle-price ins { text-decoration: none; color: var(--psingle-sale); }
.psingle-price .woocommerce-Price-amount { font-weight: inherit; }

.psingle-excerpt {
    font-size: 16px;
    color: #5a6068;
    line-height: 1.65;
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid #e5e7eb;
}
.psingle-excerpt p { margin: 0 0 0.8em; }
.psingle-excerpt p:last-child { margin: 0; }

/* ===== FORM ===== */
.psingle-form-wrap { margin-bottom: 28px; }
.psingle-form, .psingle-wc-form {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: stretch;
}
.psingle-form.cart {
    display: flex !important;
    flex-direction: row !important;
}
.psingle-qty {
    display: inline-flex;
    align-items: stretch;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.psingle-qty-btn {
    width: 44px;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 18px;
    color: #0f172a;
    transition: background-color 0.2s ease;
    line-height: 1;
    font-family: inherit;
}
.psingle-qty-btn:hover { background: #f1f5f9; }
.psingle-qty-input {
    width: 56px;
    text-align: center;
    border: 0;
    background: transparent;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    font-family: inherit;
    -moz-appearance: textfield;
}
.psingle-qty-input::-webkit-outer-spin-button,
.psingle-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.psingle-add-to-cart,
.psingle-wc-form .single_add_to_cart_button {
    flex: 1;
    min-width: 200px;
    background: #0f172a;
    color: #ffffff;
    border: 0;
    padding: 16px 32px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
    line-height: 1;
    text-transform: none;
    text-decoration: none;
}
.psingle-add-to-cart:hover,
.psingle-wc-form .single_add_to_cart_button:hover {
    background: var(--psingle-accent);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 115, 230, 0.25);
}
.psingle-add-to-cart i { font-size: 15px; }
.psingle-wc-form .single_add_to_cart_button.added { background: #10b981 !important; }

/* Variations form (variable products) */
.psingle-wc-form .variations_form { width: 100%; }
.psingle-wc-form .variations_form .variations {
    width: 100%;
    margin-bottom: 16px;
    border-collapse: collapse;
}
.psingle-wc-form .variations_form .variations tr {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
}
.psingle-wc-form .variations_form .variations label {
    font-weight: 600;
    color: #0f172a;
    font-size: 14px;
}
.psingle-wc-form .variations_form .variations select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    font-family: inherit;
}
.psingle-wc-form .variations_form .variations_button {
    display: flex;
    gap: 14px;
    align-items: stretch;
    flex-wrap: wrap;
    margin-top: 16px;
}
.psingle-wc-form .variations_form .quantity { display: flex; }
.psingle-wc-form .variations_form .quantity input.qty {
    width: 80px;
    padding: 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
}
.psingle-wc-form .woocommerce-variation-price { margin-bottom: 14px; font-size: 22px; font-weight: 700; }
.psingle-wc-form .woocommerce-variation-availability { margin-bottom: 14px; font-size: 14px; }

.psingle-out-of-stock {
    display: inline-block;
    padding: 14px 24px;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
}

/* ===== META ===== */
.psingle-meta {
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.psingle-meta-item {
    font-size: 14px;
    color: #5a6068;
    line-height: 1.5;
}
.psingle-meta-label {
    color: #0f172a;
    font-weight: 600;
    margin-right: 6px;
}
.psingle-meta a {
    color: var(--psingle-accent);
    text-decoration: none;
}
.psingle-meta a:hover { text-decoration: underline; }

/* ===== TABS ===== */
.psingle-tabs {
    margin-top: 60px;
    border-top: 1px solid #e5e7eb;
    padding-top: 40px;
}
.psingle-tabs-nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 30px;
}
.psingle-tab-btn {
    background: transparent;
    border: 0;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    color: #5a6068;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
}
.psingle-tab-btn i { font-size: 14px; }
.psingle-tab-btn::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--psingle-accent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}
.psingle-tab-btn:hover { color: #0f172a; }
.psingle-tab-btn.is-active { color: var(--psingle-accent); }
.psingle-tab-btn.is-active::after { transform: scaleX(1); }

.psingle-tab-panel {
    display: none;
    color: #5a6068;
    line-height: 1.7;
    font-size: 15px;
    padding: 10px 0;
}
.psingle-tab-panel.is-active { display: block; animation: psingle-fade 0.4s ease; }
@keyframes psingle-fade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* WC attributes table */
.psingle-tab-panel .woocommerce-product-attributes,
.psingle-tab-panel .shop_attributes {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}
.psingle-tab-panel .shop_attributes th,
.psingle-tab-panel .shop_attributes td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}
.psingle-tab-panel .shop_attributes th {
    background: #f8fafc;
    color: #0f172a;
    font-weight: 600;
    width: 30%;
}

/* WC comments */
.psingle-tab-panel .commentlist {
    list-style: none;
    padding: 0;
    margin: 0 0 30px;
}
.psingle-tab-panel #comments h2 { font-size: 20px; font-weight: 700; margin-bottom: 18px; color: #0f172a; }

/* ===== RELATED ===== */
.psingle-related {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #e5e7eb;
}
.psingle-related-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 24px;
    color: #0f172a;
}
.psingle-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.psingle-related-item {
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}
.psingle-related-item:hover { transform: translateY(-4px); }
.psingle-related-img {
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
    margin-bottom: 10px;
}
.psingle-related-img img { width: 100%; height: 100%; object-fit: cover; }
.psingle-related-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; color: #0f172a; }
.psingle-related-price { font-size: 14px; font-weight: 700; color: var(--psingle-accent); }
.psingle-related-price del { color: #94a3b8; font-weight: 500; font-size: 0.8em; }


/* ===================================================
 * VARIANTE 1 : CLASSIC SIDE-BY-SIDE (par défaut)
 * =================================================== */


/* ===================================================
 * VARIANTE 2 : HERO CINEMATIC
 * =================================================== */
.psingle-variant-hero .psingle-main {
    grid-template-columns: 1fr;
    gap: 0;
}
.psingle-variant-hero .psingle-gallery {
    margin-bottom: 60px;
}
.psingle-variant-hero .psingle-main-image {
    aspect-ratio: 16/9;
    max-height: 70vh;
    border-radius: 16px;
}
.psingle-variant-hero .psingle-thumbs {
    grid-template-columns: repeat(6, 1fr);
    max-width: 600px;
    margin: 0 auto;
}
.psingle-variant-hero .psingle-info {
    text-align: center;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
}
.psingle-variant-hero .psingle-title {
    font-size: 48px;
    letter-spacing: -0.02em;
}
.psingle-variant-hero .psingle-rating,
.psingle-variant-hero .psingle-price { justify-content: center; }
.psingle-variant-hero .psingle-excerpt {
    text-align: center;
    border: 0;
    padding: 0;
    margin-bottom: 24px;
    max-width: 600px;
}
.psingle-variant-hero .psingle-form-wrap {
    display: flex;
    justify-content: center;
}
.psingle-variant-hero .psingle-form.cart {
    max-width: 500px;
    margin: 0 auto;
}
.psingle-variant-hero .psingle-meta {
    border-top: 0;
    padding-top: 24px;
    align-items: center;
    text-align: center;
}


/* ===================================================
 * VARIANTE 3 : STICKY INFO
 * =================================================== */
.psingle-variant-sticky .psingle-main {
    grid-template-columns: 1.2fr 0.8fr;
}
.psingle-variant-sticky .psingle-gallery {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.psingle-variant-sticky .psingle-main-image,
.psingle-variant-sticky .psingle-thumb {
    cursor: default;
}
.psingle-variant-sticky .psingle-gallery .psingle-main-image:nth-child(n+2) { display: block; }
/* Affiche toutes les images d'un coup (mode galerie scrollable) - on garde la première et on duplique les autres en dessous */
.psingle-variant-sticky .psingle-info {
    position: sticky;
    top: 100px;
    align-self: start;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}
.psingle-variant-sticky .psingle-title { font-size: 28px; }
.psingle-variant-sticky .psingle-thumbs { display: none; }


/* RESPONSIVE */
@media (max-width: 1024px) {
    .psingle-main { gap: 30px; }
    .psingle-title { font-size: 28px; }
    .psingle-variant-hero .psingle-title { font-size: 36px; }
    .psingle-related-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .psingle-main { grid-template-columns: 1fr; gap: 30px; }
    .psingle-thumbs-left .psingle-gallery { grid-template-columns: 1fr; }
    .psingle-thumbs-left .psingle-thumbs { grid-template-columns: repeat(5, 1fr); grid-template-rows: auto; max-height: none; }
    .psingle-variant-sticky .psingle-info { position: static; }
    .psingle-title { font-size: 24px; }
    .psingle-price { font-size: 22px; }
    .psingle-related-grid { grid-template-columns: repeat(2, 1fr); }
    .psingle-form.cart, .psingle-wc-form .variations_form .variations_button { flex-direction: column; align-items: stretch; }
    .psingle-add-to-cart { min-width: 0; }
}
@media (max-width: 480px) {
    .psingle-tabs-nav { gap: 0; }
    .psingle-tab-btn { padding: 12px 14px; font-size: 13px; }
}

/* ===== LIGHTBOX SINGLE PRODUCT ===== */
.psingle-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.psingle-lightbox.is-open { opacity: 1; }
.psingle-lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}
.psingle-lb-close {
    position: absolute;
    top: 20px; right: 20px;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 0;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    line-height: 1;
    transition: background 0.3s;
}
.psingle-lb-close:hover { background: var(--psingle-accent); }
