/* Pencarian beranda gaya marketplace (js/cari-toko.js)
   HP: layar penuh. Tablet/desktop: panel melayang di bawah header. */
.cs-akar { position: fixed; inset: 0; z-index: 70; font-family: 'Sora', system-ui, sans-serif; }
.cs-akar[hidden] { display: none; }
.cs-tirai { position: absolute; inset: 0; background: rgba(20, 26, 43, .45); opacity: 0; transition: opacity .2s ease; }
.cs-akar.tampil .cs-tirai { opacity: 1; }
.cs-panel { position: absolute; inset: 0; background: #f7f9fb; display: flex; flex-direction: column; transform: translateY(14px); opacity: 0; transition: transform .25s cubic-bezier(.22, 1, .36, 1), opacity .2s ease; }
.cs-akar.tampil .cs-panel { transform: none; opacity: 1; }
.cs-atas { display: flex; align-items: center; gap: 6px; padding: 10px 12px 10px 6px; background: #fff; box-shadow: 0 1px 0 #eceef0; padding-top: calc(10px + env(safe-area-inset-top)); }
.cs-kembali { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #191c1e; flex-shrink: 0; }
.cs-kembali:active { background: #eceef0; }
.cs-kolom { flex: 1; min-width: 0; position: relative; display: flex; align-items: center; height: 42px; border-radius: 12px; background: #f2f4f6; border: 1.5px solid #e3e7ee; transition: border-color .15s ease, background .15s ease; }
.cs-kolom:focus-within { border-color: #2976c7; background: #fff; }
.cs-kolom > .material-symbols-outlined { font-size: 20px; color: #717783; margin: 0 6px 0 12px; flex-shrink: 0; }
.cs-kolom input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font: 600 14px 'Sora', sans-serif; color: #191c1e; outline: none; -webkit-appearance: none; appearance: none; }
.cs-kolom input::-webkit-search-cancel-button { display: none; }
.cs-kolom input::placeholder { color: #9aa0aa; font-weight: 500; }
.cs-hapus { width: 32px; height: 32px; margin-right: 4px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #717783; flex-shrink: 0; }
.cs-hapus[hidden] { display: none; }
.cs-hapus .material-symbols-outlined { font-size: 18px; }
.cs-cari-btn { height: 42px; padding: 0 16px; border-radius: 12px; background: #1e2a4f; color: #fff; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.cs-isi { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 14px 16px calc(24px + env(safe-area-inset-bottom)); }

/* blok */
.cs-blok { margin-bottom: 20px; }
.cs-blok-kepala { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cs-blok-kepala h3 { font-size: 13px; font-weight: 800; color: #191c1e; }
.cs-blok-kepala button { font-size: 11.5px; font-weight: 700; color: #005da7; }
.cs-chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-chip { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px; border-radius: 999px; background: #fff; border: 1px solid #e3e7ee; font-size: 12px; font-weight: 700; color: #191c1e; white-space: nowrap; max-width: 100%; }
.cs-chip .material-symbols-outlined { font-size: 16px; color: #ca4a20; }
.cs-chip:active { background: #eceef0; }

/* riwayat */
.cs-riwayat { background: #fff; border-radius: 16px; overflow: hidden; }
.cs-riwayat li { display: flex; align-items: center; }
.cs-riwayat li + li { border-top: 1px solid #f0f2f5; }
.cs-riwayat a, .cs-riwayat .cs-riw-isi { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 11px 4px 11px 14px; font-size: 13px; color: #191c1e; text-align: left; }
.cs-riwayat .material-symbols-outlined { font-size: 19px; color: #9aa0aa; flex-shrink: 0; }
.cs-riwayat .cs-riw-teks { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-riw-hapus { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cs-riw-hapus .material-symbols-outlined { font-size: 17px; }

/* kategori */
.cs-kat { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cs-kat a { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 10.5px; font-weight: 700; color: #191c1e; line-height: 1.25; }
.cs-kat-foto { width: 100%; aspect-ratio: 1; max-width: 72px; border-radius: 18px; background: #fff; box-shadow: 0 2px 10px -4px rgba(20, 26, 43, .15); display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 8px; }
.cs-kat-foto img { width: 100%; height: 100%; object-fit: contain; }
.cs-kat-foto .material-symbols-outlined { font-size: 28px; color: #b77900; font-variation-settings: 'FILL' 1; }

/* saran saat mengetik */
.cs-saran { background: #fff; border-radius: 16px; overflow: hidden; margin: -4px 0 16px; }
.cs-baris { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; color: #191c1e; text-decoration: none; width: 100%; text-align: left; }
.cs-baris + .cs-baris { border-top: 1px solid #f0f2f5; }
.cs-baris.aktif, .cs-baris:hover { background: #f4f7fb; }
.cs-baris > .material-symbols-outlined { font-size: 19px; color: #9aa0aa; flex-shrink: 0; }
.cs-baris-teks { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #414751; }
.cs-baris-teks b { color: #191c1e; font-weight: 800; }
.cs-isi-kolom { width: 32px; height: 32px; margin: -6px -6px -6px 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #9aa0aa; flex-shrink: 0; }
.cs-isi-kolom .material-symbols-outlined { font-size: 18px; transform: rotate(-45deg); }
.cs-logo { width: 34px; height: 34px; border-radius: 10px; background: #f2f4f6; overflow: hidden; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cs-logo img { width: 100%; height: 100%; object-fit: contain; }
.cs-logo .material-symbols-outlined { font-size: 19px; color: #005da7; }
.cs-baris-sub { display: block; font-size: 10.5px; color: #717783; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-produk-foto { width: 48px; height: 48px; border-radius: 12px; background: #f2f4f6; overflow: hidden; flex-shrink: 0; position: relative; }
.cs-produk-foto img { width: 100%; height: 100%; object-fit: cover; }
.cs-harga { font-size: 12.5px; font-weight: 800; color: #ca4a20; flex-shrink: 0; text-align: right; }
.cs-harga s { display: block; font-size: 10px; color: #9aa0aa; font-weight: 600; }
.cs-semua { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 13px; font-size: 12.5px; font-weight: 800; color: #005da7; border-top: 1px solid #f0f2f5; }
.cs-memuat { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-size: 12px; color: #717783; }
.cs-memuat i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #d9dde3; border-top-color: #005da7; animation: csPutar .7s linear infinite; }
@keyframes csPutar { to { transform: rotate(360deg); } }

/* hasil */
.cs-hasil-kepala { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cs-hasil-kepala p { font-size: 13px; color: #414751; }
.cs-hasil-kepala b { color: #191c1e; }
.cs-urut { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 12px; padding: 0 16px; }
.cs-urut::-webkit-scrollbar { display: none; }
.cs-urut button { height: 32px; padding: 0 13px; border-radius: 999px; background: #fff; border: 1px solid #e3e7ee; font-size: 11.5px; font-weight: 700; color: #414751; white-space: nowrap; flex-shrink: 0; }
.cs-urut button.aktif { background: #1e2a4f; border-color: #1e2a4f; color: #fff; }
.cs-urut .cs-pisah { width: 1px; background: #e3e7ee; flex-shrink: 0; margin: 6px 2px; }
.cs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cs-kosong { text-align: center; padding: 28px 12px 8px; }
.cs-kosong-ikon { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px -8px rgba(20, 26, 43, .25); }
.cs-kosong-ikon .material-symbols-outlined { font-size: 34px; color: #2976c7; }
.cs-kosong h3 { font-size: 15px; font-weight: 800; color: #191c1e; }
.cs-kosong p { font-size: 12px; color: #717783; margin-top: 4px; line-height: 1.6; }
.cs-wa { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; height: 40px; padding: 0 18px; border-radius: 999px; background: #16a34a; color: #fff; font-size: 12.5px; font-weight: 800; text-decoration: none; }
.cs-wa .material-symbols-outlined { font-size: 18px; }
.cs-pintas { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 14px; padding: 0 16px; }
.cs-pintas::-webkit-scrollbar { display: none; }
.cs-pintas a { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 5px; border-radius: 999px; background: #fff; border: 1px solid #e3e7ee; font-size: 12px; font-weight: 700; color: #191c1e; white-space: nowrap; flex-shrink: 0; }
.cs-pintas .cs-logo { width: 30px; height: 30px; border-radius: 50%; }

/* tombol pemicu di header (desktop besar: ikon saja) */
.cs-pemicu { cursor: pointer; caret-color: transparent; }
@media (min-width: 1024px) {
    #search-wrap { flex: 0 0 auto !important; max-width: none !important; }
    #search-wrap #search-input { display: none; }
    #search-wrap #search-btn { position: static !important; transform: none !important; width: 44px !important; height: 44px !important; background: #eceef0; color: #191c1e; }
    #search-wrap #search-btn:hover { background: #e0e3e5; }
}

/* tablet & desktop: panel melayang */
@media (min-width: 640px) {
    .cs-panel { inset: 18px auto auto 50%; width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 36px); max-height: calc(100dvh - 36px); transform: translate(-50%, -10px); border-radius: 24px; overflow: hidden; box-shadow: 0 30px 80px -20px rgba(20, 26, 43, .5); }
    .cs-akar.tampil .cs-panel { transform: translate(-50%, 0); }
    .cs-atas { padding: 14px 14px 14px 8px; }
    .cs-kolom { height: 46px; }
    .cs-cari-btn { height: 46px; }
    .cs-isi { padding: 16px 20px 20px; }
    .cs-urut, .cs-pintas { margin-left: -20px; margin-right: -20px; padding-left: 20px; padding-right: 20px; }
    .cs-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
    .cs-kat { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (min-width: 900px) { .cs-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 639px) { .cs-cari-btn { display: none; } }
@media (prefers-reduced-motion: reduce) { .cs-panel, .cs-tirai { transition: none; } }
