/**
 * WC Gift Progress - Frontend Styles
 * Integração visual com Side Cart WooCommerce
 */

/* Container Principal */
.wcgp-gift-progress-wrapper {
    padding: 15px 20px;
    background-color: var(--wcgp-card-bg-color, #fff8f5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-family: inherit;
}

/* Texto de Progresso */
.wcgp-progress-text {
    text-align: center;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--wcgp-text-color, #333);
    font-weight: 500;
    line-height: 1.4;
}

.wcgp-remaining-text,
.wcgp-complete-text {
    display: block;
}

.wcgp-complete-text {
    color: #2e7d32;
    font-weight: 600;
}

/* Container da Barra de Progresso */
.wcgp-progress-bar-container {
    position: relative;
    padding-right: 70px;
    margin-bottom: 15px;
}

/* Barra de Progresso */
.wcgp-progress-bar {
    height: 8px;
    background-color: var(--wcgp-bar-bg-color, #f5d5c8);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.wcgp-progress-bar-fill {
    height: 100%;
    background-color: var(--wcgp-bar-color, #e8734a);
    border-radius: 10px;
    transition: width 0.5s ease-out;
    position: relative;
}

/* Animação de brilho na barra */
.wcgp-progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: wcgp-shimmer 2s infinite;
}

@keyframes wcgp-shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Checkpoint */
.wcgp-checkpoint {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.wcgp-checkpoint-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #fff;
    border: 3px solid var(--wcgp-bar-bg-color, #f5d5c8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.wcgp-checkpoint-achieved .wcgp-checkpoint-icon {
    background-color: var(--wcgp-bar-color, #e8734a);
    border-color: var(--wcgp-bar-color, #e8734a);
    animation: wcgp-pulse 0.5s ease-out;
}

@keyframes wcgp-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.wcgp-checkpoint-info {
    margin-top: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wcgp-checkpoint-value {
    font-size: 10px;
    color: var(--wcgp-text-color, #333);
    font-weight: 600;
    white-space: nowrap;
}

.wcgp-checkpoint-label {
    font-size: 9px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Card do Brinde */
.wcgp-gift-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 12px;
    border: 1px dashed var(--wcgp-bar-bg-color, #f5d5c8);
    transition: all 0.3s ease;
}

.wcgp-completed .wcgp-gift-card {
    border-color: var(--wcgp-bar-color, #e8734a);
    border-style: solid;
    box-shadow: 0 2px 8px rgba(232, 115, 74, 0.2);
}

.wcgp-gift-card-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wcgp-gift-image {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    background-color: #f5f5f5;
}

.wcgp-gift-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wcgp-gift-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background-color: #4caf50;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.wcgp-gift-info {
    flex: 1;
    min-width: 0;
}

.wcgp-gift-name {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--wcgp-text-color, #333);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wcgp-gift-description {
    display: block;
    font-size: 11px;
    color: #888;
    line-height: 1.3;
}

/* Estado Completado */
.wcgp-completed .wcgp-progress-bar-fill {
    width: 100% !important;
}

.wcgp-completed .wcgp-gift-card {
    animation: wcgp-celebrate 0.6s ease-out;
}

@keyframes wcgp-celebrate {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.02);
    }
    75% {
        transform: scale(0.98);
    }
}

/* Responsivo */
@media (max-width: 480px) {
    .wcgp-gift-progress-wrapper {
        padding: 12px 15px;
    }
    
    .wcgp-progress-text {
        font-size: 13px;
    }
    
    .wcgp-checkpoint-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .wcgp-gift-image {
        width: 45px;
        height: 45px;
    }
    
    .wcgp-gift-name {
        font-size: 12px;
    }
    
    .wcgp-gift-description {
        font-size: 10px;
    }
}

/* Transições suaves para atualizações AJAX */
.wcgp-gift-progress-wrapper *:not(.wcgp-complete-text) {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Animação pulsante do texto de meta atingida */
.wcgp-complete-text {
    display: inline-block;
    animation: wcgp-text-pulse 1.5s ease-in-out infinite;
}

@keyframes wcgp-text-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.02);
    }
}
