/*
 * =====================================================================
 *  ARAMA MODÜLÜ STİLLERİ
 *  Yer: /modules/search/assets/search.css
 * ---------------------------------------------------------------------
 *  TÜM sınıflar "lfm-search-" ile başlar => sitenin geri kalanıyla
 *  ASLA çakışmaz. Modül kapatılınca bu dosya hiç yüklenmez.
 *  Renkler /theme/css/lafon.css içindeki --lf-* değişkenlerinden gelir.
 * =====================================================================
 */

/* ---------- Header arama formu (masaüstü) ---------- */
.lfm-search { position: relative; width: 100%; }
.lfm-search-box {
    display: flex; align-items: stretch; width: 100%; height: 52px;
    background: #f8fafc; border: 1.5px solid #e5e7eb; border-radius: 14px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.lfm-search-box:focus-within { background: #fff; border-color: var(--lf-brand-500); box-shadow: 0 0 0 4px rgba(34,197,94,.12); }
.lfm-search.is-open .lfm-search-box { border-bottom-left-radius: 14px; border-bottom-right-radius: 14px; }

.lfm-search-cat-wrap { position: relative; display: flex; flex-shrink: 0; border-right: 1px solid #e5e7eb; }
.lfm-search-cat {
    appearance: none; -webkit-appearance: none; background: transparent; border: 0; outline: 0;
    padding: 0 34px 0 16px; font-size: 14px; font-weight: 600; color: #4b5563; cursor: pointer;
    max-width: 210px; text-overflow: ellipsis; border-radius: 14px 0 0 14px;
}
.lfm-search-cat:focus-visible { box-shadow: inset 0 0 0 2px var(--lf-brand-500); }
.lfm-search-cat-chev { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #9ca3af; pointer-events: none; }

.lfm-search-field { position: relative; display: flex; align-items: center; flex: 1; min-width: 0; }
.lfm-search-input {
    flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: 0;
    padding: 0 8px 0 16px; font-size: 15px; color: #111827;
}
.lfm-search-input::placeholder { color: #9ca3af; }
.lfm-search-input::-webkit-search-cancel-button { display: none; }
.lfm-search-iconbtn {
    flex-shrink: 0; width: 34px; height: 34px; margin-right: 4px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; color: #9ca3af; transition: background .15s, color .15s;
}
.lfm-search-iconbtn:hover { background: #f1f5f9; color: #374151; }
.lfm-search-iconbtn.is-listening { color: #fff; background: #ef4444; animation: lfm-search-pulse 1.2s infinite; }
@keyframes lfm-search-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); } 50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); } }

.lfm-search-btn {
    flex-shrink: 0; margin: 4px; padding: 0 28px; display: inline-flex; align-items: center; gap: 6px;
    background: var(--lf-brand-600); color: #fff; font-weight: 700; font-size: 15px; border-radius: 11px;
    transition: background .15s, transform .1s;
}
.lfm-search-btn:hover { background: var(--lf-brand-700); }
.lfm-search-btn:active { transform: scale(.97); }
@media (max-width: 1023px) { .lfm-search-btn { padding: 0 16px; } .lfm-search-cat { max-width: 150px; } }

/* ---------- Açılır öneri paneli ---------- */
.lfm-search-drop {
    position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 60;
    background: #fff; border: 1px solid #eef0f3; border-radius: 20px;
    box-shadow: 0 24px 60px -12px rgba(15,23,42,.25); overflow: hidden;
    max-height: min(70vh, 560px); overflow-y: auto; overscroll-behavior: contain;
    animation: lfm-search-in .16s ease-out;
}
.lfm-search-drop.is-static { position: static; border: 0; border-radius: 0; box-shadow: none; max-height: none; animation: none; }
@keyframes lfm-search-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.lfm-search-sec { padding: 10px 8px 6px; }
.lfm-search-sec + .lfm-search-sec { border-top: 1px solid #f1f5f9; }
.lfm-search-sec-h { display: flex; align-items: center; justify-content: space-between; padding: 4px 10px 6px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #9ca3af; }
.lfm-search-sec-h button { font-size: 11px; font-weight: 700; color: #ef4444; text-transform: none; letter-spacing: 0; }

.lfm-search-item {
    display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px;
    color: #1f2937; text-decoration: none; cursor: pointer; transition: background .12s;
}
.lfm-search-item:hover, .lfm-search-item.is-active { background: #f0fdf4; }
.lfm-search-item.is-active { box-shadow: inset 3px 0 0 var(--lf-brand-500); }
.lfm-search-thumb { position: relative; width: 48px; height: 48px; border-radius: 12px; overflow: hidden; background: #f1f5f9; flex-shrink: 0; border: 1px solid #eef0f3; }
.lfm-search-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lfm-search-vip { position: absolute; left: 2px; top: 2px; background: #facc15; color: #713f12; font-size: 8px; font-weight: 900; padding: 0 3px; border-radius: 4px; }
.lfm-search-ic { width: 36px; height: 36px; border-radius: 10px; background: #f1f5f9; color: #6b7280; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.lfm-search-ic img { width: 100%; height: 100%; object-fit: cover; }
.lfm-search-txt { flex: 1; min-width: 0; }
.lfm-search-txt b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lfm-search-txt small { display: block; font-size: 12px; color: #9ca3af; margin-top: 1px; }
.lfm-search-txt mark { background: #dcfce7; color: #14532d; border-radius: 3px; padding: 0 1px; }
.lfm-search-price { font-size: 14px; font-weight: 900; color: #111827; white-space: nowrap; }
.lfm-search-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 10px 8px; }
.lfm-search-tag {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
    background: #f8fafc; border: 1px solid #eef0f3; font-size: 13px; font-weight: 600; color: #374151; cursor: pointer;
}
.lfm-search-tag:hover, .lfm-search-tag.is-active { border-color: var(--lf-brand-400); color: var(--lf-brand-700); background: #f0fdf4; }
.lfm-search-all {
    display: flex; align-items: center; justify-content: center; gap: 6px; padding: 13px;
    background: #f8fafc; border-top: 1px solid #f1f5f9; font-size: 13px; font-weight: 800; color: var(--lf-brand-700);
}
.lfm-search-all:hover, .lfm-search-all.is-active { background: #f0fdf4; }
.lfm-search-none { padding: 28px 16px; text-align: center; color: #9ca3af; font-size: 14px; }
.lfm-search-skel { display: flex; gap: 12px; padding: 10px 18px; align-items: center; }
.lfm-search-skel i { display: block; border-radius: 10px; background: linear-gradient(90deg,#f1f5f9 25%,#e9edf2 37%,#f1f5f9 63%); background-size: 400% 100%; animation: lfm-search-sh 1.2s ease infinite; }
@keyframes lfm-search-sh { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Mobil sahte kutu ---------- */
.lfm-search-fake {
    width: 100%; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px;
    background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 14px; color: #9ca3af; font-size: 15px; text-align: left;
}
.lfm-search-fake span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Mobil tam ekran panel ---------- */
.lfm-search-overlay { position: fixed; inset: 0; z-index: 200; background: #fff; display: flex; flex-direction: column; }
.lfm-search-overlay[hidden] { display: none; }
.lfm-search-overlay.is-open { animation: lfm-search-slide .2s ease-out; }
@keyframes lfm-search-slide { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.lfm-search-ov-form { display: flex; flex-direction: column; height: 100%; }
.lfm-search-ov-head { display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 10px) 12px 10px; border-bottom: 1px solid #f1f5f9; }
.lfm-search-ov-back { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: #374151; flex-shrink: 0; }
.lfm-search-ov-back:active { background: #f1f5f9; }
.lfm-search-ov-field { height: 46px; background: #f3f4f6; border-radius: 14px; border: 1.5px solid transparent; }
.lfm-search-ov-field:focus-within { border-color: var(--lf-brand-500); background: #fff; }
.lfm-search-ov-field .lfm-search-input { font-size: 16px; padding-left: 14px; }
.lfm-search-ov-cats { display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px; scrollbar-width: none; flex-shrink: 0; }
.lfm-search-ov-cats::-webkit-scrollbar { display: none; }
.lfm-search-chip { flex-shrink: 0; padding: 7px 14px; border-radius: 999px; background: #f3f4f6; font-size: 13px; font-weight: 600; color: #4b5563; white-space: nowrap; }
.lfm-search-chip.is-active { background: var(--lf-brand-600); color: #fff; }
.lfm-search-ov-body { flex: 1; overflow-y: auto; padding-bottom: calc(env(safe-area-inset-bottom) + 20px); }
.lfm-search-ov-body .lfm-search-item { padding: 10px 12px; }

/* ---------- Sonuç sayfası ---------- */
.lfm-search-fchip {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 12px; border-radius: 999px;
    background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; font-size: 13px; font-weight: 700;
}
.lfm-search-fchip:hover { background: #dcfce7; }

.lfm-search-filters { width: 280px; flex-shrink: 0; }
.lfm-search-filters-panel { background: #fff; border: 1px solid #f1f5f9; border-radius: 24px; padding: 20px; box-shadow: 0 1px 2px rgba(0,0,0,.04); position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow-y: auto; scrollbar-width: thin; }
.lfm-search-filters-backdrop { display: none; }
.lfm-search-fgroup { padding: 14px 0; border-top: 1px solid #f1f5f9; }
.lfm-search-fgroup h3 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #9ca3af; margin-bottom: 10px; }
.lfm-search-radio { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; cursor: pointer; font-size: 14px; color: #374151; }
.lfm-search-radio:hover { background: #f8fafc; }
.lfm-search-radio input { accent-color: var(--lf-brand-600); width: 16px; height: 16px; }
.lfm-search-radio span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lfm-search-radio small { font-size: 11px; font-weight: 700; color: #9ca3af; background: #f3f4f6; padding: 1px 7px; border-radius: 999px; }
.lfm-search-radio:has(input:checked) { background: #f0fdf4; color: #15803d; font-weight: 700; }
.lfm-search-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: #f3f4f6; padding: 4px; border-radius: 12px; }
.lfm-search-seg label { cursor: pointer; }
.lfm-search-seg input { position: absolute; opacity: 0; pointer-events: none; }
.lfm-search-seg span { display: block; text-align: center; padding: 8px 4px; border-radius: 9px; font-size: 12px; font-weight: 700; color: #6b7280; }
.lfm-search-seg input:checked + span { background: #fff; color: var(--lf-brand-700); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.lfm-search-seg input:focus-visible + span { box-shadow: 0 0 0 2px var(--lf-brand-500); }
.lfm-search-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: #374151; font-weight: 600; }
.lfm-search-switch input { position: absolute; opacity: 0; }
.lfm-search-switch > span { position: relative; width: 40px; height: 22px; border-radius: 999px; background: #e5e7eb; transition: background .2s; flex-shrink: 0; }
.lfm-search-switch > span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s; }
.lfm-search-switch input:checked + span { background: var(--lf-brand-600); }
.lfm-search-switch input:checked + span::after { transform: translateX(18px); }
.lfm-search-switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(34,197,94,.3); }

/* Mobil: filtreler alttan açılan panel */
@media (max-width: 1023px) {
    .lfm-search-filters { position: fixed; inset: 0; z-index: 150; width: auto; visibility: hidden; pointer-events: none; }
    .lfm-search-filters.is-open { visibility: visible; pointer-events: auto; }
    .lfm-search-filters-backdrop { display: block; position: absolute; inset: 0; background: rgba(15,23,42,.45); opacity: 0; transition: opacity .25s; }
    .lfm-search-filters.is-open .lfm-search-filters-backdrop { opacity: 1; }
    .lfm-search-filters-panel {
        position: absolute; left: 0; right: 0; bottom: 0; top: auto; max-height: 88vh; border-radius: 28px 28px 0 0;
        padding: 20px 20px calc(env(safe-area-inset-bottom) + 16px); transform: translateY(100%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
    }
    .lfm-search-filters.is-open .lfm-search-filters-panel { transform: none; }
}
