/**
 * Sol-alt: WhatsApp | Sağ-alt: paylaşım + sosyal (açılır)
 * --timtek-vv-bottom: JS (visualViewport) ile ek alt boşluk; mobilde yarım görünmeyi önler
 */
:root {
    --timtek-vv-bottom: 0px;
}

.timtek-float-stack {
    position: fixed;
    bottom: calc(max(28px, 12px + env(safe-area-inset-bottom, 0px)) + var(--timtek-vv-bottom, 0px));
    /* Tema (preloader 99999999) ve katmanların üstünde */
    z-index: 2147483000;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    font-family: "Montserrat", system-ui, sans-serif;
}

.timtek-float-stack--left {
    left: max(16px, env(safe-area-inset-left));
    right: auto;
    align-items: flex-start;
}

.timtek-float-stack--right {
    left: auto;
    right: max(16px, env(safe-area-inset-right));
    align-items: flex-end;
}

.timtek-float-fabs {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 10px;
    max-width: min(100vw - 32px, 420px);
}

.timtek-float-fabs--social-col {
    align-items: flex-end;
}

.timtek-float-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    touch-action: manipulation;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    color: #fff;
    font-size: 24px;
    line-height: 1;
}

.timtek-float-fab:focus-visible {
    outline: 3px solid rgba(37, 211, 102, 0.55);
    outline-offset: 3px;
}

.timtek-float-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.timtek-float-fab--wa {
    width: auto;
    min-width: 52px;
    height: auto;
    min-height: 52px;
    padding: 10px 18px 10px 14px;
    border-radius: 999px;
    gap: 10px;
    background: #25d366;
}

.timtek-float-fab--wa > i {
    font-size: 30px;
    line-height: 1;
    flex-shrink: 0;
}

.timtek-float-fab--wa:hover {
    background: #20bd5a;
}

.timtek-float-fab--social {
    background: #03246b;
}

.timtek-float-fab--social:hover {
    background: #042d7a;
}

.timtek-float-fab--social.is-open {
    background: #042d7a;
}

.timtek-float-fab__chev {
    transition: transform 0.25s ease;
}

.timtek-float-fab--social.is-open .timtek-float-fab__chev {
    transform: rotate(180deg);
}

.timtek-social-flyout {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.35s ease, opacity 0.25s ease;
}

.timtek-social-flyout.is-open {
    max-height: 420px;
    opacity: 1;
    pointer-events: auto;
}

.timtek-float-debug-empty {
    font-size: 11px;
    line-height: 1.35;
    color: #64748b;
    max-width: 200px;
    text-align: right;
    padding: 6px 4px;
}

.timtek-float-fab__label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    line-height: 1.2;
}

/* ——— Responsive: tablet / telefon (Mobile L ~425px dahil) ——— */
@media (max-width: 768px) {
    .timtek-float-stack {
        bottom: calc(max(44px, 20px + env(safe-area-inset-bottom, 0px)) + var(--timtek-vv-bottom, 0px));
    }
}

@media (max-width: 576px) {
    .timtek-float-stack {
        bottom: calc(max(52px, 24px + env(safe-area-inset-bottom, 0px)) + var(--timtek-vv-bottom, 0px));
    }

    .timtek-float-stack--left {
        left: max(10px, env(safe-area-inset-left));
    }

    .timtek-float-stack--right {
        right: max(10px, env(safe-area-inset-right));
    }

    .timtek-float-fabs {
        max-width: calc(100vw - 20px);
    }

    .timtek-wa-panel {
        width: min(360px, calc(100vw - 20px));
    }

    .timtek-wa-panel__head-title {
        font-size: 13px;
    }

    .timtek-wa-panel__head-text {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* iOS: input odakta otomatik zoom’u engellemek için min. 16px */
    .timtek-wa-panel__input {
        font-size: 16px;
        min-height: 44px;
    }

    .timtek-wa-panel__send-icon {
        width: 44px;
        height: 44px;
    }

    .timtek-social-rail__link {
        width: 46px;
        height: 46px;
        min-width: 44px;
        min-height: 44px;
    }

    .timtek-float-fab {
        min-width: 48px;
        min-height: 48px;
    }

    .timtek-float-debug {
        left: max(8px, env(safe-area-inset-left));
        top: max(72px, env(safe-area-inset-top));
        max-width: calc(100vw - 16px);
    }
}

@media (max-width: 380px) {
    .timtek-float-fab__label {
        font-size: 12px;
    }

    .timtek-float-fab--wa {
        padding: 9px 12px 9px 10px;
        min-height: 48px;
        gap: 8px;
    }

    .timtek-float-fab--wa > i {
        font-size: 26px;
    }

    .timtek-wa-panel__intro {
        font-size: 13px;
    }
}

.timtek-social-rail__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    font-size: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timtek-social-rail__link:hover {
    transform: scale(1.08);
    color: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.26);
}

.timtek-social-rail__link--instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.timtek-social-rail__link--linkedin { background: #0a66c2; }
.timtek-social-rail__link--twitter { background: #000; }
.timtek-social-rail__link--facebook { background: #1877f2; }
.timtek-social-rail__link--youtube { background: #ff0000; }

/* Küçük ekranda panel taşmasın; yükseklik viewport’a göre sınırlı */
.timtek-wa-panel {
    width: min(360px, calc(100vw - 24px));
    max-width: calc(100vw - 16px);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.4s ease, opacity 0.25s ease;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.timtek-wa-panel.is-open {
    max-height: min(85vh, 520px);
    opacity: 1;
    pointer-events: auto;
}

.timtek-wa-panel__inner {
    display: flex;
    flex-direction: column;
    background: #e5ddd5;
    border-radius: 12px;
    border: 1px solid rgba(7, 94, 84, 0.22);
    max-height: inherit;
}

.timtek-wa-panel__inner--wa {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-shadow: 0 4px 20px rgba(7, 94, 84, 0.15);
}

.timtek-wa-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    color: #fff;
}

/* WhatsApp üst çubuk yeşili (Web/mobil uygulama tonu) */
.timtek-wa-panel__head--wa {
    background: linear-gradient(180deg, #128c7e 0%, #075e54 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.timtek-wa-panel__head-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.timtek-wa-panel__head-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
}

.timtek-wa-panel__head-icon i {
    font-size: 22px;
    color: #fff;
}

.timtek-wa-panel__head-text {
    line-height: 1.25;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.timtek-wa-panel__close {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.timtek-wa-panel__close:hover {
    background: rgba(255, 255, 255, 0.24);
}

.timtek-wa-panel__body {
    padding: 0;
}

/* Sohbet alanı: klasik WhatsApp duvar kağıdı tonu + hafif doku */
.timtek-wa-panel__body--wa {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.timtek-wa-panel__chat {
    flex: 1;
    min-height: 72px;
    padding: 12px 12px 8px;
    background-color: #e5ddd5;
    background-image:
        repeating-linear-gradient(
            -42deg,
            rgba(0, 0, 0, 0.028) 0,
            rgba(0, 0, 0, 0.028) 1px,
            transparent 1px,
            transparent 10px
        ),
        repeating-linear-gradient(
            42deg,
            rgba(255, 255, 255, 0.04) 0,
            rgba(255, 255, 255, 0.04) 1px,
            transparent 1px,
            transparent 12px
        );
}

/* Gelen mesaj balonu */
.timtek-wa-panel__bubble {
    display: inline-block;
    max-width: 100%;
    background: #fff;
    border-radius: 0 9px 9px 9px;
    padding: 8px 11px 9px;
    box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}

.timtek-wa-panel__intro {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.5;
    color: #111b21;
    font-weight: 400;
}

/* Alt yazı çubuğu (WhatsApp Web giriş bandı) */
.timtek-wa-panel__composer-bar {
    background: #f0f2f5;
    padding: 8px 10px 10px;
    border-top: 1px solid rgba(17, 27, 33, 0.08);
}

.timtek-wa-panel__composer {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timtek-wa-panel__input {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(17, 27, 33, 0.12);
    border-radius: 999px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    color: #111b21;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.timtek-wa-panel__input::placeholder {
    color: #8696a0;
}

.timtek-wa-panel__input:focus {
    outline: none;
    border-color: #25d366;
    box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.22);
    background: #fff;
}

/* WhatsApp gönder yeşili */
.timtek-wa-panel__send-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: background 0.2s ease, transform 0.15s ease;
}

.timtek-wa-panel__send-icon:hover {
    background: #20bd5a;
}

.timtek-wa-panel__send-icon:active {
    transform: scale(0.96);
}

.timtek-wa-panel__send-icon:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.45);
}

.timtek-float-debug {
    position: fixed;
    left: 12px;
    top: 80px;
    z-index: 2147483100;
    max-width: min(420px, calc(100vw - 24px));
    padding: 12px 36px 12px 12px;
    background: #1e293b;
    color: #e2e8f0;
    font-size: 11px;
    line-height: 1.4;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    font-family: ui-monospace, monospace;
}

.timtek-float-debug strong {
    display: block;
    margin-bottom: 8px;
    color: #fbbf24;
}

.timtek-float-debug__pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 10px;
}

.timtek-float-debug__close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.timtek-float-debug__close:hover {
    background: rgba(255, 255, 255, 0.22);
}

@media (prefers-reduced-motion: reduce) {
    .timtek-float-fab,
    .timtek-social-flyout,
    .timtek-social-rail__link,
    .timtek-wa-panel,
    .timtek-float-fab__chev {
        transition: none;
    }
}
