/*
 * Bootstrap 4 Compatibility Shim for Glass Theme
 * Provides Bootstrap classes used by child templates
 * until they are individually rewritten in Phase 2+.
 */

/* ===== Grid System ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
}
.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: -15px;
  margin-right: -15px;
}
.row > * {
  padding-left: 15px;
  padding-right: 15px;
}
[class*="col-"] { width: 100%; }
@media (min-width: 576px) {
  .col-sm-4 { width: 33.3333%; flex: 0 0 33.3333%; }
  .col-sm-8 { width: 66.6667%; flex: 0 0 66.6667%; }
}
@media (min-width: 768px) {
  .col-md-3 { width: 25%; flex: 0 0 25%; }
  .col-md-4 { width: 33.3333%; flex: 0 0 33.3333%; }
  .col-md-6 { width: 50%; flex: 0 0 50%; }
  .col-md-8 { width: 66.6667%; flex: 0 0 66.6667%; }
  .col-md-9 { width: 75%; flex: 0 0 75%; }
}
@media (min-width: 1200px) {
  .col-xl-4 { width: 33.3333%; flex: 0 0 33.3333%; }
  .col-xl-6 { width: 50%; flex: 0 0 50%; }
  .col-xl-8 { width: 66.6667%; flex: 0 0 66.6667%; }
  .col-xl-12 { width: 100%; flex: 0 0 100%; }
}

/* ===== Cards ===== */
.card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.card-body { padding: 1.25rem; }
.card-header {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: transparent;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
}
.card-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: transparent;
}
.card-deck {
  display: flex;
  flex-wrap: wrap;
  margin-left: -15px;
  margin-right: -15px;
}
.card-deck .card {
  flex: 1 0 0%;
  margin-left: 15px;
  margin-right: 15px;
}

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 0.3em 0.6em;
  font-size: 75%;
  font-weight: 600;
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 6px;
}
.badge-danger {
  color: #fff;
  background-color: var(--color-primary);
}
.badge-dark {
  color: #fff;
  background-color: #1B365D;
}
.badge-secondary {
  color: #fff;
  background-color: #C0C0C0;
}
.badge-warning {
  color: #1B365D;
  background-color: #fbbf24;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 500;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
  border-radius: 8px;
  transition: all 0.15s ease;
}
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.85rem; }
.viewdetail-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  transition: none;
  margin: 0;
  white-space: nowrap;
}
.viewdetail-btn::before,
.viewdetail-btn::after { display: none; }
.viewdetail-btn:hover { opacity: 1; transform: none; }
.btn-primary {
  color: #fff;
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-primary:hover {
  opacity: 0.9;
}
.btn-danger {
  color: #fff;
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-danger:hover { opacity: 0.9; }
.btn-outline-danger {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: transparent;
}
.btn-outline-danger:hover {
  color: #fff;
  background-color: var(--color-primary);
}
.btn-pill { border-radius: 50px; }

/* ===== Display Utilities ===== */
.d-flex { display: flex !important; }
.d-none { display: none !important; }
.d-inline-block { display: inline-block !important; }
@media (min-width: 768px) {
  .d-md-none { display: none !important; }
  .d-md-block { display: block !important; }
}
@media (min-width: 992px) {
  .d-lg-none { display: none !important; }
  .d-lg-inline-block { display: inline-block !important; }
  .d-lg-flex { display: flex !important; }
}

/* ===== Flexbox Utilities ===== */
.flex-fill { flex: 1 1 auto !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-column { flex-direction: column !important; }
@media (min-width: 768px) {
  .flex-md-row { flex-direction: row !important; }
}
@media (min-width: 992px) {
  .flex-lg-row { flex-direction: row !important; }
}
.justify-content-between {
  justify-content: space-between !important;
}
.justify-content-center {
  justify-content: center !important;
}
.align-items-center { align-items: center !important; }

/* ===== Spacing ===== */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.mr-3 { margin-right: 1rem !important; }
.ml-1 { margin-left: 0.25rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.ml-3 { margin-left: 1rem !important; }
.p-0 { padding: 0 !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.pt-0 { padding-top: 0 !important; }
.pt-2 { padding-top: 0.5rem !important; }
.pb-0 { padding-bottom: 0 !important; }
.pb-2 { padding-bottom: 0.5rem !important; }
.pb-4 { padding-bottom: 1.5rem !important; }
.pl-4 { padding-left: 1.5rem !important; }

/* ===== Text Utilities ===== */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-capitalize { text-transform: capitalize !important; }
.text-muted { color: #C0C0C0 !important; }
.text-dark { color: #1B365D !important; }
.text-white { color: #fff !important; }
.text-danger { color: var(--color-primary) !important; }
.small, small { font-size: 85%; }

/* ===== Rounded / Borders ===== */
.rounded { border-radius: 8px !important; }
.rounded-circle { border-radius: 50% !important; }
.border-0 { border: 0 !important; }
.img-fluid {
  max-width: 100%;
  height: auto;
}

/* ===== Lists ===== */
.list-unstyled {
  padding-left: 0;
  list-style: none;
}
.list-group {
  display: flex;
  flex-direction: column;
  padding-left: 0;
  margin-bottom: 0;
}
.list-group-item {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.list-group-item:last-child { border-bottom: 0; }

/* ===== Breadcrumbs ===== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  padding: 0.5rem 0;
  margin-bottom: 1rem;
  list-style: none;
  background: transparent;
  font-size: 0.9rem;
}
.breadcrumb-item + .breadcrumb-item::before {
  display: inline-block;
  padding-right: 0.5rem;
  padding-left: 0.5rem;
  color: #C0C0C0;
  content: "/";
}
.breadcrumb-item.active { color: #C0C0C0; }

/* ===== Navigation ===== */
.nav {
  display: flex;
  flex-wrap: wrap;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
}
.nav-link {
  display: block;
  padding: 0.5rem 1rem;
  color: inherit;
  transition: color 0.15s ease;
}
.nav-link:hover { color: #1B365D; }

/* ===== Forms ===== */
.form-control {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #1B365D;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #C0C0C0;
  border-radius: 8px;
  transition: border-color 0.15s ease;
}
.form-control:focus {
  border-color: var(--color-primary);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(27, 54, 93, 0.15);
}
.form-inline {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
}

/* ===== Media Object ===== */
.media { display: flex; align-items: flex-start; }
.media-body { flex: 1; }

/* ===== Modal ===== */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1050;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
  background: rgba(0, 0, 0, 0.5);
}
.modal.show { display: block; }
.modal-dialog {
  position: relative;
  width: auto;
  max-width: 500px;
  margin: 1.75rem auto;
}
.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 3.5rem);
}
.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  outline: 0;
}
.modal-body { padding: 1rem; }
.fade { opacity: 0; transition: opacity 0.15s linear; }
.fade.show { opacity: 1; }

/* ===== Tables ===== */
.table { width: 100%; margin-bottom: 1rem; }
.table th,
.table td {
  padding: 0.75rem;
  vertical-align: top;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.table thead th {
  vertical-align: bottom;
  border-bottom: 2px solid rgba(0, 0, 0, 0.06);
}

/* ===== Misc ===== */
.clearfix::after {
  display: block;
  clear: both;
  content: "";
}
.accordion {}
.pull-right { float: right !important; }
.hidden-xs { display: none; }
@media (min-width: 576px) {
  .hidden-xs { display: block; }
}
.bd-b { border-bottom: 1px solid rgba(0, 0, 0, 0.06); }
/* ===== Review & Article Titles ===== */
.review-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.4;
  color: #1B365D;
}
.review-title:hover {
  color: #0056B3;
}
.review-list .review-title {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}
#sidebar .review-list .review-title {
  font-size: 1.15rem;
}
.viewdetail-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: #1B365D;
}
.viewdetail-title:hover {
  color: #0056B3;
}
#compare .viewdetail-title {
  font-size: 1.15rem;
}
.product-item .viewdetail-title {
  font-size: 1.1rem;
}
.col-title h2 {
  font-size: 1.35rem;
}
.block-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.content-fixed {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 15px;
  padding-right: 15px;
}

/* ===== AI Score Tooltip ===== */
.ai-score {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.ai-score a { cursor: pointer; color: #9ca3af; }
.ai-score a:hover { color: #6b7280; }
.ai-score svg { width: 14px; height: 14px; }
.ai-score-content {
  visibility: hidden;
  position: absolute;
  top: 0;
  left: 100%;
  margin-left: 0.5rem;
  z-index: 2147483647;
  width: 360px;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  font-size: 0.8rem;
  font-weight: 400;
  color: #6b7280;
  line-height: 1.5;
  text-align: left;
}
.ai-score-content.show { visibility: visible; }
.ai-score:hover .ai-score-content { visibility: visible; }

/* ===== Review Page — Image gallery grid ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.75rem;
}
.gallery-main { height: 100%; overflow: hidden; }
.gallery-side {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
}
.gallery-side-item { flex: 1; min-height: 0; overflow: hidden; }
.gallery-caption { margin-top: 0.75rem; clear: both; }
@media (max-width: 639px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    height: auto;
  }
  .gallery-main { height: 220px; }
  .gallery-side {
    flex-direction: row;
    height: 140px;
  }
}

/* ===== Review Page — "In This Article" box ===== */
.in-this-article {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
}

/* ===== Review Page — Related articles float box ===== */
.rel-article {
  float: left;
  width: 260px;
  margin: 0 1.5rem 1rem 0;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #f9fafb;
}
@media (max-width: 767px) {
  .rel-article { float: none; width: 100%; margin: 1rem 0; }
}

/* ===== Review Page — Compare products layout ===== */
.compare-product-layout {
  display: grid;
  grid-template-columns: 3fr 4fr 3fr;
  gap: 1.25rem;
  align-items: center;
}
.compare-product-image { text-align: center; }
.compare-product-info { min-width: 0; text-align: left; }
.compare-product-score { min-width: 0; }
.compare-product .card-footer {
  background: #f3f4f6;
  border-top: 1px solid #e5e7eb;
}
@media (max-width: 767px) {
  .compare-product-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
    text-align: center;
  }
  .compare-product-score {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
  }
}

/* ===== Review Page — Carousel ===== */
.carousel-track {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: background 0.15s ease;
}
.carousel-arrow:hover { background: #fff; }
.carousel-arrow-left { left: -12px; }
.carousel-arrow-right { right: -12px; }
@media (max-width: 767px) {
  .carousel-arrow { display: none; }
}

/* Star Rating */
.star-rating { display: inline-flex; gap: 2px; }
.star-rating-star {
  text-decoration: none;
  font-size: 22px;
  line-height: 1;
  color: #d2d2d2;
  cursor: pointer;
}
.star-rating-star::after { content: "\2605"; }
.star-rating-star.active::after { color: #EDB867; }
.star-rating.readonly .star-rating-star { cursor: default; }

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  gap: 0.35rem;
  justify-content: center;
}
.page-item .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.page-item .page-link:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}
.page-item.active .page-link {
  background: var(--color-primary, #D01818);
  color: #fff;
  border-color: var(--color-primary, #D01818);
  pointer-events: none;
}
.page-item.disabled .page-link {
  color: #9ca3af;
  pointer-events: none;
}
