/* ==============================
   ANB WhatsApp Widget v3.1
   Chat + contact card + lite + admin
   ============================== */

.anb-wa-widget,
.anb-wa-widget *,
.anb-wa-admin,
.anb-wa-admin * {
    box-sizing: border-box;
}

.anb-wa-widget {
    --anb-wa-color: #0B7C67;
    z-index: 999999;
    width: min(350px, calc(100vw - 32px));
    font-family: inherit;
    color: #1f2933;
    line-height: 1.35;
}

.anb-wa-floating {
    position: fixed;
    right: 24px;
    bottom: 24px;
}

.anb-wa-left.anb-wa-floating {
    left: 24px;
    right: auto;
}

.anb-wa-inline {
    position: relative !important;
    inset: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    top: auto !important;
    width: 100%;
    max-width: 420px;
    margin: 24px auto;
    z-index: 1;
}

/* ==============================
   Chat style
   ============================== */

.anb-wa-chat {
    position: absolute;
    right: 0;
    bottom: 86px;
    width: 100%;
    overflow: hidden;
    background: rgba(255, 255, 255, .98);
    border: 1px solid rgba(15, 23, 42, .07);
    border-radius: 26px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .18), 0 8px 24px rgba(15, 23, 42, .08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transform-origin: bottom right;
    animation: anbWaIn .35s cubic-bezier(.2, .85, .25, 1.2);
}

.anb-wa-left .anb-wa-chat {
    left: 0;
    right: auto;
    transform-origin: bottom left;
}

.anb-wa-inline .anb-wa-chat {
    position: relative !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    top: auto !important;
    display: block !important;
    animation: none !important;
}

.anb-wa-closed .anb-wa-chat,
.anb-wa-chat.is-hidden {
    display: none;
}

.anb-wa-inline.anb-wa-closed .anb-wa-chat {
    display: block !important;
}

.anb-wa-close {
    position: absolute;
    top: 13px;
    right: 14px;
    z-index: 3;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #667085;
    font-size: 28px;
    line-height: 28px;
    cursor: pointer;
    transition: background .2s, color .2s, transform .2s;
}

.anb-wa-close:hover {
    background: #f2f4f7;
    color: #111827;
    transform: rotate(90deg);
}

.anb-wa-chat-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 54px 17px 20px;
    background: var(--anb-wa-color);
    background: linear-gradient(135deg, var(--anb-wa-color), #095e51);
    color: #fff;
}

.anb-wa-inline .anb-wa-chat-head {
    padding-right: 20px;
}

.anb-wa-avatar {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}

.anb-wa-chat-head strong {
    display: block;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.anb-wa-chat-head span {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    font-weight: 500;
    opacity: .94;
}

.anb-wa-chat-body {
    padding: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.anb-wa-message {
    position: relative;
    max-width: 92%;
    margin: 0 0 14px;
    padding: 13px 15px;
    border-radius: 17px 17px 17px 5px;
    background: #eef8f1;
    color: #263238;
    font-size: 16px;
    line-height: 1.45;
}

.anb-wa-hours {
    margin: 0 0 12px;
    color: #667085;
    font-size: 13px;
}

.anb-wa-input {
    display: block;
    width: 100%;
    min-height: 84px;
    max-height: 150px;
    margin: 0 0 12px;
    padding: 13px 14px;
    resize: vertical;
    outline: none;
    border: 1px solid #d0d5dd;
    border-radius: 17px;
    background: #fff;
    color: #1f2937;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.35;
    transition: border .18s, box-shadow .18s;
}

.anb-wa-input:focus {
    border-color: var(--anb-wa-color);
    box-shadow: 0 0 0 4px rgba(11, 124, 103, .13);
}

.anb-wa-send {
    text-decoration: none !important;
}

.anb-wa-chat-style .anb-wa-send {
    width: 100%;
    min-height: 56px;
    border-radius: 999px;
    background: var(--anb-wa-color);
    background: linear-gradient(135deg, var(--anb-wa-color), #095e51);
    color: #fff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 800;
    box-shadow: 0 12px 30px rgba(11, 124, 103, .22);
    transition: transform .22s, box-shadow .22s, filter .22s;
}

.anb-wa-chat-style .anb-wa-send:hover {
    transform: translateY(-2px);
    filter: saturate(1.06);
    box-shadow: 0 16px 38px rgba(11, 124, 103, .3);
}

.anb-wa-fab {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 70px;
    height: 70px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--anb-wa-color);
    background: linear-gradient(135deg, var(--anb-wa-color), #095e51);
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 16px 38px rgba(10, 110, 49, .28), 0 6px 16px rgba(0, 0, 0, .18);
    cursor: pointer;
    transition: transform .22s, box-shadow .22s, filter .22s;
    overflow: visible;
}

.anb-wa-left .anb-wa-fab {
    left: 0;
    right: auto;
}

.anb-wa-fab:hover {
    transform: translateY(-3px) scale(1.03);
    filter: saturate(1.08);
    box-shadow: 0 20px 45px rgba(10, 110, 49, .35), 0 8px 20px rgba(0, 0, 0, .2);
}

.anb-wa-glow {
    position: absolute;
    inset: -10px;
    z-index: -1;
    border-radius: inherit;
    background: var(--anb-wa-color);
    opacity: .18;
    filter: blur(1px);
    animation: anbWaGlow 2.6s ease-in-out infinite;
}

.anb-wa-inline .anb-wa-fab,
.anb-wa-card-style .anb-wa-fab,
.anb-wa-card-style .anb-wa-close,
.anb-wa-lite-style .anb-wa-fab,
.anb-wa-lite-style .anb-wa-close {
    display: none !important;
}

/* ==============================
   Lite style: Barnadolor subtle
   ============================== */

.anb-wa-lite-style {
    width: min(340px, calc(100vw - 32px));
}

.anb-wa-lite-style.anb-wa-inline {
    width: 100%;
    max-width: 340px;
    margin: 18px auto;
}

.anb-wa-lite {
    width: 100%;
    padding: 20px 22px;
    border: 1px solid rgba(122, 31, 43, .14);
    border-radius: 18px;
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .055);
    text-align: center;
}

.anb-wa-lite h3 {
    margin: 0 0 14px !important;
    color: #24313c;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 600;
    letter-spacing: -.015em;
}

.anb-wa-lite-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 18px;
    border: 1px solid var(--anb-wa-color);
    border-radius: 999px;
    background: transparent;
    color: var(--anb-wa-color) !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none !important;
    box-shadow: none;
    gap: 7px;
    transition: background .18s, color .18s, transform .18s, box-shadow .18s;
}

.anb-wa-lite-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.anb-wa-lite-button .anb-wa-icon {
    width: 16px;
    height: 16px;
    display: block;
}

.anb-wa-lite-button:hover {
    background: var(--anb-wa-color);
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(122, 31, 43, .14);
}

/* ==============================
   Contact card style
   ============================== */

.anb-wa-card-style {
    width: min(430px, calc(100vw - 32px));
}

.anb-wa-card-style.anb-wa-inline {
    width: 100%;
    max-width: 460px;
}

.anb-wa-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: 34px;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(11, 124, 103, .10), transparent 45%),
        linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.98));
    box-shadow: 0 22px 60px rgba(15, 23, 42, .11), 0 6px 18px rgba(15, 23, 42, .06);
    color: #24313c;
}

.anb-wa-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--anb-wa-color), #c9e7e1);
}

.anb-wa-card-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    padding: 7px 12px;
    border-radius: 999px;
    background: #eef8f6;
    color: var(--anb-wa-color);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .01em;
}

.anb-wa-card h3 {
    margin: 0 0 12px !important;
    color: #1f2937;
    font-size: clamp(23px, 2.6vw, 31px);
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -.035em;
}

.anb-wa-card p {
    margin: 0 0 20px !important;
    color: #52616f;
    font-size: 16px;
    line-height: 1.62;
}

.anb-wa-card-hours {
    margin: -4px 0 20px;
    color: #667085;
    font-size: 14px;
}

.anb-wa-card-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 54px;
    padding: 13px 20px;
    border-radius: 999px;
    background: var(--anb-wa-color);
    color: #fff !important;
    font-size: 16px;
    font-weight: 800;
    text-decoration: none !important;
    box-shadow: 0 14px 34px rgba(11, 124, 103, .24);
    transition: transform .22s, box-shadow .22s, filter .22s;
}

.anb-wa-card-button:hover {
    transform: translateY(-2px);
    filter: saturate(1.08) brightness(.98);
    box-shadow: 0 18px 44px rgba(11, 124, 103, .30);
}

.anb-wa-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Protecció anti-temes: cap CSS del theme/SiteOrigin pot fer la icona gegant */
.anb-wa-icon {
    display: block !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    flex: 0 0 28px !important;
    color: currentColor;
    fill: currentColor;
}

.anb-wa-fab .anb-wa-icon {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    flex-basis: 42px !important;
}

.anb-wa-avatar .anb-wa-icon {
    width: 29px !important;
    height: 29px !important;
    min-width: 29px !important;
    max-width: 29px !important;
    min-height: 29px !important;
    max-height: 29px !important;
    flex-basis: 29px !important;
}

.anb-wa-send .anb-wa-icon,
.anb-wa-card-button .anb-wa-icon {
    width: 23px !important;
    height: 23px !important;
    min-width: 23px !important;
    max-width: 23px !important;
    min-height: 23px !important;
    max-height: 23px !important;
    flex-basis: 23px !important;
}

.anb-wa-fab.anb-wa-pulse {
    animation: anbWaPulse .82s cubic-bezier(.2, .8, .2, 1);
}

@keyframes anbWaIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes anbWaPulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes anbWaGlow {
    0%, 100% {
        transform: scale(.98);
        opacity: .14;
    }

    50% {
        transform: scale(1.08);
        opacity: .26;
    }
}

@media (max-width: 767px) {
    .anb-wa-floating {
        right: 16px;
        bottom: 16px;
        width: min(330px, calc(100vw - 32px));
    }

    .anb-wa-left.anb-wa-floating {
        left: 16px;
        right: auto;
    }

    .anb-wa-chat {
        bottom: 76px;
        border-radius: 22px;
    }

    .anb-wa-chat-head {
        padding: 17px 50px 15px 17px;
    }

    .anb-wa-inline .anb-wa-chat-head {
        padding-right: 17px;
    }

    .anb-wa-chat-body {
        padding: 17px;
    }

    .anb-wa-message {
        font-size: 15px;
    }

    .anb-wa-fab {
        width: 62px;
        height: 62px;
    }

    .anb-wa-fab .anb-wa-icon {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        max-width: 38px !important;
        min-height: 38px !important;
        max-height: 38px !important;
        flex-basis: 38px !important;
    }

    .anb-wa-card {
        padding: 28px 24px;
        border-radius: 22px;
    }

    .anb-wa-lite {
        padding: 18px 20px;
        border-radius: 16px;
    }

    .anb-wa-lite h3 {
        font-size: 17px;
    }

    .anb-wa-hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .anb-wa-hide-desktop {
        display: none !important;
    }
}

/* ==============================
   Admin
   ============================== */

.anb-wa-admin {
    max-width: 1220px;
}

.anb-wa-admin h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 24px 0;
}

.anb-wa-admin h1 span {
    padding: 6px 9px;
    border-radius: 999px;
    background: #dcfce7;
    color: #078c3d;
    font-size: 12px;
    font-weight: 800;
}

.anb-wa-admin-shortcodes {
    margin: 0 0 22px;
    padding: 20px;
    border: 1px solid #bfdbfe;
    border-radius: 18px;
    background: #eff6ff;
}

.anb-wa-admin-shortcodes h2 {
    margin: 0 0 14px;
    font-size: 18px;
}

.anb-wa-shortcode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.anb-wa-admin-shortcodes label {
    display: block;
    margin: 0;
}

.anb-wa-admin-shortcodes strong {
    display: block;
    margin-bottom: 7px;
}

.anb-wa-admin-shortcodes input {
    width: 100%;
    padding: 9px 10px;
    border-radius: 9px;
    background: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.anb-wa-admin-shortcodes p {
    margin: 12px 0 0;
    color: #475569;
}

.anb-wa-admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 22px;
    align-items: start;
}

.anb-wa-admin-card {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .04);
}

.anb-wa-admin-card h2 {
    margin: 0 0 18px;
    font-size: 18px;
}

.anb-wa-admin-card hr {
    margin: 24px 0;
    border: 0;
    border-top: 1px solid #e5e7eb;
}

.anb-wa-admin-card label {
    display: block;
    margin: 0 0 16px;
    font-weight: 650;
}

.anb-wa-admin-card input[type="text"],
.anb-wa-admin-card input[type="color"],
.anb-wa-admin-card textarea,
.anb-wa-admin-card select {
    display: block;
    width: 100%;
    max-width: none;
    margin-top: 7px;
    border-radius: 9px;
    border-color: #d0d5dd;
}

.anb-wa-admin-card input[type="color"] {
    height: 42px;
    padding: 4px;
}

.anb-wa-admin-card small {
    display: block;
    margin-top: 6px;
    color: #667085;
    font-weight: 400;
}

.anb-wa-admin-check {
    display: flex !important;
    gap: 9px;
    align-items: center;
}

.anb-wa-admin-check input {
    margin: 0;
}

.anb-wa-admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.anb-wa-admin-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.anb-wa-admin-checks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 18px;
    margin: 8px 0 22px;
}

.anb-wa-admin-checks label {
    margin: 0;
    font-weight: 500;
}

.anb-wa-admin-preview {
    position: sticky;
    top: 46px;
}

.anb-wa-preview-area {
    position: relative;
    min-height: 500px;
    overflow: hidden;
    border-radius: 22px;
    background: linear-gradient(135deg, #f8fafc, #eef2f7);
    padding: 22px;
}

.anb-wa-preview-chat {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    animation: none;
}

.anb-wa-preview-card {
    margin: 30px auto !important;
}

.anb-wa-preview-fab {
    position: absolute;
    right: 30px;
    bottom: 28px;
    display: grid;
    place-items: center;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--anb-wa-color);
    background: linear-gradient(135deg, var(--anb-wa-color), #095e51);
    color: #fff;
    box-shadow: 0 16px 38px rgba(10, 110, 49, .25);
}

.anb-wa-preview-fab .anb-wa-icon {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
}

.anb-wa-clicks {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 18px 0;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
}

.anb-wa-clicks span {
    color: #667085;
}

.anb-wa-clicks strong {
    font-size: 32px;
}

.anb-wa-admin-preview code {
    display: block;
    margin: 8px 0;
    padding: 8px;
    border-radius: 8px;
    background: #ecfdf5;
    color: #047857;
    white-space: normal;
}

@media (max-width: 960px) {
    .anb-wa-admin-layout,
    .anb-wa-admin-grid,
    .anb-wa-admin-grid-3,
    .anb-wa-admin-checks,
    .anb-wa-shortcode-grid {
        grid-template-columns: 1fr;
    }

    .anb-wa-admin-preview {
        position: static;
    }
}
