/* 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;
}

/* ---------- Lớp phủ ---------- */
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(15, 35, 20, .5); opacity: 0; transition: opacity .2s; }
.gs-overlay.on .gs-backdrop { opacity: 1; }

.gs-bar {
    --gs-h: 50px;
    position: absolute; left: 0; right: 0; top: 0;
    background: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.22);
    transform: translateY(-6px); opacity: 0; transition: transform .2s, opacity .2s;
}
.gs-overlay.on .gs-bar { transform: none; opacity: 1; }
.gs-wrap { width: 1200px; max-width: 100%; margin: 0 auto; position: relative; }
.gs-form .gs-wrap { display: flex; align-items: center; height: var(--gs-h); }
.gs-field { position: relative; flex: 1 1 auto; height: 100%; }
.gs-field input {
    width: 100%; height: 100%; box-sizing: border-box; border: 0; outline: 0; background: transparent;
    padding: 0 44px 0 44px; 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: 14px; top: 50%; transform: translateY(-50%); color: var(--gs-green2); font-size: 16px; pointer-events: none; }
.gs-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: #b5bbc2; font-size: 18px; cursor: pointer; padding: 6px; }
.gs-clear:hover { color: var(--gs-red); }
.gs-go {
    flex: 0 0 auto; height: calc(100% - 10px); margin: 0 6px; padding: 0 20px; border: 0; border-radius: 4px; cursor: pointer;
    background: linear-gradient(var(--gs-green1), var(--gs-green2)); color: #fff; font-size: 15px; font-weight: 600; font-family: inherit;
    display: inline-flex; align-items: center; gap: 8px; transition: filter .15s;
}
.gs-go:hover { filter: brightness(1.1); }
.gs-x { flex: 0 0 auto; width: 44px; height: 100%; border: 0; background: none; color: #9aa0a6; font-size: 20px; cursor: pointer; }
.gs-x:hover { color: var(--gs-red); }

/* ---------- Danh sách gợi ý ---------- */
.gs-dropwrap { padding-bottom: 0; }
.gs-drop {
    width: 780px; max-width: 100%; box-sizing: border-box; background: #fff;
    border: 1px solid var(--gs-line); border-top: 2px solid var(--gs-green1);
    border-radius: 0 0 10px 10px; box-shadow: 0 14px 30px rgba(0,0,0,.18);
    margin-left: 0; max-height: calc(100vh - 120px); overflow-y: auto; overscroll-behavior: contain;
}
.gs-drop[hidden] { display: none; }
.gs-label { padding: 12px 16px 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 6px 4px; }
.gs-items li { list-style: none; margin: 0; padding: 0; }
.gs-items a { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--gs-ink); }
.gs-items li.act a, .gs-items a:hover { background: #f1f7ee; }
.gs-th { flex: 0 0 76px; height: 52px; border-radius: 6px; 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: 2px 6px 6px; padding: 11px 14px; border-radius: 8px; background: #f6f7f8; color: var(--gs-green2); font-size: 14.5px; text-decoration: none; }
.gs-all:hover { background: #eaf3e6; }
.gs-all[hidden] { display: none; }
.gs-all i { margin-left: 4px; font-size: 12px; }
.gs-hint { padding: 8px 16px 10px; 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-page .gs-sel { margin-left: 0; } }

/* ---------- Mobile ---------- */
@media (max-width: 980px) {
    .gs-wrap { width: 100%; }
    .gs-drop { width: 100%; border-radius: 0 0 10px 10px; max-height: calc(100vh - 100px); }
    .gs-go span { display: none; }
    .gs-go { padding: 0 14px; }
    .gs-field input { font-size: 16px; padding-left: 38px; } /* 16px: iOS không tự phóng to */
    .gs-ico { left: 12px; }
    .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-bar, .gs-backdrop, .gs-thumb img { transition: none; } }
