@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;700&display=swap');

/* --- GENERAL --- */
.wgb-gift-container { width: 100%; display: block; clear: both; margin-bottom: 10px; position: relative; }
.wgb-icon { vertical-align: middle; margin-right: 8px; display: inline-block; }

/* --- PRODUS (Product Page) --- */
.wgb-gift-card { 
    background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 15px; 
    transition: border-color 0.2s; position: relative;
    /* Adăugat fallback fonts pentru siguranță */
    font-family: inherit, sans-serif; 
}
.wgb-gift-card:hover { border-color: #2dac02; }

/* Badge Activ (Verde) */
.wgb-gift-active-badge { 
    background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; 
    padding: 12px; border-radius: 8px; font-size: 14px; font-weight: 600; 
    display: flex; align-items: center; 
}
.wgb-gift-active-badge a { margin-left: auto; font-size: 12px; color: #2dac02; text-decoration: underline; }

/* Inputuri Produs */
#wgb-gift-message-ui { margin-top: 12px; border-top: 1px dashed #cbd5e0; padding-top: 10px; }
.wgb-helper-text { font-size: 13px; color: #64748b; margin-bottom: 5px; }

.wgb-gift-card textarea { 
    width: 100%; height: 70px; border: 1px solid #cbd5e0; border-radius: 6px; 
    padding: 8px; font-size: 13px; margin-top: 5px; font-family: inherit; color: #333; 
    box-sizing: border-box; /* Asigură că padding-ul nu lățește elementul */
}
.wgb-gift-card textarea:focus { outline: none; border-color: #2dac02; box-shadow: 0 0 0 1px #2dac02; }

/* Checkbox & Label */
.wgb-checkbox-label { cursor:pointer; font-weight:600; color:#1e293b; display:flex; align-items:center; margin:0; font-size:15px; }
.wgb-checkbox-trigger { margin-right: 10px; transform: scale(1.2); cursor: pointer; accent-color: #2dac02; }

/* Character Counter */
#wgb_char_count_ui, #wgb_char_count_modal {
    font-family: sans-serif;
}

/* Buton Previzualizare (NOU v1.5) */
.wgb-preview-btn {
    background: transparent; border: none; padding: 0;
    color: var(--wgb-color, #2dac02); /* Folosește variabila dinamică sau fallback */
    font-size: 13px; font-weight: 600;
    cursor: pointer; display: inline-flex; align-items: center; gap: 2px;
    transition: opacity 0.2s;
    margin-top: 5px;
}
/* Hover simplu: doar opacitate, fără background sau schimbare culoare */
.wgb-preview-btn:hover { 
    opacity: 0.8; 
    background: transparent; 
    color: var(--wgb-color, #2dac02);
    text-decoration: none; /* Opțional: scoate sublinierea dacă vrei super clean */
}
.wgb-preview-btn svg { vertical-align: middle; }

/* --- ANIMAȚIE INIMI MARI (CENTER SCREEN) --- */
.wgb-heart-burst-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1px; height: 1px;
    z-index: 999999; /* Ajustat la o valoare sigură */
    pointer-events: none; /* Să nu blocheze click-urile */
}

.wgb-big-heart {
    position: absolute;
    color: #2dac02; /* Verde Brand */
    opacity: 0;
    width: 50px; 
    height: 50px;
}

@keyframes floatUpBig {
    0% { transform: translate(-50%, 0) scale(0.5); opacity: 0; }
    20% { opacity: 1; transform: translate(var(--tx), -50px) scale(1.2); }
    80% { opacity: 0.8; }
    100% { transform: translate(var(--tx), -200px) scale(1); opacity: 0; }
}

/* --- COȘ (CART) --- */
.wgb-cart-box { 
    margin: 20px 0; background: #ffffff; border: 1px solid #e2e8f0; 
    border-left: 4px solid #2dac02; border-radius: 6px; padding: 20px; 
}
.wgb-cart-header { display: flex; align-items: center; font-weight: 700; font-size: 15px; color: #1e293b; margin-bottom: 10px; }

.wgb-cart-msg-preview { 
    font-style: italic; color: #475569; background: #f8fafc; padding: 12px; 
    border-radius: 6px; margin-bottom: 12px; border: 1px solid #e2e8f0; 
}
.wgb-action-links { display: flex; gap: 15px; font-size: 13px; flex-wrap: wrap; }
.wgb-edit-btn { color: #2dac02; font-weight: 600; cursor: pointer; text-decoration: none; display: flex; align-items: center; }
.wgb-remove-btn { color: #ef4444; cursor: pointer; text-decoration: none; display: flex; align-items: center; }

/* --- MODAL POPUP --- */
.wgb-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); 
    z-index: 999999; /* Ajustat la o valoare sigură */
    display: none; 
    align-items: center; justify-content: center;
    backdrop-filter: blur(3px);
}

.wgb-modal-content {
    background: #fff; width: 90%; max-width: 500px;
    padding: 30px; border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    position: relative;
    animation: wgbPopUp 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    box-sizing: border-box;
}

@keyframes wgbPopUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.wgb-modal-title { 
    font-size: 20px; font-weight: bold; margin-bottom: 20px; color: #1e293b; 
    border-bottom: 1px solid #f1f5f9; padding-bottom: 10px; 
    display: flex; align-items: center;
}
.wgb-modal-textarea { 
    width: 100%; height: 120px; padding: 12px; 
    border: 1px solid #cbd5e0; border-radius: 6px; 
    font-family: inherit; font-size: 14px; margin-bottom: 5px; color: #333; 
    box-sizing: border-box; 
}
.wgb-modal-textarea:focus { border-color: #2dac02; outline: none; }

.wgb-modal-actions { display: flex; justify-content: flex-end; gap: 12px; }

.wgb-btn-save { 
    background: #2dac02; color: #fff; border: none; padding: 10px 24px; 
    border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 14px;
}
.wgb-btn-save:hover { background: #258e02; }

.wgb-btn-cancel { 
    background: #fff; color: #64748b; border: 1px solid #cbd5e0; 
    padding: 10px 18px; border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 500;
}
.wgb-btn-cancel:hover { background: #f8fafc; color: #333; }

.wgb-close-x { position: absolute; top: 20px; right: 20px; cursor: pointer; color: #94a3b8; font-size: 24px; line-height: 1; }
.wgb-close-x:hover { color: #ef4444; }

/* --- LIVE PREVIEW MODAL (NOU v1.5) --- */
.wgb-preview-content {
    max-width: 600px; /* Un pic mai lat pentru a cuprinde cardul */
    background: #f1f5f9; /* Fundal gri deschis pentru a scoate în evidență "hârtia" */
}

.wgb-preview-card-body {
    background: #fff;
    width: 100%;
    max-width: 400px; /* Lățime limitată pentru aspect de hârtie */
    aspect-ratio: 210/297; /* Raport A4 */
    margin: 0 auto;
    padding: 30px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
}

.wgb-preview-header img { max-width: 180px; height: auto; margin-bottom: 10px; }
#wgb-preview-subtitle {
    font-weight: 700; text-transform: uppercase; letter-spacing: 1px; font-size: 14px;
    margin-top: 10px;
}

.wgb-preview-msg-box {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
    width: 100%;
}

#wgb-preview-text-target {
    font-family: 'Caveat', cursive;
    font-size: 22px; /* Mai mic decât la print (32pt) dar bun pentru ecran */
    line-height: 1.4;
    color: #1e293b;
    word-break: break-word;
}

#wgb-preview-footer {
    font-size: 12px; color: #64748b; font-weight: 500;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 480px) {
    .wgb-modal-content {
        padding: 20px;
        width: 95%;
    }
    .wgb-modal-title {
        font-size: 18px;
    }
    .wgb-btn-save, .wgb-btn-cancel {
        padding: 10px 15px;
        font-size: 13px;
    }
    .wgb-close-x {
        top: 15px; right: 15px;
    }
    /* Ajustare Preview pe mobil */
    .wgb-preview-card-body {
        max-width: 100%;
        aspect-ratio: auto;
        min-height: 400px;
    }
}