/* ==================================================
   components.css
   Aqui você mexe em:
   - menu hambúrguer animado
   - dropdown do menu
   - tooltips e popups
   - botão de chat flutuante
   - classes genéricas de swiper/carrossel
   - setas e paginação dos carrosséis
   ================================================== */

.mobile-menu-btn {
    display: none;
    width: 30px;
    height: 22px;
    position: relative;
    cursor: pointer;
}

.mobile-menu-btn span {
    position: absolute;
    width: 100%;
    height: 3px;
    background: var(--azul-profundo);
    border-radius: 2px;
    left: 0;
    transition: 0.3s ease;
}

.mobile-menu-btn span:nth-child(1) { top: 0; }
.mobile-menu-btn span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.mobile-menu-btn span:nth-child(3) { bottom: 0; }

.mobile-menu-btn.active span:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

.mobile-menu-btn.active span {
    background: var(--verde-esmeralda-digital);
}

/* =========================
   Dropdown
   ========================= */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: var(--sombra-suave);
    border-radius: 8px;
    padding: 10px 0;
    min-width: 200px;
    z-index: 1001;
}

.dropdown:hover .dropdown-menu {
    display: block;
    animation: fadeIn 0.25s ease;
}

.dropdown-menu li {
    margin: 0 !important;
}

.dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    color: var(--azul-profundo);
    font-weight: 500;
}

.dropdown-menu li a:hover {
    background-color: rgba(31, 165, 186, 0.1);
    color: var(--verde-esmeralda-digital);
}

.dropdown-menu li a:after {
    display: none;
}

.dropdown > a:after {
    content: "▼";
    font-size: 0.7em;
    margin-left: 5px;
    vertical-align: middle;
}

/* =========================
   Base Swiper / Carrosséis
   ========================= */
.services-swiper,
.agents-swiper,
.products-swiper {
    width: 100%;
}

/* IMPORTANTE:
   No desktop o Swiper dos agentes deve continuar escondendo os cards laterais.
   As setas ficam fora do .agents-swiper e passam a ser posicionadas pelo wrapper pai. */
.agents-swiper,
.agents-swiper.swiper,
.agents-swiper.swiper-horizontal {
    overflow: hidden !important;
}

.services-swiper .swiper-wrapper,
.agents-swiper .swiper-wrapper,
.products-swiper .swiper-wrapper {
    align-items: stretch;
}

.services-swiper .swiper-slide,
.agents-swiper .swiper-slide,
.products-swiper .swiper-slide {
    height: auto;
    box-sizing: border-box;
}

/* Wrappers que também usam classes de grid não podem manter gap do grid dentro do Swiper */
.agents-swiper .agents-grid,
.products-swiper .products-grid {
    gap: 0;
}

.services-pagination,
.agents-pagination,
.products-pagination {
    margin-top: 20px;
    position: relative;
}

/* Setas */
.agents-prev,
.agents-next,
.products-prev,
.products-next {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--branco);
    box-shadow: var(--sombra-suave);
    color: var(--azul-profundo);
    transition: 0.25s ease;
}

.agents-prev:hover,
.agents-next:hover,
.products-prev:hover,
.products-next:hover {
    background: var(--verde-esmeralda-digital);
    color: var(--branco);
}

.agents-prev::after,
.agents-next::after,
.products-prev::after,
.products-next::after {
    font-size: 14px;
    font-weight: 700;
}

.swiper-button-disabled {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Touch não mostra setas */
.touch-device .agents-prev,
.touch-device .agents-next,
.touch-device .products-prev,
.touch-device .products-next {
    display: none !important;
}

/* Desktop no-touch mostra setas */
.no-touch .agents-prev,
.no-touch .agents-next,
.no-touch .products-prev,
.no-touch .products-next {
    display: flex;
}

/* =========================
   Tooltips
   ========================= */
.service-info {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 20;
}

.info-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--verde-esmeralda-digital);
    color: var(--branco);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.info-tooltip {
    position: absolute;
    top: 0;
    left: calc(100% + 10px);
    width: max-content;
    max-width: 280px;
    background: var(--azul-profundo);
    color: var(--branco);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    transition: 0.25s ease;
    z-index: 10001;
}

.info-tooltip p {
    color: var(--branco) !important;
    font-size: medium;
    margin-bottom: 10px;
}

.info-tooltip p:last-child {
    margin-bottom: 0;
}

/* Posicionamento adaptável definido pelo JS */
.service-info.tooltip-right .info-tooltip {
    left: calc(100% - 25px);
    right: auto;
    transform: none;
}

.service-info.tooltip-left .info-tooltip {
    right: calc(100% - 25px);
    left: auto;
    transform: none;
}

.service-info.tooltip-center .info-tooltip {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

/* Em touch, hover não abre sozinho */
.touch-device .service-info:not(.active):hover .info-tooltip {
    opacity: 0;
    pointer-events: none;
}

.service-info.active {
    z-index: 10002 !important;
}
/* Touch/tablet: eleva o card ativo para o tooltip não ficar atrás do card vizinho */
.touch-device .tooltip-card-active {
    z-index: 120 !important;
}

.touch-device .tooltip-card-active .service-info {
    z-index: 130 !important;
}

.touch-device .tooltip-card-active .info-tooltip {
    z-index: 140 !important;
}

/* =========================
   SDR
   ========================= */
.sdr-info {
    display: inline-block;
    color: var(--verde-esmeralda-digital);
    border-bottom: none;
    cursor: pointer;
    position: relative;
    font-weight: 500;
}

.sdr-info::after {
    content: attr(data-sdr-text);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 230px;
    background: var(--azul-profundo);
    color: var(--branco);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 150;
}

.touch-device .sdr-info::after {
    display: none !important;
}

.sdr-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    padding: 20px;
}

.sdr-popup-overlay.active {
    display: flex;
}

.sdr-popup {
    width: 100%;
    max-width: 360px;
    background: var(--branco);
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
    position: relative;
    overflow-x: hidden;
}

.sdr-popup h4 {
    color: var(--azul-profundo);
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.sdr-popup p {
    color: var(--cinza-escuro);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0;
    max-height: 50vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    word-break: break-word;
}

.sdr-popup-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: var(--azul-profundo);
    cursor: pointer;
}

/* =========================
   Popups
   ========================= */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.popup-content {
    background-color: var(--branco);
    border-radius: 10px;
    padding: 30px;
    position: relative;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--cinza-medio);
    transition: var(--transicao);
}

.popup-close:hover {
    color: var(--azul-profundo);
}

.popup-title {
    margin-bottom: 15px;
    color: var(--azul-profundo);
    font-size: 1.5rem;
}

.popup-text {
    margin-bottom: 25px;
    font-size: 1.1rem;
    color: var(--cinza-escuro);
}

.popup-buttons {
    display: flex;
    flex-direction: row;
    gap: 15px;
}

.popup-buttons .btn {
    flex: 1;
    min-width: 0;
}

.chat-popup {
    width: 90%;
    max-width: 500px;
    height: auto;
    max-height: 80vh;
    overflow: hidden;
}

/* =========================
   Botão flutuante de chat
   ========================= */
.chat-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--azul-profundo);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--branco);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s ease;
}

.chat-button:hover {
    transform: scale(1.1);
    background-color: var(--verde-esmeralda-digital);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

.chat-button i {
    font-size: 24px;
}

/* =========================
   Mobile / Tablet
   ========================= */
@media (max-width: 1365px) {
    .services-grid.services-swiper,
    .agents-grid.agents-swiper,
    .products-grid.products-swiper {
        display: block;
        margin-top: 50px;
    }

    .services-swiper,
    .agents-swiper,
    .products-swiper {
        position: relative;
        padding-bottom: 0;
        overflow: visible; /* evita cortar cards e hover */
    }

    .services-swiper .swiper-wrapper,
    .agents-swiper .swiper-wrapper,
    .products-swiper .swiper-wrapper {
        padding-bottom: 34px; /* respiro para paginação e hover */
    }

    .agents-swiper .swiper-slide,
    .products-swiper .swiper-slide {
        display: flex;
        height: auto;
        overflow: visible;
    }

    .services-pagination,
    .agents-pagination,
    .products-pagination {
        position: static !important;
        margin-top: 18px;
        width: 100%;
        text-align: center;
        line-height: 1;
    }

    .services-pagination .swiper-pagination-bullet,
    .agents-pagination .swiper-pagination-bullet,
    .products-pagination .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
        background: var(--cinza-medio);
        opacity: 1;
    }

    .services-pagination .swiper-pagination-bullet-active,
    .agents-pagination .swiper-pagination-bullet-active,
    .products-pagination .swiper-pagination-bullet-active {
        background: var(--verde-esmeralda-digital);
    }

    .service-info {
        z-index: 50;
    }

    .service-info.active {
        z-index: 10002 !important;
    }

    .service-info.active .info-icon {
        background: var(--azure1);
        box-shadow: 0 0 0 4px rgba(33, 141, 201, 0.18);
    }

    .service-info.active .info-tooltip {
        opacity: 1;
        pointer-events: auto;
    }

    .info-tooltip {
        width: min(280px, calc(100vw - 40px));
        max-width: 280px;
        max-height: 350px;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        z-index: 10001;
        top: 28px;
    }

    .sdr-info::after {
        display: none;
    }

    .sdr-info:active {
        opacity: 0.8;
    }
}

/* =========================
   Desktop
   ========================= */
@media (min-width: 1366px) {
    .services-grid.services-swiper {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        padding-top: 12px;
    }

    /* Agentes em desktop continuam no swiper */
    .agents-carousel-shell {
        position: relative;

        /* ALTERE AQUI:
           espaço lateral reservado para as setas */
        --agents-shell-side-space: 30px;

        /* ALTERE AQUI:
           tamanho do botão circular */
        --agents-arrow-size: 50px;

        /* ALTERE AQUI:
           distância da seta em relação ao card
           valor menor = mais perto da borda externa
           valor maior = mais perto do card */
        --agents-arrow-offset: -30px;

        padding: 0 var(--agents-shell-side-space);
        overflow: visible;
    }

    .agents-swiper {
        position: relative;
        overflow: hidden !important;
        padding: 12px 0 58px;
    }

    .agents-swiper .agents-grid.swiper-wrapper {
        display: flex;
        align-items: stretch;
    }

    .agents-swiper .swiper-slide {
        display: flex;
        height: auto;
        overflow: visible;
    }

    /* Produtos em desktop voltam para grid estático */
    .products-swiper {
        overflow: visible;
        padding: 0;
    }

    .products-swiper .products-grid.swiper-wrapper {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 30px; /* espaço horizontal entre os cards dos planos */
        margin-top: 40px;
        align-items: stretch;
        transform: none !important;
    }

    .products-swiper .swiper-wrapper {
        transform: none !important;
    }

    .products-swiper .product-card.swiper-slide {
        display: flex;
        width: auto !important;
        margin-right: 0 !important;
        height: auto;
        overflow: visible;
    }

    .products-pagination,
    .products-prev,
    .products-next {
        display: none !important;
    }

    .services-grid.services-swiper .swiper-wrapper {
        display: contents;
    }

    .services-grid.services-swiper .swiper-slide {
        width: auto !important;
        overflow: visible;
    }

    .services-grid.services-swiper .service-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
        z-index: 30;
    }

    .services-pagination {
        display: none;
    }

    .services-grid.services-swiper .service-card:nth-child(4n) .info-tooltip {
        left: auto;
        right: calc(100% + 10px);
    }

    .no-touch .sdr-info:hover::after {
        opacity: 1;
        transform: translateX(-50%) translateY(-4px);
    }

    .no-touch .service-info:hover .info-tooltip {
        opacity: 1;
        pointer-events: auto;
        z-index: 99999;
    }

    .touch-device .service-info.active .info-tooltip {
        opacity: 1;
        pointer-events: auto;
        z-index: 10001;
    }

    .no-touch .info-tooltip {
        height: auto;
        max-height: none;
        overflow: visible;
        z-index: 99999;
    }

    /* Corrige tooltip atrás do card vizinho e preserva hover elevado */
    .no-touch .agent-card,
    .no-touch .product-card,
    .no-touch .service-card {
        overflow: visible;
        position: relative;
    }

    .no-touch .agent-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
        z-index: 50;
    }

    .no-touch .product-card:hover {
        transform: translateY(-8px); /* ALTERE AQUI: quanto o card sobe */
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08); /* ALTERE AQUI: força da sombra */
        z-index: 50;
    }

    .no-touch .service-card:hover {
        z-index: 50;
    }

    .no-touch .service-info {
        z-index: 60;
    }

    .no-touch .service-info:hover {
        z-index: 70;
    }

    .services,
    .services .container,
    .services-grid.services-swiper,
    .services-grid.services-swiper .swiper-wrapper,
    .services-grid.services-swiper .swiper-slide,
    .service-card,
    .agents,
    .agents .container,
    .agents-carousel-shell,
    .agents-grid,
    .agents-swiper .swiper-wrapper,
    .agents-swiper .swiper-slide,
    .agent-card,
    .entry-products,
    .entry-products .container,
    .products-swiper,
    .products-grid,
    .products-swiper .swiper-wrapper,
    .products-swiper .swiper-slide,
    .product-card {
        overflow: visible;
    }

    /* =========================
       SETAS DO SWIPER - AGENTES (DESKTOP)
       As setas ficam no wrapper pai (.agents-carousel-shell),
       fora do .agents-swiper. Assim elas não são cortadas
       e o carrossel continua escondendo os cards laterais.
    ========================= */
    .agents-carousel-shell .agents-prev,
    .agents-carousel-shell .agents-next {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);

        width: var(--agents-arrow-size) !important;   /* ALTERE AQUI via variável */
        height: var(--agents-arrow-size) !important;  /* ALTERE AQUI via variável */
        border-radius: 50% !important;
        z-index: 9999;

        display: flex !important;
        align-items: center;
        justify-content: center;

        background: #17345d !important; /* ALTERE AQUI: cor do fundo */
        border: 1px solid #edf2f6 !important; /* ALTERE AQUI: cor/espessura da borda */
        box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1) !important; /* ALTERE AQUI: sombra */

        cursor: pointer;
        font-size: 0 !important;
        color: transparent !important;
        overflow: visible;
    }

    /* SETA ESQUERDA
       ALTERE via --agents-arrow-offset no .agents-carousel-shell */
    .agents-carousel-shell .agents-prev {
        left: var(--agents-arrow-offset) !important;
    }

    /* SETA DIREITA
       ALTERE via --agents-arrow-offset no .agents-carousel-shell */
    .agents-carousel-shell .agents-next {
        right: var(--agents-arrow-offset) !important;
    }

    /* HOVER DA SETA */
    .agents-carousel-shell .agents-prev:hover,
    .agents-carousel-shell .agents-next:hover {
        box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1) !important; /* ALTERE AQUI: sombra no hover */
    }

    /* remove qualquer ícone herdado */
    .agents-carousel-shell .agents-prev::before,
    .agents-carousel-shell .agents-next::before {
        content: none !important;
        display: none !important;
    }

    .agents-carousel-shell .agents-prev::after,
    .agents-carousel-shell .agents-next::after {
        content: "" !important;
        display: block !important;
        width: 30px;   /* ALTERE AQUI: tamanho da seta interna */
        height: 30px;  /* ALTERE AQUI: tamanho da seta interna */
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
    }

    /* seta esquerda */
    .agents-carousel-shell .agents-prev::after {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M15.5 4.5L8 12l7.5 7.5' stroke='white' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    }

    /* seta direita */
    .agents-carousel-shell .agents-next::after {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M8.5 4.5L16 12l-7.5 7.5' stroke='white' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    }

    /* quando a seta estiver desabilitada, ela some */
    .agents-carousel-shell .agents-prev.swiper-button-disabled,
    .agents-carousel-shell .agents-next.swiper-button-disabled {
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .agents-pagination {
        position: static !important;
        margin-top: 22px;
        text-align: center;
        line-height: 1;
    }

    .agents-pagination .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
        background: var(--cinza-medio);
        opacity: 1;
    }

    .agents-pagination .swiper-pagination-bullet-active {
        background: var(--verde-esmeralda-digital);
    }

}

/* =========================
   Mobile menu / dropdown
   ========================= */
@media (max-width: 1023px) {
    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        background-color: transparent;
        padding: 0 0 0 20px;
        min-width: auto;
    }

    .dropdown:hover .dropdown-menu {
        display: none !important;
    }

    .dropdown.active .dropdown-menu {
        display: block !important;
    }

    .dropdown > a:after {
        float: right;
    }

    .mobile-menu-btn {
        display: block;
        z-index: 1002;
    }
}

@media (max-width: 768px) {
    .chat-popup {
        width: 95%;
        max-width: none;
    }

    .chat-popup iframe {
        height: 350px !important;
    }

    .popup-content {
    text-align: center; /* centraliza textos do popup */
    }

    .popup-title,
    .popup-text {
        text-align: center;
    }

    .popup-buttons {
        flex-direction: column; /* botões um embaixo do outro */
        gap: 12px; /* ALTERE AQUI: espaço entre os botões */
    }

    .popup-buttons .btn {
        width: 100%;
        flex: unset;
        min-width: 0;
        padding-left: 10px;
        padding-right: 10px;
    }

    .chat-button {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    .mobile-menu-btn {
        display: block;
        z-index: 1002;
    }
}

html,
body {
    overflow-x: hidden;
}