/* ==========================================================================
   KDK VIETNAM — 3. COMPONENTS MODULE (Buttons, Section Badges, Product Cards, Modal, Search)
   ========================================================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--grad-primary) !important;
  color: var(--white) !important;
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(237, 27, 36, 0.35);
  color: var(--white) !important;
}

.btn-outline {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  background: transparent;
}

.btn-outline:hover {
  background: var(--primary-light) !important;
  transform: translateY(-2px);
}

.btn-outline-white {
  border-color: rgba(255,255,255,0.4) !important;
  color: var(--white) !important;
  background: transparent;
}

.btn-outline-white:hover {
  background: var(--white) !important;
  color: var(--dark) !important;
}

.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 6px; }
.btn-md { padding: 10px 20px; font-size: 14px; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: 10px; }

/* ==========================================================================
   SECTION BADGE PILLS (HIGH CONTRAST GUARANTEED)
   ========================================================================== */
.section-label {
  display: inline-flex !important;
  align-items: center !important;
  align-self: flex-start !important;
  width: fit-content !important;
  gap: 8px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 1.5px !important;
  color: var(--white) !important;
  background: var(--grad-primary) !important;
  padding: 6px 18px !important;
  border-radius: 6px !important;
  margin-bottom: 18px !important;
  box-shadow: 0 4px 14px var(--primary-glow) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
}

.product-tag {
  display: inline-flex;
  align-items: center;
  background: rgba(237, 27, 36, 0.08);
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 10px;
  max-width: 100%;
  line-height: 1.35;
  align-self: flex-start;
  border: 1px solid rgba(237, 27, 36, 0.15);
}

.product-cat-tag {
  display: inline-flex !important;
  align-items: center !important;
  align-self: flex-start !important;
  width: fit-content !important;
  gap: 6px !important;
  padding: 5px 16px !important;
  background: var(--grad-primary) !important;
  color: var(--white) !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  margin-bottom: 12px !important;
  box-shadow: 0 4px 12px var(--primary-glow) !important;
}

/* PRODUCT CARD */
.product-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
  height: 100%;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(237, 27, 36, 0.4);
}

.product-img-box {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  background: #0f1218;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.product-img-box a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.product-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

.product-card:hover .product-img-box img {
  transform: scale(1.06);
}

.product-info {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-info h3 {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 8px;
}

.product-info h3 a {
  color: var(--text-dark);
}

.product-info h3 a:hover {
  color: var(--primary);
}

.product-sku {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 500;
}

.product-price-box {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-top: auto;
  margin-bottom: 18px;
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.product-actions .btn {
  padding: 8px 6px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  min-width: 0 !important;
  width: 100% !important;
  justify-content: center !important;
  text-align: center !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
}

.product-actions .btn i {
  font-size: 12px;
  margin-right: 2px;
}

/* BLOG CARD */
.blog-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
  height: 100%;
}

.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(237, 27, 36, 0.4);
}

.blog-img-box {
  width: 100%;
  height: 210px;
  overflow: hidden;
  background: var(--bg-light);
}

.blog-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.blog-card:hover .blog-img-box img {
  transform: scale(1.08);
}

.blog-info {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-date {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.blog-info h3 {
  font-size: 17px;
  margin-bottom: 12px;
}

.blog-excerpt {
  font-size: 14px;
  color: var(--text-body);
  line-height: 1.6;
  margin-bottom: 20px;
}

.read-more-link {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.read-more-link:hover {
  gap: 10px;
  color: var(--primary-dark);
}

/* CATALOG TOOLBAR & SEARCH */
.catalog-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
  background-color: var(--bg-light);
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.search-box-wrap {
  position: relative;
  flex: 1;
}

.search-box-wrap.full-width { width: 100%; }

.search-box-wrap .search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}

.search-box-wrap input {
  width: 100%;
  padding: 13px 18px 13px 48px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  background: var(--white);
  transition: var(--transition);
}

.search-box-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.sort-box-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.sort-box-wrap select {
  padding: 10px 18px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  background: var(--white);
}

.tabs-header {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.tab-btn {
  padding: 10px 22px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--white);
  color: var(--text-body);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn:hover,
.tab-btn.active {
  background: var(--grad-primary) !important;
  color: var(--white) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 6px 18px var(--primary-glow);
}

/* PAGINATION CONTROLS */
.catalog-stats-text {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.pagination-container {
  display: flex;
  justify-content: center;
  margin-top: 48px;
  flex-wrap: wrap;
  gap: 8px;
}

/* WordPress paginate_links() output styles */
.pagination-container .page-numbers {
  min-width: 44px;
  height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--white);
  color: var(--text-dark);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.pagination-container .page-numbers:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.pagination-container .page-numbers.current {
  background: var(--grad-primary) !important;
  border-color: var(--primary) !important;
  color: var(--white) !important;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.pagination-container .page-numbers.dots {
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: default;
}

.pagination-container .page-numbers.dots:hover {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.pagination-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 44px;
  height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--white);
  color: var(--text-dark);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);

  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover:not(.disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.page-btn.active {
  background: var(--grad-primary) !important;
  border-color: var(--primary) !important;
  color: var(--white) !important;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-ellipsis {
  padding: 0 8px;
  color: var(--text-muted);
  font-weight: 600;
}

/* QUICK VIEW MODAL */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  position: relative;
  background: var(--white);
  width: min(92vw, 920px);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 22px;
  background: none;
  border: none;
  font-size: 32px;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-close:hover {
  color: var(--primary);
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
}

.modal-main-img-box {
  width: 100%;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: 16px;
}

.modal-main-img-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.modal-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
}

.modal-thumbs img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
}

.modal-thumbs img.active {
  border-color: var(--primary);
}

/* TECHNICAL SPECS TABLE */
.specs-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.specs-table th, .specs-table td {
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  font-size: 14px;
  text-align: left;
}

.specs-table th {
  background-color: var(--bg-light);
  width: 35%;
  font-weight: 600;
  color: var(--text-dark);
}

/* ==========================================================================
   OFFICIAL KDK WELCOME LETTER (THƯ NGỎ) - 100% PURE HTML & CSS
   ========================================================================== */
.kdk-welcome-letter {
  position: relative;
  background: radial-gradient(circle at 80% 20%, #2a080c 0%, #0d0d0d 60%, #050505 100%);
  border: 1px solid rgba(230, 0, 18, 0.3);
  border-radius: var(--radius-xl);
  padding: 50px 55px;
  color: #f1f5f9;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), inset 0 0 80px rgba(230, 0, 18, 0.05);
  overflow: hidden;
}

.kdk-welcome-letter::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(to bottom, #e60012, #ff4d5a, #80000a);
  box-shadow: 0 0 15px rgba(230, 0, 18, 0.8);
}

.kdk-welcome-letter::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    rgba(230, 0, 18, 0.03),
    rgba(230, 0, 18, 0.03) 10px,
    transparent 10px,
    transparent 20px
  );
  pointer-events: none;
}

.letter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 25px;
  margin-bottom: 30px;
}

.letter-title {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffffff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.letter-title span.red {
  color: var(--primary);
  text-shadow: 0 0 20px rgba(230, 0, 18, 0.6);
}

.letter-subtitle-badge {
  background: rgba(230, 0, 18, 0.15);
  color: #ff4d5a;
  border: 1px solid rgba(230, 0, 18, 0.4);
  padding: 6px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.letter-salutation {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 22px;
}

.letter-content p {
  font-size: 15.5px;
  line-height: 1.85;
  color: #cbd5e1;
  margin-bottom: 20px;
  text-align: justify;
}

.letter-content p strong {
  color: #ffffff;
}

.letter-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 40px;
  padding-top: 25px;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
}

.letter-thanks {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  font-style: italic;
}

.letter-signature-box {
  text-align: right;
}

.letter-sign-title {
  font-size: 13px;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.letter-sign-name {
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   PURE CSS ORGANIZATIONAL CHART (SƠ ĐỒ TỔ CHỨC HTML)
   ========================================================================== */
.kdk-org-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  position: relative;
  margin: 20px 0;
}

.org-node-top {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid var(--primary);
  border-radius: var(--radius-xl);
  padding: 24px 40px;
  color: var(--white);
  text-align: center;
  box-shadow: 0 10px 30px rgba(230,0,18,0.25);
  position: relative;
  max-width: 550px;
  width: 100%;
}

.org-node-top h3 {
  color: var(--white);
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.org-node-top .org-sub {
  font-size: 13.5px;
  color: #ff99a1;
  font-weight: 600;
}

.org-line-v {
  width: 3px;
  height: 25px;
  background: var(--primary);
  box-shadow: 0 0 8px rgba(230,0,18,0.5);
}

.org-tree-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  width: 100%;
}

@media (max-width: 992px) {
  .org-tree-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .kdk-welcome-letter {
    padding: 35px 25px;
  }
}

@media (max-width: 576px) {
  .org-tree-grid {
    grid-template-columns: 1fr;
  }
  .letter-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  .letter-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  .letter-signature-box {
    text-align: left;
  }
}

.org-node-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-top: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
}

.org-node-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.org-node-card .icon-box {
  width: 48px;
  height: 48px;
  background: rgba(230,0,18,0.1);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.org-node-card h4 {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.org-node-card .head-count {
  display: inline-block;
  background: rgba(230,0,18,0.08);
  color: var(--primary);
  font-weight: 700;
  font-size: 12.5px;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.org-node-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.org-node-card li {
  font-size: 13px;
  color: var(--text-body);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.org-node-card li i {
  color: var(--primary);
  font-size: 11px;
}

/* ==========================================================================
   PDF FOOTER & TECH SECTION BACKGROUND (HEXAGON & AUDIO SOUNDWAVE EFFECT)
   ========================================================================== */
.footer {
  position: relative;
  background: radial-gradient(circle at 50% 0%, #1c0508 0%, #0c0d10 60%, #050507 100%) !important;
  border-top: 3px solid var(--primary);
  color: #cbd5e1;
  overflow: hidden;
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(rgba(230, 0, 18, 0.15) 1px, transparent 1px),
    radial-gradient(rgba(230, 0, 18, 0.08) 1px, #0c0d10 1px);
  background-size: 40px 40px;
  background-position: 0 0, 20px 20px;
  opacity: 0.25;
  pointer-events: none;
}

.footer::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 120px;
  background: linear-gradient(to top, rgba(230, 0, 18, 0.06), transparent);
  pointer-events: none;
}

.pdf-tech-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 35px 30px;
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.pdf-tech-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--grad-primary);
}

.pdf-tech-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.cert-card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

@media (max-width: 992px) {
  .cert-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .cert-card-grid {
    grid-template-columns: 1fr;
  }
}

.cert-item {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
}

.cert-item:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 12px 30px rgba(230,0,18,0.15);
}

.cert-img-box {
  position: relative;
  height: 280px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
}

.cert-img-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.cert-item:hover .cert-img-box img {
  transform: scale(1.05);
}

.cert-info {
  padding: 18px 20px;
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.cert-info h4 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.cert-info p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0;
}
