/* Airmax Chatbot — widget styles (by EcomFlow)
   --amc-primary / --amc-accent yönetim panelinden gelir (inline style ile üzerine yazılır). */

#amc-chatbot {
    --amc-primary: #13385a;
    --amc-accent: #ea9438;
    /* Türetilmiş tonlar: önce sabit yedek, sonra color-mix (destekleyen tarayıcılarda). */
    --amc-dark: #0d2740;
    --amc-light: #2f5d8a;
    --amc-dark: color-mix(in srgb, var(--amc-primary) 78%, #000);
    --amc-light: color-mix(in srgb, var(--amc-primary) 72%, #fff);
    --amc-grad: linear-gradient(135deg, var(--amc-dark), var(--amc-primary) 55%, var(--amc-light));
    --amc-bg: #eef3f7;
    --amc-border: #d9e2ec;
    --amc-text: #16243d;
    --amc-muted: #5f6b7d;
    --amc-shadow: 0 24px 60px -18px rgba(19, 56, 90, 0.45);
    --amc-side: 26px;
    --amc-bottom: 26px;
    font-family: inherit;
    color: var(--amc-text);
    font-size: 14.5px;
    line-height: 1.5;
}
#amc-chatbot *,
#amc-chatbot *::before,
#amc-chatbot *::after { box-sizing: border-box; }
#amc-chatbot svg { display: block; }
#amc-chatbot button {
    font-family: inherit; -webkit-appearance: none; appearance: none; margin: 0;
    text-transform: none; letter-spacing: normal; min-height: 0; height: auto;
    box-shadow: none; text-shadow: none; line-height: 1.3; outline: none;
}
#amc-chatbot input,
#amc-chatbot select { text-transform: none; letter-spacing: normal; box-shadow: none; }
#amc-chatbot h2 { text-transform: none; letter-spacing: normal; padding: 0; }
#amc-chatbot img { box-shadow: none; border: 0; }
#amc-chatbot a { box-shadow: none; }

/* ---------- Launcher ---------- */
#amc-chatbot .amc-launcher {
    position: fixed;
    left: var(--amc-side);
    bottom: var(--amc-bottom);
    z-index: 99990;
    height: 64px;
    min-width: 64px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    background: var(--amc-grad);
    color: #fff;
    box-shadow: var(--amc-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 22px 0 14px;
    overflow: hidden;
    transition: transform .35s cubic-bezier(.2, .9, .3, 1.3), box-shadow .3s, width .35s, padding .35s, border-radius .35s;
}
#amc-chatbot .amc-launcher:hover { transform: translateY(-3px) scale(1.04); }
#amc-chatbot .amc-launcher .amc-robot { width: 40px; height: 40px; flex: 0 0 auto; transition: transform .4s, opacity .25s; }
#amc-chatbot .amc-launcher-label { font-weight: 700; font-size: 19px; letter-spacing: .2px; white-space: nowrap; transition: opacity .25s, transform .35s; }
#amc-chatbot .amc-launcher .amc-x { position: absolute; width: 40px; height: 40px; transform: scale(0) rotate(90deg); transition: transform .4s; }
#amc-chatbot .amc-launcher.amc-open { width: 64px; min-width: 0; padding: 0; border-radius: 50%; }
#amc-chatbot .amc-launcher.amc-open .amc-robot,
#amc-chatbot .amc-launcher.amc-open .amc-launcher-label { transform: scale(0); opacity: 0; }
#amc-chatbot .amc-launcher.amc-open .amc-x { transform: scale(1) rotate(0); }
#amc-chatbot .amc-launcher::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 999px;
    border: 3px solid var(--amc-accent);
    opacity: .55;
    animation: amc-pulse 2.6s ease-out infinite;
    pointer-events: none;
}
#amc-chatbot .amc-launcher.amc-open::after { display: none; }
@keyframes amc-pulse {
    0%   { transform: scale(.92); opacity: .6; }
    70%  { transform: scale(1.45); opacity: 0; }
    100% { opacity: 0; }
}

/* ---------- Teaser ---------- */
#amc-chatbot .amc-teaser {
    position: fixed;
    left: var(--amc-side);
    bottom: calc(var(--amc-bottom) + 78px);
    z-index: 99988;
    width: 300px;
    max-width: calc(100vw - 52px);
    background: #fff;
    border: 1px solid var(--amc-border);
    border-radius: 18px 18px 18px 6px;
    box-shadow: var(--amc-shadow);
    padding: 16px;
    cursor: pointer;
    display: none;
    animation: amc-teaser-in .5s cubic-bezier(.2, .9, .3, 1.2) both;
    transition: transform .25s, box-shadow .25s;
}
#amc-chatbot .amc-teaser.amc-visible { display: block; }
#amc-chatbot .amc-teaser:hover { transform: translateY(-2px); }
#amc-chatbot .amc-teaser::after {
    content: "";
    position: absolute;
    left: 24px;
    bottom: -8px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-right: 1px solid var(--amc-border);
    border-bottom: 1px solid var(--amc-border);
    transform: rotate(45deg);
    border-bottom-right-radius: 3px;
}
#amc-chatbot .amc-teaser-row { display: flex; gap: 12px; align-items: flex-start; padding-right: 14px; }
#amc-chatbot .amc-teaser-avatar { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 12px; background: var(--amc-grad); display: grid; place-items: center; }
#amc-chatbot .amc-teaser-avatar svg { width: 24px; height: 24px; }
#amc-chatbot .amc-teaser-text { display: flex; flex-direction: column; gap: 3px; }
#amc-chatbot .amc-teaser-text b { font-size: 14px; color: var(--amc-primary); }
#amc-chatbot .amc-teaser-text span { font-size: 13px; line-height: 1.45; color: var(--amc-muted); }
#amc-chatbot .amc-teaser-close {
    position: absolute; top: 8px; right: 8px;
    width: 22px; height: 22px; border: none; border-radius: 50%;
    background: var(--amc-bg); color: var(--amc-muted); cursor: pointer;
    display: grid; place-items: center; padding: 0; transition: background .2s;
}
#amc-chatbot .amc-teaser-close:hover { background: var(--amc-border); }
#amc-chatbot .amc-teaser-close svg { width: 11px; height: 11px; }
@keyframes amc-teaser-in {
    0%   { opacity: 0; transform: translateY(14px) scale(.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Window ---------- */
#amc-chatbot .amc-window {
    position: fixed;
    left: var(--amc-side);
    bottom: calc(var(--amc-bottom) + 78px);
    z-index: 99989;
    width: 392px;
    max-width: calc(100vw - 32px);
    height: 660px;
    max-height: calc(100vh - 140px);
    background: #fff;
    border-radius: 22px;
    box-shadow: var(--amc-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(24px) scale(.96);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transform-origin: bottom left;
    transition: transform .4s cubic-bezier(.2, .9, .3, 1.2), opacity .3s, visibility .3s;
}
#amc-chatbot .amc-window.amc-open { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; visibility: visible; }

#amc-chatbot .amc-head { background: var(--amc-grad); color: #fff; padding: 10px 12px 11px; position: relative; overflow: hidden; flex: 0 0 auto; }
#amc-chatbot .amc-head::before { content: ""; position: absolute; right: -40px; top: -55px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
#amc-chatbot .amc-row { display: flex; align-items: center; gap: 10px; position: relative; }
#amc-chatbot .amc-avatar { width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; flex: 0 0 auto; }
#amc-chatbot .amc-avatar svg { width: 20px; height: 20px; }
#amc-chatbot .amc-id { display: flex; flex-direction: column; justify-content: center; min-width: 0; flex: 1 1 auto; }
#amc-chatbot .amc-id h2 { font-size: 14.5px; margin: 0; font-weight: 700; line-height: 1.15; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#amc-chatbot .amc-sub { font-size: 11.5px; opacity: .85; margin-top: 2px; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#amc-chatbot .amc-dot { width: 8px; height: 8px; border-radius: 50%; background: #7ee2a0; box-shadow: 0 0 0 3px rgba(126, 226, 160, .3); flex: 0 0 auto; }
#amc-chatbot .amc-head-actions { margin-left: auto; display: flex; gap: 7px; flex: 0 0 auto; }
#amc-chatbot .amc-restart,
#amc-chatbot .amc-close-head {
    background: rgba(255, 255, 255, .14); border: none; color: #fff;
    width: 28px; height: 28px; border-radius: 8px; cursor: pointer; padding: 0;
    display: grid; place-items: center; transition: background .2s;
}
#amc-chatbot .amc-restart:hover,
#amc-chatbot .amc-close-head:hover { background: rgba(255, 255, 255, .28); }
#amc-chatbot .amc-restart svg,
#amc-chatbot .amc-close-head svg { width: 15px; height: 15px; }
#amc-chatbot .amc-close-head { display: none; }

#amc-chatbot .amc-progress { height: 4px; background: var(--amc-bg); flex: 0 0 auto; }
#amc-chatbot .amc-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--amc-primary), var(--amc-accent)); border-radius: 0 3px 3px 0; transition: width .5s ease; }

#amc-chatbot .amc-body {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    padding: 20px 18px 8px; display: flex; flex-direction: column; gap: 14px;
    scroll-behavior: smooth; -webkit-overflow-scrolling: touch;
}
#amc-chatbot .amc-body::-webkit-scrollbar { width: 7px; }
#amc-chatbot .amc-body::-webkit-scrollbar-thumb { background: var(--amc-border); border-radius: 10px; }

/* ---------- Messages ---------- */
#amc-chatbot .amc-msg { display: flex; gap: 9px; align-items: flex-end; max-width: 88%; animation: amc-rise .45s cubic-bezier(.2, .9, .3, 1.1) both; }
#amc-chatbot .amc-mini { width: 28px; height: 28px; border-radius: 50%; background: var(--amc-grad); flex: 0 0 auto; display: grid; place-items: center; }
#amc-chatbot .amc-mini svg { width: 15px; height: 15px; }
#amc-chatbot .amc-msg.amc-user { align-self: flex-end; flex-direction: row-reverse; }
#amc-chatbot .amc-msg.amc-has-cards { max-width: 100%; }
#amc-chatbot .amc-msg.amc-has-cards .amc-bubble { flex: 1 1 auto; }
#amc-chatbot .amc-bubble { padding: 12px 15px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; min-width: 0; }
#amc-chatbot .amc-bot .amc-bubble { background: var(--amc-bg); color: var(--amc-text); border-bottom-left-radius: 5px; }
#amc-chatbot .amc-bot .amc-bubble a { color: var(--amc-primary); font-weight: 700; text-decoration: underline; }
#amc-chatbot .amc-user .amc-bubble { background: var(--amc-primary); color: #fff; border-bottom-right-radius: 5px; }
@keyframes amc-rise {
    0%   { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

#amc-chatbot .amc-typing .amc-bubble { display: flex; gap: 5px; padding: 14px 16px; }
#amc-chatbot .amc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--amc-light); opacity: .55; animation: amc-blink 1.3s infinite; }
#amc-chatbot .amc-typing i:nth-child(2) { animation-delay: .2s; }
#amc-chatbot .amc-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes amc-blink {
    0%, 60%, 100% { transform: translateY(0); opacity: .4; }
    30%           { transform: translateY(-5px); opacity: 1; }
}

/* ---------- Options ---------- */
#amc-chatbot .amc-options { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 37px; margin-top: -4px; animation: amc-rise .4s both; }
#amc-chatbot .amc-opt {
    border: 1.5px solid var(--amc-light); background: #fff; color: var(--amc-primary);
    font-weight: 600; font-size: 13.5px; padding: 9px 15px; border-radius: 999px;
    cursor: pointer; transition: .2s; line-height: 1.3; text-align: left;
}
#amc-chatbot .amc-opt:hover { background: var(--amc-primary); color: #fff; border-color: var(--amc-primary); transform: translateY(-1px); }
#amc-chatbot .amc-options.amc-full .amc-opt { flex: 1 1 100%; text-align: center; }

/* ---------- Product cards ---------- */
#amc-chatbot .amc-cards { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 11px; }
#amc-chatbot .amc-card {
    flex: 1 1 calc(50% - 5px); min-width: 132px;
    display: flex; flex-direction: column; align-items: stretch;
    border: 1.5px solid var(--amc-border); border-radius: 14px; overflow: hidden;
    text-decoration: none !important; color: var(--amc-text) !important; background: #fff; transition: .22s;
}
#amc-chatbot .amc-cards.amc-single .amc-card { flex: 1 1 100%; }
#amc-chatbot .amc-card:hover { border-color: var(--amc-accent); transform: translateY(-2px); box-shadow: 0 10px 22px -12px rgba(19, 56, 90, .45); }
#amc-chatbot .amc-ph { position: relative; display: grid; place-items: center; width: 100%; height: 124px; padding: 10px; background: #f7f9fb; overflow: hidden; }
#amc-chatbot .amc-cards.amc-single .amc-ph { height: 168px; }
#amc-chatbot .amc-ph img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
#amc-chatbot .amc-t { display: block; text-align: center; font-weight: 700; font-size: 13.5px; padding: 9px 8px 2px; border-top: 1px solid var(--amc-bg); }
#amc-chatbot .amc-d { display: block; text-align: center; font-size: 11.5px; color: var(--amc-muted); padding: 0 8px 9px; line-height: 1.35; }
#amc-chatbot .amc-card:hover .amc-t { color: var(--amc-primary); }

/* ---------- Footer form ---------- */
#amc-chatbot .amc-foot { display: none; padding: 10px 18px 12px; border-top: 1px solid var(--amc-bg); background: #fff; flex: 0 0 auto; max-height: 78%; overflow-y: auto; }
#amc-chatbot .amc-foot.amc-visible { display: block; }
#amc-chatbot .amc-form { display: flex; flex-direction: column; gap: 8px; animation: amc-rise .4s both; }
#amc-chatbot .amc-field label { display: block; font-size: 12px; font-weight: 600; color: var(--amc-muted); margin: 0 0 4px 3px; }
#amc-chatbot .amc-field .amc-req { color: #d6483b; }
#amc-chatbot .amc-field input,
#amc-chatbot .amc-field select {
    width: 100%; font-family: inherit; font-size: 14px; padding: 10px 13px; margin: 0;
    border: 1.5px solid var(--amc-border); border-radius: 11px; background: #fff; color: var(--amc-text);
    transition: .2s; outline: none; box-shadow: none; height: auto; line-height: 1.3;
}
#amc-chatbot .amc-field select { -webkit-appearance: none; appearance: none; padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f6b7d' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; cursor: pointer; }
#amc-chatbot .amc-field input:focus,
#amc-chatbot .amc-field select:focus { border-color: var(--amc-light); box-shadow: 0 0 0 3px rgba(19, 56, 90, .13); }
#amc-chatbot .amc-telwrap { display: flex; align-items: stretch; }
#amc-chatbot .amc-prefix { display: flex; align-items: center; padding: 0 12px; font-size: 14px; font-weight: 600; color: var(--amc-muted); background: var(--amc-bg); border: 1.5px solid var(--amc-border); border-right: 0; border-radius: 12px 0 0 12px; }
#amc-chatbot .amc-telwrap input { border-radius: 0 12px 12px 0; }
#amc-chatbot .amc-kvkk { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 12px; line-height: 1.45; color: var(--amc-muted); margin: 2px 3px 0; }
#amc-chatbot .amc-kvkk input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
#amc-chatbot .amc-kvkk-box { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; border: 1.5px solid var(--amc-border); border-radius: 6px; display: grid; place-items: center; color: #fff; background: #fff; transition: .2s; }
#amc-chatbot .amc-kvkk-box svg { width: 11px; height: 11px; opacity: 0; transition: opacity .15s; }
#amc-chatbot .amc-kvkk input:checked + .amc-kvkk-box { background: var(--amc-primary); border-color: var(--amc-primary); }
#amc-chatbot .amc-kvkk input:checked + .amc-kvkk-box svg { opacity: 1; }
#amc-chatbot .amc-kvkk input:focus-visible + .amc-kvkk-box { box-shadow: 0 0 0 3px rgba(19, 56, 90, .13); }
#amc-chatbot .amc-kvkk-text a { color: var(--amc-primary); font-weight: 600; text-decoration: underline; }
#amc-chatbot .amc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
#amc-chatbot .amc-form-err { color: #d6483b; font-size: 12.5px; font-weight: 600; margin: -2px 3px 0; min-height: 0; }
#amc-chatbot .amc-form-err:empty { display: none; }
#amc-chatbot .amc-form-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
#amc-chatbot .amc-send {
    border: none; color: #fff; font-weight: 700; font-size: 14.5px; padding: 12px; border-radius: 12px;
    cursor: pointer; transition: .25s; display: flex; align-items: center; justify-content: center; gap: 8px; line-height: 1.2;
}
#amc-chatbot .amc-send:hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 12px 24px -10px rgba(19, 56, 90, .5); }
#amc-chatbot .amc-send:disabled { opacity: .6; cursor: default; transform: none; }
#amc-chatbot .amc-send svg { width: 18px; height: 18px; }
#amc-chatbot .amc-send.amc-email { background: var(--amc-accent); }
#amc-chatbot .amc-send.amc-whatsapp { background: #25d366; }
#amc-chatbot .amc-send.amc-whatsapp:hover { box-shadow: 0 12px 24px -10px rgba(37, 211, 102, .55); }
#amc-chatbot .amc-hint { display: flex; align-items: center; justify-content: center; gap: 5px; margin: 2px 0 0; font-size: 11.5px; color: #8a9bb8; }
#amc-chatbot .amc-hint svg { width: 12px; height: 12px; }

#amc-chatbot .amc-credit { text-align: center; font-size: 11px; color: #8a9bb8; padding: 6px 0 10px; flex: 0 0 auto; }
#amc-chatbot .amc-credit b { color: var(--amc-primary); }

/* ---------- Right-side variant ---------- */
#amc-chatbot[data-position="right"] .amc-launcher,
#amc-chatbot[data-position="right"] .amc-teaser,
#amc-chatbot[data-position="right"] .amc-window { left: auto; right: var(--amc-side); }
#amc-chatbot[data-position="right"] .amc-window { transform-origin: bottom right; }
#amc-chatbot[data-position="right"] .amc-teaser { border-radius: 18px 18px 6px 18px; }
#amc-chatbot[data-position="right"] .amc-teaser::after { left: auto; right: 24px; }

/* ---------- Mobile ---------- */
@media (max-width: 460px) {
    #amc-chatbot { --amc-side: 16px; --amc-bottom: 16px; }
    #amc-chatbot .amc-launcher { height: 56px; min-width: 56px; padding: 0 18px 0 10px; }
    #amc-chatbot .amc-launcher .amc-robot { width: 36px; height: 36px; }
    #amc-chatbot .amc-launcher-label { font-size: 17px; }
    #amc-chatbot .amc-launcher.amc-open { display: none; }
    #amc-chatbot .amc-close-head { display: grid; }
    #amc-chatbot .amc-window,
    #amc-chatbot[data-position="right"] .amc-window {
        inset: 0; left: 0; right: 0; bottom: 0; width: 100%; max-width: 100%;
        height: 100%; max-height: 100%; border-radius: 0;
    }
    #amc-chatbot .amc-teaser,
    #amc-chatbot[data-position="right"] .amc-teaser { left: 16px; right: 16px; width: auto; bottom: calc(var(--amc-bottom) + 70px); }
    #amc-chatbot .amc-teaser::after { left: 22px; }
    body.amc-lock { overflow: hidden !important; }
}

@media (prefers-reduced-motion: reduce) {
    #amc-chatbot * { animation: none !important; transition: none !important; }
}
