/* =============================================
   Dijix Search — hantema.com v1.0.0
   ============================================= */

/* ---- Elementor reset: widget kenarlık/padding sıfırla ---- */
.elementor-widget-dijix_search,
.elementor-widget-dijix_search .elementor-widget-container {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ---- Wrap ---- */
.dsearch-wrap {
    position: relative;
    width: 100%;
    max-width: 340px;
    font-family: inherit;
}

/* ---- Bar ---- */
.dsearch-bar {
    display: flex;
    align-items: center;
    gap: 0;
    height: 46px;
    padding: 0 6px 0 16px;
    background: #f4f4f4;
    border: 2px solid transparent !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    cursor: text;
}

/* Stil varyantları */
.dsearch-style-pill .dsearch-bar      { border-radius: 100px; }
.dsearch-style-rounded .dsearch-bar   { border-radius: 10px; }
.dsearch-style-sharp .dsearch-bar     { border-radius: 0; }
.dsearch-style-underline .dsearch-bar {
    border-radius: 0;
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid #ddd !important;
    padding-left: 0;
    padding-right: 0;
}
.dsearch-style-underline .dsearch-bar.focused { border-bottom-color: #222 !important; box-shadow: none !important; }

.dsearch-bar.focused {
    border-color: #222 !important;
    box-shadow: 0 0 0 3px rgba(34,34,34,0.1) !important;
}

/* Input — solda, icon sağda */
.dsearch-input {
    flex: 1;
    background: none;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    font-size: 14px;
    color: #222;
    min-width: 0;
    padding: 0;
    line-height: 1;
    -webkit-appearance: none;
    appearance: none;
}
.dsearch-input::-webkit-search-cancel-button,
.dsearch-input::-webkit-search-decoration { display: none; }
.dsearch-input:focus { outline: none !important; box-shadow: none !important; border: none !important; }

/* Clear butonu */
.dsearch-clear {
    flex-shrink: 0;
    background: none;
    border: none !important;
    padding: 4px;
    cursor: pointer;
    color: #aaa;
    display: flex;
    align-items: center;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
    outline: none;
}
.dsearch-clear svg   { width: 13px; height: 13px; display: block; }
.dsearch-clear:hover { color: #333; background: rgba(0,0,0,0.07); }

/* Arama ikonu — sağda */
.dsearch-icon-btn {
    flex-shrink: 0;
    background: none;
    border: none !important;
    padding: 6px 10px;
    cursor: pointer;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    border-radius: 0;
    outline: none;
    order: 10; /* daima en sağda */
}
.dsearch-icon-btn svg           { width: 17px; height: 17px; display: block; }
.dsearch-bar.focused .dsearch-icon-btn { color: #222; }

/* Pill stilinde sağ ikon için yuvarlak arka plan */
.dsearch-style-pill .dsearch-bar .dsearch-icon-btn {
    background: #222;
    color: #fff;
    border-radius: 100px;
    width: 34px;
    height: 34px;
    padding: 0;
    margin-right: 2px;
}
.dsearch-style-pill .dsearch-bar.focused .dsearch-icon-btn { background: #000; color: #fff; }

/* ===============================================
   MASAÜSTÜ — Tam Ekran Arama Paneli (Dropdown)
   =============================================== */
.dsearch-results {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15,15,15,0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 20px 40px;
    animation: dsearchFadeIn 0.22s ease;
    min-height: 100vh;
}
@keyframes dsearchFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.dsearch-results-inner {
    width: 100%;
    max-width: 680px;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0,0,0,0.22), 0 8px 24px rgba(0,0,0,0.1);
    animation: dsearchSlideDown 0.26s cubic-bezier(0.22,1,0.36,1);
}
@keyframes dsearchSlideDown {
    from { transform: translateY(-20px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0)     scale(1);    opacity: 1; }
}

/* Üstte büyük arama barı */
.dsearch-panel-searchbar {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 20px;
    height: 64px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
}
.dsearch-panel-searchbar-icon {
    color: #999;
    display: flex;
    flex-shrink: 0;
    margin-right: 12px;
}
.dsearch-panel-searchbar-icon svg { width: 20px; height: 20px; }
.dsearch-panel-searchbar-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    font-size: 18px;
    color: #111;
    background: transparent;
    padding: 0;
    min-width: 0;
}
.dsearch-panel-searchbar-input::-webkit-search-cancel-button { display: none; }
.dsearch-panel-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    display: flex;
    padding: 6px;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}
.dsearch-panel-close svg   { width: 18px; height: 18px; }
.dsearch-panel-close:hover { background: #f0f0f0; color: #222; }

/* Loader */
.dsearch-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px;
}
.dsearch-loader-dots { display: flex; gap: 5px; }
.dsearch-loader-dots span {
    width: 7px; height: 7px;
    background: #bbb;
    border-radius: 50%;
    animation: dsearchBounce 0.9s infinite ease-in-out;
}
.dsearch-loader-dots span:nth-child(1) { animation-delay: 0s; }
.dsearch-loader-dots span:nth-child(2) { animation-delay: 0.15s; }
.dsearch-loader-dots span:nth-child(3) { animation-delay: 0.30s; }
@keyframes dsearchBounce {
    0%,80%,100% { transform: scale(0.7); opacity: 0.5; }
    40%          { transform: scale(1.0); opacity: 1;   }
}

/* No result */
.dsearch-empty {
    padding: 40px 20px;
    text-align: center;
    color: #aaa;
    font-size: 14px;
}
.dsearch-empty svg { width: 40px; height: 40px; margin: 0 auto 12px; display: block; opacity: 0.25; }

/* Sonuç header */
.dsearch-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 8px;
    border-bottom: 1px solid #f5f5f5;
}
.dsearch-results-count {
    font-size: 11px;
    color: #bbb;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Item */
.dsearch-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    text-decoration: none;
    color: inherit;
    transition: background 0.13s;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
}
.dsearch-item:last-of-type { border-bottom: none; }
.dsearch-item:hover         { background: #fafafa; }

/* Ürün görseli */
.dsearch-item-thumb {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    background: #f0f0f0;
    border: 1px solid #eee;
}
.dsearch-item-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.dsearch-item-thumb-placeholder {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
}
.dsearch-item-thumb-placeholder svg { width: 22px; height: 22px; }

/* Meta */
.dsearch-item-meta { flex: 1; min-width: 0; }
.dsearch-item-top {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 3px;
}
.dsearch-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.dsearch-item-title mark {
    background: rgba(245,158,11,0.18);
    color: #c07600;
    border-radius: 2px;
    padding: 0 2px;
    font-style: normal;
}
.dsearch-item-type {
    flex-shrink: 0;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    background: #111;
    color: #fff;
    padding: 2px 7px;
    border-radius: 4px;
    line-height: 1.7;
}
.dsearch-item-excerpt {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    margin-top: 1px;
}
/* Fiyat */
.dsearch-item-price {
    font-size: 14px;
    font-weight: 700;
    color: #111;
    white-space: nowrap;
    margin-left: auto;
    padding-left: 12px;
    flex-shrink: 0;
}
.dsearch-item-price-sale {
    color: #e53e3e;
}
.dsearch-item-price-old {
    font-size: 11px;
    font-weight: 400;
    color: #bbb;
    text-decoration: line-through;
    display: block;
    text-align: right;
}

/* Ok */
.dsearch-item-arrow {
    flex-shrink: 0;
    color: #ddd;
    transition: color 0.15s, transform 0.15s;
    display: flex;
}
.dsearch-item-arrow svg       { width: 14px; height: 14px; }
.dsearch-item:hover .dsearch-item-arrow { color: #999; transform: translateX(3px); }

/* Tüm sonuçlar */
.dsearch-viewall {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: #111;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: background 0.2s;
    cursor: pointer;
}
.dsearch-viewall:hover { background: #000; }
.dsearch-viewall svg   { width: 14px; height: 14px; }

/* Klavye ipucu */
.dsearch-keyboard-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 10px 20px;
    background: #f9f9f9;
    border-top: 1px solid #f0f0f0;
}
.dsearch-keyboard-hint span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #bbb;
}
.dsearch-keyboard-hint kbd {
    background: #eee;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 10px;
    font-family: monospace;
    color: #666;
    line-height: 1.6;
}

/* ================================================
   MOBİL İKON & OVERLAY
   ================================================ */
.dsearch-mobile-trigger { display: none; }

.dsearch-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    backdrop-filter: blur(4px);
}
.dsearch-overlay.active { opacity: 1; pointer-events: all; }

.dsearch-overlay-box {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: #fff;
    z-index: 99999;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    transform: translateY(-100%);
    transition: transform 0.25s cubic-bezier(0.22,1,0.36,1);
}
.dsearch-overlay-box.active { transform: translateY(0); }

.dsearch-overlay-bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 8px 0 14px;
    background: #f4f4f4;
    border-radius: 100px;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}
.dsearch-overlay-bar.focused { border-color: #222; }

.dsearch-overlay-input {
    flex: 1;
    background: none;
    border: none !important;
    outline: none !important;
    font-size: 15px;
    color: #222;
    min-width: 0;
    padding: 0;
}
.dsearch-overlay-input::-webkit-search-cancel-button { display: none; }

.dsearch-overlay-icon { color: #888; display: flex; flex-shrink: 0; order: 10; }
.dsearch-overlay-icon svg { width: 17px; height: 17px; }

.dsearch-overlay-clear {
    background: none; border: none; padding: 3px;
    cursor: pointer; color: #aaa; display: flex;
    border-radius: 50%; transition: color 0.2s;
    order: 9;
}
.dsearch-overlay-clear svg { width: 13px; height: 13px; }

.dsearch-overlay-cancel {
    flex-shrink: 0;
    background: none; border: none;
    font-size: 14px; font-weight: 600;
    color: #555; cursor: pointer; padding: 6px 4px;
    white-space: nowrap; transition: color 0.2s;
}
.dsearch-overlay-cancel:hover { color: #111; }

.dsearch-overlay-results {
    position: fixed;
    top: 64px; left: 0; right: 0; bottom: 0;
    background: #fff;
    z-index: 99999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: dsearchSlideUp 0.2s ease;
}
@keyframes dsearchSlideUp {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* Mobil item daha büyük dokunma alanı */
.dsearch-overlay-results .dsearch-item { padding: 14px 16px; }
.dsearch-overlay-results .dsearch-item-thumb { width: 52px; height: 52px; }

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 767px) {
    /* Masaüstü bar gizle, mobil ikon göster */
    .dsearch-has-mobile .dsearch-bar     { display: none; }
    .dsearch-mobile-trigger {
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none !important;
        cursor: pointer;
        padding: 4px;
        color: #222;
        transition: color 0.2s, transform 0.2s;
        outline: none;
    }
    .dsearch-mobile-trigger:hover { transform: scale(1.1); }
    .dsearch-mobile-trigger svg   { width: 22px; height: 22px; display: block; }

    /* Masaüstü panel mobilde gösterme */
    .dsearch-results { display: none !important; }
}

@media (min-width: 768px) {
    .dsearch-overlay,
    .dsearch-overlay-box,
    .dsearch-overlay-results { display: none !important; }
}
