/* =============================================
   AFFILIATE WEBSITE - style.css
   Cách dùng: File này chứa toàn bộ giao diện.
   Bạn có thể thay màu sắc ở phần :root bên dưới.
   ============================================= */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&display=swap');

/* --- Biến màu sắc (CSS Variables) ---
   Muốn đổi màu toàn trang? Chỉ sửa ở đây! */
:root {
  --primary: #ff6b35;        /* Màu cam chính */
  --primary-dark: #e85a24;   /* Cam đậm hơn (hover) */
  --secondary: #2d2d2d;      /* Màu chữ tối */
  --bg: #f7f5f2;             /* Nền trang */
  --card-bg: #ffffff;        /* Nền card */
  --border: #ebe8e4;         /* Màu viền */
  --text-muted: #888;        /* Màu chữ mờ */
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 24px rgba(255,107,53,0.18);
  --radius: 16px;
  --radius-sm: 10px;

  /* Màu nút theo sàn - có thể tùy chỉnh */
  --tiktok: #010101;
  --tiktok-hover: #333;
  --shopee: #ee4d2d;
  --shopee-hover: #d44127;
  --lazada: #0f146b;
  --lazada-hover: #0a0f55;
}

/* --- Reset cơ bản --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Be Vietnam Pro', sans-serif;
  background: var(--bg);
  color: var(--secondary);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

/* =============================================
   TAB NAVIGATION
   ============================================= */
.tab-nav {
  display: flex;
  gap: 0;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  border-top: 1px solid var(--border);
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  border-bottom: 3px solid transparent;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--primary); }

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Tab content panels */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Ẩn search & filter khi không ở tab shop */
.search-hidden { display: none !important; }

/* =============================================
   HEADER (updated for tabs)
   ============================================= */
.site-header {
  background: #fff;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  letter-spacing: -0.5px;
}

.logo span {
  color: var(--secondary);
}

/* --- Thanh tìm kiếm --- */
.search-box {
  flex: 1;
  max-width: 360px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 9px 16px 9px 38px;
  border: 2px solid var(--border);
  border-radius: 50px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  background: var(--bg);
  color: var(--secondary);
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--primary);
  background: #fff;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 15px;
}

/* =============================================
   FILTER / MENU DANH MỤC
   (menu ngang cuộn ngang trên mobile)
   ============================================= */
.filter-bar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* Ẩn thanh cuộn nhưng vẫn cuộn được */
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  max-width: 1100px;
  margin: 0 auto;
  white-space: nowrap;
}

.filter-btn {
  padding: 7px 18px;
  border: 2px solid var(--border);
  border-radius: 50px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--secondary);
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Nút đang được chọn */
.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* =============================================
   NỘI DUNG CHÍNH
   ============================================= */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* --- Thông báo không tìm thấy --- */
#no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  display: none; /* Ẩn mặc định, JS sẽ hiện khi cần */
}

#no-results .no-results-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

#no-results p {
  font-size: 16px;
}

/* =============================================
   SECTION DANH MỤC
   (mỗi danh mục là một section)
   ============================================= */
.category-section {
  margin-bottom: 36px;
}

/* --- Tiêu đề danh mục --- */
.category-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-title::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 22px;
  background: var(--primary);
  border-radius: 3px;
}

/* --- Lưới sản phẩm ---
   2 cột trên mobile, 3-4 cột trên desktop */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

/* 3 cột từ màn hình 640px trở lên */
@media (min-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
}

/* 4 cột từ màn hình 900px trở lên */
@media (min-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
}

/* =============================================
   CARD SẢN PHẨM
   ============================================= */
.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* --- Ảnh sản phẩm --- */
.product-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3; /* Tỷ lệ ảnh cố định */
  background: #f0ede9;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  transition: transform 0.3s ease;
  display: block;
}

.product-card:hover .product-img-wrap img {
  transform: scale(1.06);
}

/* --- Tags (badge) --- */
.product-tags {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 50px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Màu đặc biệt cho một số tag */
.tag[data-tag="#sale"] { background: #e53e3e; }
.tag[data-tag="#hot"]  { background: #dd6b20; }
.tag[data-tag="#mới"]  { background: #38a169; }
.tag[data-tag="#trending"] { background: #805ad5; }
.tag[data-tag="#bestseller"] { background: #d69e2e; }

/* --- Thông tin sản phẩm --- */
.product-info {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--secondary);
  line-height: 1.4;
  /* Cắt tối đa 2 dòng */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Giá sản phẩm --- */
.product-price-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

/* Giá gốc — gạch ngang */
.price-original {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: line-through;
}

/* Giá sau giảm — nổi bật */
.price-sale {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
}

/* Badge % giảm */
.price-badge {
  font-size: 10px;
  font-weight: 700;
  background: #fff0eb;
  color: var(--primary);
  border: 1px solid #ffd0bc;
  padding: 2px 6px;
  border-radius: 50px;
}

/* Nếu chỉ có 1 giá (không giảm) */
.price-normal {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
}

/* --- Khu vực nút mua --- */
.product-links {
  padding: 0 10px 12px;
}

/* 3 logo nằm ngang */
.buy-btns-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.buy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 6px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fff;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}

.buy-btn img {
  height: 22px;
  width: auto;
  display: block;
  object-fit: contain;
  transition: transform 0.15s;
}

.buy-btn:hover img { transform: scale(1.1); }
.buy-btn:active    { transform: scale(0.95); }

.btn-tiktok:hover { border-color: #010101; background: #f2f2f2; }
.btn-shopee:hover { border-color: var(--shopee); background: #fff4f1; }
.btn-lazada:hover { border-color: var(--lazada); background: #f0f2ff; }

/* =============================================
   HOVER OVERLAY (PC)
   ============================================= */
.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.22s ease;
  z-index: 3;
}

.product-card:hover .card-overlay {
  opacity: 1;
}

.overlay-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background 0.15s, transform 0.15s;
}

.overlay-btn:hover {
  background: rgba(255,255,255,0.35);
  transform: scale(1.12);
}

/* Mobile: luôn hiện 2 icon nhỏ góc phải trên */
.card-mobile-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 4;
}

.mobile-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

/* Ẩn mobile actions trên PC (dùng overlay thay) */
@media (hover: hover) and (pointer: fine) {
  .card-mobile-actions { display: none; }
}

/* Ẩn overlay trên touch device */
@media (hover: none) {
  .card-overlay { display: none; }
}

/* =============================================
   SHARE POPUP
   ============================================= */
.share-popup {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(360px, 92vw);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  padding: 18px;
  z-index: 999;
  animation: slideUp 0.22s ease;
}

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}

.share-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 8px;
}

.share-popup-name {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.popup-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 50%;
  transition: background 0.15s;
}
.popup-close:hover { background: #f0ede9; }

.share-links { display: flex; flex-direction: column; gap: 10px; }

.share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f7f5f2;
  border-radius: 10px;
  padding: 10px 14px;
}

.share-platform-label {
  font-weight: 700;
  font-size: 14px;
}

.share-copy-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--secondary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.share-copy-btn:hover { background: #444; }
.share-copy-btn.copied { background: #38a169; }

/* =============================================
   INFO MODAL
   ============================================= */
.info-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 998;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@media (min-width: 540px) {
  .info-modal-overlay { align-items: center; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.info-modal {
  background: #fff;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.25s ease;
}

@media (min-width: 540px) {
  .info-modal {
    border-radius: 20px;
    max-height: 80vh;
  }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(0,0,0,0.08);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.modal-close:hover { background: rgba(0,0,0,0.15); }

.modal-img-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  background: #f7f5f2;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
}

.modal-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-body {
  padding: 16px 18px 24px;
}

.modal-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }

.modal-name {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 8px;
}

.modal-price-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.modal-price-orig {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.modal-price-sale {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

.modal-desc {
  font-size: 14px;
  color: #555;
  line-height: 1.7;
  background: #f7f5f2;
  border-radius: 10px;
  padding: 12px 14px;
}

body.modal-open { overflow: hidden; }

/* =============================================
   NÚT XEM VIDEO
   ============================================= */
.video-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: rgba(0,0,0,0.55);
  border-radius: 50%;
  text-decoration: none;
  backdrop-filter: blur(4px);
  border: 2px solid rgba(255,255,255,0.3);
  transition: background 0.18s, transform 0.15s;
  z-index: 2;
}

.video-btn:hover {
  background: #cc0000dd;
  transform: scale(1.12);
}

.video-btn-icon {
  font-size: 12px;
  color: #fff;
  margin-left: 2px; /* căn giữa icon ▶ */
}

.video-btn-text { display: none; }

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

/* =============================================
   LOADING ANIMATION (hiện khi đang tải data)
   ============================================= */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =============================================
   ANIMATION HIỆN CARD
   ============================================= */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card {
  animation: fadeUp 0.3s ease both;
}

/* Stagger - mỗi card hiện ra trễ hơn 1 chút */
.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.10s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.20s; }

/* =============================================
   REVIEW TAB
   ============================================= */
.review-page { padding: 24px 16px 40px; max-width: 800px; margin: 0 auto; }

.review-header { text-align: center; margin-bottom: 28px; }
.review-header h1 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.review-header p  { color: var(--text-muted); font-size: 14px; }

.review-list { display: flex; flex-direction: column; gap: 20px; }

.review-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: fadeUp 0.3s ease both;
}

@media (min-width: 600px) {
  .review-card { flex-direction: row; }
}

.review-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  flex-shrink: 0;
  background: #f0ede9;
  overflow: hidden;
}
@media (min-width: 600px) {
  .review-img-wrap { width: 200px; aspect-ratio: unset; }
}

.review-img-wrap img { width: 100%; height: 100%; object-fit: contain; }

.review-category {
  position: absolute; bottom: 8px; left: 8px;
  background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 50px;
}

.review-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 10px; }

.review-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.review-stars { display: flex; gap: 2px; }
.star { font-size: 16px; color: #ddd; }
.star.filled { color: #f6ad26; }

.review-rating-num { font-weight: 700; font-size: 14px; }

.verified-badge {
  background: #e6ffed; color: #2f855a;
  font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 50px;
  border: 1px solid #c6f6d5;
}

.review-date { color: var(--text-muted); font-size: 12px; margin-left: auto; }

.review-product-name { font-size: 16px; font-weight: 800; line-height: 1.3; }

.review-summary {
  font-size: 13px; color: #555; font-style: italic;
  background: #f7f5f2; border-left: 3px solid var(--primary);
  padding: 8px 12px; border-radius: 0 8px 8px 0;
}

.review-pros-cons { display: flex; flex-direction: column; gap: 4px; }
.review-pros, .review-cons { list-style: none; display: flex; flex-direction: column; gap: 3px; }
.review-pros li, .review-cons li { font-size: 13px; line-height: 1.5; }

.review-buy-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.review-buy-btn {
  padding: 6px 14px; border-radius: 8px;
  font-size: 12px; font-weight: 700;
  text-decoration: none; color: #fff;
  transition: opacity 0.15s;
}
.review-buy-btn:hover { opacity: 0.85; }
.rbtn-tiktok { background: #010101; }
.rbtn-shopee { background: var(--shopee); }
.rbtn-lazada { background: var(--lazada); }

/* =============================================
   TOOLS TAB
   ============================================= */
.tools-page { padding: 24px 16px 40px; max-width: 700px; margin: 0 auto; }

.tools-header { text-align: center; margin-bottom: 24px; }
.tools-header h1 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.tools-header p  { color: var(--text-muted); font-size: 14px; }

.tools-grid { display: flex; flex-direction: column; gap: 12px; }

.tool-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  box-shadow: var(--shadow);
}
.tool-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}

.tool-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}

.tool-info { flex: 1; }
.tool-name { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.tool-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.tool-arrow { font-size: 22px; color: var(--text-muted); font-weight: 300; }

/* Tool panel */
.tool-panel { animation: fadeUp 0.25s ease; }

.tool-back {
  background: none; border: 1.5px solid var(--border);
  border-radius: 50px; padding: 7px 16px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; margin-bottom: 20px;
  transition: border-color 0.15s, color 0.15s;
}
.tool-back:hover { border-color: var(--primary); color: var(--primary); }

.tool-loading { text-align: center; padding: 40px; color: var(--text-muted); }

/* Tool common UI */
.tool-wrap { background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border); padding: 20px; }

.tool-title-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.tool-title-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.tool-title-row h2 { font-size: 18px; font-weight: 800; }

.tool-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.tool-field { display: flex; flex-direction: column; gap: 5px; }
.tool-field label { font-size: 13px; font-weight: 600; color: var(--secondary); }
.tool-field input, .tool-field select {
  padding: 10px 14px; border: 2px solid var(--border);
  border-radius: 10px; font-family: inherit; font-size: 14px;
  outline: none; transition: border-color 0.2s; background: var(--bg);
}
.tool-field input:focus, .tool-field select:focus { border-color: var(--primary); background: #fff; }

.tool-btn {
  background: var(--primary); color: #fff;
  border: none; border-radius: 10px;
  padding: 12px; font-family: inherit;
  font-size: 15px; font-weight: 700;
  cursor: pointer; transition: background 0.15s, transform 0.12s;
}
.tool-btn:hover  { background: var(--primary-dark); }
.tool-btn:active { transform: scale(0.98); }

.tool-result { border-radius: 12px; overflow: hidden; }
.tool-error  { color: #c53030; background: #fff5f5; border: 1px solid #feb2b2; border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.tool-tip    { margin-top: 14px; font-size: 12px; color: var(--text-muted); background: #f7f5f2; border-radius: 8px; padding: 10px 12px; }
.tool-tip code { background: var(--border); padding: 1px 5px; border-radius: 4px; font-size: 11px; }

/* Tính giá result */
.tg-result-grid { display: flex; flex-direction: column; gap: 0; }
.tg-res-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: #f7f5f2;
}
.tg-res-item:last-child { border-bottom: none; }
.tg-res-item.highlight { background: #fff8f5; }
.tg-res-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.tg-res-val { font-size: 16px; font-weight: 800; }
.tg-res-val.orig  { color: var(--text-muted); text-decoration: line-through; font-size: 14px; }
.tg-res-val.sale  { color: var(--primary); font-size: 20px; }
.tg-res-val.saved { color: #38a169; }

/* So sánh giá result */
.ss-winner {
  background: #e6ffed; border: 1px solid #9ae6b4;
  border-radius: 10px; padding: 12px 16px;
  font-size: 14px; margin-bottom: 12px; color: #276749;
}
.ss-table { display: flex; flex-direction: column; gap: 8px; }
.ss-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  background: #f7f5f2; border-radius: 10px; padding: 12px 14px;
  border: 1.5px solid transparent;
}
.ss-row.ss-best { border-color: #38a169; background: #f0fff4; }
.ss-platform { font-weight: 700; font-size: 14px; flex: 1; min-width: 100px; }
.ss-breakdown { font-size: 12px; color: var(--text-muted); }
.ss-total { font-size: 16px; font-weight: 800; color: var(--primary); margin-left: auto; }
.ss-badge { background: #38a169; color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 50px; }

/* Tỉ giá result */
.tool-rate-note { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.tigia-tabs { display: flex; border: 2px solid var(--border); border-radius: 10px; overflow: hidden; }
.tigia-tab {
  flex: 1; padding: 9px; border: none; background: none;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; color: var(--text-muted); transition: all 0.15s;
}
.tigia-tab.active { background: var(--primary); color: #fff; }

.tigia-res { background: #f7f5f2; border-radius: 12px; padding: 20px; text-align: center; }
.tigia-from { font-size: 18px; font-weight: 700; color: var(--text-muted); }
.tigia-arrow { font-size: 24px; color: var(--primary); margin: 4px 0; }
.tigia-to { font-size: 28px; font-weight: 800; color: var(--primary); }
.tigia-to span { font-size: 16px; font-weight: 600; }
.tigia-rate { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
