/* =========================================================
   Tin học Xanh – giao diện chính
   Tông màu lấy theo logo & ảnh bìa: xanh lá công nghệ + xanh ngọc
   ========================================================= */
:root {
  --brand: #198754;
  --brand-dark: #0F5132;
  --brand-light: #8BC34A;
  --brand-teal: #0E8C7F;
  --brand-soft: #EAF6EF;
  --ink: #1F2A24;
  --bs-primary: #198754;
  --bs-primary-rgb: 25, 135, 84;
  --bs-link-color: #198754;
  --bs-link-color-rgb: 25, 135, 84;
  --bs-link-hover-color: #0F5132;
  --bs-link-hover-color-rgb: 15, 81, 50;
  --bs-body-font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

body { background: #F6FAF7; color: var(--ink); }
a { text-decoration: none; }
.text-brand { color: var(--brand); }

/* ---------- Topbar & Navbar ---------- */
.topbar { background: var(--brand-dark); color: #DDEFE4; padding: .35rem 0; }
.topbar a { color: #fff; }
.navbar { --bs-navbar-active-color: var(--brand); }
.navbar .nav-link { font-weight: 500; }
.navbar .nav-link:hover, .navbar .nav-link.active { color: var(--brand); }
.brand-name { font-weight: 800; font-size: 1.2rem; color: var(--brand-dark); letter-spacing: .3px; }
.brand-tag { font-size: .7rem; color: var(--brand-teal); text-transform: uppercase; letter-spacing: 1px; }
.dropdown-item:active { background: var(--brand); }

.btn-cta {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-teal) 100%);
  color: #fff; font-weight: 600; border: 0;
  box-shadow: 0 4px 14px rgba(25, 135, 84, .3);
}
.btn-cta:hover, .btn-cta:focus { color: #fff; filter: brightness(1.08); transform: translateY(-1px); }
.btn-zalo { background: #0068FF; color: #fff; }
.btn-zalo:hover { background: #0054d1; color: #fff; }
.btn-success { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); }

/* ---------- Hero ---------- */
.hero { background: radial-gradient(1200px 400px at 80% 0%, #DFF3E6 0%, transparent 60%), linear-gradient(180deg, #fff 0%, #F6FAF7 100%); }
.hero-badge { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; padding: .5em 1em; }
.hero-cover { aspect-ratio: 2000 / 1116; object-fit: cover; width: 100%; height: auto; }
.service-tiles .tile {
  display: flex; align-items: center; gap: .75rem; height: 100%;
  background: #fff; border-radius: 1rem; padding: 1rem; color: var(--ink); font-weight: 600; font-size: .92rem;
  box-shadow: 0 2px 10px rgba(15, 81, 50, .07); transition: .2s;
}
.service-tiles .tile i { font-size: 1.6rem; color: var(--brand); }
.service-tiles .tile:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(15, 81, 50, .15); color: var(--brand-dark); }

.page-hero { background: linear-gradient(135deg, var(--brand-dark), var(--brand) 60%, var(--brand-teal)); color: #fff; }

/* ---------- Section title ---------- */
.section-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 1.25rem; padding-left: .75rem; border-left: 4px solid var(--brand); }
.section-title i { color: var(--brand); }

/* ---------- Card bài viết ---------- */
.post-card { border-radius: 1rem; transition: transform .2s, box-shadow .2s; }
.post-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(15, 81, 50, .14) !important; }
.post-card .card-title a { color: var(--ink); }
.post-card .card-title a:hover { color: var(--brand); }
.thumb-placeholder {
  display: flex !important; align-items: center; justify-content: center; width: 100%; height: 100%;
  background: linear-gradient(135deg, #E3F4EA, #CDEBDD); color: var(--brand); font-size: 2.5rem;
}
.badge-cat {
  display: inline-block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .4px;
  color: var(--brand-dark); background: var(--brand-soft); padding: .25rem .6rem; border-radius: 50rem;
}
.badge-cat-light { background: rgba(255, 255, 255, .9); }
.post-meta { color: #6c757d; display: flex; gap: 1rem; flex-wrap: wrap; }
.post-meta i { color: var(--brand); }

/* Featured */
.featured-main { position: relative; }
.featured-overlay { position: absolute; inset: auto 0 0 0; background: linear-gradient(0deg, rgba(10, 40, 25, .9), transparent); }
.featured-main img { transition: transform .4s; }
.featured-main:hover img { transform: scale(1.04); }
.featured-side { transition: .2s; }
.featured-side:hover { box-shadow: 0 8px 22px rgba(15, 81, 50, .15) !important; }
.featured-side-thumb { width: 110px; height: 80px; }

/* ---------- Sidebar ---------- */
.contact-card { background: linear-gradient(160deg, #fff 0%, var(--brand-soft) 100%); border-top: 4px solid var(--brand) !important; }
.popular-rank {
  flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem;
}
.popular-item:nth-child(-n+3) .popular-rank { background: var(--brand); color: #fff; }
.popular-item a { color: var(--ink); }
.popular-item a:hover { color: var(--brand); }

/* ---------- Chi tiết bài viết ---------- */
.post-title { font-size: clamp(1.5rem, 3.5vw, 2.25rem); line-height: 1.3; }
.post-content { font-size: 1.06rem; line-height: 1.8; }
.post-content h2 { font-size: 1.5rem; font-weight: 700; margin: 2rem 0 1rem; color: var(--brand-dark); }
.post-content h3 { font-size: 1.2rem; font-weight: 700; margin: 1.5rem 0 .75rem; }
.post-content img { border-radius: .5rem; height: auto; }
.post-content figure.image { text-align: center; margin: 1.5rem 0; }
.post-content figure.image figcaption { font-size: .88rem; color: #6c757d; margin-top: .4rem; }
.post-content .image-style-align-left { float: left; margin: 0 1.25rem 1rem 0; max-width: 50%; }
.post-content .image-style-align-right { float: right; margin: 0 0 1rem 1.25rem; max-width: 50%; }
.post-content blockquote { border-left: 4px solid var(--brand); background: var(--brand-soft); padding: .75rem 1.25rem; border-radius: 0 .5rem .5rem 0; }
.post-content pre { background: #f6f8fa; border: 1px solid #e3e8ee; border-radius: .5rem; padding: 1rem; font-size: .9rem; }
.post-content :not(pre) > code { background: var(--brand-soft); color: var(--brand-dark); padding: .1em .35em; border-radius: .25rem; }
.post-content table { margin: 1rem 0; }
.post-content table th { background: var(--brand-soft); }
.post-content .toc-anchor { scroll-margin-top: 90px; }
.tag-pill { display: inline-block; margin: .2rem; padding: .2rem .7rem; border-radius: 50rem; background: #F1F5F2; color: var(--brand-dark); font-size: .85rem; }
.tag-pill:hover { background: var(--brand); color: #fff; }

/* Mục lục */
.toc-inline { background: var(--brand-soft); border-radius: .75rem; padding: .25rem 1rem; }
.toc-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; background: none; border: 0; padding: .6rem 0; font-weight: 700; color: var(--brand-dark); }
.toc-toggle[aria-expanded="true"] .bi-chevron-down { transform: rotate(180deg); }
.toc-list, .toc-list ol { list-style: none; padding-left: 0; margin: 0; counter-reset: toc; }
.toc-list ol { padding-left: 1.4rem; }
.toc-list li { counter-increment: toc; }
.toc-list a { display: block; padding: .3rem .5rem; color: var(--ink); font-size: .93rem; border-left: 2px solid transparent; border-radius: 0 .25rem .25rem 0; }
.toc-list a::before { content: counters(toc, ".") ". "; color: var(--brand); font-weight: 600; }
.toc-list a:hover { color: var(--brand); background: rgba(25, 135, 84, .06); }
.toc-list a.active { color: var(--brand-dark); font-weight: 600; border-left-color: var(--brand); background: rgba(25, 135, 84, .08); }
.toc-inline .toc-list { padding-bottom: .75rem; }
.toc-sticky { position: sticky; top: 90px; z-index: 1; }
.toc-sticky .card-body { max-height: calc(100vh - 160px); overflow-y: auto; }

/* CTA cuối bài */
.cta-box { background: linear-gradient(135deg, var(--brand-dark), var(--brand) 55%, var(--brand-teal)); color: #fff; }

/* ---------- Bảng giá ---------- */
.price-card { border: 1px solid #DDEDE3; border-radius: 1rem; position: relative; overflow: hidden; }
.price-card-hot { border: 2px solid var(--brand); box-shadow: 0 12px 30px rgba(25, 135, 84, .18); }
.price-card .price { font-size: 1.6rem; font-weight: 800; color: var(--brand); margin: .5rem 0 1rem; }
.price-card .price small { font-size: .85rem; color: #6c757d; font-weight: 500; }
.ribbon { position: absolute; top: 14px; right: -34px; transform: rotate(45deg); background: var(--brand); color: #fff; font-size: .72rem; font-weight: 700; padding: .25rem 2.5rem; }
.feature-list { list-style: none; padding: 0; margin: 0; }
.feature-list li { padding: .35rem 0 .35rem 1.6rem; position: relative; font-size: .93rem; }
.feature-list li::before { content: "\F26E"; font-family: "bootstrap-icons"; position: absolute; left: 0; color: var(--brand); }
.price-table thead th { background: var(--brand); color: #fff; }
.feature-box { background: #fff; border-radius: 1rem; padding: 1.25rem; box-shadow: 0 2px 10px rgba(15, 81, 50, .07); }
.feature-box > i { font-size: 2rem; color: var(--brand); display: block; margin-bottom: .5rem; }
.scroll-offset { scroll-margin-top: 90px; }

/* ---------- Sản phẩm ---------- */
.product-card { border-radius: .9rem; }
.product-price { color: #D9480F; font-weight: 700; }

.service-tiles .tile small { display: block; font-weight: 400; font-size: .78rem; color: #6c757d; }
.zalo-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1100;
  background: #0068FF; color: #fff; padding: .6rem 1rem; border-radius: .6rem; font-size: .9rem; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }

/* ---------- Tiện ích ---------- */
.tool-card { background: #fff; border-radius: 1rem; padding: 1.25rem; color: var(--ink); box-shadow: 0 2px 10px rgba(15, 81, 50, .07); transition: .2s; }
.tool-card:hover { transform: translateY(-4px); box-shadow: 0 12px 26px rgba(15, 81, 50, .15); color: var(--ink); }
.tool-icon { width: 52px; height: 52px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-teal)); color: #fff; font-size: 1.5rem; }
.stat-box { background: var(--brand-soft); border-radius: .6rem; padding: .5rem; }
.stat-box b { font-size: 1.2rem; color: var(--brand-dark); }
.invoice-sheet { max-width: 900px; margin: 0 auto; padding: 2rem; border-radius: .5rem; border: 1px solid #e5e5e5; font-family: "Times New Roman", serif; }
.invoice-table thead th { background: #f3f3f3; text-align: center; }
.signature-box { border: 1px solid var(--brand); color: var(--brand-dark); padding: .5rem .75rem; border-radius: .25rem; }

@media print {
  body { background: #fff !important; }
  .topbar, .navbar, .site-footer, .float-contact, .breadcrumb, .d-print-none { display: none !important; }
  .invoice-sheet { border: 0; box-shadow: none !important; padding: 0; max-width: none; }
  main { padding: 0 !important; }
}

/* ---------- Form ---------- */
.form-control:focus, .form-select:focus { border-color: var(--brand-light); box-shadow: 0 0 0 .2rem rgba(25, 135, 84, .2); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Pagination ---------- */
.pagination { --bs-pagination-color: var(--brand); --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-hover-color: var(--brand-dark); }

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-dark); color: #E3F2E8; }
.site-footer a { color: #E3F2E8; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer h6 { color: #fff; letter-spacing: .5px; }
.site-footer li { margin-bottom: .35rem; }
.footer-bottom { background: rgba(0, 0, 0, .18); }

/* ---------- Nút liên hệ nổi ---------- */
.float-contact { position: fixed; right: 16px; bottom: 18px; z-index: 1050; display: flex; flex-direction: column; gap: 10px; }
.fc-btn {
  width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.25rem; border: 0; box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}
.fc-btn:hover { color: #fff; transform: scale(1.08); }
.fc-zalo { background: #0068FF; font-size: .78rem; font-weight: 700; }
.fc-phone { background: var(--brand); animation: ring 2.2s infinite; }
.fc-top { background: #6c757d; opacity: 0; pointer-events: none; transition: opacity .2s; }
.fc-top.show { opacity: .85; pointer-events: auto; }
@keyframes ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(25, 135, 84, .5); } 50% { box-shadow: 0 0 0 12px rgba(25, 135, 84, 0); } }

@media (max-width: 575.98px) {
  .post-content .image-style-align-left, .post-content .image-style-align-right { float: none; max-width: 100%; margin: 1rem 0; }
  .featured-side-thumb { width: 90px; height: 68px; }
  .navbar .btn-cta { width: 100%; }
}
