/**
 * Voiles & Traditions — Gift Card Redeem Block Styles
 *
 * Bloc de saisie d'un code carte/bon cadeau avec animation swipe.
 * Utilise les variables CSS du design system (--vtp-*) pour la charte graphique.
 *
 * @since 1.2.0
 */

/* ================================================================
 *  Bloc principal
 * ================================================================ */

.vt-gift-card-redeem-block {
    max-width: 560px;
    margin: 2.5rem auto;
    text-align: center;
    font-family: var(--vtp-font);
}

.vt-gc-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: var(--vtp-primary-dark);
}

/* ================================================================
 *  Slider : conteneur à deux panneaux
 * ================================================================ */

.vt-gc-slider {
    position: relative;
    overflow: hidden;
    /* La hauteur s'adapte au panel actif via JS */
    transition: height 0.5s var(--vtp-ease);
}

.vt-gc-slider-inner {
    display: flex;
    width: 200%;
    transition: transform 0.55s var(--vtp-ease-spring);
    will-change: transform;
}

.vt-gc-panel {
    width: 50%;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Quand le slider est en position "résultat" */
.vt-gc-slider.vt-gc-slid .vt-gc-slider-inner {
    transform: translateX(-50%);
}

/* ================================================================
 *  Formulaire de saisie (Panel 1)
 * ================================================================ */

.vt-gc-form {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    align-items: stretch;
    margin-bottom: 0.75rem;
}

.vt-gc-input {
    flex: 1;
    max-width: 300px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--vtp-text);
    background: var(--vtp-white);
    border: 1px solid var(--vtp-border);
    border-radius: var(--vtp-radius-sm);
    outline: none;
    transition: border-color 0.2s var(--vtp-ease), box-shadow 0.2s var(--vtp-ease);
    text-align: center;
}

.vt-gc-input:focus {
    border-color: var(--vtp-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.vt-gc-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--vtp-font);
    color: var(--vtp-white);
    background: var(--vtp-accent);
    border: none;
    border-radius: var(--vtp-radius-sm);
    cursor: pointer;
    transition: background 0.2s var(--vtp-ease), transform 0.15s var(--vtp-ease);
    white-space: nowrap;
}

.vt-gc-btn:hover {
    background: var(--vtp-accent-dark);
}

.vt-gc-btn:active {
    transform: scale(0.97);
}

.vt-gc-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* ================================================================
 *  Messages
 * ================================================================ */

.vt-gc-message {
    min-height: 1.4em;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    transition: opacity 0.3s var(--vtp-ease);
}

.vt-gc-message-error {
    color: var(--vtp-danger);
    font-weight: 500;
}

.vt-gc-message-success {
    color: var(--vtp-success);
    font-weight: 500;
}

/* Shake pour input invalide */
@keyframes vt-gc-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.vt-gc-shake {
    animation: vt-gc-shake 0.4s ease-in-out;
    border-color: var(--vtp-danger) !important;
}

/* ================================================================
 *  Carte résultat (Panel 2)
 * ================================================================ */

.vt-gc-result {
    max-width: 400px;
    margin: 0 auto;
}

/* Carte */
.vt-gc-card {
    background: var(--vtp-white);
    border: 1px solid var(--vtp-border);
    border-radius: var(--vtp-radius-lg);
    box-shadow: var(--vtp-shadow-md);
    overflow: hidden;
    text-align: left;
    animation: vtpFadeIn 0.45s 0.25s var(--vtp-ease) both;
}

/* Image de présentation (optionnelle) */
.vt-gc-card-image {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center;
    background-color: var(--vtp-primary);
    position: relative;
}

.vt-gc-card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(30, 58, 95, 0.7));
}

.vt-gc-card-image .vt-gc-card-type {
    position: absolute;
    bottom: 12px;
    left: 16px;
    z-index: 1;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--vtp-white);
    background: var(--vtp-accent);
    padding: 4px 10px;
    border-radius: var(--vtp-radius-sm);
}

/* Corps */
.vt-gc-card-body {
    padding: 1.25rem 1.5rem;
}

.vt-gc-card-amount-label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--vtp-text-light, #6b7280);
}

.vt-gc-card-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--vtp-primary-dark);
    line-height: 1.1;
    margin-bottom: 0.3rem;
}

.vt-gc-card-code {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--vtp-text-muted);
    letter-spacing: 0.1em;
}

.vt-gc-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--vtp-border-light);
    font-size: 0.82rem;
    color: var(--vtp-text-light);
}

.vt-gc-card-meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.vt-gc-card-meta-icon {
    font-size: 1rem;
    line-height: 1;
}

/* ================================================================
 *  Boutons d'action (zone multi-boutons)
 * ================================================================ */

.vt-gc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
    margin-top: 1.2rem;
}

.vt-gc-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--vtp-font);
    color: var(--vtp-white);
    border: none;
    border-radius: var(--vtp-radius-sm);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s var(--vtp-ease), transform 0.15s var(--vtp-ease), opacity 0.3s var(--vtp-ease);
    white-space: nowrap;
}

.vt-gc-action-btn:hover {
    color: var(--vtp-white);
    text-decoration: none;
    transform: translateY(-1px);
}

.vt-gc-action-btn:active {
    transform: scale(0.97);
}

.vt-gc-action-icon {
    font-size: 1.1rem;
    line-height: 1;
}

/* Variantes de couleur */
.vt-gc-action-btn--redirect {
    background: var(--vtp-accent);
}

.vt-gc-action-btn--redirect:hover {
    background: var(--vtp-accent-dark);
}

.vt-gc-action-btn--trip {
    background: var(--vtp-primary);
}

.vt-gc-action-btn--trip:hover {
    background: var(--vtp-primary-light);
}

.vt-gc-action-btn--cart {
    background: var(--vtp-success);
}

.vt-gc-action-btn--cart:hover {
    background: #047857;
}

/* Animation échelonnée des boutons */
.vt-gc-action-btn.vt-gc-btn-visible {
    display: inline-flex;
    animation: vtpFadeIn 0.35s var(--vtp-ease) both;
}
.vt-gc-action-btn.vt-gc-btn-visible:nth-child(1) { animation-delay: 0.35s; }
.vt-gc-action-btn.vt-gc-btn-visible:nth-child(2) { animation-delay: 0.5s; }
.vt-gc-action-btn.vt-gc-btn-visible:nth-child(3) { animation-delay: 0.65s; }

/* ================================================================
 *  Bouton Retour
 * ================================================================ */

.vt-gc-back-btn {
    display: block;
    margin: 1.2rem auto 0;
    padding: 0.5rem 1rem;
    /* font-size: 0.85rem; */
    /* font-weight: 500; */
    /* font-family: var(--vtp-font); */
    /* color: var(--vtp-text-light); */
    /* background: none; */
    /* border: none; */
    /* cursor: pointer; */
    /* transition: color 0.2s var(--vtp-ease); */
    /* animation: vtpFadeIn 0.3s 0.6s var(--vtp-ease) both; */
}

.vt-gc-back-btn:hover {
    color: var(--vtp-primary);
}

/* ================================================================
 *  Cartes appliquées dans le panier WooCommerce
 * ================================================================ */

.vt-gc-applied-cards {
    margin: 1rem 0;
    padding: 1rem 1.2rem;
    background: var(--vtp-bg);
    border: 1px solid var(--vtp-border);
    border-radius: var(--vtp-radius);
}

.vt-gc-applied-cards h4 {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--vtp-primary-dark);
}

.vt-gc-applied-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    font-size: 0.88rem;
}

.vt-gc-applied-code {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.vt-gc-applied-type {
    color: var(--vtp-text-light);
    font-size: 0.82rem;
}

.vt-gc-remove {
    margin-left: auto;
    color: var(--vtp-danger);
    font-size: 0.82rem;
    text-decoration: none;
    cursor: pointer;
}

.vt-gc-remove:hover {
    text-decoration: underline;
}

/* ================================================================
 *  Responsive
 * ================================================================ */

@media (max-width: 480px) {
    .vt-gc-form {
        flex-direction: column;
        align-items: stretch;
    }

    .vt-gc-input {
        max-width: none;
    }

    .vt-gc-result {
        max-width: 100%;
    }

    .vt-gc-card-image {
        height: 130px;
    }

    .vt-gc-card-amount {
        font-size: 1.6rem;
    }

    .vt-gc-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .vt-gc-action-btn {
        justify-content: center;
    }
}
