/* ========================================
   ORDER BUMP - LAYOUT IGUAL AO PREVIEW ADMIN
======================================== */

div#order-bump-sempre-visivel, div#order-bump-apenas-pagamento {
    margin-bottom: 20px;
}

.order-bump-resumo .order-bump-container {
    border-radius: 10px;
    background: #f8f9ff;
    overflow: hidden;
    animation: order-bump-pulse 4s ease-in-out infinite;
}

.order-bump-resumo .order-bump-header {
    padding: 15px;
    text-align: center;
}

.order-bump-resumo .order-bump-header h4 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
}

.order-bump-resumo .order-bump-content {
    padding: 20px;
}

.order-bump-resumo .order-bump-produto {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

/* Atualizar para usar .order-bump-imagem ao invés de .produto-thumb */
.order-bump-resumo .order-bump-imagem {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    border: 1px solid var(--color-gray-200);
    margin-right: 15px;
}

.order-bump-resumo .order-bump-imagem img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-fast);
}

.order-bump-resumo .order-bump-imagem:hover img {
    transform: scale(1.05);
}

/* Atualizar para usar .order-bump-info */
.order-bump-resumo .order-bump-info {
    flex: 1;
    min-width: 0;
}

.order-bump-resumo .order-bump-nome {
    margin: 0 0 5px 0;
    color: #333;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
}

.order-bump-resumo .order-bump-descricao {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 0.8rem;
    line-height: 1.3;
}

/* Atualizar para usar .order-bump-precos */
.order-bump-resumo .order-bump-precos {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    align-items: center;
}

.order-bump-resumo .preco-original {
    color: var(--color-gray-400);
    text-decoration: line-through;
    font-size: 0.8rem;
}

.order-bump-resumo .preco-desconto,
.order-bump-resumo .preco-normal {
    color: var(--color-primary);
    font-weight: 700;
    font-size: 0.9rem;
}

.order-bump-resumo .economia-tag {
    background: var(--color-success);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Atualizar para usar .order-bump-acao */
.order-bump-resumo .order-bump-acao {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.order-bump-resumo .order-bump-checkbox {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: bold;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 6px;
    transition: var(--transition-normal);
    border: none;
    text-decoration: none;
}

.order-bump-resumo .order-bump-checkbox:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    color: white;
}

.order-bump-resumo .order-bump-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: white;
}

.order-bump-resumo .order-bump-checkbox .checkbox-text {
    font-size: 1em;
    color: inherit;
}

.order-bump-resumo .checkmark {
    font-size: 1em;
    color: inherit;
}

/* Urgência para depois_pagamento */
.order-bump-resumo .order-bump-urgencia {
    text-align: center;
    background: #f8d7da;
    color: #721c24;
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: var(--spacing-md);
    border: 1px solid #f8d7da;
    animation: urgency-glow 3s ease-in-out infinite;
}

@keyframes urgency-glow {
    0%, 100% { background: #f8d7da; }
    50% { background: #f8d7da; }
}

/* Variante para depois_pagamento */
.order-bump-payment-only .order-bump-container {
    border-color: var(--color-danger);
    animation: urgent-pulse 2s ease-in-out infinite;
}

.order-bump-payment-only .order-bump-header {
    background: linear-gradient(135deg, var(--color-danger) 0%, #c82333 100%);
}

.order-bump-payment-only .order-bump-urgencia {
    background: #f8d7da;
    color: #721c24;
    border-color: #f1aeb5;
    animation: urgency-glow-red 3s ease-in-out infinite;
}

@keyframes urgent-pulse {
    0%, 100% { border-color: var(--color-danger); }
    50% { border-color: #a71e2a; }
}

@keyframes urgency-glow-red {
    0%, 100% { background: #f8d7da; }
    50% { background: #f5c6cb; }
}

/* Responsivo */
@media (max-width: 768px) {
    .order-bump-resumo .order-bump-produto {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }

    .order-bump-resumo .order-bump-imagem {
        align-self: center;
        width: 60px;
        height: 60px;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .order-bump-resumo .order-bump-precos {
        justify-content: center;
    }
    
    .order-bump-resumo .order-bump-checkbox {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.8rem;
    }
    
    .order-bump-resumo .order-bump-header {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .order-bump-resumo .order-bump-content {
        padding: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .order-bump-resumo .order-bump-nome {
        font-size: 0.85rem;
    }
    
    .order-bump-resumo .order-bump-descricao {
        font-size: 0.75rem;
    }
    
    .order-bump-resumo .order-bump-precos {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-xs);
    }
    
    .order-bump-resumo .economia-tag {
        font-size: 0.65rem;
    }
}

/* ========================================
   🆕 ORDER BUMP POPUP - ESTILOS ADICIONAIS
======================================== */

/* Estilos base para o popup */
.order-bump-popup-overlay {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: orderBumpFadeIn 0.3s ease-out;
    pointer-events: auto;
}

.order-bump-popup-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: orderBumpSlideIn 0.3s ease-out;
    position: relative;
    pointer-events: all;
}

/* Animações do popup */
@keyframes orderBumpFadeIn {
    from { 
        opacity: 0; 
    }
    to { 
        opacity: 1; 
    }
}

@keyframes orderBumpSlideIn {
    from { 
        opacity: 0; 
        transform: translateY(-20px) scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

@keyframes orderBumpFadeOut {
    from { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
    to { 
        opacity: 0; 
        transform: translateY(-20px) scale(0.9); 
    }
}

@keyframes orderBumpSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Spinner animado */
.order-bump-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: orderBumpSpin 1s linear infinite;
    margin: 0 auto 20px;
}

/* Estados do popup */
.order-bump-popup-overlay.closing {
    animation: orderBumpFadeOut 0.3s ease-out;
}

.order-bump-popup-overlay.closing .order-bump-popup-content {
    animation: orderBumpFadeOut 0.3s ease-out;
}

/* Popup de sucesso */
.order-bump-popup-content.success {
    border-left: 4px solid #28a745;
}

.order-bump-popup-content.success .order-bump-spinner {
    border-color: #f3f3f3;
    border-top-color: #28a745;
}

/* Popup de erro */
.order-bump-popup-content.error {
    border-left: 4px solid #dc3545;
}

.order-bump-popup-content.error .order-bump-spinner {
    border-color: #f3f3f3;
    border-top-color: #dc3545;
}

/* Títulos e textos do popup */
.order-bump-popup-content h3 {
    margin: 0 0 10px 0 !important;
    color: #333;
    font-size: 18px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.order-bump-popup-content p {
    margin: 0 !important;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Estados específicos do texto */
.order-bump-popup-content.success h3 {
    color: #28a745;
}

.order-bump-popup-content.error h3 {
    color: #dc3545;
}

/* Prevenção de scroll no body quando popup está ativo */
body.order-bump-popup-active {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Barra superior colorida */
.order-bump-popup-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #007cba, #28a745);
    border-radius: 12px 12px 0 0;
}

.order-bump-popup-content.success::before {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.order-bump-popup-content.error::before {
    background: linear-gradient(90deg, #dc3545, #fd7e14);
}

/* Responsividade do popup */
@media (max-width: 768px) {
    .order-bump-popup-content {
        padding: 20px;
        margin: 20px;
        max-width: calc(100% - 40px);
    }
    
    .order-bump-popup-content h3 {
        font-size: 16px !important;
    }
    
    .order-bump-popup-content p {
        font-size: 13px !important;
    }
    
    .order-bump-spinner {
        width: 30px;
        height: 30px;
        border-width: 3px;
    }
}

/* Suporte para movimento reduzido */
@media (prefers-reduced-motion: reduce) {
    .order-bump-popup-overlay,
    .order-bump-popup-content,
    .order-bump-spinner {
        animation: none !important;
    }
    
    .order-bump-spinner {
        border-top-color: transparent;
    }
}

/* Modo escuro (opcional) */
@media (prefers-color-scheme: dark) {
    .order-bump-popup-content {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .order-bump-popup-content h3 {
        color: #e2e8f0 !important;
    }
    
    .order-bump-popup-content p {
        color: #a0aec0 !important;
    }
    
    .order-bump-popup-content.success h3 {
        color: #68d391 !important;
    }
    
    .order-bump-popup-content.error h3 {
        color: #fc8181 !important;
    }
}