/* ThietKeInfographic Frontend CSS — Plugin
   Cards, Archive, Filter Sidebar, Contact Info */

:root {
  --dh-primary: #1B6EF3;
  --dh-primary-dark: #1455C0;
  --dh-primary-light: #E8F0FE;
  --dh-accent: #FF6B2B;
  --dh-text-dark: #1A1D23;
  --dh-text-mid: #3D4350;
  --dh-text-light: #6B7280;
  --dh-bg: #F5F7FA;
  --dh-white: #FFFFFF;
  --dh-border: #E4E7EF;
  --dh-shadow-sm: 0 1px 4px rgba(0,0,0,.06);
  --dh-shadow-md: 0 4px 20px rgba(27,110,243,.10);
  --dh-shadow-lg: 0 8px 40px rgba(27,110,243,.14);
  --dh-radius: 14px;
  --dh-radius-sm: 8px;
}

/* ─── CARD ─── */
.dh-card {
  background: var(--dh-white);
  border-radius: var(--dh-radius);
  border: 1px solid var(--dh-border);
  overflow: hidden;
  transition: all .25s;
  box-shadow: var(--dh-shadow-sm);
  display: flex;
  flex-direction: column;
}
.dh-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--dh-shadow-lg);
  border-color: var(--dh-primary);
}
.dh-card--featured { border-color: #FFD166; }

.dh-card-thumb-wrap {
  display: block;
  position: relative;
  height: 180px;
  overflow: hidden;
  background: var(--dh-bg);
  text-decoration: none;
}
.dh-card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.dh-card:hover .dh-card-img { transform: scale(1.04); }

.dh-card-avatar {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; font-weight: 800; color: white;
  letter-spacing: 2px;
}
.dh-card-overlay {
  position: absolute; inset: 0;
  background: rgba(27,110,243,0);
  display: flex; align-items: center; justify-content: center;
  transition: background .25s;
}
.dh-card:hover .dh-card-overlay { background: rgba(27,110,243,.15); }
.dh-card-overlay-btn {
  background: white; color: var(--dh-primary);
  padding: 7px 18px; border-radius: 30px;
  font-size: .82rem; font-weight: 600;
  opacity: 0; transform: scale(.85); transition: all .2s;
  pointer-events: none;
}
.dh-card:hover .dh-card-overlay-btn { opacity:1; transform:scale(1); }

.dh-card-badge { position: absolute; top: 10px; left: 10px; z-index: 2; }
.dh-badge { font-size: .68rem; font-weight: 700; padding: 3px 10px; border-radius: 12px; display:inline-block; }
.badge-hot  { background: #FFF0E8; color: #E05A20; }
.badge-new  { background: var(--dh-primary-light); color: var(--dh-primary); }
.badge-sale { background: #FFFDE7; color: #B45309; }
.badge-pro  { background: #F3E5F5; color: #7C3AED; }
.badge-free { background: #EDFDF4; color: #15803D; }

.dh-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.dh-card-terms { display: flex; flex-wrap: wrap; gap: 6px; }
.dh-term-tag {
  font-size: .7rem; font-weight: 600; color: var(--dh-primary);
  background: var(--dh-primary-light); padding: 2px 8px;
  border-radius: 10px; text-decoration: none;
}
.dh-term-tag:hover { background: var(--dh-primary); color: white; }
.dh-card-title { margin: 0; font-size: .95rem; font-weight: 700; line-height: 1.4; }
.dh-card-title a { color: var(--dh-text-dark); text-decoration: none; }
.dh-card-title a:hover { color: var(--dh-primary); }
.dh-card-tagline { font-size: .78rem; color: var(--dh-text-light); margin: 0; }
.dh-card-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.dh-card-rating { display: flex; align-items: center; gap: 4px; }
.dh-stars { color: #F59E0B; font-size: .82rem; }
.dh-rating-num { font-size: .82rem; font-weight: 700; color: var(--dh-text-dark); }
.dh-review-count { font-size: .75rem; color: var(--dh-text-light); }
.dh-card-delivery { font-size: .75rem; color: var(--dh-text-light); }
.dh-card-delivery i { margin-right: 3px; }

.dh-card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--dh-border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.dh-price { font-size: 1rem; font-weight: 800; color: var(--dh-primary); }
.dh-price-contact { font-size: .85rem; color: var(--dh-accent); font-weight: 600; }
.dh-btn-card-detail {
  background: var(--dh-primary); color: white;
  padding: 7px 14px; border-radius: 7px;
  font-size: .78rem; font-weight: 600;
  text-decoration: none; transition: background .2s;
  white-space: nowrap;
}
.dh-btn-card-detail:hover { background: var(--dh-primary-dark); }

/* ─── GRID SYSTEM ─── */
.dh-grid {
  display: grid;
  gap: 20px;
}
.dh-grid-col-2 { grid-template-columns: repeat(2,1fr); }
.dh-grid-col-3 { grid-template-columns: repeat(3,1fr); }
.dh-grid-col-4 { grid-template-columns: repeat(4,1fr); }

/* ─── ARCHIVE PAGE ─── */
.dh-archive-wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.dh-archive-search { margin-bottom: 24px; }
.dh-archive-layout { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start; }

/* Filter button mobile */
.dh-mobile-filter-btn {
  display: none;
  align-items: center; gap: 8px;
  background: var(--dh-primary); color: white;
  border: none; padding: 10px 20px; border-radius: 8px;
  font-size: .9rem; font-weight: 600; cursor: pointer;
  margin-bottom: 16px;
}
.dh-filter-count {
  background: var(--dh-accent); color: white;
  width: 20px; height: 20px; border-radius: 50%;
  font-size: .72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* Filter sidebar */
.dh-filter-sidebar {
  background: var(--dh-white); border: 1px solid var(--dh-border);
  border-radius: var(--dh-radius); padding: 20px;
  position: sticky; top: 80px;
  box-shadow: var(--dh-shadow-sm);
  max-height: calc(100vh - 100px); overflow-y: auto;
}
.dh-filter-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dh-filter-header h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.dh-filter-close { display: none; background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--dh-text-light); }
.dh-filter-reset {
  width: 100%; background: var(--dh-bg); border: 1px solid var(--dh-border);
  border-radius: 7px; padding: 8px; font-size: .82rem; cursor: pointer;
  margin-bottom: 16px; color: var(--dh-text-mid); font-weight: 500;
  transition: all .2s;
}
.dh-filter-reset:hover { background: #FFEBEE; color: #DC2626; border-color: #FFCDD2; }

.dh-filter-group { margin-bottom: 16px; border-bottom: 1px solid var(--dh-border); padding-bottom: 16px; }
.dh-filter-group:last-child { border-bottom: none; }
.dh-filter-group-head {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--dh-text-dark);
  padding: 4px 0; user-select: none;
}
.dh-filter-group-head i { font-size: .75rem; transition: transform .2s; }
.dh-filter-group.collapsed .dh-filter-group-head i { transform: rotate(-90deg); }
.dh-filter-group.collapsed .dh-filter-group-body { display: none; }
.dh-filter-group-body { margin-top: 10px; }
.dh-filter-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; cursor: pointer; font-size: .82rem;
  color: var(--dh-text-mid); transition: color .15s;
}
.dh-filter-opt:hover { color: var(--dh-primary); }
.dh-filter-opt input[type=radio] { accent-color: var(--dh-primary); }
.dh-filter-opt span:first-of-type { flex: 1; }
.dh-filter-cnt { font-size: .72rem; color: var(--dh-text-light); background: var(--dh-bg); padding: 1px 6px; border-radius: 8px; }
.dh-select { width: 100%; padding: 7px 10px; border: 1px solid var(--dh-border); border-radius: 7px; font-size: .85rem; }

/* Mobile overlay */
.dh-filter-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 999;
}

/* Archive toolbar */
.dh-archive-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.dh-result-count { font-size: .85rem; color: var(--dh-text-light); }
.dh-active-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.dh-active-filter-tag {
  background: var(--dh-primary-light); color: var(--dh-primary);
  font-size: .75rem; font-weight: 600; padding: 4px 10px; border-radius: 12px;
  display: flex; align-items: center; gap: 5px; cursor: pointer;
}
.dh-active-filter-tag .dh-remove-filter:hover { color: #DC2626; }

/* Loading & no results */
.dh-loading { grid-column: 1/-1; text-align: center; padding: 60px 20px; }
.dh-spinner {
  width: 40px; height: 40px; border: 3px solid var(--dh-border);
  border-top-color: var(--dh-primary); border-radius: 50%;
  animation: dh-spin .7s linear infinite; margin: 0 auto 12px;
}
@keyframes dh-spin { to { transform: rotate(360deg); } }
.dh-no-results { grid-column: 1/-1; text-align: center; padding: 60px 20px; }
.dh-no-results-icon { font-size: 3rem; margin-bottom: 12px; }
.dh-no-results p { font-size: 1rem; font-weight: 600; color: var(--dh-text-dark); }
.dh-no-results small { color: var(--dh-text-light); }

/* Pagination */
.dh-pagination { display: flex; gap: 8px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.dh-page-btn {
  padding: 8px 14px; border: 1px solid var(--dh-border);
  border-radius: 7px; background: white; cursor: pointer;
  font-size: .85rem; color: var(--dh-text-mid); transition: all .2s;
}
.dh-page-btn:hover { border-color: var(--dh-primary); color: var(--dh-primary); }
.dh-page-btn.active { background: var(--dh-primary); color: white; border-color: var(--dh-primary); }
.dh-page-btn:disabled { opacity: .4; cursor: default; }

/* ─── SEARCH BAR ─── */
.dh-search-box {
  display: flex; align-items: center; gap: 10px;
  background: white; border-radius: 50px;
  border: 1px solid var(--dh-border);
  padding: 8px 8px 8px 20px;
  box-shadow: var(--dh-shadow-sm);
}
.dh-search-box i { color: var(--dh-text-light); }
.dh-search-box input {
  flex: 1; border: none; outline: none; font-size: .95rem;
  font-family: 'Inter', sans-serif; background: transparent;
}
.dh-search-box button {
  background: var(--dh-accent); color: white;
  border: none; padding: 9px 22px; border-radius: 40px;
  font-size: .88rem; font-weight: 600; cursor: pointer;
}
.dh-search-box button:hover { background: #e05a20; }
.dh-search-form-sc .dh-search-inner { /* same as above */
  display: flex; align-items: center; gap: 10px;
  background: white; border: 1px solid var(--dh-border);
  border-radius: 50px; padding: 8px 8px 8px 20px;
}

/* ─── CONTACT INFO ─── */
.dh-contact-info-block { display: flex; flex-direction: column; gap: 10px; }
.dh-ci-item { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--dh-text-mid); }
.dh-ci-item i { color: var(--dh-primary); width: 20px; }
.dh-ci-item a { color: var(--dh-text-mid); text-decoration: none; }
.dh-ci-item a:hover { color: var(--dh-primary); }
.dh-ci-social { display: flex; gap: 12px; margin-top: 6px; }
.dh-ci-social a { color: var(--dh-text-light); font-size: 1.1rem; transition: color .2s; }
.dh-ci-social a:hover { color: var(--dh-primary); }

/* ─── CONTACT PAGE ─── */
.dh-contact-page-wrap { max-width: 900px; margin: 0 auto; }
.dh-contact-page-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 32px; }
.dh-contact-left h2 { margin-top: 0; }
.dh-contact-map iframe { width: 100%; height: 350px; border-radius: var(--dh-radius); border: 0; }

/* ─── STATS ─── */
.dh-stats-wrap { display: flex; gap: 32px; flex-wrap: wrap; }
.dh-stat-item { text-align: center; }
.dh-stat-num { font-size: 1.6rem; font-weight: 800; color: var(--dh-primary); display: block; }
.dh-stat-label { font-size: .78rem; color: var(--dh-text-light); }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .dh-grid-col-4 { grid-template-columns: repeat(3,1fr); }
  .dh-archive-layout { grid-template-columns: 240px 1fr; }
}

@media (max-width: 768px) {
  .dh-grid-col-4, .dh-grid-col-3 { grid-template-columns: repeat(2,1fr); }
  .dh-grid-col-2 { grid-template-columns: 1fr; }
  .dh-archive-layout { grid-template-columns: 1fr; }
  .dh-mobile-filter-btn { display: flex; }

  .dh-filter-sidebar {
    position: fixed !important; top: 0 !important; left: -320px; width: 300px;
    height: 100vh; max-height: 100vh; z-index: 1000;
    transition: left .3s ease; border-radius: 0; border-right: 1px solid var(--dh-border);
  }
  .dh-filter-sidebar.open { left: 0; }
  .dh-filter-overlay.open { display: block; }
  .dh-filter-close { display: block !important; }

  .dh-contact-page-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .dh-grid-col-4, .dh-grid-col-3, .dh-grid-col-2 { grid-template-columns: repeat(2,1fr); }
  .dh-card-thumb-wrap { height: 140px; }
}
