/*
 * Nefes Atölyesi WhatsApp ile Satın Al v1.1.0
 * Yalnızca mağazada JS tarafından işaretlenen ürün butonlarını etkiler.
 */

/* İki düğmeyi aynı satıra al: diğer ürün kartlarına dokunma. */
.nefeswa-inline-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: center !important;
    gap: 7px !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

.nefeswa-inline-actions > .nefeswa-buy-branch,
.nefeswa-inline-actions > .nefeswa-cart-branch {
    display: flex !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: auto !important;
    float: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* İki butonu aynı yükseklikte tut; WooCommerce sepet aksiyonu çalışmaya devam eder. */
.nefeswa-inline-actions > a.nefeswa-btn,
.nefeswa-inline-actions > a.nefeswa-cart-peer,
.nefeswa-inline-actions > .nefeswa-buy-branch > a.nefeswa-btn,
.nefeswa-inline-actions > .nefeswa-cart-branch > a.nefeswa-cart-peer {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    float: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    vertical-align: middle !important;
}

/* WhatsApp düğmesi: oval kenar, animasyon ve WhatsApp yeşili. */
a.nefeswa-btn,
.woocommerce a.nefeswa-btn,
.woocommerce ul.products li.product a.nefeswa-btn,
.fusion-woocommerce a.nefeswa-btn {
    position: relative !important;
    isolation: isolate;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    gap: 5px !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 42px !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 9px 10px !important;
    overflow: hidden !important;
    border: 1px solid rgba(255,255,255,.4) !important;
    border-radius: 9999px !important;
    -webkit-border-radius: 9999px !important;
    background: linear-gradient(115deg, #12a24d 0%, #25d366 55%, #128d46 100%) !important;
    background-color: #20ba5d !important;
    box-shadow: 0 4px 14px rgba(18,157,77,.26) !important;
    color: #fff !important;
    font-family: inherit !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    letter-spacing: 0 !important;
    text-decoration: none !important;
    text-align: center !important;
    text-transform: none !important;
    white-space: normal !important;
    cursor: pointer !important;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease !important;
    animation: nefeswa-breathe 2.8s ease-in-out infinite;
    -webkit-tap-highlight-color: transparent;
}

/* Tema sonradan :before ve :after biçimlendirmesi verse de oval kalır. */
a.nefeswa-btn::before,
.woocommerce a.nefeswa-btn::before {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 0 !important;
    border: 1px solid rgba(255,255,255,.30) !important;
    border-radius: inherit !important;
    pointer-events: none !important;
    animation: nefeswa-ring 2.8s ease-out infinite;
}

a.nefeswa-btn::after,
.woocommerce a.nefeswa-btn::after {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 0 !important;
    border-radius: inherit !important;
    background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,.23) 50%, transparent 75%) !important;
    background-size: 250% 100% !important;
    background-position: 100% 0;
    pointer-events: none !important;
    animation: nefeswa-shine 4.8s ease-in-out infinite;
}

a.nefeswa-btn .nefeswa-icon {
    position: relative;
    z-index: 1;
    display: block !important;
    flex: 0 0 16px !important;
    width: 16px !important;
    height: 16px !important;
    color: #fff !important;
    fill: currentColor;
}

a.nefeswa-btn .nefeswa-label {
    position: relative;
    z-index: 1;
    display: block;
    min-width: 0;
    line-height: 1.2;
    text-wrap: balance;
}

a.nefeswa-btn .nefeswa-pulse-dot {
    position: relative;
    z-index: 1;
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e5fff0;
    box-shadow: 0 0 0 0 rgba(229,255,240,.52);
    animation: nefeswa-dot 1.9s ease-out infinite;
}

a.nefeswa-btn:hover,
a.nefeswa-btn:focus-visible,
.woocommerce a.nefeswa-btn:hover,
.woocommerce a.nefeswa-btn:focus-visible {
    color: #fff !important;
    background: linear-gradient(120deg, #118f49, #20c45e) !important;
    box-shadow: 0 8px 22px rgba(18,157,77,.38) !important;
    transform: translateY(-2px) !important;
    text-decoration: none !important;
    border-radius: 9999px !important;
}

a.nefeswa-btn:focus-visible { outline: 2px solid #125b36 !important; outline-offset: 3px !important; }
a.nefeswa-btn:active { transform: translateY(0) scale(.98) !important; }

@keyframes nefeswa-breathe {
    0%, 100% { box-shadow: 0 4px 12px rgba(18,157,77,.20); }
    50% { box-shadow: 0 5px 19px rgba(18,157,77,.39); }
}
@keyframes nefeswa-ring {
    0% { opacity: .8; transform: scale(1); }
    65%, 100% { opacity: .15; transform: scale(.96); }
}
@keyframes nefeswa-shine {
    0%, 34% { background-position: 100% 0; opacity: 0; }
    43% { opacity: 1; }
    60%, 100% { background-position: -100% 0; opacity: 0; }
}
@keyframes nefeswa-dot {
    0% { box-shadow: 0 0 0 0 rgba(229,255,240,.52); }
    70%, 100% { box-shadow: 0 0 0 6px rgba(229,255,240,0); }
}

/* Dar ekranlarda metin satır kırabilir ancak butonlar birbirinin altına geçmez. */
@media (max-width: 600px) {
    .nefeswa-inline-actions { gap: 5px !important; }
    a.nefeswa-btn,
    .woocommerce a.nefeswa-btn,
    .woocommerce ul.products li.product a.nefeswa-btn {
        min-height: 40px !important;
        padding: 8px 6px !important;
        font-size: 10px !important;
        gap: 4px !important;
    }
    a.nefeswa-btn .nefeswa-icon {
        flex-basis: 15px !important;
        width: 15px !important;
        height: 15px !important;
    }
    a.nefeswa-btn .nefeswa-pulse-dot { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    a.nefeswa-btn, a.nefeswa-btn::before, a.nefeswa-btn::after,
    a.nefeswa-btn .nefeswa-pulse-dot {
        animation: none !important;
        transition: none !important;
    }
}
