/**
 * Order Bumps Stylesheet
 * Connect E-Commerce Module
 *
 * Estilos dedicados para a seção de Order Bumps
 * nas páginas de detalhes de produtos
 */

/* Container Principal */
.order-bumps-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 40px 0;
    margin: 40px 0;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.order-bumps-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

/* Grid de Cards */
.order-bumps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Quando houver apenas 1 item, centralizar e limitar largura */
.order-bumps-grid:has(.order-bump-card:only-child) {
    grid-template-columns: 1fr;
    max-width: 400px;
}

/* Quando houver 2 itens, usar 50% cada */
.order-bumps-grid:has(.order-bump-card:nth-child(2):last-child) {
    grid-template-columns: repeat(2, 1fr);
}

/* Card Individual */
.order-bump-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.order-bump-card:hover {
    box-shadow: 0 8px 24px rgba(22, 163, 74, 0.15);
    transform: translateY(-4px);
    border-color: #16A34A;
}

/* Imagem do Produto */
.order-bump-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 60%;
    background: #f5f5f5;
    overflow: hidden;
}

.order-bump-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.order-bump-card:hover .order-bump-image {
    transform: scale(1.05);
}

/* Conteúdo do Card */
.order-bump-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Título do Produto */
.order-bump-title-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Headline/Badge */
.order-bump-headline {
    display: block;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

/* Seção de Preços */
.order-bump-pricing {
    margin-bottom: 12px;
}

.order-bump-price-from {
    display: flex;
    align-items: baseline;
    gap: 6px;
    color: #999;
    font-size: 12px;
    margin-bottom: 4px;
}

.order-bump-price-from-label {
    font-weight: 500;
}

.order-bump-price-original {
    text-decoration: line-through;
    font-size: 14px;
}

.order-bump-price-to {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.order-bump-price-to-label {
    color: #333;
    font-size: 12px;
    font-weight: 500;
}

.order-bump-price-final {
    font-size: 26px;
    font-weight: 700;
    color: #16A34A;
}

/* Descrição */
.order-bump-description {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Botão de Compra */
.btn-add-order-bump {
    background: linear-gradient(135deg, #16A34A 0%, #15803d 100%);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-add-order-bump:hover:not(:disabled) {
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.3);
    transform: translateY(-2px);
}

/* Hover para botão "Ver Produto" (Produtos Relacionados) */
.btn-add-order-bump[href]:hover {
    background: #128a3a !important;
    color: #fff !important;
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.3) !important;
}

.btn-add-order-bump:active:not(:disabled) {
    transform: translateY(0);
}

.btn-add-order-bump:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-add-order-bump.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-add-order-bump i {
    font-size: 16px;
}

/* Loading State */
.btn-add-order-bump .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsividade - Tablet */
@media (max-width: 992px) {
    .order-bumps-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .order-bumps-title {
        font-size: 22px;
    }
}

/* Responsividade - Mobile */
@media (max-width: 768px) {
    .order-bumps-section {
        padding: 30px 15px;
        margin: 30px 0;
    }

    .order-bumps-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .order-bumps-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .order-bump-content {
        padding: 15px;
    }

    .order-bump-title-text {
        font-size: 15px;
    }

    .order-bump-price-final {
        font-size: 24px;
    }

    .btn-add-order-bump {
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* Animação de Entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.order-bump-card {
    animation: fadeInUp 0.5s ease-out;
}

.order-bump-card:nth-child(1) {
    animation-delay: 0.1s;
}

.order-bump-card:nth-child(2) {
    animation-delay: 0.2s;
}

.order-bump-card:nth-child(3) {
    animation-delay: 0.3s;
}

/* Badge de Economia */
.order-bump-savings {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc2626;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}
