/* ============================================
   WHMCS Store CSS - Bá Chủ Host
   Chỉ làm đẹp + hiệu ứng, không can thiệp layout
   ============================================ */

:root {
  --blue:        #2563eb;
  --blue-light:  #eff6ff;
  --blue-border: #93c5fd;
  --green:       #16a34a;
  --green-light: #f0fdf4;
  --green-border:#86efac;
  --border:      #e2e8f0;
  --text-1:      #1e293b;
  --text-2:      #475569;
  --text-3:      #94a3b8;
  --bg-card:     #ffffff;
  --bg-soft:     #f8fafc;
  --bg-muted:    #f1f5f9;
  --t:           0.18s ease;
}

/* ── Tiêu đề trang ───────────────────────────── */
.header-lined h1 {
  font-size: 1.4rem !important;
  font-weight: 700 !important;
  color: var(--text-1) !important;
  border-bottom: 2px solid var(--border) !important;
  padding-bottom: 10px !important;
  margin-bottom: 20px !important;
  position: relative !important;
}
.header-lined h1::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 44px; height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--blue-border));
  border-radius: 2px;
}

/* ── Sidebar ─────────────────────────────────── */
.card-sidebar,
.panel-sidebar {
  border-radius: 10px !important;
  border-color: var(--border) !important;
  box-shadow: 0 1px 4px rgba(15,23,42,0.06) !important;
  overflow: hidden !important;
}
.card-sidebar .card-header,
.panel-sidebar .panel-heading {
  background: var(--bg-muted) !important;
  border-bottom-color: var(--border) !important;
}
.card-sidebar .panel-title,
.panel-sidebar .panel-title {
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: var(--text-3) !important;
}
.card-sidebar .list-group-item,
.panel-sidebar .list-group-item {
  border-color: var(--border) !important;
  color: var(--text-2) !important;
  font-size: 0.85rem !important;
  transition: background var(--t), color var(--t), padding-left var(--t) !important;
}
.card-sidebar .list-group-item:hover,
.panel-sidebar .list-group-item:hover {
  background: var(--blue-light) !important;
  color: var(--blue) !important;
  padding-left: 20px !important;
}
.card-sidebar .list-group-item.active,
.panel-sidebar .list-group-item.active {
  background: var(--blue-light) !important;
  color: var(--blue) !important;
  border-left: 3px solid var(--blue) !important;
  font-weight: 600 !important;
}

/* ── Product Card ────────────────────────────── */
.product {
  border-radius: 12px !important;
  border-color: var(--border) !important;
  background: var(--bg-card) !important;
  box-shadow: 0 1px 3px rgba(15,23,42,0.07), 0 3px 12px rgba(15,23,42,0.05) !important;
  overflow: hidden !important;
  position: relative !important;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t) !important;
}

/* Dải màu trên đầu card — chỉ hiện khi hover */
.product::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--blue-border));
  opacity: 0;
  transition: opacity var(--t);
  z-index: 1;
}
.product:hover { 
  transform: translateY(-3px) !important;
  box-shadow: 0 6px 24px rgba(37,99,235,0.12), 0 2px 6px rgba(15,23,42,0.08) !important;
  border-color: var(--blue-border) !important;
}
.product:hover::before { opacity: 1; }

/* Header card */
.product header {
  background: var(--bg-muted) !important;
  border-bottom-color: var(--border) !important;
}
.product header span[id$="-name"] {
  font-weight: 700 !important;
  color: var(--text-1) !important;
}

/* Badge số lượng */
.product header .qty {
  background: var(--green-light) !important;
  color: var(--green) !important;
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  border: 1px solid var(--green-border) !important;
  border-radius: 999px !important;
  padding: 2px 9px !important;
}

/* Feature list */
.product .product-desc {
  text-align: left !important;
}
.product .product-desc ul {
  list-style: none !important;
  padding: 0 10% !important;
  margin: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  float: none !important;
}
.product .product-desc ul li {
  display: grid !important;
  grid-template-columns: auto 1fr !important;
  align-items: baseline !important;
  gap: 4px 8px !important;
  padding: 5px 0 !important;
  border-bottom: 1px dashed var(--border) !important;
  font-size: 0.82rem !important;
  color: var(--text-2) !important;
  line-height: 1.5 !important;
}
.product .product-desc ul li:last-child {
  border-bottom: none !important;
}
/* Nếu feature-value dài hơn 50% card thì chiếm cả hàng */
.product .product-desc ul li .feature-value {
  font-weight: 700 !important;
  color: var(--blue) !important;
  font-size: 0.82rem !important;
  word-break: break-word !important;
  /* Nếu text dài, chiếm full row */
  max-width: 100% !important;
}
.product .product-desc ul li .feature-value::after {
  content: ' —' !important;
  color: var(--text-3) !important;
  font-weight: 400 !important;
}
/* Khi feature-value quá dài (>= 20 ký tự) — tự wrap xuống dòng mới */
.product .product-desc ul li:has(.feature-value:only-child),
.product .product-desc ul li:has(.feature-value[style]),
.product .product-desc ul li .feature-value:not(:last-child) ~ * {
  color: var(--text-2) !important;
}
/* Class inject bởi JS khi value > 20 ký tự: stack thành 2 dòng */
.product .product-desc ul li.feature-long {
  grid-template-columns: 1fr !important;
  gap: 1px !important;
}
.product .product-desc ul li.feature-long .feature-value {
  color: var(--blue) !important;
}
.product .product-desc ul li.feature-long .feature-value::after {
  content: '' !important;
}
/* Text label đứng sau — xám nhỏ hơn */
.product .product-desc ul li.feature-long > :not(.feature-value) {
  font-size: 0.75rem !important;
  color: var(--text-3) !important;
  padding-left: 2px !important;
}

/* Footer card */
.product footer {
  background: transparent !important;
  border-top-color: var(--border) !important;
}

/* Giá */
.product-pricing .price {
  font-weight: 800 !important;
  color: var(--blue) !important;
}
.product-pricing .price.is-free {
  color: var(--green) !important;
}
.product-pricing .billing-cycle {
  color: var(--text-3) !important;
  font-size: 0.7rem !important;
}
.product-pricing br { display: none !important; }

/* Nút đăng ký */
.btn-order-now.btn-success {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  box-shadow: 0 1px 4px rgba(37,99,235,0.25) !important;
  transition: background var(--t), box-shadow var(--t), transform var(--t) !important;
}
.btn-order-now.btn-success:hover {
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
  box-shadow: 0 3px 12px rgba(37,99,235,0.35) !important;
  transform: translateY(-1px) !important;
}

/* Nút đã giới hạn */
.btn-order-now.limit-disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
}

/* ── Hiệu ứng xuất hiện ──────────────────────── */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.product { animation: cardIn 0.3s ease both; }
#products .row:nth-child(1) .col-md-6:nth-child(1) .product { animation-delay: 0.04s; }
#products .row:nth-child(1) .col-md-6:nth-child(2) .product { animation-delay: 0.09s; }
#products .row:nth-child(2) .col-md-6:nth-child(1) .product { animation-delay: 0.14s; }
#products .row:nth-child(2) .col-md-6:nth-child(2) .product { animation-delay: 0.19s; }
#products .row:nth-child(3) .col-md-6:nth-child(1) .product { animation-delay: 0.24s; }