/* ═══════════════════════════════════════
   BUNDLE — LOADING STATES
   ═══════════════════════════════════════ */

/* Barre de chargement dorée — même style que le side cart */
.tp-bundle-loader {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 10;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    border-radius: 16px 16px 0 0;
}
.tp-bundle-loader.tp-active {
    opacity: 1;
}
.tp-bundle-loader.tp-active::after {
    content: '';
    display: block;
    height: 100%;
    width: 40%;
    background: #C9A84C;
    border-radius: 0 2px 2px 0;
    animation: tp-bundle-slide 1.2s ease infinite;
}
@keyframes tp-bundle-slide {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* Overlay gris léger pendant validation serveur */
.tp-bundle-modal-content {
    position: relative;
}
.tp-bundle-modal-content.tp-bundle-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.45);
    z-index: 5;
    cursor: wait;
    border-radius: inherit;
}

/* Spinner dans le bouton */
.tp-btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tp-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes tp-spin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════
   BUNDLE PAGE & MODAL — Premium Design
   ═══════════════════════════════════════ */

/* ─── Bundle Section (page bundle — hidden on product pages) ─── */
.tp-bundle-section {
    padding: 60px 20px;
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}
.tp-bundle-title {
    font-family: var(--font-title);
    font-size: clamp(28px, 4vw, 42px);
    margin-bottom: 10px;
}
.tp-bundle-subtitle {
    font-size: 15px;
    color: #737373;
    margin-bottom: 40px;
}
.tp-bundle-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}
@media (max-width: 768px) {
    .tp-bundle-cards { grid-template-columns: 1fr; max-width: 360px; margin: 0 auto 30px; }
}
.tp-bundle-card {
    position: relative;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 28px 20px;
    text-align: center;
    transition: all 0.25s ease;
}
.tp-bundle-card:hover {
    border-color: #121212;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    transform: translateY(-3px);
}
.tp-bundle-card-popular { border-color: #C9A84C; }
.tp-bundle-card-best { border-color: #121212; background: #121212; color: #fff; }
.tp-bundle-card-best .tp-bundle-desc { color: rgba(255,255,255,0.6); }
.tp-bundle-card-best .tp-btn-primary {
    background: #C9A84C; border-color: #C9A84C; color: #121212;
    border-radius: 8px; text-transform: uppercase; letter-spacing: 0.06em;
}
.tp-bundle-card-best .tp-btn-primary:hover { background: #d4b966; }
.tp-bundle-badge {
    position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
    background: #C9A84C; color: #fff;
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    padding: 4px 14px; border-radius: 20px; white-space: nowrap;
}
.tp-bundle-qty {
    font-family: var(--font-title);
    font-size: 28px; display: block; margin-bottom: 8px;
}
.tp-bundle-discount-label { font-size: 17px; margin-bottom: 8px; }
.tp-bundle-discount-label strong { color: #C9A84C; font-size: 22px; }
.tp-bundle-card-best .tp-bundle-discount-label strong { color: #C9A84C; }
.tp-bundle-desc { font-size: 13px; color: #737373; margin-bottom: 20px; }
.tp-bundle-card .tp-btn-primary,
.tp-bundle-card .tp-btn-outline {
    border-radius: 8px; text-transform: uppercase; letter-spacing: 0.06em; font-size: 12px;
}

/* ═══════════════════════════════════════
   BUNDLE MODAL — Premium Popup
   ═══════════════════════════════════════ */
.tp-bundle-modal {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 10002;
    display: none;
    align-items: center;
    justify-content: center;
}
.tp-bundle-modal.open { display: flex; }

.tp-bundle-modal-overlay {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.tp-bundle-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 720px;
    width: 95%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    animation: tpModalIn 0.3s ease;
}
@keyframes tpModalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Header ─── */
.tp-bundle-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.tp-bundle-modal-header h2 {
    font-size: 16px; font-weight: 700;
    letter-spacing: 0.03em;
    color: #121212;
}
.tp-bundle-modal-close {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #888;
    border-radius: 50%;
    transition: all 0.2s;
    background: none; border: none; cursor: pointer;
}
.tp-bundle-modal-close:hover { background: #f5f5f5; color: #121212; }

/* ─── Shipping bar (top, visible) ─── */
.tp-bundle-shipping-bar {
    padding: 14px 24px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
    background: #fafafa;
}
.tp-bundle-shipping-text {
    font-size: 12px; color: #555;
    margin-bottom: 8px;
    display: flex; align-items: center;
}
.tp-bundle-shipping-text strong { color: #121212; }
.tp-bundle-shipping-track {
    height: 4px;
    background: #e5e5e5;
    border-radius: 999px;
    overflow: hidden;
}
.tp-bundle-shipping-fill {
    height: 100%;
    background: linear-gradient(90deg, #C9A84C, #d4b966);
    border-radius: 999px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Selection bar ─── */
.tp-bundle-modal-selection {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 24px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.tp-bundle-selected-items { display: flex; gap: 8px; }
.tp-bundle-selected-slot {
    width: 44px; height: 44px;
    border: 2px dashed #d4d4d4;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    transition: all 0.25s;
}
.tp-bundle-selected-slot.filled {
    border-style: solid; border-color: #C9A84C;
    box-shadow: 0 2px 8px rgba(201,168,76,0.2);
}
.tp-bundle-selected-slot img { width: 100%; height: 100%; object-fit: cover; }
.tp-bundle-selected-text {
    font-size: 13px; font-weight: 600; color: #555;
}

/* ─── Product grid ─── */
.tp-bundle-modal-grid {
    flex: 1; overflow-y: auto;
    padding: 20px 24px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    align-content: start;
}
@media (max-width: 600px) {
    .tp-bundle-modal-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
.tp-bundle-modal-loading {
    grid-column: 1 / -1;
    text-align: center; padding: 40px 0; color: #888;
}
.tp-bundle-modal-loading p { margin-top: 12px; font-size: 13px; }

/* Product card in modal */
.tp-bundle-modal-product {
    position: relative;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    background: #fff;
}
.tp-bundle-modal-product:hover {
    border-color: #d4d4d4;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    transform: translateY(-2px);
}
.tp-bundle-modal-product.selected {
    border-color: #C9A84C;
    background: rgba(201, 168, 76, 0.04);
    box-shadow: 0 4px 16px rgba(201,168,76,0.12);
}

.tp-bundle-modal-product-img {
    width: 100%; aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
    margin-bottom: 8px;
}
.tp-bundle-modal-product-img img { width: 100%; height: 100%; object-fit: cover; }

.tp-bundle-modal-product-name {
    font-size: 12px; font-weight: 600;
    line-height: 1.3; margin-bottom: 4px;
    color: #121212;
}
.tp-bundle-modal-product-price {
    font-size: 12px; font-weight: 500; color: #737373;
}

/* Check mark */
.tp-bundle-modal-check {
    display: none;
    position: absolute; top: 8px; right: 8px;
    width: 24px; height: 24px;
    background: #C9A84C;
    border-radius: 50%;
    align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(201,168,76,0.3);
}
.tp-bundle-modal-product.selected .tp-bundle-modal-check { display: flex; }

/* ─── Footer ─── */
.tp-bundle-modal-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
    gap: 16px;
    background: #fafafa;
}
@media (max-width: 480px) {
    .tp-bundle-modal-footer { flex-direction: column; }
}
.tp-bundle-modal-total {
    display: flex; align-items: center; gap: 8px; font-size: 14px;
}
.tp-bundle-original-price {
    text-decoration: line-through; color: #aaa; font-size: 14px;
}
.tp-bundle-final-price { font-size: 20px; font-weight: 800; color: #121212; }

#tp-bundle-add-to-cart {
    border-radius: 10px !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 13px;
    padding: 14px 28px;
    font-weight: 700;
}
#tp-bundle-add-to-cart:disabled { opacity: 0.35; cursor: not-allowed; }

/* ═══════════════════════════════════════
   UPSELL POST-ACHAT PAGE
   ═══════════════════════════════════════ */
.tp-upsell-page {
    max-width: 700px; margin: 0 auto;
    padding: 40px 20px; text-align: center;
}
.tp-upsell-page h1 { font-family: var(--font-title); font-size: 28px; margin-bottom: 10px; }
.tp-upsell-page .tp-upsell-subtitle { font-size: 15px; color: #737373; margin-bottom: 30px; }
.tp-upsell-timer { font-size: 14px; color: #c0392b; font-weight: 600; margin-bottom: 20px; }
.tp-upsell-offer {
    background: #fafafa; border: 2px solid #C9A84C;
    border-radius: 16px; padding: 30px; margin-bottom: 20px;
}
.tp-upsell-skip {
    font-size: 13px; color: #888; text-decoration: underline;
    cursor: pointer; background: none; border: none; font-family: inherit;
}
.tp-upsell-skip:hover { color: #121212; }
