html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  margin: 0;
}

body > header {
  flex-shrink: 0;
}

body > main {
  flex: 1 0 auto;
}

body > footer {
  flex-shrink: 0;
  margin-top: auto;
}

/* Khung ảnh danh sách sản phẩm — ảnh tự căn, không méo */
.product-thumb-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: var(--bs-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-thumb-frame--empty {
  color: var(--bs-secondary-color);
}

.product-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.product-detail-img {
  width: 100%;
  min-height: 20rem;
  max-height: 30rem;
  object-fit: contain;
  object-position: center;
}

.product-detail-img.bg-light {
  object-fit: unset;
}

.cart-item-thumb {
  width: 3rem;
  height: 3rem;
  object-fit: cover;
  object-position: center;
}

.checkout-thumb {
  width: 4rem;
  height: 4rem;
  object-fit: cover;
  object-position: center;
}

.image-preview-wrap {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.375rem;
  overflow: hidden;
  background-color: var(--bs-light);
}

.image-preview {
  display: block;
  width: 100%;
  max-height: 13.75rem;
  object-fit: contain;
  object-position: center;
}

.product-edit-images {
  display: grid;
  gap: 1rem;
}

@media (min-width: 576px) {
  .product-edit-images--dual {
    grid-template-columns: 1fr 1fr;
  }
}

.product-card:hover {
  transform: translateY(-2px);
  transition: transform 0.15s ease;
}

/* Trang danh sách sản phẩm */
.products-list-page {
  padding-bottom: 2rem;
}

.page-main {
  width: 100%;
}

.products-list-page .search-section {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.products-list-page .category-card {
  background: #fff;
  border-radius: 18px;
  padding: 1.5rem 0.75rem;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  height: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 2px solid transparent;
}

.products-list-page .category-card:hover,
.products-list-page .category-card--active {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.15);
  border-color: #2563eb;
}

.products-list-page .category-card i {
  font-size: 2.25rem;
  color: #2563eb;
  margin-bottom: 0.75rem;
  display: block;
}

.products-list-page .category-card h6 {
  font-weight: 600;
  margin: 0;
  color: #1f2937;
  font-size: 0.85rem;
  line-height: 1.3;
}

.products-list-page .products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

/* Trang chủ */
body.layout-fullwidth {
  background: #f5f7fa;
}

.home-page .hero-section {
  min-height: 500px;
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
}

.home-page .hero-img {
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.home-page .category-card {
  background: white;
  border-radius: 18px;
  padding: 30px 15px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  height: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.home-page .category-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.15);
}

.home-page .category-card i {
  font-size: 42px;
  color: #2563eb;
  margin-bottom: 15px;
  display: block;
}

.home-page .category-card h6 {
  font-weight: 600;
  margin: 0;
  color: #1f2937;
  min-height: 40px;
}

.home-page .section-muted {
  background: #f8fafc;
}

.home-page .home-product-track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.home-page .home-product-track > .product-card-ui {
  flex: 0 0 240px;
  scroll-snap-align: start;
}

.home-page .home-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

/* Thẻ sản phẩm dùng chung (trang chủ + /Products) */
.product-card-ui {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
  min-height: 100%;
}

.product-card-ui:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.product-card-ui--vip {
  position: relative;
  border: 2px solid #fbbf24;
  box-shadow: 0 8px 22px rgba(251, 191, 36, 0.28);
}

.product-card-ui__vip-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  background: linear-gradient(135deg, #fde047, #f59e0b);
  color: #1f2937;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  line-height: 1;
}

.product-card-ui__media {
  position: relative;
  display: block;
  height: 168px;
  flex-shrink: 0;
  overflow: hidden;
  background: #e2e8f0;
}

.product-card-ui__img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 2.5rem;
  pointer-events: none;
}

.product-card-ui__img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-card-ui__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  max-width: calc(100% - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
}

.product-card-ui__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 0.9rem 1rem 1.1rem;
  gap: 0.35rem;
}

.product-card-ui__title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 0.15rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6rem;
}

.product-card-ui__title a:hover {
  color: #2563eb !important;
}

.product-card-ui__meta,
.product-card-ui__seller {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.3;
}

.product-card-ui__price {
  margin: 0.35rem 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #2563eb;
  line-height: 1.2;
}

.product-card-ui__actions {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.product-card-ui__actions .btn:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.product-card-ui__actions .btn {
  font-size: 0.78rem;
  padding: 0.4rem 0.55rem;
  white-space: nowrap;
}

.product-card-ui__cart-btn {
  flex: 0 0 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.home-page .feature-box {
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  height: 100%;
}

.home-page .feature-box i {
  font-size: 50px;
  color: #2563eb;
  margin-bottom: 20px;
}

.home-page .home-product-track::-webkit-scrollbar {
  height: 6px;
}

.home-page .home-product-track::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.home-page .vip-section {
  background: linear-gradient(135deg, #fff7d6, #fff1a8);
}

.home-page .vip-title {
  color: #d97706;
}
