/* Botones flotantes de contacto. Selectores con dos clases para imponerse a los estilos
   globales de botón del tema ([type=button], button:hover...). */
.phcb {
    --phcb-gap: 10px;
    position: fixed;
    right: var(--phcb-side);
    bottom: var(--phcb-bottom);
    z-index: 99999;
    line-height: 1;
}

.phcb.phcb--left {
    right: auto;
    left: var(--phcb-side);
}

.phcb .phcb__list {
    display: flex;
    flex-direction: column;
    gap: var(--phcb-gap);
    margin: 0;
    /* Mismo hueco bajo el último botón que tenía Buttonizer. */
    padding: 0 0 var(--phcb-gap);
    list-style: none;
}

.phcb .phcb__item {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}

.phcb .phcb__button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: var(--phcb-size);
    height: var(--phcb-size);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--phcb-color);
    box-shadow: rgba(0, 0, 0, .2) 0 2px 6px 1px;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: transform .25s ease-in-out, filter .25s ease-in-out;
}

.phcb .phcb__button:hover,
.phcb .phcb__button:focus,
.phcb .phcb__button:focus-visible {
    background: var(--phcb-color);
    color: #fff;
    filter: brightness(1.06);
    transform: scale(1.06);
}

.phcb .phcb__button:focus-visible {
    outline: 3px solid #2271b1;
    outline-offset: 3px;
}

.phcb .phcb__button svg {
    width: 45%;
    height: 45%;
}

.phcb .phcb__label {
    position: absolute;
    top: 50%;
    right: calc(100% + 12px);
    padding: 4px 10px;
    border-radius: 4px;
    background: #4e4c4c;
    color: #fff;
    font-size: 12px;
    line-height: 17px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%);
    transition: opacity .25s ease-in-out;
    visibility: hidden;
}

.phcb.phcb--left .phcb__label {
    right: auto;
    left: calc(100% + 12px);
}

.phcb [data-phcb="whatsapp"] .phcb__label {
    background: var(--phcb-color);
}

.phcb.phcb--labels-hide .phcb__label {
    display: none;
}

.phcb.phcb--labels-hover .phcb__button:hover .phcb__label,
.phcb.phcb--labels-hover .phcb__button:focus-visible .phcb__label {
    opacity: 1;
    visibility: visible;
}

.phcb.phcb--zoom .phcb__item {
    animation: phcb-zoom .35s ease-out both;
}

.phcb.phcb--zoom .phcb__item:nth-child(2) { animation-delay: .05s; }
.phcb.phcb--zoom .phcb__item:nth-child(3) { animation-delay: .1s; }
.phcb.phcb--zoom .phcb__item:nth-child(4) { animation-delay: .15s; }

@keyframes phcb-zoom {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Chat de WhatsApp */
.phcb .phcb-chat {
    position: absolute;
    right: calc(100% + 16px);
    bottom: 0;
    box-sizing: border-box;
    width: 380px;
    max-width: calc(100vw - var(--phcb-size) - 48px);
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
    box-shadow: rgba(0, 0, 0, .2) 0 0 20px 0;
    color: #000;
    font-family: Roboto, Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
}

.phcb.phcb--left .phcb-chat {
    right: auto;
    left: calc(100% + 16px);
}

.phcb .phcb-chat[hidden] {
    display: none;
}

.phcb .phcb-chat__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-sizing: border-box;
    min-height: 60px;
    padding: 10px 14px 10px 18px;
    background: #128c7e;
    color: #fff;
}

.phcb .phcb-chat__agent strong,
.phcb .phcb-chat__agent span {
    display: block;
}

.phcb .phcb-chat__agent strong {
    font-size: 16px;
    font-weight: 700;
}

.phcb .phcb-chat__agent span {
    margin-top: 2px;
    font-size: 13px;
    opacity: .9;
}

.phcb .phcb-chat__head .phcb-chat__close {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .2);
    color: #fff;
    cursor: pointer;
}

.phcb .phcb-chat__head .phcb-chat__close:hover,
.phcb .phcb-chat__head .phcb-chat__close:focus-visible {
    background: rgba(0, 0, 0, .35);
    color: #fff;
}

.phcb .phcb-chat__close svg {
    width: 20px;
    height: 20px;
}

.phcb .phcb-chat__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 120px;
    padding: 16px;
    background: #e4ddd6;
}

.phcb .phcb-chat__day {
    align-self: center;
    padding: 3px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .85);
    color: #54656f;
    font-size: 12px;
}

.phcb .phcb-chat__bubble {
    align-self: flex-start;
    max-width: 85%;
    padding: 7px 10px 5px;
    border-radius: 0 8px 8px 8px;
    background: #fff;
    box-shadow: 0 1px .5px rgba(0, 0, 0, .13);
}

.phcb .phcb-chat__bubble strong {
    display: block;
    color: #128c7e;
    font-size: 13px;
}

.phcb .phcb-chat__bubble p {
    margin: 2px 0 0;
    color: #111b21;
}

.phcb .phcb-chat__time {
    display: block;
    margin-top: 2px;
    color: #667781;
    font-size: 11px;
    text-align: right;
}

.phcb .phcb-chat .phcb-chat__form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 10px;
    background: #f0f2f5;
}

.phcb .phcb-chat .phcb-chat__form input {
    flex: 1 1 auto;
    box-sizing: border-box;
    min-width: 0;
    height: 42px;
    margin: 0;
    padding: 0 14px;
    border: 0;
    border-radius: 21px;
    background: #fff;
    box-shadow: none;
    color: #111b21;
    font: inherit;
}

.phcb .phcb-chat .phcb-chat__form input:focus {
    outline: 2px solid #128c7e;
    outline-offset: 0;
}

.phcb .phcb-chat .phcb-chat__form button {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #128c7e;
    color: #fff;
    cursor: pointer;
}

.phcb .phcb-chat .phcb-chat__form button:hover,
.phcb .phcb-chat .phcb-chat__form button:focus-visible {
    background: #0e7266;
    color: #fff;
}

.phcb .phcb-chat__form button svg {
    width: 20px;
    height: 20px;
}

.phcb .phcb-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (max-width: 767px) {
    .phcb.phcb--hide-mobile {
        display: none;
    }

    .phcb .phcb-chat {
        position: fixed;
        right: 12px;
        bottom: calc(var(--phcb-bottom) + var(--phcb-count) * (var(--phcb-size) + var(--phcb-gap)) + var(--phcb-gap) + 6px);
        left: 12px;
        width: auto;
        max-width: none;
    }

    .phcb.phcb--left .phcb-chat {
        left: 12px;
    }
}

@media (min-width: 768px) {
    .phcb.phcb--hide-desktop {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .phcb.phcb--zoom .phcb__item {
        animation: none;
    }

    .phcb .phcb__button,
    .phcb .phcb__label {
        transition: none;
    }
}
