/* ============================================
   POPUP DE RECOMENDAÇÃO - CANTO INFERIOR DIREITO
   Design moderno com delay de 3s
   ============================================ */

.recommendation-popup {
    position: fixed;
    bottom: -600px; /* Começa fora da tela */
    right: 30px;
    width: 420px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(255, 107, 53, 0.25),
                0 8px 32px rgba(0, 0, 0, 0.1),
                0 0 0 1px rgba(255, 107, 53, 0.1);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 9999;
    backdrop-filter: blur(10px);
}

/* Estado ativo - aparece após 3s */
.recommendation-popup.active {
    bottom: 30px;
    opacity: 1;
    visibility: visible;
    animation: popupSlideUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popupSlideUp {
    0% {
        bottom: -600px;
        opacity: 0;
        transform: scale(0.85) rotate(-2deg);
    }
    60% {
        bottom: 45px;
        transform: scale(1.03) rotate(1deg);
    }
    80% {
        bottom: 25px;
        transform: scale(0.98) rotate(-0.5deg);
    }
    100% {
        bottom: 30px;
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Header do popup */
.recommendation-header {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C5F 100%);
    padding: 24px;
    color: white;
    position: relative;
    overflow: hidden;
}

.recommendation-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    animation: headerGlow 4s ease-in-out infinite;
}

@keyframes headerGlow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-15px, -15px) scale(1.1); }
}

.recommendation-header h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px 0;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.recommendation-header h3 i {
    font-size: 24px;
    animation: starSpin 3s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

@keyframes starSpin {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-15deg) scale(1.1); }
    50% { transform: rotate(0deg) scale(1.2); }
    75% { transform: rotate(15deg) scale(1.1); }
}

.recommendation-header p {
    font-size: 14px;
    margin: 0;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Botão fechar */
.btn-close-popup {
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.btn-close-popup:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg) scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-close-popup:active {
    transform: rotate(90deg) scale(0.95);
}

/* Conteúdo */
.recommendation-content {
    padding: 24px;
    background: white;
}

/* Card do produto */
.recommendation-product {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #FFF5F0 0%, #FFE8DC 100%);
    border-radius: 16px;
    border: 2px solid rgba(255, 107, 53, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.recommendation-product::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.6) 50%, 
        transparent 100%);
    transition: left 0.6s ease;
}

.recommendation-product:hover::before {
    left: 100%;
}

.recommendation-product:hover {
    background: linear-gradient(135deg, #FFE8DC 0%, #FFD4BE 100%);
    border-color: rgba(255, 107, 53, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.15);
}

.recommendation-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    background: white;
    border: 2px solid rgba(255, 107, 53, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.recommendation-product:hover .recommendation-image {
    border-color: #FF6B35;
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.25);
    transform: scale(1.08) rotate(2deg);
}

.recommendation-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.recommendation-name {
    font-size: 16px;
    font-weight: 700;
    color: #2C3E50;
    margin: 0 0 12px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recommendation-price {
    color: #FF6B35;
    font-size: 26px;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.5px;
}

.recommendation-price::before {
    content: '';
    width: 4px;
    height: 28px;
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C5F 100%);
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

/* Destaque */
.recommendation-highlight {
    background: linear-gradient(135deg, #FFF5F0 0%, #FFE8DC 100%);
    padding: 14px 16px;
    border-radius: 12px;
    border-left: 4px solid #FF6B35;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.08);
    position: relative;
    overflow: hidden;
}

.recommendation-highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.5) 50%, 
        transparent 100%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.recommendation-highlight i {
    color: #FF6B35;
    margin-right: 10px;
    font-size: 18px;
    animation: checkBounce 2s ease-in-out infinite;
}

@keyframes checkBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.recommendation-highlight span {
    color: #2C3E50;
    font-size: 14px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

/* Botões */
.recommendation-actions {
    display: flex;
    gap: 12px;
}

.btn-view-product {
    flex: 1;
    padding: 14px 20px;
    background: white;
    color: #2C3E50;
    border: 2px solid #E0E6ED;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-view-product:hover {
    background: #F5F7FA;
    border-color: #FF6B35;
    color: #FF6B35;
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(255, 107, 53, 0.15);
}

.btn-view-product i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.btn-view-product:hover i {
    transform: scale(1.3);
}

.btn-add-recommendation {
    flex: 1;
    padding: 14px 20px;
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C5F 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-add-recommendation::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-add-recommendation:hover::before {
    width: 300px;
    height: 300px;
}

.btn-add-recommendation:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.45);
}

.btn-add-recommendation i {
    font-size: 16px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.btn-add-recommendation:hover i {
    transform: scale(1.2) rotate(15deg);
}

.btn-add-recommendation span {
    position: relative;
    z-index: 1;
}

.btn-add-recommendation:active {
    transform: translateY(-1px);
}

/* RESPONSIVO - Mobile - VERSÃO COMPACTA */
@media (max-width: 768px) {
    .recommendation-popup {
        width: calc(100% - 30px);
        right: 15px;
        left: 15px;
        border-radius: 16px;
        max-width: 360px;
    }
    
    .recommendation-popup.active {
        bottom: 15px;
    }
    
    .recommendation-header {
        padding: 16px;
    }
    
    .recommendation-header h3 {
        font-size: 17px;
    }
    
    .recommendation-header h3 i {
        font-size: 18px;
    }
    
    .recommendation-header p {
        font-size: 12px;
    }
    
    .btn-close-popup {
        width: 30px;
        height: 30px;
        top: 14px;
        right: 14px;
        font-size: 14px;
    }
    
    .recommendation-content {
        padding: 16px;
    }
    
    .recommendation-product {
        flex-direction: column;
        padding: 12px;
        text-align: center;
        margin-bottom: 14px;
    }
    
    .recommendation-image {
        width: 100%;
        max-width: 140px;
        height: 140px;
        margin: 0 auto;
    }
    
    .recommendation-info {
        align-items: center;
    }
    
    .recommendation-name {
        font-size: 14px;
        text-align: center;
        margin-bottom: 8px;
    }
    
    .recommendation-price {
        font-size: 20px;
        justify-content: center;
    }
    
    .recommendation-price::before {
        height: 22px;
    }
    
    .recommendation-highlight {
        padding: 10px 12px;
        margin-bottom: 14px;
    }
    
    .recommendation-highlight i {
        font-size: 15px;
    }
    
    .recommendation-highlight span {
        font-size: 12px;
    }
    
    .recommendation-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-view-product,
    .btn-add-recommendation {
        width: 100%;
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* Mobile MUITO pequeno (< 400px) - EXTRA COMPACTO */
@media (max-width: 400px) {
    .recommendation-popup {
        width: calc(100% - 20px);
        right: 10px;
        left: 10px;
        max-width: 320px;
        border-radius: 14px;
    }
    
    .recommendation-popup.active {
        bottom: 10px;
    }
    
    .recommendation-header {
        padding: 14px;
    }
    
    .recommendation-header h3 {
        font-size: 15px;
    }
    
    .recommendation-header h3 i {
        font-size: 16px;
    }
    
    .recommendation-header p {
        font-size: 11px;
    }
    
    .btn-close-popup {
        width: 28px;
        height: 28px;
        top: 12px;
        right: 12px;
        font-size: 13px;
    }
    
    .recommendation-content {
        padding: 14px;
    }
    
    .recommendation-product {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .recommendation-image {
        max-width: 120px;
        height: 120px;
    }
    
    .recommendation-name {
        font-size: 13px;
    }
    
    .recommendation-price {
        font-size: 18px;
    }
    
    .recommendation-price::before {
        height: 20px;
        width: 3px;
    }
    
    .recommendation-highlight {
        padding: 8px 10px;
        margin-bottom: 12px;
    }
    
    .recommendation-highlight i {
        font-size: 14px;
        margin-right: 6px;
    }
    
    .recommendation-highlight span {
        font-size: 11px;
    }
    
    .recommendation-actions {
        gap: 6px;
    }
    
    .btn-view-product,
    .btn-add-recommendation {
        padding: 10px 14px;
        font-size: 12px;
    }
    
    .btn-view-product i,
    .btn-add-recommendation i {
        font-size: 14px;
    }
}

/* Acessibilidade - Redução de movimento */
@media (prefers-reduced-motion: reduce) {
    .recommendation-popup,
    .recommendation-popup.active,
    .recommendation-header::before,
    .recommendation-product::before,
    .recommendation-highlight::before {
        animation: none;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .recommendation-popup.active {
        bottom: 30px;
    }
}