/**
 * Üst bar — açılır arama kutusu + küçük görsel efektler.
 * navbar.css'ten sonra yüklenir (_navbar.html).
 */

/* ================ AÇILIR ARAMA ================ */
.ed-search { position: relative; display: inline-flex; }

.ed-search-form {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 3;
    width: var(--ed-search-w, 420px);
    height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 6px 0 12px;
    margin: 0;
    background: #fff;
    border: 2px solid #f27a1a;
    border-radius: 10px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.55), 0 0 0 4px rgba(242, 122, 26, 0.18);
    /* Kapalıyken sağ kenarda sıfır genişlik: açılırken sola doğru büyür */
    clip-path: inset(0 0 0 100% round 10px);
    opacity: 0;
    pointer-events: none;
    transition: clip-path .32s cubic-bezier(.2, .8, .2, 1), opacity .18s ease;
}
.ed-search.open .ed-search-form {
    clip-path: inset(0 0 0 0 round 10px);
    opacity: 1;
    pointer-events: auto;
}
.ed-search.open .ed-search-toggle { visibility: hidden; }

.ed-search-ico { color: #f27a1a; font-size: 1rem; flex-shrink: 0; }

.ed-search-form input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #1b2238;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
}
.ed-search-form input::placeholder { color: #8a8f9c; font-weight: 500; }
/* Tarayıcının kendi temizle (x) simgesi — bizimki var */
.ed-search-form input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.ed-search-close {
    flex-shrink: 0;
    width: 30px; height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: #f3f1ee;
    color: #4a4f5c;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.ed-search-close:hover, .ed-search-close:focus-visible {
    background: #f27a1a;
    color: #fff;
    outline: none;
}

/* Telefon / tablet: barın hemen altında tam genişlik */
@media (max-width: 992px) {
    .ed-search { position: static; }
    .ed-search-form {
        top: calc(100% + 8px);
        left: 10px;
        right: 10px;
        width: auto;
        height: 48px;
        border-radius: 12px;
        clip-path: inset(0 0 100% 0 round 12px);
        transform: translateY(-6px);
        transition: clip-path .28s cubic-bezier(.2, .8, .2, 1), opacity .18s ease, transform .28s ease;
    }
    .ed-search.open .ed-search-form {
        clip-path: inset(0 0 0 0 round 12px);
        transform: none;
    }
    /* Telefonda düğme yerinde kalır, ikinci basış kutuyu kapatır */
    .ed-search.open .ed-search-toggle {
        visibility: visible;
        background: rgba(242, 122, 26, 0.18);
        border-color: rgba(242, 122, 26, 0.5);
    }
    /* iOS'ta odaklanınca sayfa büyümesin diye en az 16px */
    .ed-search-form input { font-size: 16px; }
}

/* Öneri listesi üst bardaki kutunun altında da düzgün görünsün */
.search-suggest-dropdown { z-index: 1080; }

/* ================ BAR EFEKTLERİ ================ */

/* Üst kenarda ince ışık: bar sayfadan "kopar" */
.ed-nav::before {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.14) 50%, transparent 100%);
    pointer-events: none;
}

/* Alt turuncu çizgide yavaş akan parıltı */
.ed-nav::after {
    background: linear-gradient(90deg, transparent 0%, #d61c1c 20%, #f27a1a 35%, #ffc27a 50%, #f27a1a 65%, #d61c1c 80%, transparent 100%);
    background-size: 200% 100%;
    animation: edLine 9s linear infinite;
}
@keyframes edLine {
    from { background-position: 100% 0; }
    to   { background-position: -100% 0; }
}

/* Kaydırınca logo da hafif küçülür */
.ed-brand img { transition: width .25s ease, height .25s ease; }
.ed-nav.scrolled .ed-brand img { width: 32px; height: 32px; }

/* Düğme ikonları üzerine gelince küçük bir hareket yapar */
.ed-icon-btn i { transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.ed-icon-btn:hover i { transform: scale(1.12) rotate(-6deg); }
.ed-icon-btn:hover {
    box-shadow: 0 6px 16px -8px rgba(242, 122, 26, 0.6);
}
.ed-icon-btn:focus-visible, .ed-user:focus-visible, .ed-link:focus-visible {
    outline: 2px solid #f27a1a;
    outline-offset: 2px;
}

/* Sağdaki düğmeler aynı yükseklikte (40px) */
.ed-user {
    height: 40px;
    padding: 4px 14px 4px 4px;
    box-sizing: border-box;
}

/* Kampanyalar noktası: yanıp sönmek yerine yavaşça "nefes alır" */
.ed-link.flame .pulse { animation: edBreathe 2.4s ease-in-out infinite; }
@keyframes edBreathe {
    0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(255, 77, 58, 0.5); }
    50%      { transform: scale(1.25); box-shadow: 0 0 0 5px rgba(255, 77, 58, 0); }
}

/* Sepet sayacı: ürün eklenince kısa zıplama */
.ed-cart-badge.bump { animation: edBump .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes edBump {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.45); }
    100% { transform: scale(1); }
}

/* "Hareketi azalt" açık olanlarda efektler kapanır */
@media (prefers-reduced-motion: reduce) {
    .ed-nav::after, .ed-link.flame .pulse, .ed-cart-badge.bump { animation: none; }
    .ed-search-form, .ed-icon-btn i, .ed-brand img { transition: none; }
    .ed-icon-btn:hover i { transform: none; }
}
