/* WhatsApp müşteri desteği widget */
.wa-widget {
    position: fixed;
    right: 1rem;
    bottom: 1.25rem;
    z-index: 45;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
    font-family: Inter, system-ui, sans-serif;
}

@media (min-width: 640px) {
    .wa-widget {
        right: 1.5rem;
        bottom: 1.5rem;
    }
}

.wa-widget__panel {
    width: min(22rem, calc(100vw - 2rem));
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    opacity: 0;
    transform: translateY(0.75rem) scale(0.98);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.wa-widget.is-open .wa-widget__panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.wa-widget__panel[hidden] {
    display: none;
}

.wa-widget.is-open .wa-widget__panel[hidden] {
    display: flex;
}

.wa-widget__card {
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
    border: 1px solid #e8eef5;
    display: flex;
    flex-direction: column;
    max-height: min(32rem, calc(100dvh - 7rem));
}

.wa-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, #0d5f47 0%, #0a4a38 100%);
    color: #fff;
}

.wa-widget__header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.wa-widget__header-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wa-widget__header-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.wa-widget__header-title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.25;
}

.wa-widget__header-status {
    margin: 0.125rem 0 0;
    font-size: 0.75rem;
    opacity: 0.88;
}

.wa-widget__close {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.wa-widget__close:hover {
    background: rgba(255, 255, 255, 0.12);
}

.wa-widget__close svg {
    width: 1.125rem;
    height: 1.125rem;
}

.wa-widget__body {
    background: #f7f4ef;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.wa-widget__messages {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    flex: 1 1 auto;
    min-height: 7.5rem;
    max-height: 14rem;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 1rem;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.wa-widget__messages::-webkit-scrollbar {
    display: none;
}

.wa-widget__messages.is-active {
    max-height: 16rem;
}

.wa-widget__bubble {
    align-self: flex-start;
    max-width: 92%;
    background: #fff;
    border-radius: 0.875rem;
    border-bottom-left-radius: 0.25rem;
    padding: 0.75rem 0.875rem 1.5rem;
    position: relative;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.wa-widget__bubble p {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #334155;
    white-space: pre-line;
}

.wa-widget__bubble--user {
    align-self: flex-end;
    background: #dcf8c6;
    border-bottom-left-radius: 0.875rem;
    border-bottom-right-radius: 0.25rem;
}

.wa-widget__bubble-time {
    position: absolute;
    right: 0.625rem;
    bottom: 0.375rem;
    font-size: 0.625rem;
    color: #94a3b8;
    font-style: normal;
}

.wa-widget__quick {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
    flex-shrink: 0;
    transition: opacity 0.2s ease, max-height 0.25s ease, padding 0.25s ease;
    max-height: 12rem;
    overflow: hidden;
}

.wa-widget__body.is-chat-started .wa-widget__quick {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    pointer-events: none;
    visibility: hidden;
}

.wa-widget__typing {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.65rem 0.875rem;
    background: #fff;
    border-radius: 0.875rem;
    border-bottom-left-radius: 0.25rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.wa-widget__typing span {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: #94a3b8;
    animation: wa-typing 1.2s infinite ease-in-out;
}

.wa-widget__typing span:nth-child(2) { animation-delay: 0.15s; }
.wa-widget__typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes wa-typing {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.wa-widget__quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 4.25rem;
    padding: 0.5rem 0.375rem;
    border: 1px solid #e8eef5;
    border-radius: 0.75rem;
    background: #fff;
    color: #334155;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.wa-widget__quick-btn:hover,
.wa-widget__quick-btn.is-active {
    border-color: #25D366;
    color: #0d5f47;
    box-shadow: 0 2px 10px rgba(37, 211, 102, 0.12);
}

.wa-widget__quick-icon {
    font-size: 1.125rem;
    line-height: 1;
}

.wa-widget__composer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #fff;
    border-top: 1px solid #eef2f7;
    flex-shrink: 0;
}

.wa-widget__input {
    flex: 1;
    min-width: 0;
    border: none;
    background: #f1f5f9;
    border-radius: 9999px;
    padding: 0.7rem 1rem;
    font-size: 0.8125rem;
    color: #334155;
    outline: none;
}

.wa-widget__input::placeholder {
    color: #94a3b8;
}

.wa-widget__input:focus {
    box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.25);
}

.wa-widget__send {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 9999px;
    background: #25D366;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.15s;
}

.wa-widget__send:hover {
    background: #1daa52;
}

.wa-widget__send svg {
    width: 1.125rem;
    height: 1.125rem;
}

.wa-widget__cta {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.25rem;
    border: none;
    border-radius: 9999px;
    background: #25D366;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35);
    transition: background 0.15s, transform 0.15s;
}

.wa-widget__cta:hover {
    background: #1daa52;
    transform: translateY(-1px);
}

.wa-widget__cta svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.wa-widget__fab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 9999px;
    background: #25D366;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(37, 211, 102, 0.4);
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.wa-widget__fab:hover {
    background: #1daa52;
    transform: translateY(-1px);
}

.wa-widget__fab svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.wa-widget__fab-label {
    display: none;
}

@media (min-width: 640px) {
    .wa-widget__fab-label {
        display: inline;
    }
}

.wa-widget.is-open .wa-widget__fab {
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.28);
}
