/* Hesap arayuzu parcasi: whatsapp.css. Sahibi: baglam (hesap UI akisi, kb/06 § 16.24). */
/*
| Destek baglami, '*' parcasi (kart formu, sepet ve odeme sonucu haric).
|   - a.ae-wa: yuzen destek dugmesi; yalnizca gecerli numara varken
|     whatsapp.js cizer (numara yoksa dugme de yok). Yuvarlak ikon dugme
|     (sahip 2026-11-09): 56 x 56 px daire, ortada beyaz WhatsApp isareti
|     (30 px, satir ici SVG), gorunur metin yok (ad aria-label ve title);
|     z 80 (sekme cubugu 90, detay alt cubugu 89 ustte).
|     Renk (sahip istisnasi 2026-11-10, "wp yesili olacak"; config/aeke/
|     brand.php owner_exceptions.whatsapp_button, ice aktarici izni
|     config/aeke/site.php accent.owner_exceptions): zemin WhatsApp yesili
|     #25d366, isaret beyaz. Beyaz #25d366 uzerinde 1,98:1 kalir; isaretin
|     dis kenarinda WhatsApp koyu yesili #075e54 ince cizgi vardir (zemine
|     3,87:1, beyaza 7,67:1; WCAG 1.4.11 en az 3:1). Uzerine gelme #1ebe5b
|     (cizgiye 3,13:1); basili halde ayni ton ve hafif kuculme. Renk iki
|     temada da aynidir. Yesil degerler YALNIZ bu dosyada ve bu kuralda.
|   - .ae-wa-slot: siparis detayindaki destek yuvasi (WhatsApp ya da e-posta).
|   - .ae-prefill-note: on doldurulan destek formlarinin bilgi satiri
|     (on-doldurma.js; ayri stil dosyasi yok, bu parca o sayfalarda yuklu).
|   - Siparis detayi capalari sabit basligin altinda kalmaz.
| Renk yalnizca --customer-*, --ae-action* ve --ae-acc-* belirteclerinden;
| tek istisna yuzen dugmenin WhatsApp yesilleri (--ae-wa-*, yukarida).
*/

/* ==== Yuzen dugme ==== */
.ae-wa {
    position: fixed;
    right: max(24px, env(safe-area-inset-right));
    bottom: max(24px, env(safe-area-inset-bottom));
    z-index: 80;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    box-sizing: border-box;
    padding: 0;
    border-radius: 50%;
    --ae-wa-green: #25d366;
    --ae-wa-green-hover: #1ebe5b;
    --ae-wa-ink: #075e54;
    background: var(--ae-wa-green);
    color: #ffffff;
    line-height: 0;
    text-decoration: none;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32), 0 2px 6px rgba(0, 0, 0, 0.2);
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    transition: opacity 0.2s ease, transform 0.34s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0s, background-color 0.15s ease;
}

.ae-wa-icon {
    flex: none;
    display: block;
    width: 30px;
    height: 30px;
    fill: currentColor;
    pointer-events: none;
}

/* Isaretin dis kenari: koyu yesil cizgi dolgunun ALTINDA cizilir (paint-order),
   gorunen kisim 1,2 birimin yarisi (24 birimlik kutu 30 px: ~0,75 px). */
.ae-wa-icon path {
    stroke: var(--ae-wa-ink);
    stroke-width: 1.2;
    stroke-linejoin: round;
    paint-order: stroke fill;
}

.ae-wa:focus-visible {
    outline: 2px solid var(--customer-accent, #5cc6d0);
    outline-offset: 3px;
}

/* Zorunlu renk kipinde (Windows yuksek karsitlik) zemin duser: daire
   cerceveyle gorunur kalir. */
@media (forced-colors: active) {
    .ae-wa {
        border: 2px solid LinkText;
    }
}

.ae-wa:active {
    background: var(--ae-wa-green-hover);
    transform: scale(0.94);
    transition-duration: 0.1s;
}

@media (hover: hover) {
    .ae-wa:hover {
        background: var(--ae-wa-green-hover);
    }
}

/* Eylemle yarismaz, ortmez: satin alma sayfasi, acik menu ya da dialog
   (sepet, arama, panel, belge), bildirim ve detayda sag sutunla cakisma. */
html:has(main.purchase-page) .ae-wa,
html:has(#navigation.open) .ae-wa,
html:has(dialog[open]) .ae-wa,
html:has(.shop-toast) .ae-wa,
html:has(.ae-acc-toast) .ae-wa,
.ae-wa.is-tucked {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.34s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0.2s;
}

/* Dugme varken sayfanin son satiri (altbilgi) arkasinda kalmaz. */
html.ae-wa-on .brand-footer .footer-bottom {
    padding-bottom: 96px;
}

@media (max-width: 720px), (pointer: coarse) and (max-height: 500px) {
    /* Sekme cubugunun 16 px ustunde (cubuk 49 pt + 1 px ust cizgi), sag
       guvenli alan icinde. */
    .ae-wa {
        right: max(16px, env(safe-area-inset-right));
        bottom: calc(49px + 1px + 16px + env(safe-area-inset-bottom));
    }

    html.ae-wa-on .brand-footer .footer-bottom {
        padding-bottom: 96px;
    }

    /* Siparis detayi: telefonda yuzen dugme yok; destek alt cubukta ve
       destek kartinda. */
    html:has(.ae-od) .ae-wa {
        display: none;
    }

    html.ae-wa-on:has(.ae-od) .brand-footer .footer-bottom {
        padding-bottom: 24px;
    }
}

/* ==== Siparis detayi: destek yuvasi ==== */
.ae-od-contact:has(.ae-wa-slot) {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--customer-line);
}

.ae-wa-slot {
    display: grid;
    gap: 8px;
    justify-items: start;
}

.customer-page .ae-wa-slot .ae-wa-slot-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--customer-text);
}

.customer-page .ae-wa-slot .ae-wa-slot-text {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--customer-muted);
}

.customer-page .ae-wa-slot .ae-wa-slot-meta {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--customer-muted);
    word-break: break-all;
}

@media (max-width: 720px), (pointer: coarse) and (max-height: 500px) {
    .ae-wa-slot {
        justify-items: stretch;
    }

    .customer-page .ae-wa-slot .ae-wa-slot-meta {
        text-align: center;
    }
}

/* Detay bolumleri capayla acilir; sabit baslik bolum basligini ortmez.
   Paket kokte scroll-padding-top: 80px verir; bu deger ona eklenir
   (masaustunde toplam 108 px, kitin --ae-acc-head degeri). */
.ae-od :is(#teslimat, #islemler, #garanti, #belgeler) {
    scroll-margin-top: 28px;
}

.ae-od :is(#teslimat, #islemler, #garanti, #belgeler):focus {
    outline: none;
}

@media (max-width: 720px), (pointer: coarse) and (max-height: 500px) {
    .ae-od :is(#teslimat, #islemler, #garanti, #belgeler) {
        scroll-margin-top: env(safe-area-inset-top);
    }
}

/* ==== On doldurma bilgi satiri ==== */
.ae-prefill-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid var(--ae-acc-info-line, var(--customer-line, rgba(255, 255, 255, 0.16)));
    border-radius: 12px;
    background: var(--customer-soft, transparent);
    color: var(--customer-text, inherit);
    font-size: 15px;
    line-height: 1.5;
    text-align: left;
}

.ae-prefill-note::before {
    content: '';
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    background: var(--customer-accent, currentColor);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M12 8.2v.1M12 11v6'/%3E%3Cpath d='M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M12 8.2v.1M12 11v6'/%3E%3Cpath d='M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (prefers-reduced-motion: reduce) {
    .ae-wa,
    .ae-wa:active,
    .ae-wa.is-tucked {
        transition: none;
        transform: none;
    }
}
