/* =============================================================
   CBB – Pages Mon Compte (Fidélité, Codes Promos, Wishlist, Parrainage)
   ============================================================= */

/* ---- Base communes ----------------------------------------- */
.cbb-account-page {
    max-width: 800px;
}

.cbb-account-section {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.cbb-account-section h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
}

.cbb-account-empty {
    padding: 40px 0;
    text-align: center;
    color: #666;
    font-size: .95rem;
}

.cbb-btn-link {
    color: #E84C3D;
    text-decoration: underline;
}

.cbb-btn-sm {
    display: inline-block;
    padding: 6px 14px;
    background: transparent;
    border: 1px solid #E84C3D;
    color: #E84C3D;
    border-radius: 4px;
    font-size: .8rem;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.cbb-btn-sm:hover {
    background: #E84C3D;
    color: #fff;
}

.cbb-btn-primary {
    display: inline-block;
    padding: 12px 32px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .05em;
    cursor: pointer;
    transition: background .2s;
}
.cbb-btn-primary:hover {
    background: #333;
}

.cbb-account-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.cbb-account-table th,
.cbb-account-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}
.cbb-account-table thead th {
    background: #f6f6f6;
    font-weight: 700;
    color: #444;
}
.cbb-account-table tbody tr:last-child td {
    border-bottom: none;
}

/* ---- Points Fidélité --------------------------------------- */
.cbb-loyalty-balance-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: linear-gradient(135deg, #4ECDC4 0%, #3ab5ac 100%);
    color: #fff;
    border-radius: 10px;
    padding: 28px 32px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.cbb-loyalty-balance-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cbb-loyalty-label {
    font-size: .85rem;
    opacity: .9;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.cbb-loyalty-points-value {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
}
.cbb-points-unit {
    font-size: 1.2rem;
    font-weight: 600;
}
.cbb-loyalty-discount-equiv {
    font-size: .9rem;
    opacity: .9;
}
.cbb-loyalty-balance-right {
    min-width: 220px;
    flex: 1;
}
.cbb-loyalty-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cbb-loyalty-progress-bar {
    background: rgba(255,255,255,.3);
    border-radius: 100px;
    height: 12px;
    overflow: hidden;
}
.cbb-loyalty-progress-fill {
    background: #fff;
    height: 100%;
    border-radius: 100px;
    transition: width .6s ease;
}
.cbb-loyalty-progress-label {
    font-size: .8rem;
    opacity: .9;
    text-align: right;
}

.cbb-loyalty-rules ul {
    margin: 0;
    padding-left: 20px;
}
.cbb-loyalty-rules li {
    margin-bottom: 8px;
    font-size: .9rem;
    color: #444;
}
.cbb-loyalty-cta-note {
    margin-top: 16px;
    font-size: .85rem;
    color: #888;
}

/* ---- Design fidélité client -------------------------------- */
.cbb-loyalty-rules-main {
    margin-bottom: 18px;
}
.cbb-loyalty-rule-line {
    color: #c0392b;
    margin-bottom: 14px;
    line-height: 1.5;
}
.cbb-loyalty-rule-line strong {
    font-weight: 700;
    font-size: 1rem;
    display: block;
}
.cbb-loyalty-rule-sub {
    font-size: .88rem;
    font-weight: 400;
}
.cbb-loyalty-tiers {
    margin-bottom: 18px;
}
.cbb-loyalty-tier-line {
    margin: 3px 0;
    font-size: .9rem;
    color: #333;
}
.cbb-loyalty-current-points {
    color: #c0392b;
    font-size: .95rem;
    margin-bottom: 14px;
}
.cbb-loyalty-current-points strong {
    color: #c0392b;
}
.cbb-loyalty-explainer p {
    font-size: .88rem;
    color: #444;
    margin-bottom: 6px;
}

.cbb-points-delta {
    font-weight: 700;
}
.cbb-points-delta.positive { color: #27ae60; }
.cbb-points-delta.negative { color: #e74c3c; }

/* ---- Codes Promos ----------------------------------------- */
.cbb-coupon-group {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.cbb-coupon-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #1a1a1a;
    color: #fff;
    font-weight: 700;
    font-size: .95rem;
}

.cbb-coupon-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.cbb-coupon-group-body {
    padding: 0 20px;
}

.cbb-coupon-item {
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}
.cbb-coupon-item:last-child {
    border-bottom: none;
}

.cbb-coupon-code-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.cbb-coupon-code-label {
    font-size: .85rem;
    color: #888;
}
.cbb-coupon-code {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    background: #f5f5f5;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: .04em;
}
.cbb-coupon-copy {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    transition: background .2s, color .2s;
}
.cbb-coupon-copy:hover,
.cbb-coupon-copy.copied {
    background: #4ECDC4;
    color: #fff;
    border-color: #4ECDC4;
}

.cbb-coupon-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.cbb-coupon-meta-item {
    font-size: .85rem;
    color: #555;
}
.cbb-coupon-amount {
    font-weight: 700;
    color: #E84C3D;
    margin-left: 4px;
}

/* ---- Wishlist --------------------------------------------- */
.cbb-wishlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.cbb-wishlist-item {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: #fff;
    transition: box-shadow .2s;
}
.cbb-wishlist-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
}

.cbb-wishlist-item-img img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.cbb-wishlist-item-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cbb-wishlist-item-name {
    font-size: .9rem;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cbb-wishlist-item-price {
    font-size: .85rem;
    color: #E84C3D;
    font-weight: 700;
}

.cbb-wishlist-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,.9);
    border: 1px solid #ddd;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s;
}
.cbb-wishlist-remove:hover {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}

/* ---- Parrainage ------------------------------------------- */
.cbb-referral-points-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #4ECDC4;
    color: #fff;
    border-radius: 8px;
    padding: 18px 24px;
    margin-bottom: 24px;
}
.cbb-referral-points-banner .cbb-btn-sm {
    border-color: #fff;
    color: #fff;
}
.cbb-referral-points-banner .cbb-btn-sm:hover {
    background: rgba(255,255,255,.2);
}
.cbb-referral-points-label {
    display: block;
    font-size: .8rem;
    opacity: .9;
    margin-bottom: 2px;
}
.cbb-referral-points-value {
    font-size: 1.5rem;
    font-weight: 800;
}

.cbb-referral-cta-title {
    font-size: 1rem;
    font-weight: 800;
    color: #E84C3D;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: .03em;
    line-height: 1.4;
}

.cbb-referral-intro {
    font-size: .9rem;
    color: #444;
    margin-bottom: 24px;
}

.cbb-referral-code-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.cbb-referral-code-display code {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 14px;
    font-family: 'Courier New', monospace;
    font-size: .95rem;
    font-weight: 700;
    color: #1a1a1a;
    word-break: break-all;
    flex: 1;
}

.cbb-referral-url-input {
    flex: 1;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: .85rem;
    color: #555;
}

.cbb-btn-copy {
    padding: 8px 16px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: .85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s;
}
.cbb-btn-copy.copied,
.cbb-btn-copy:hover {
    background: #4ECDC4;
}

.cbb-referral-link-label {
    margin: 16px 0 4px;
    font-size: .9rem;
    color: #555;
}

.cbb-referral-send-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.cbb-referral-send-form input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: .9rem;
    background: #fafafa;
}
.cbb-referral-send-form input[type="text"]:focus {
    outline: none;
    border-color: #4ECDC4;
}

.cbb-referral-feedback {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: .875rem;
}
.cbb-referral-feedback.success {
    background: #edfaf3;
    color: #27ae60;
    border: 1px solid #c3e6cb;
}
.cbb-referral-feedback.error {
    background: #fdf0f0;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.cbb-referral-footnote {
    margin-top: 12px;
    font-size: .8rem;
    color: #888;
    font-style: italic;
}

.cbb-ref-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: .8rem;
    font-weight: 600;
}
.cbb-ref-status--pending   { background: #fff8e1; color: #f39c12; }
.cbb-ref-status--converted { background: #edfaf3; color: #27ae60; }

/* ---- Detail commande client ------------------------------- */
.cbb-customer-order-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 16px;
}

.cbb-customer-order-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 28px;
    background: linear-gradient(135deg, #fff7f5 0%, #ffffff 100%);
    border: 1px solid #f1ddd7;
    border-radius: 18px;
}

.cbb-customer-order-kicker {
    margin: 0 0 8px;
    color: #e5755f;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.cbb-customer-order-heading {
    margin: 0;
    color: #1f2937;
    font-size: 1.8rem;
    font-weight: 700;
}

.cbb-customer-order-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #6b7280;
    font-size: .9rem;
    text-align: right;
}

.cbb-customer-order-panel {
    background: #fff7f5;
    border: 1px solid #f1ddd7;
    border-radius: 18px;
    padding: 24px;
}

.cbb-customer-order-shipping-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #4b3f3a;
    font-size: .95rem;
    line-height: 1.5;
}

.cbb-customer-order-shipping-list strong {
    color: #e5755f;
    margin-right: 6px;
}

.cbb-customer-section-subtitle {
    margin: 0 0 16px;
    color: #e5755f;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.cbb-customer-coffre-section,
.cbb-customer-extras-section {
    margin-bottom: 24px;
}

.cbb-customer-box-item {
    background: #fff;
    border: 1px solid #f1e5e1;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 8px 20px rgba(17, 24, 39, .04);
}

.cbb-customer-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid #f3e5e1;
}

.cbb-customer-box-header strong {
    color: #e5755f;
    font-size: 1rem;
    font-weight: 700;
}

.cbb-customer-box-header span {
    color: #6b7280;
    font-size: .85rem;
    white-space: nowrap;
}

.cbb-customer-item-line,
.cbb-customer-extra-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #fff8f6;
    border: 1px solid #f7e9e5;
    border-radius: 12px;
}

.cbb-customer-item-thumb {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #f1ddd7;
    flex-shrink: 0;
}

.cbb-customer-item-name {
    flex: 1;
    color: #1f2937;
    font-size: .92rem;
    line-height: 1.4;
}

.cbb-customer-item-price {
    color: #1f2937;
    font-size: .92rem;
    font-weight: 700;
    white-space: nowrap;
}

.cbb-customer-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cbb-customer-card-message,
.cbb-customer-card-from {
    color: #6b7280;
    font-size: .78rem;
    line-height: 1.4;
}

.cbb-customer-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    padding: 14px 6px 0;
    border-top: 1px solid #f1ddd7;
    color: #1f2937;
    font-size: .92rem;
    font-weight: 700;
}

.cbb-customer-totals {
    background: #fff;
    border: 1px solid #f1e5e1;
    border-radius: 14px;
    padding: 18px;
}

.cbb-customer-total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f4ece9;
}

.cbb-customer-total-line:last-child {
    border-bottom: none;
}

.cbb-customer-total-label {
    color: #6b7280;
    font-size: .9rem;
}

.cbb-customer-total-value {
    color: #1f2937;
    font-size: .9rem;
    font-weight: 700;
    text-align: right;
}

.cbb-customer-total-line.subtotal .cbb-customer-total-label,
.cbb-customer-total-line.subtotal .cbb-customer-total-value {
    font-size: 1rem;
    font-weight: 700;
}

.cbb-customer-total-line.total {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 2px solid #1f2937;
    border-bottom: none;
}

.cbb-customer-total-line.total .cbb-customer-total-label,
.cbb-customer-total-line.total .cbb-customer-total-value {
    color: #1f2937;
    font-size: 1.1rem;
    font-weight: 700;
}

.cbb-customer-total-line.discount .cbb-customer-total-value {
    color: #0f9f6e;
}

.cbb-customer-order-notes {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    padding: 20px 24px;
}

.cbb-customer-order-notes h3 {
    margin: 0 0 14px;
    color: #1f2937;
    font-size: 1rem;
    font-weight: 700;
}

/* ---- Responsive ------------------------------------------- */
@media (max-width: 600px) {
    .cbb-loyalty-balance-card { flex-direction: column; }
    .cbb-loyalty-balance-right { width: 100%; }
    .cbb-wishlist-grid { grid-template-columns: repeat(2, 1fr); }
    .cbb-referral-send-form { flex-direction: column; }
    .cbb-referral-points-banner { flex-direction: column; align-items: flex-start; }

    .cbb-customer-order-hero,
    .cbb-customer-box-header,
    .cbb-customer-item-line,
    .cbb-customer-extra-item,
    .cbb-customer-subtotal,
    .cbb-customer-total-line {
        flex-direction: column;
        align-items: flex-start;
    }

    .cbb-customer-order-meta {
        text-align: left;
    }

    .cbb-customer-order-panel {
        padding: 18px;
    }
}
/* Erreurs login / inscription (JS + WC) */
.cbb-auth-js-error {
    display: block;
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fff5f5;
    border: 1px solid #f5c2c2;
    color: #9b1c1c;
    font-size: 14px;
    line-height: 1.45;
}
.woocommerce-error,
.woocommerce-message,
.woocommerce-info,
.cbb-wc-notices-wrap .woocommerce-error {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Tip "Copié !" à côté des boutons copie */
.cbb-copy-tip,
.cbb-coupon-copied-tip {
    display: inline-block;
    margin-left: 8px;
    color: #0a7a4b;
    font-size: 13px;
    font-weight: 600;
    vertical-align: middle;
}
.cbb-coupon-code {
    cursor: pointer;
    user-select: all;
}
.cbb-coupon-copy {
    position: relative;
    z-index: 2;
    pointer-events: auto !important;
    min-width: 32px;
    min-height: 28px;
}
