/**
 * Post-it Checklist - Style Chic & Pro
 */

/* ====================== POST-IT CHIC & PRO ====================== */
.cekonay-postit-checklist {
    position: fixed;
    left: 50%;
    top: 20vh;
    transform: translateX(-50%);
    width: 90%;
    max-width: 480px;
    background: linear-gradient(135deg, #faf9f6 0%, #e8e1d5 100%);
    border-radius: 6px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.08);
    z-index: 100001 !important; /* Au-dessus du fly-cart (99996-100000) */
    font-family: Georgia, serif;
    color: #2c1e18;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06);
    transition: opacity 0.3s ease, transform 0.3s ease;
    /* Caché par défaut */
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-20px);
}

/* État ouvert (contrôlé par classe body comme le fly-cart) */
body.cekonay-postit-open .cekonay-postit-checklist {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* Bouton close (X) en haut à droite */
.cekonay-postit-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 28px;
    cursor: pointer;
    color: #8a7a6a;
    z-index: 10;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
    font-weight: 300;
}

.cekonay-postit-close:hover {
    color: #4a3c2f;
    transform: scale(1.1);
}

/* Header */
.cekonay-postit-header {
    position: relative;
    padding: 20px 28px 16px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.25), transparent);
    border-bottom: 1px solid rgba(0,0,0,0.08);
    text-align: center;
}

.cekonay-postit-header h4 {
    margin: 0;
    font-size: 21px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 400;
    color: #3a2f28;
}

/* Zone scrollable */
.cekonay-postit-items {
    max-height: 400px;
    overflow-y: auto;
    padding: 16px 28px;
    background: rgba(255,255,255,0.12);
}

/* Scrollbar discrète */
.cekonay-postit-items::-webkit-scrollbar {
    width: 5px;
}

.cekonay-postit-items::-webkit-scrollbar-track {
    background: transparent;
}

.cekonay-postit-items::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.18);
    border-radius: 3px;
}

.cekonay-postit-items::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.3);
}

/* Ligne produit */
.cekonay-postit-item {
    display: flex;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    cursor: pointer;
    transition: background 0.2s;
}

.cekonay-postit-item:last-child {
    border-bottom: none;
}

.cekonay-postit-item:hover {
    background: rgba(255,255,255,0.3);
}

/* Checkbox ronde */
.cekonay-postit-checkbox {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid #4a3c2f;
    border-radius: 50%;
    margin-right: 14px;
    position: relative;
    transition: all 0.25s;
}

.cekonay-postit-item.checked .cekonay-postit-checkbox {
    background: #4a3c2f;
    border-color: #4a3c2f;
}

.cekonay-postit-item.checked .cekonay-postit-checkbox::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #faf9f6;
    font-weight: bold;
    font-size: 13px;
}

/* Texte produit */
.cekonay-postit-text {
    font-size: 15px;
    flex: 1;
    line-height: 1.4;
    word-wrap: break-word;
}

.cekonay-postit-item.checked .cekonay-postit-text {
    opacity: 0.55;
    text-decoration: line-through;
    font-style: italic;
}

/* Footer avec compteur et switch */
.cekonay-postit-footer {
    padding: 14px 28px;
    background: rgba(0,0,0,0.04);
    text-align: center;
    font-size: 15px;
    letter-spacing: 0.5px;
    border-top: 1px solid rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cekonay-postit-count {
    flex: 1;
}

.cekonay-postit-count .checked-count {
    color: #b89b72;
    font-weight: bold;
    font-size: 17px;
}

/* Switch ON/OFF (desktop uniquement) */
.cekonay-postit-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6a5a4a;
}

.cekonay-postit-toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: rgba(0,0,0,0.15);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.cekonay-postit-toggle-switch.active {
    background: #b89b72;
}

.cekonay-postit-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.cekonay-postit-toggle-switch.active::after {
    transform: translateX(20px);
}

/* ====================== PASTILLE MOBILE (bouton flottant) ====================== */
.cekonay-postit-mobile-trigger {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: linear-gradient(135deg, #b89b72 0%, #8a7a6a 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    cursor: pointer;
    z-index: 9998;
    font-family: Georgia, serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cekonay-postit-mobile-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.cekonay-postit-mobile-trigger.hidden {
    display: none;
}

/* Badge compteur sur la pastille mobile */
.cekonay-postit-mobile-trigger .badge {
    display: inline-block;
    background: white;
    color: #4a3c2f;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 6px;
    font-weight: bold;
}

/* ====================== MOBILE ====================== */
@media (max-width: 640px) {
    /* Cacher le trigger mobile (bouton flottant) - on ouvre via fly-cart */
    .cekonay-postit-mobile-trigger {
        display: none !important;
    }

    /* Post-it visible sur mobile (ouvert depuis fly-cart) */
    .cekonay-postit-checklist {
        top: 10vh;
        width: 95%;
        max-height: 80vh;
    }

    .cekonay-postit-items {
        max-height: 50vh;
    }
}

/* Animation typewriter (si JS l'active) */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.cekonay-postit-text.typewriter {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    animation: typewriter 1s steps(40) forwards;
}