/* Tìm kiếm toàn site — giaophanthaibinh.net (16/11/2026)
   Màu theo giao diện: xanh #63a045 → #367745, nhấn đỏ gạch #b13830 */
:root { --gs-green1: #63a045; --gs-green2: #367745; --gs-red: #b13830; --gs-ink: #222; --gs-mute: #6b7280; --gs-line: #e5e7eb; }

/* ---------- Nút mở (thanh menu desktop / header mobile) ---------- */
.box_menu { position: relative; }
.box_menu.fixed { position: fixed; }
.gs-trigger {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%); z-index: 5;
    width: 36px; height: 34px; padding: 0; cursor: pointer;
    border: 1px solid rgba(255,255,255,.55); border-radius: 4px; background: rgba(255,255,255,.14);
    color: #fff; font-size: 15px; line-height: 1; transition: background .2s, border-color .2s;
}
.gs-trigger:hover, .gs-trigger:focus-visible { background: rgba(255,255,255,.3); border-color: #fff; outline: none; }
.gs-trigger-m {
    position: absolute; right: 8px; top: 0; width: 40px; height: 40px; color: #fff; font-size: 19px;
    line-height: 40px; text-align: center; text-decoration: none;
}

/* ---------- Hộp tìm kiếm (canh giữa, cố định một chỗ) ---------- */
html.gs-lock { overflow: hidden; }
.gs-overlay { position: fixed; inset: 0; z-index: 100000; }
.gs-overlay[hidden] { display: none; }
.gs-backdrop { position: absolute; inset: 0; background: rgba(12, 30, 18, .55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); opacity: 0; transition: opacity .18s; }
.gs-overlay.on .gs-backdrop { opacity: 1; }

.gs-dialog {
    position: absolute; top: 9vh; left: 50%; width: 720px; max-width: calc(100% - 24px);
    max-height: 82vh; display: flex; flex-direction: column; box-sizing: border-box;
    background: #fff; border-radius: 16px; overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,.38);
    opacity: 0; transform: translateX(-50%) scale(.97); transition: opacity .18s, transform .18s;
}
.gs-overlay.on .gs-dialog { opacity: 1; transform: translateX(-50%) scale(1); }

.gs-form { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; margin: 0; padding: 10px 10px 10px 6px; border-bottom: 1px solid var(--gs-line); background: #fff; }
.gs-field { position: relative; flex: 1 1 auto; height: 48px; }
.gs-field input {
    width: 100%; height: 100%; box-sizing: border-box; border: 0; outline: 0; background: transparent; margin: 0;
    padding: 0 40px 0 46px; font-size: 18px; color: var(--gs-ink); font-family: inherit; -webkit-appearance: none; appearance: none;
}
.gs-field input::placeholder { color: #9aa0a6; }
.gs-field input::-webkit-search-cancel-button { display: none; }
.gs-ico { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--gs-green2); font-size: 17px; pointer-events: none; }
.gs-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: #b5bbc2; font-size: 17px; cursor: pointer; padding: 6px; margin: 0; }
.gs-clear:hover { color: var(--gs-red); }
.gs-go {
    flex: 0 0 auto; height: 44px; margin: 0; padding: 0 22px; border: 0; border-radius: 10px; cursor: pointer;
    background: linear-gradient(var(--gs-green1), var(--gs-green2)); color: #fff; font-size: 15px; font-weight: 600; font-family: inherit; transition: filter .15s;
}
.gs-go:hover { filter: brightness(1.1); }
.gs-x { flex: 0 0 auto; width: 40px; height: 40px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: #f1f3f4; color: #6b7280; font-size: 16px; cursor: pointer; transition: all .15s; }
.gs-x:hover { background: var(--gs-red); color: #fff; }

/* ---------- Danh sách gợi ý (cùng khung với ô nhập) ---------- */
.gs-drop { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; background: #fff; }
.gs-drop[hidden] { display: none; }
.gs-label { padding: 14px 18px 6px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--gs-mute); font-weight: 700; }
.gs-items { list-style: none; margin: 0; padding: 0 8px 4px; }
.gs-items li { list-style: none; margin: 0; padding: 0; }
.gs-items a { display: flex; gap: 14px; align-items: center; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--gs-ink); }
.gs-items li.act a, .gs-items a:hover { background: #f1f7ee; }
.gs-th { flex: 0 0 80px; height: 54px; border-radius: 8px; overflow: hidden; background: #eef0f2; display: block; }
.gs-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gs-tx { min-width: 0; flex: 1; }
.gs-tt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 15px; line-height: 20px; font-weight: 600; color: #1b1b1b; }
.gs-mt { display: block; margin-top: 3px; font-size: 12.5px; color: var(--gs-mute); }
.gs-mt b { font-weight: 600; color: var(--gs-green2); margin-right: 10px; }
.gs-mt i { font-style: normal; }
.gs-all { display: block; margin: 4px 8px 8px; padding: 12px 14px; border-radius: 10px; background: #f3f8f0; color: var(--gs-green2); font-size: 14.5px; text-decoration: none; }
.gs-all:hover { background: #e6f1e0; }
.gs-all[hidden] { display: none; }
.gs-all i { margin-left: 4px; font-size: 12px; }
.gs-hint { padding: 9px 18px 11px; font-size: 12px; color: #9aa0a6; border-top: 1px solid var(--gs-line); }
.gs-page mark, .gs-drop mark { background: #fff1a8; color: inherit; padding: 0 1px; border-radius: 2px; }

/* ---------- Trang kết quả ---------- */
.gs-page { font-family: inherit; }
.gs-hero { background: #f4f8f2; border: 1px solid #dbe8d5; border-radius: 12px; padding: 14px; margin-bottom: 16px; }
.gs-hero-row { display: flex; align-items: center; background: #fff; border: 2px solid var(--gs-green1); border-radius: 10px; overflow: hidden; height: 50px; }
.gs-hero-row:focus-within { border-color: var(--gs-green2); box-shadow: 0 0 0 3px rgba(99,160,69,.2); }
.gs-hero-ico { margin-left: 14px; color: var(--gs-green2); }
.gs-hero-row input[type=search] { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; padding: 0 12px; font-size: 17px; font-family: inherit; background: transparent; -webkit-appearance: none; appearance: none; }
.gs-hero-row input[type=search]::-webkit-search-cancel-button { display: none; }
.gs-hero-btn { height: 100%; padding: 0 24px; border: 0; cursor: pointer; background: linear-gradient(var(--gs-green1), var(--gs-green2)); color: #fff; font-size: 15.5px; font-weight: 600; font-family: inherit; }
.gs-hero-btn:hover { filter: brightness(1.1); }
.gs-opts { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; margin-top: 10px; font-size: 14px; color: #444; }
.gs-check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.gs-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--gs-green2); }
.gs-sel { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.gs-sel select { height: 32px; border: 1px solid #cfd8c9; border-radius: 6px; background: #fff; padding: 0 8px; font-size: 14px; font-family: inherit; }

.gs-summary { font-size: 15.5px; color: #333; margin: 4px 2px 12px; line-height: 22px; }
.gs-summary .gs-q { color: var(--gs-red); }
.gs-took { color: var(--gs-mute); font-size: 13px; }
.gs-sub { font-size: 13px; font-weight: 700; color: var(--gs-mute); text-transform: uppercase; letter-spacing: .06em; margin: 6px 2px 12px; }

.gs-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.gs-chip { display: inline-block; padding: 6px 12px; border: 1px solid #d5dccf; border-radius: 999px; background: #fff; color: #3b4a36; font-size: 13.5px; line-height: 18px; text-decoration: none; transition: all .15s; }
.gs-chip em { font-style: normal; color: var(--gs-mute); font-size: 12px; margin-left: 3px; }
.gs-chip:hover { border-color: var(--gs-green1); background: #f1f7ee; }
.gs-chip.on { background: var(--gs-green2); border-color: var(--gs-green2); color: #fff; }
.gs-chip.on em { color: rgba(255,255,255,.8); }

.gs-list { margin: 0; }
.gs-card { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid #e6e6e6; }
.gs-card:first-child { padding-top: 4px; }
.gs-thumb { flex: 0 0 210px; height: 138px; border-radius: 8px; overflow: hidden; background: #eef0f2; display: block; }
.gs-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.gs-card:hover .gs-thumb img { transform: scale(1.04); }
.gs-info { flex: 1; min-width: 0; }
.gs-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 12.5px; color: var(--gs-mute); margin-bottom: 5px; }
.gs-meta i { margin-right: 3px; }
.gs-cat { background: #eaf3e6; color: var(--gs-green2); font-weight: 600; padding: 2px 9px; border-radius: 999px; text-decoration: none; }
.gs-cat:hover { background: var(--gs-green2); color: #fff; }
.gs-info h3 { margin: 0 0 6px; padding: 0; font-size: 19px; line-height: 25px; font-weight: 600; }
.gs-info h3 a { color: #14324a; text-decoration: none; }
.gs-info h3 a:hover { color: var(--gs-red); }
.gs-info p { margin: 0; font-size: 15px; line-height: 22px; color: #555; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

.gs-empty { text-align: center; padding: 28px 16px 20px; color: #555; }
.gs-empty-ico { font-size: 40px; color: #c6d6bf; margin-bottom: 8px; }
.gs-empty h4 { margin: 0 0 8px; font-size: 20px; color: #333; font-weight: 600; }
.gs-empty p { margin: 0; font-size: 15px; line-height: 22px; }
.gs-tips { list-style: none; display: inline-block; text-align: left; margin: 6px 0 0; padding: 0; font-size: 15px; line-height: 24px; }
.gs-tips li { list-style: none; padding-left: 18px; position: relative; }
.gs-tips li:before { content: "›"; position: absolute; left: 4px; color: var(--gs-green1); font-weight: 700; }
.gs-tips a { color: var(--gs-red); text-decoration: underline; }

.gs-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 22px 0 6px; }
.gs-pg { min-width: 38px; height: 38px; box-sizing: border-box; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #d5dccf; border-radius: 8px; background: #fff; color: #333; font-size: 15px; text-decoration: none; }
.gs-pg:hover { border-color: var(--gs-green1); background: #f1f7ee; }
.gs-pg.on { background: var(--gs-green2); border-color: var(--gs-green2); color: #fff; font-weight: 700; }
.gs-dots { align-self: center; color: var(--gs-mute); padding: 0 2px; }
.gs-note { text-align: center; font-size: 13px; color: var(--gs-mute); }


/* Reset: CSS cũ của site đặt margin:auto lên a/span/label → làm lệch flex */
.gs-page .gs-chip, .gs-page .gs-pg, .gs-page .gs-cat, .gs-page .gs-meta > span, .gs-page .gs-check, .gs-page .gs-sel,
.gs-page .gs-dots, .gs-page .gs-thumb, .gs-drop .gs-items a, .gs-drop .gs-th, .gs-drop .gs-tx { margin-left: 0; margin-right: 0; }
.gs-page .gs-opts label span { margin: 0; }
.gs-page .gs-sel { margin-left: auto; }
@media (max-width: 980px) {
    .gs-dialog { top: 0; left: 0; width: 100%; max-width: 100%; max-height: 100vh; max-height: 100dvh; border-radius: 0 0 16px 16px; transform: translateY(-8px); }
    .gs-overlay.on .gs-dialog { transform: none; }
    .gs-field input { font-size: 16px; padding-left: 42px; } /* 16px: iOS không tự phóng to */
    .gs-ico { left: 14px; }
    .gs-go { padding: 0 16px; }
    .gs-hero { padding: 10px; margin: 0 10px 14px; }
    .gs-summary, .gs-chips, .gs-list, .gs-pager, .gs-empty, .gs-sub { margin-left: 12px; margin-right: 12px; }
    .gs-sel { margin-left: 0; }
}
@media (max-width: 600px) {
    .gs-card { gap: 12px; }
    .gs-thumb { flex-basis: 112px; height: 84px; }
    .gs-info h3 { font-size: 16.5px; line-height: 22px; }
    .gs-info p { font-size: 14px; line-height: 20px; -webkit-line-clamp: 3; }
    .gs-th { flex-basis: 64px; height: 46px; }
    .gs-hero-btn { padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) { .gs-dialog, .gs-backdrop, .gs-thumb img { transition: none; } }
