/**
 * STYLE SYSTÈME CARTES CADEAUX - CAND'EOLE
 * Version : 3.6.0 (Optimisation Étapes + Téléportation Étape 3 + Branding)
 */

/* ==========================================================================
   1. NETTOYAGE & MASQUAGE SÉCURISÉ (Fix "Pour" & Panier)
   ========================================================================== */

/* Masquage des champs natifs inutiles */
#pwgc-to, 
label[for="pwgc-to"], 
#pwgc-to-container, 
.pwgc-subtitle, 
#pwgc-quantity-one-per-recipient { 
    display: none !important; 
}

/* On s'assure que le container de personnalisation est prêt pour la téléportation */
#pwgc-purchase-container {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

#cand-gc-recipient-wrapper {
    display: block !important;
}

/* Désactivation Sticky Astra */
.postid-16315 .ast-sticky-add-to-cart,
.page-id-16358 .ast-sticky-add-to-cart {
    display: none !important;
}

/* ==========================================================================
   2. FICHE PRODUIT - SYSTÈME DE SECTIONS (ÉTAPES)
   ========================================================================== */

.cand-step-box {
    background: #fdfbfb; /* Rose très doux Cand'Eole */
    border: 1px solid #e0d8d0;
    padding: 25px 20px 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.cand-step-badge {
    position: absolute;
    top: -12px;
    left: 20px;
    background: #7fb0a2; /* Vert d'eau */
    color: #fff !important;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
}

/* Bloc Montant (Astra) */
.ast-variation-button-group {
    background: #fdfbfb !important;
    border: 1px solid #e0d8d0 !important;
    padding: 20px !important;
    border-radius: 15px !important;
    margin-bottom: 20px !important;
    display: block !important;
}

/* Bloc FINAL : Quantité et Bouton Panier */
.single_variation_wrap {
    background: #fff !important;
    border: 2px solid #7fb0a2 !important;
    padding: 25px 20px !important;
    border-radius: 15px !important;
    margin-top: 30px !important;
    box-shadow: 0 10px 25px rgba(127, 176, 162, 0.1) !important;
}

.woocommerce-variation-add-to-cart {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
}

/* ==========================================================================
   3. FICHE PRODUIT - DESIGN DES CHAMPS & INPUTS
   ========================================================================== */

.cand-gc-header {
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    padding: 20px; border-radius: 12px; border: 1px solid #e0d8d0;
    text-align: center; margin-bottom: 25px;
}

.cand-label-title, .pwgc-label { 
    font-weight: 700 !important; 
    color: #5d5d5d !important; 
    margin-bottom: 12px !important; 
    display: block !important; 
    font-size: 0.95rem !important; 
}

/* Inputs, Selects et Textareas */
.cand-form-section input, 
.cand-select-theme,
#pwgc-message, 
#pw_gift_card_from,
.cand-email-input-v4 {
    width: 100% !important; max-width: 100% !important; box-sizing: border-box !important;
    padding: 12px 15px !important; border: 1px solid #dcd7d0 !important;
    border-radius: 8px !important; font-size: 14px !important;
    background-color: #fff !important;
    transition: all 0.3s ease;
}

#pwgc-message { min-height: 110px !important; resize: none !important; }

input:focus, .cand-select-theme:focus, #pwgc-message:focus, #pw_gift_card_from:focus {
    border-color: #d92b9c !important;
    outline: none !important;
    box-shadow: 0 0 8px rgba(217, 43, 156, 0.1) !important;
}

/* Destinataires dynamique */
.cand-recipient-row { display: flex; align-items: center; margin-bottom: 5px; background: #fff; border: 1px solid #dcd7d0; border-radius: 8px; padding: 4px 12px; }
.cand-recipient-row input { flex: 1; border: none !important; background: transparent !important; box-shadow: none !important; }
.cand-recipient-note { font-size: 0.82rem !important; color: #666 !important; background: rgba(127, 176, 162, 0.05); padding: 10px 12px; border-left: 3px solid #7fb0a2; margin: 10px 0 15px; display: block; border-radius: 0 5px 5px 0; }

/* Bouton Ajouter (Style lien discret) */
.cand-add-btn {
    display: inline-block;
    background: none !important; /* Supprime le fond */
    color: #888 !important; /* Gris neutre au repos */
    padding: 5px 0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    border-bottom: 1px dashed #ccc; /* Petite ligne pointillée discrète */
    margin-top: 10px;
}

.cand-add-btn:hover {
    color: #7fb0a2 !important; /* Passe au vert d'eau au survol */
    border-bottom: 1px solid #7fb0a2; /* La ligne devient pleine */
}

/* Bouton Supprimer (Plus petit et gris) */
.cand-remove-btn {
    color: #bbb; /* Gris très clair pour ne pas polluer l'oeil */
    cursor: pointer;
    font-size: 18px;
    margin-left: 10px;
    line-height: 1;
    transition: 0.2s;
}

.cand-remove-btn:hover {
    color: #d75050; /* Devient rouge uniquement quand on veut supprimer */
}

/* Datepicker & Compteur */
#cand-clear-date { display: none; cursor: pointer; color: #d75050; font-size: 22px; font-weight: bold; padding: 5px 10px; border: 1px solid #f0ece8; border-radius: 8px; background: #fff; }
#cand-char-count { font-size: 11px; color: #999; text-align: right; margin-top: 5px; font-weight: 600; }


/* ==========================================================================
   4. PAGE MON COMPTE - INTERFACE GÉNÉRALE
   ========================================================================== */

.cand-gc-account-wrapper { margin-top: 20px; }
.cand-gc-account-card { background: #fff; padding: 30px; border-radius: 15px; border: 1px solid #f0ece8; box-shadow: 0 4px 15px rgba(0,0,0,0.03); margin-bottom: 30px; }
.cand-gc-form-check { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.cand-gc-input-check { flex: 1; min-width: 250px; padding: 12px; border: 1px solid #ddd; border-radius: 8px; }
.admin-reset-btn { background: #d75050 !important; color: #fff !important; font-size: 10px !important; border: none; }

.cand-gc-history-section { margin-top: 40px; }
.cand-gc-history-title { color: #5d5d5d; font-size: 1.2rem; border-bottom: 2px solid #f0ece8; padding-bottom: 10px; margin-bottom: 20px; }
.cand-gc-table-container { overflow-x: auto; border-radius: 10px; border: 1px solid #f0ece8; background: #fff; }
.cand-gc-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.cand-gc-table th, .cand-gc-table td { padding: 12px; text-align: left; }
.cand-gc-table thead tr { background: #fdfbfb; border-bottom: 1px solid #eee; color: #888; }
.cand-gc-table tbody tr { border-bottom: 1px solid #f9f9f9; }
.cand-gc-empty { padding: 30px; text-align: center; color: #888; font-style: italic; }
.cand-separator { margin: 40px 0; border: 0; border-top: 1px solid #eee; }


/* ==========================================================================
   5. PAGE MON COMPTE - STATUTS & HISTORIQUE
   ========================================================================== */

.cand-history-container { display: flex; flex-direction: column; border: 1px solid #f0ece8; border-radius: 12px; overflow: hidden; background: #fff; }
.cand-history-card-block { padding: 20px; border-bottom: 1px solid #f0ece8; }
.cand-history-card-block:last-child { border-bottom: none; }
.cand-history-card-block:nth-child(even) { background-color: #fdfbfb; }

.cand-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    flex-wrap: nowrap !important;
    gap: 10px;
}

.card-label { font-size: 1rem; color: #5d5d5d; white-space: nowrap; }
.history-code { font-size: 1.1rem !important; color: #d92b9c !important; font-weight: bold; font-family: monospace; }

.status-badge {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px;
    white-space: nowrap;
}
.status-badge .dot { height: 8px; width: 8px; border-radius: 50%; display: inline-block; }
.status-valid { color: #7fb0a2; background: #f0f7f6; } .status-valid .dot { background-color: #7fb0a2; }
.status-empty { color: #d75050; background: #fdf2f2; } .status-empty .dot { background-color: #d75050; }
.status-expired { color: #aaa; background: #f5f5f5; } .status-expired .dot { background-color: #aaa; }
.status-pending { color: #f39c12; background: #fef5e7; } .status-pending .dot { background-color: #f39c12; }

.cand-history-transactions { display: flex; flex-direction: column; gap: 8px; }
.t-line { font-size: 0.9rem; color: #5d5d5d; display: flex; align-items: center; flex-wrap: wrap; line-height: 1.8; }
.cand-copy-btn, .cand-mail-link { font-size: 0.85rem; color: #7fb0a2; cursor: pointer; text-decoration: none; font-weight: 600; }
.cand-copy-feedback { color: #7fb0a2; font-size: 11px; font-weight: bold; margin-left: 10px; border-left: 2px solid #7fb0a2; padding-left: 8px; }


/* ==========================================================================
   6. PAGE HUB SEO - DESIGN VERTICAL & PULSATION
   ========================================================================== */

.cand-hub-pillar { max-width: 1000px; margin: auto; padding: 20px; overflow-x: hidden; }
.cand-hub-header-seo { text-align: center; margin-bottom: 40px; }
.cand-hub-main-title { font-family: 'Spirax', cursive; color: #d92b9c; font-size: 2.8rem; margin-bottom: 5px; }
.cand-hub-main-subtitle { font-size: 1.1rem; color: #666; font-style: italic; }

.cand-hub-full-width-section { width: 100%; margin-bottom: 50px; text-align: center; }
.cand-mini-title { color: #7fb0a2; font-size: 1.6rem; margin-bottom: 20px; font-weight: bold; }

.bandeau-solde {
    background: #fff; padding: 30px; border-radius: 20px;
    border: 1px solid #f0ece8; box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    max-width: 800px; margin: 0 auto;
}
.cand-form-inline { display: flex; gap: 10px; max-width: 500px; margin: 20px auto 0; }
.cand-form-inline input { flex: 1; text-align: center; font-weight: bold; border-radius: 8px !important; border: 1px solid #eee !important; padding: 12px !important; }
.cand-form-inline button { padding: 0 30px; background: #7fb0a2; border: none; border-radius: 8px; color: #fff; cursor: pointer; transition: 0.3s; }
.cand-form-inline button:hover { background: #d92b9c; }

.cand-image-container-vertical { text-align: center; }
.cand-custom-banner-link { 
    display: inline-block; 
    max-width: 450px; 
    width: 100%;
    border-radius: 15px !important; 
    overflow: hidden; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.08); 
    border: 1px solid #f0ece8;
    line-height: 0;
}
.cand-hub-img-promo { width: 100%; height: auto; display: block; transition: 0.5s ease; }

.pulse-effect { animation: cand-subtle-pulse 3s infinite ease-in-out; }
@keyframes cand-subtle-pulse {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.03); filter: brightness(1.05); }
    100% { transform: scale(1); filter: brightness(1); }
}

.cand-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.cand-grid-item { background: #fff; padding: 25px; border-radius: 15px; border: 1px solid #f0ece8; box-shadow: 0 2px 10px rgba(0,0,0,0.02); font-size: 0.95rem; }

.cand-bg-soft { background: #fdfbfb; padding: 40px 30px; border-radius: 25px; margin: 20px 0; }
.cand-disclaimer-box { margin-top: 25px; padding-top: 20px; border-top: 1px solid #eee; }
.cand-disclaimer-box p { font-size: 0.82rem !important; line-height: 1.3 !important; color: #888; margin-bottom: 6px !important; }

.cand-gc-result-success { background: #e6f2f0; padding: 15px; border-radius: 8px; color: #15799e; border: 1px solid #7fb0a2; margin-top: 15px; }
.cand-gc-result-error { background: #fdf2f2; padding: 15px; border-radius: 8px; color: #d75050; margin-top: 20px; text-align: center; border: 1px solid #f8d7da; }


/* ==========================================================================
   7. RESPONSIVE MOBILE
   ========================================================================== */

@media (min-width: 923px) {
    .cand-info-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 922px) {
    .cand-hub-pillar { padding: 15px; }
    .cand-form-inline { flex-direction: column; }
    .cand-form-inline button { width: 100%; margin-top: 10px; padding: 12px; }
    
    .cand-custom-banner-link { max-width: 100%; aspect-ratio: 1/1; }
    .cand-hub-main-title { font-size: 2.2rem; }
    
    .cand-bg-soft { 
        margin-left: -20px !important; 
        margin-right: -20px !important; 
        border-radius: 0 !important; 
        padding: 30px 15px !important;
        width: calc(100% + 40px) !important;
    }
}