/**
 * Estilos frontend do módulo de brindes
 * Design responsivo e moderno para a barra de progresso
 *
 * @package CraftandoTools
 * @since 3.0.0
 */

/* === BASE MODERNIZADA === */
.craftando-gifts-progress {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 2rem 0;
    background: none;
    border-radius: 16px;
    box-shadow: none;
    overflow: hidden;
    border: none;
    position: relative;
}



.gifts-progress-container {
    padding: 1.5rem;
    position: relative;
    backdrop-filter: blur(10px);
}

/* === LAYOUT CHECKOUT ELEGANTE E MINIMALISTA === */
.progress-info-checkout {
    text-align: center;
    padding: 16px;
    background: #ffffff;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid #e5e7eb;
}

.progress-message-checkout {
    font-size: 1rem;
    font-weight: 500;
    color: #374151;
    line-height: 1.4;
    margin-bottom: 8px;
}

.progress-status-checkout {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 400;
}

/* Checkout - design mais limpo e compacto */
.woocommerce-checkout .craftando-gifts-progress {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.woocommerce-checkout .gifts-progress-container {
    padding: 14px 18px !important;
}

.woocommerce-checkout .progress-bar {
    height: 8px !important;
    margin-top: 8px;
    background: #e9ecef;
}

.woocommerce-checkout .progress-fill {
    border-radius: 4px;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%) !important;
}

.woocommerce-checkout .progress-bar-wrapper {
    margin-top: 8px;
}

/* Ocultar botão no checkout */
.woocommerce-checkout .gifts-action-button {
    display: none;
}

/* === LAYOUT CARRINHO OTIMIZADO === */
.progress-info-cart {
    text-align: center;
    padding-bottom: 8px;
}

.progress-message-cart {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.4;
}

/* Barra segmentada elegante para carrinho */
.progress-bar-segmented {
    display: flex;
    gap: 2px;
    height: 4px;
    margin-top: 12px;
    background: #f8fafc;
    border-radius: 4px;
    overflow: hidden;
}

.progress-segment {
    flex: 1;
    background: #e2e8f0;
    transition: background-color 0.4s ease;
}

.progress-segment.completed {
    background: #10b981;
}

.progress-segment.current {
    background: #6366f1;
}

.progress-segment.pending {
    background: #e2e8f0;
}

.segment-fill {
    height: 100%;
    background: inherit;
    transition: width 0.5s ease;
}

/* Carrinho - design específico */
.woocommerce-cart .craftando-gifts-progress {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.woocommerce-cart .gifts-progress-container {
    padding: 16px 20px !important;
}

/* === BETHEME DESIGN CUSTOMIZADO === */
.progress-info-betheme {
    margin: 0;
    padding: 0;
    background: none;
}

.progress-header-betheme {
    font-size: 12px;
    color: #9ca3af;
    margin: 0 0 4px 0;
    line-height: 1;
    text-align: center;
    font-weight: bold;
}

.progress-track-betheme {
    display: flex;
    height: 15px;
    background: #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.progress-segment-betheme {
    flex: 1;
    position: relative;
    border-right: 1px solid rgba(255,255,255,0.3);
    background: #d1d5db;
    overflow: hidden;
}

.progress-segment-betheme:last-child {
    border-right: none;
}

.progress-segment-betheme.completed {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

.progress-segment-fill-betheme {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
    transition: width 0.5s ease;
    width: 0%;
}

.progress-labels-betheme {
    display: flex;
    margin: 2px 0 0 0;
}

.progress-label-betheme {
    flex: 1;
    text-align: center;
    font-size: 0.6rem;
    color: #6b7280;
    line-height: 1;
}

@keyframes pulse {
    0%, 100% { 
        box-shadow: 
            0 3px 12px rgba(59, 130, 246, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }
    50% { 
        box-shadow: 
            0 5px 20px rgba(59, 130, 246, 0.6),
            inset 0 1px 0 rgba(255, 255, 255, 0.7);
    }
}

/* === ESTILO MODERNO === */
.craftando-gifts-progress.style-modern .progress-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.craftando-gifts-progress.style-modern .progress-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.craftando-gifts-progress.style-modern .progress-message {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.4;
}

.craftando-gifts-progress.style-modern .progress-bar-wrapper {
    position: relative;
}

.craftando-gifts-progress.style-modern .progress-bar {
    position: relative;
    height: 4px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.craftando-gifts-progress.style-modern .progress-fill {
    height: 100%;
    background: #10b981;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.craftando-gifts-progress.style-modern .progress-percentage {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: #059669;
    background: rgba(255,255,255,0.9);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* === ESTILO CLÁSSICO === */
.craftando-gifts-progress.style-classic .classic-progress {
    text-align: center;
}

.craftando-gifts-progress.style-classic .progress-text {
    font-size: 1rem;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 1rem;
}

.craftando-gifts-progress.style-classic .progress-bar {
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.craftando-gifts-progress.style-classic .progress-fill {
    height: 100%;
    background: #667eea;
    border-radius: 6px;
    transition: width 0.6s ease;
}

/* === ESTILO MINIMALISTA === */
.craftando-gifts-progress.style-minimal .minimal-progress {
    /* Remover padding extra do container para estilo minimal */
}

.craftando-gifts-progress.style-minimal .gifts-progress-container {
    padding: 1rem;
}

.craftando-gifts-progress.style-minimal .progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.craftando-gifts-progress.style-minimal .progress-message {
    font-size: 0.875rem;
    color: #4a5568;
}

.craftando-gifts-progress.style-minimal .progress-percent {
    font-size: 0.75rem;
    font-weight: 600;
    color: #667eea;
}

.craftando-gifts-progress.style-minimal .progress-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.craftando-gifts-progress.style-minimal .progress-fill {
    height: 100%;
    background: #667eea;
    border-radius: 2px;
    transition: width 0.4s ease;
}

/* === BRINDES ATUAIS === */
.current-gifts {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.gifts-title {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gifts-title::before {
    content: "🎁";
    font-size: 1.125rem;
}

.gifts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gift-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.gift-thumbnail {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    background: #edf2f7;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.gift-placeholder {
    font-size: 1.5rem;
    opacity: 0.6;
}

.gift-details {
    flex: 1;
}

.gift-name {
    font-weight: 500;
    color: #2d3748;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.gift-description {
    font-size: 0.75rem;
    color: #718096;
    line-height: 1.4;
}

/* === GIFT ITEM LAYOUT === */
.gift-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.gift-price-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gift-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: #c6f6d5;
    color: #276749;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.gift-badge .dashicons {
    font-size: 0.875rem;
    width: 0.875rem;
    height: 0.875rem;
}

/* === PRÓXIMOS TIERS === */
.upcoming-tiers {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.tiers-title {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tiers-title::before {
    content: "🎯";
    font-size: 1.125rem;
}

.tiers-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.tier-preview {
    text-align: center;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.tier-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.tier-value {
    font-weight: 600;
    color: #667eea;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.tier-product .product-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    background: #edf2f7;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem auto;
}

.tier-product .product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-placeholder {
    font-size: 1.25rem;
    opacity: 0.6;
}

.tier-product .product-name {
    font-size: 0.75rem;
    color: #4a5568;
    line-height: 1.3;
    font-weight: 500;
}

/* === RESPONSIVO === */
@media (max-width: 768px) {
    .craftando-gifts-progress {
        margin: 1.5rem 0;
        border-radius: 8px;
    }
    
    .gifts-progress-container {
        padding: 1rem;
    }
    
    .craftando-gifts-progress.style-modern .progress-header {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .craftando-gifts-progress.style-modern .progress-message {
        font-size: 1rem;
    }
    
    .gifts-list {
        gap: 0.5rem;
    }
    
    .gift-item {
        padding: 0.5rem;
        gap: 0.75rem;
    }
    
    .gift-thumbnail {
        width: 40px;
        height: 40px;
    }
    
    .gift-name {
        font-size: 0.8125rem;
    }
    
    .gift-badge {
        padding: 0.25rem 0.5rem;
        font-size: 0.6875rem;
    }
    
    .tiers-preview {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.75rem;
    }
    
    .tier-preview {
        padding: 0.75rem 0.5rem;
    }
    
    .tier-product .product-thumbnail {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .craftando-gifts-progress.style-modern .progress-percentage {
        position: static;
        transform: none;
        margin-top: 0.5rem;
        text-align: center;
        background: none;
        padding: 0;
    }
    
    .gift-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .tiers-preview {
        grid-template-columns: 1fr;
    }
}

/* === ANIMAÇÕES === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.craftando-gifts-progress {
    animation: fadeInUp 0.6s ease-out;
}

.gift-item,
.tier-preview {
    animation: fadeInUp 0.4s ease-out;
}

.gift-item:nth-child(2) { animation-delay: 0.1s; }
.gift-item:nth-child(3) { animation-delay: 0.2s; }
.tier-preview:nth-child(2) { animation-delay: 0.1s; }
.tier-preview:nth-child(3) { animation-delay: 0.2s; }

/* === INTEGRAÇÃO COM TEMAS === */
.woocommerce .craftando-gifts-progress {
    margin: 1rem 0;
}

.cart-collaterals .craftando-gifts-progress {
    margin-bottom: 1.5rem;
}

/* === DARK MODE SUPPORT === */
@media (prefers-color-scheme: dark) {
    .craftando-gifts-progress {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .craftando-gifts-progress.style-modern .progress-message,
    .gifts-title,
    .tiers-title,
    .gift-name {
        color: #e2e8f0;
    }
    
    .gift-item,
    .tier-preview {
        background: #4a5568;
        border-color: #718096;
    }
    
    .current-gifts,
    .upcoming-tiers {
        border-color: #4a5568;
    }
}

/* === BETHEME INTEGRATION - MODERN LAYOUT === */
/* BeTheme integration - ultra clean */
.mfn-ch-gifts-progress {
    margin: 8px 0;
    padding: 0;
}

.mfn-ch-gifts-progress .craftando-gifts-progress {
    margin: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 11px;
}

.mfn-ch-gifts-progress .gifts-progress-container {
    padding: 6px !important;
}

/* Layout moderno com flexbox */
.mfn-ch-gifts-progress .progress-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}


.mfn-ch-gifts-progress .progress-icon {
    width: 32px !important;
    height: 32px !important;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.mfn-ch-gifts-progress .progress-icon svg {
    width: 16px;
    height: 16px;
}

.mfn-ch-gifts-progress .progress-details {
    flex: 1;
}

.mfn-ch-gifts-progress .progress-message {
    font-size: 0.85rem !important;
    color: #1e293b;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 2px;
}

.mfn-ch-gifts-progress .progress-status {
    font-size: 0.7rem !important;
    color: #64748b;
    font-weight: 400;
}

/* Barra de progresso moderna */
.mfn-ch-gifts-progress .progress-bar-wrapper {
    width: 100%;
}

.mfn-ch-gifts-progress .progress-bar {
    height: 5px !important;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.mfn-ch-gifts-progress .progress-fill {
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 50%, #15803d 100%) !important;
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.mfn-ch-gifts-progress .progress-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* === GIFT ITEMS NO CARRINHO BETHEME - DESIGN LIMPO === */
.mfn-cart-holder .mfn-gift-item {
    background: #ffffff;
    border: 1px solid #f0f9ff;
    border-radius: 12px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.mfn-cart-holder .mfn-gift-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.mfn-cart-holder .mfn-gift-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #e6fffa;
}

.mfn-cart-holder .mfn-gift-item .mfn-chp-name a {
    color: #15803d !important;
    font-weight: 500;
}

.mfn-cart-holder .mfn-gift-item .gift-description {
    font-size: 0.8rem;
    color: #65a30d;
    font-style: italic;
    margin-top: 2px;
}

.mfn-cart-holder .mfn-gift-item .gift-price {
    color: #15803d !important;
    font-weight: 500;
}

.mfn-cart-holder .mfn-gift-item .gift-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.2);
}

.mfn-cart-holder .mfn-gift-item .gift-value {
    color: #22c55e !important;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

.mfn-chp-quantity {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #6b7280;
    font-size: 0.8rem;
}

.mfn-chp-quantity .quantity-label {
    font-weight: 500;
}

.mfn-chp-quantity .quantity-value {
    font-weight: 600;
    color: #374151;
}

.mfn-cart-holder .mfn-gift-item .gift-status {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #16a34a;
    font-size: 0.8rem;
    font-weight: 500;
}

.mfn-cart-holder .mfn-gift-item .gift-status svg {
    color: #22c55e;
}

.mfn-cart-holder .mfn-gift-item .gift-placeholder {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #10b981;
    font-size: 20px;
    border: 1px solid #a7f3d0;
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.1);
}

/* Remover animação desnecessária para design mais limpo */
.mfn-cart-holder .mfn-gift-item {
    /* Animação removida para design mais limpo */
}

/* === BOTÃO DE AÇÃO DOS BRINDES === */
.gifts-action-button {
    margin-top: 12px;
    text-align: center;
}

.btn-continue-shopping {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.btn-continue-shopping:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    color: white;
    text-decoration: none;
}

.btn-continue-shopping svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* BeTheme specific */
.mfn-ch-gifts-progress .gifts-action-button {
    margin-top: 8px;
}

.mfn-ch-gifts-progress .btn-continue-shopping {
    font-size: 0.8rem;
    padding: 6px 12px;
}

.mfn-ch-gifts-progress .btn-continue-shopping svg {
    width: 14px;
    height: 14px;
}

/* === ESTILOS PARA PREÇOS DE BRINDES === */
.gift-price-display {
    color: #10b981 !important;
    font-weight: 600;
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gift-subtotal-display {
    color: #10b981 !important;
    font-weight: 600;
}

.gift-subtotal-display small {
    color: #059669;
    font-weight: 400;
    font-style: italic;
}

/* Estilos específicos para carrinho WooCommerce */
.woocommerce-cart .gift-price-display,
.woocommerce-checkout .gift-price-display {
    display: inline-block;
    margin-left: 4px;
}

.woocommerce-cart .gift-subtotal-display,
.woocommerce-checkout .gift-subtotal-display {
    font-size: 1.1rem;
}

/* Mobile - responsivo moderno */
@media (max-width: 767px) {
    .mfn-ch-gifts-progress .gifts-progress-container {
        padding: 12px !important;
    }
    
    
    .mfn-ch-gifts-progress .progress-icon {
        width: 32px !important;
        height: 32px !important;
    }
    
    .mfn-ch-gifts-progress .progress-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .mfn-ch-gifts-progress .progress-message {
        font-size: 0.85rem !important;
    }
    
    .mfn-ch-gifts-progress .progress-status {
        font-size: 0.7rem !important;
    }
    
    .gift-price-display {
        font-size: 0.7rem;
        padding: 1px 6px;
    }
    
    .btn-continue-shopping {
        font-size: 0.75rem;
        padding: 6px 12px;
        gap: 6px;
    }
    
    .btn-continue-shopping svg {
        width: 14px;
        height: 14px;
    }
    
    /* Checkout mobile */
    .woocommerce-checkout .gifts-progress-container {
        padding: 12px 14px !important;
    }
    
    .progress-message-checkout {
        font-size: 0.9rem;
    }
    
    .progress-status-checkout {
        font-size: 0.8rem;
    }
    
    /* Carrinho mobile */
    .woocommerce-cart .gifts-progress-container {
        padding: 14px 16px !important;
    }
    
    .progress-message-cart {
        font-size: 0.9rem;
    }
    
    .progress-bar-segmented {
        height: 10px;
        gap: 3px;
    }
}