/* ============================================
   Garimpo Ofertas - Estilos Personalizados
   ============================================ */

/* Configuração de cores personalizadas */
:root {
    --bg-main: #212121;
    --bg-container: #303030;
    --text-main: #ffffff;
    --whatsapp-green: #10c245;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    padding-top: 50px; /* Espaço para o header fixo */
}

@media (min-width: 768px) {
    body {
        padding-top: 60px;
    }
}

.container-custom {
    background-color: var(--bg-container);
}

/* Animação de pulse para o botão flutuante */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* Animação de ondas pulsantes para o botão WhatsApp */
@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.85;
    }
    50% {
        opacity: 0.45;
    }
    100% {
        transform: scale(2.8);
        opacity: 0;
    }
}

.whatsapp-button-wrapper {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 64px;
}

.whatsapp-button-wrapper > a {
    position: relative;
    z-index: 100;
}

.whatsapp-button-ripple {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 50%;
    width: 64px;
    height: 64px;
    animation: ripple 1.8s infinite;
    pointer-events: none;
    z-index: 1;
}

.whatsapp-button-ripple:nth-child(1) {
    /* verde principal (mais escuro) */
    background-color: #10c245;
    animation-delay: 0s;
}

.whatsapp-button-ripple:nth-child(2) {
    /* verde vivo */
    background-color: #22c55e;
    animation-delay: 0.35s;
}

.whatsapp-button-ripple:nth-child(3) {
    /* esverdeado amarelado */
    background-color: #528506;
    animation-delay: 0.7s;
}

.whatsapp-button-ripple:nth-child(4) {
    /* verde puxado pro turquesa */
    background-color: #14b8a6;
    animation-delay: 1.05s;
}

.whatsapp-button-ripple:nth-child(5) {
    /* verde bem claro quase aqua */
    background-color: #6ee7b7;
    animation-delay: 1.4s;
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.bounce-animation {
    animation: bounce 1s infinite;
}

/* Estilo do botão flutuante */
.floating-whatsapp {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    opacity: 1;
    transform: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    -webkit-tap-highlight-color: transparent;
}

/* Animação de pulse específica para mobile - apenas escala suave, sem quebrar viewport */
@keyframes pulse-mobile {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
}

@media (max-width: 767px) {
    /* Prevenir overflow horizontal em toda a página */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
        position: relative;
    }
    
    /* Garantir que elementos principais não ultrapassem a viewport */
    body > * {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* Garantir que o botão flutuante fique completamente fixo */
    .floating-whatsapp {
        position: fixed !important;
        bottom: 15px !important;
        right: 15px !important;
        left: auto !important;
        top: auto !important;
        z-index: 1000;
        /* Remover todas as animações e transições do container */
        animation: none !important;
        transition: none !important;
        transform: none !important;
        /* Tamanho base do container do botão */
        width: 64px;
        height: 64px;
        max-width: 64px;
        max-height: 64px;
        /* Permitir que as ondas ultrapassem o container sem criar scroll */
        overflow: visible !important;
        /* Garantir posição fixa */
        margin: 0;
        padding: 0;
        display: block !important;
        flex-direction: unset !important;
        align-items: unset !important;
    }
    
    /* Wrapper completamente estático */
    .floating-whatsapp .whatsapp-button-wrapper {
        animation: none !important;
        transition: none !important;
        transform: none !important;
        position: relative;
        width: 64px;
        height: 64px;
        max-width: 64px;
        max-height: 64px;
        /* Permitir que as ondas apareçam além do botão */
        overflow: visible !important;
        margin: 0;
        padding: 0;
        /* Não limitar o ripple ao interior do wrapper */
        contain: none !important;
    }
    
    .floating-whatsapp [class*="animate-"] {
        animation: none !important;
    }
    
    .floating-whatsapp .whatsapp-button.pulse-animation {
        animation: none !important;
    }
    
    /* Apenas o botão interno pulsa, sem movimento */
    .floating-whatsapp .whatsapp-button {
        animation: pulse-mobile 2s ease-in-out infinite !important;
        transform-origin: 50% 50% !important;
        transition: none !important;
        /* Tamanho fixo */
        width: 64px !important;
        height: 64px !important;
        min-width: 64px !important;
        min-height: 64px !important;
        max-width: 64px !important;
        max-height: 64px !important;
        box-sizing: border-box !important;
        /* Posição fixa dentro do wrapper */
        position: relative;
        margin: 0;
        padding: 0;
        /* Evitar que o scale afete o layout ao redor sem cortar as ondas */
        contain: layout;
    }
    
    /* Ripple contido dentro do wrapper */
    .floating-whatsapp .whatsapp-button-ripple {
        animation: ripple 2s infinite !important;
        position: absolute;
        top: 0;
        left: 0;
        width: 64px;
        height: 64px;
        margin: 0;
        padding: 0;
        /* Ondas circulares partindo do centro do botão */
        transform-origin: center center;
    }
}

.floating-whatsapp.show {
    opacity: 1;
    transform: none;
}

.whatsapp-bubble {
    position: relative;
    background-color: var(--whatsapp-green);
    border-radius: 20px;
    padding: 12px 16px;
    margin-bottom: 12px;
    margin-right: 0;
    box-shadow: 0 4px 12px rgba(16, 194, 69, 0.5);
    font-size: 14px;
    max-width: 250px;
    text-align: right;
    font-weight: 600;
    color: white;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease-out;
}

.floating-whatsapp.show .whatsapp-bubble {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}

.whatsapp-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--whatsapp-green);
}

.whatsapp-button {
    background-color: var(--whatsapp-green);
    transition: all 0.3s ease;
    position: relative;
    z-index: 100;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    text-decoration: none;
    display: block;
    min-width: 64px;
    min-height: 64px;
}

.whatsapp-button:hover {
    background-color: #0ea83a;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(16, 194, 69, 0.6);
}

.whatsapp-button:active {
    transform: scale(0.98);
}

/* Animação de entrada para seções */
.section-fade {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.section-fade.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Badge de urgência (padrão: primeiro badge) */
.urgency-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s infinite;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

/* Versão "placa eletrônica" – apenas na segunda div */
.urgency-badge-board {
    background: #000000;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    animation: none;
    border: 1px solid #ff1f1f;
    box-shadow: 0 0 10px rgba(255, 31, 31, 0.6);
    font-family: "Roboto Mono", "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    overflow: hidden;
    position: relative;
}

/* Marquee horizontal dentro do badge de urgência */
.urgency-marquee-track {
    display: inline-flex;
    align-items: center;
    animation: urgencyMarquee 6s linear infinite;
    will-change: transform;
    white-space: nowrap;
}

.urgency-marquee-item {
    margin-right: 40px;
    color: #ffffff;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Estilo de texto vermelho forte só na placa eletrônica */
.urgency-badge-board .urgency-marquee-item {
    color: #ff3b3b;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-shadow: 0 0 6px rgba(255, 59, 59, 0.9);
}

@keyframes urgencyMarquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@media (max-width: 767px) {
    /* Placa eletrônica ocupa apenas a largura do container .text-center */
    .urgency-badge-board {
        display: block;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin: 0 auto;
    }
}

/* Ícones das lojas */
.store-icon {
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto;
}

/* Wrapper da logo para posicionar o balão */
.garimpo-logo-wrapper {
    position: fixed;
    top: 60px;
    left: 16px;
    z-index: 100;
}

/* Link da logo */
.garimpo-logo-link {
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.garimpo-logo-link:hover {
    transform: scale(1.1);
}

.garimpo-logo-link:active {
    transform: scale(1.05);
}

/* Logo do Garimpo Ofertas no topo esquerdo (como foto de perfil) */
.garimpo-logo-header {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--whatsapp-green);
    box-shadow: 0 4px 12px rgba(16, 194, 69, 0.4);
    transition: transform 0.3s ease;
    display: block;
    pointer-events: none;
}

@media (min-width: 768px) {
    .garimpo-logo-wrapper {
        top: 70px;
        left: 20px;
    }
    
    .garimpo-logo-header {
        width: 80px;
        height: 80px;
    }
}

/* Balão de mensagem vindo da logo */
.logo-message-bubble {
    position: absolute;
    top: 0;
    left: 80px;
    background: linear-gradient(135deg, var(--whatsapp-green), #0ea83a);
    border-radius: 16px;
    padding: 12px 16px;
    box-shadow: 0 4px 16px rgba(16, 194, 69, 0.5);
    max-width: 240px;
    opacity: 0;
    transform: translateX(-20px) scale(0.8);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    z-index: 101;
}

.logo-message-bubble.show {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
}

.message-bubble-content {
    color: white;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 600;
}

.message-text {
    margin: 0;
    line-height: 1.4;
}

.message-bubble-tail {
    position: absolute;
    left: -8px;
    top: 20px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid var(--whatsapp-green);
}

@media (max-width: 767px) {
    .logo-message-bubble {
        left: 70px;
        max-width: 200px;
        padding: 10px 14px;
        font-size: 12px;
    }
    
    .message-bubble-tail {
        top: 18px;
    }
}

/* Carrossel de logos das lojas */
.logos-carousel {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    padding: 2rem;
}

/* Carrossel na Hero Section */
.logos-carousel-hero {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    overflow: visible;
    padding: 1.5rem 0;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

/* Container do carrossel na Hero - mais espaçado */
.logos-carousel-hero .carousel-container {
    height: 180px;
    min-height: 180px;
    padding: 0 2rem;
    overflow: visible;
}

.carousel-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide.active {
    opacity: 1;
    transform: scale(1);
    z-index: 2;
}

/* Background colorido na logo ativa */
.carousel-slide.active .carousel-logo {
    background: linear-gradient(135deg, rgba(16, 194, 69, 0.2), rgba(16, 194, 69, 0.1));
    padding: 1.2rem;
    border-radius: 20px;
    border: 2px solid rgba(16, 194, 69, 0.4);
    box-shadow: 0 4px 16px rgba(16, 194, 69, 0.3);
}

.carousel-slide.prev {
    opacity: 0.3;
    transform: translateX(-120px) scale(0.6);
    z-index: 1;
}

.carousel-slide.next {
    opacity: 0.3;
    transform: translateX(120px) scale(0.6);
    z-index: 1;
}

.carousel-logo {
    max-width: 180px;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

/* Logo maior na Hero Section */
.logos-carousel-hero .carousel-logo {
    max-width: 200px;
    max-height: 140px;
}

.carousel-logo:hover {
    transform: scale(1.1);
}

/* Indicadores do carrossel */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
}

.carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicator.active {
    background-color: var(--whatsapp-green);
    width: 24px;
    border-radius: 4px;
}

/* Animação de entrada para o logo */
.logo-fade-in {
    animation: fadeInUp 0.8s ease-out;
}

/* Header com Carrossel de Frases */
.header-carousel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    border-bottom: 2px solid var(--whatsapp-green);
    z-index: 99;
    padding: 12px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.header-carousel-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .header-carousel-container {
        padding: 0 100px;
    }
}

.header-carousel-text {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease-out;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-carousel-text.show {
    opacity: 1;
    transform: translateY(0);
}

.header-carousel-text.urgency {
    color: #ff6b6b;
    animation: pulse 2s infinite;
}

@media (min-width: 768px) {
    .header-carousel-text {
        font-size: 16px;
    }
}

