/*
Theme Name: DKQ Technology
Theme URI: https://daikienquoc.vn
Author: DKQ Technology JSC
Author URI: https://daikienquoc.vn
Description: Professional machine supplier website for DKQ Technology JSC — trilingual VI/EN/ZH, product catalog, quotation system.
Version: 2.0.0
License: Proprietary
Text Domain: dkq
*/

:root {
  --navy: #1F4E79;
  --navy-dark: #15395A;
  --navy-light: #2A6BA0;
  --white: #ffffff;
  --black: #1a1a1a;
  --gray-50: #f8f9fa;
  --gray-100: #f0f2f5;
  --gray-200: #e2e6ea;
  --gray-300: #c5cdd5;
  --gray-500: #6c757d;
  --gray-700: #495057;
  --gray-900: #212529;
  --red: #dc3545;
  --gold: #f0ad4e;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-heading: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --max-width: 1200px;
  --header-h: 72px;
  --radius: 6px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-decoration: none; transition: color .2s; }
a:hover { color: var(--navy-light); }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ── WP NAV MENU (ul-based) ── */
.main-nav ul { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.main-nav li { position: relative; }
.main-nav a {
  display: block; padding: 8px 14px; font-size: .93rem; font-weight: 600;
  color: var(--gray-700); border-radius: var(--radius); white-space: nowrap;
}
.main-nav a:hover, .main-nav .current-menu-item > a,
.main-nav .current-menu-parent > a { color: var(--navy); background: var(--gray-50); }
.main-nav li.menu-item-has-children > a::after { content: ' ▾'; font-size: .7rem; }
.main-nav ul.sub-menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 100;
  flex-direction: column; align-items: stretch; gap: 0;
  background: #fff; box-shadow: 0 16px 40px rgba(10,31,54,.16);
  border-radius: 10px; min-width: 240px; padding: 8px 0;
}
.main-nav li.menu-item-has-children:hover > ul.sub-menu { display: flex; }
.main-nav ul.sub-menu a { padding: 9px 20px; font-size: .88rem; font-weight: 500; border-radius: 0; }
.main-nav ul.sub-menu a:hover { background: var(--gray-50); }

.site-header.scrolled { box-shadow: 0 6px 24px rgba(10,31,54,.12); }

/* ── HEADER ── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--white); box-shadow: var(--shadow); height: var(--header-h);
}
.site-header .container { display: flex; align-items: center; height: 100%; }
.site-branding { flex-shrink: 0; }
.site-logo { height: 40px; width: auto; }
.site-logo-text { font-size: 1.4rem; font-weight: 700; color: var(--navy); letter-spacing: -.5px; }

.main-nav { display: flex; align-items: center; margin-left: auto; gap: 2px; }
.main-nav a {
  display: block; padding: 8px 16px; font-size: .95rem; font-weight: 500;
  color: var(--gray-700); border-radius: var(--radius); white-space: nowrap;
}
.main-nav a:hover, .main-nav .current-menu-item a { color: var(--navy); background: var(--gray-50); }
.main-nav .has-dropdown { position: relative; }
.main-nav .sub-menu {
  display: none; position: absolute; top: 100%; left: 0;
  background: var(--white); box-shadow: var(--shadow-lg); border-radius: var(--radius);
  min-width: 220px; padding: 8px 0; z-index: 100;
}
.main-nav .has-dropdown:hover .sub-menu { display: block; }
.main-nav .sub-menu a { padding: 8px 20px; font-size: .88rem; font-weight: 400; border-radius: 0; }

.lang-switch { display: flex; gap: 4px; margin-left: 16px; }
.lang-switch a { padding: 4px 8px; font-size: .8rem; font-weight: 600; border-radius: 4px; background: var(--gray-100); }
.lang-switch .active { background: var(--navy); color: var(--white); }

.mobile-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; padding: 8px; color: var(--gray-700); }

/* ── HERO ── */
.hero {
  margin-top: var(--header-h); background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, var(--navy-light) 100%);
  color: var(--white); padding: 80px 0 60px; text-align: center; position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--red), var(--navy-light));
}
.hero h1 { font-size: 2.8rem; font-weight: 700; margin-bottom: 16px; line-height: 1.2; }
.hero p { font-size: 1.15rem; opacity: .9; max-width: 700px; margin: 0 auto 32px; }
.hero .btn { display: inline-block; padding: 12px 32px; background: var(--white); color: var(--navy); font-weight: 700; border-radius: 50px; font-size: 1rem; transition: all .2s; }
.hero .btn:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,.2); }

/* ── BUTTONS ── */
.btn { display: inline-block; padding: 10px 24px; border-radius: var(--radius); font-weight: 600; font-size: .9rem; cursor: pointer; transition: all .2s; border: none; }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-dark); }
.btn-outline { border: 2px solid var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-lg { padding: 14px 36px; font-size: 1rem; }

/* ── SECTIONS ── */
.section { padding: 60px 0; }
.section-title { font-size: 1.8rem; font-weight: 700; color: var(--navy); margin-bottom: 8px; text-align: center; }
.section-subtitle { text-align: center; color: var(--gray-500); margin-bottom: 40px; font-size: 1rem; }

/* ── PRODUCT GRID ── */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.product-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: all .3s; border: 1px solid var(--gray-200);
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-card-img { height: 200px; background: var(--gray-100); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-card-img img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.product-card-body { padding: 16px; }
.product-card-body h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.product-card-body h3 a { color: var(--gray-900); }
.product-card-body h3 a:hover { color: var(--navy); }
.product-card-cats { font-size: .8rem; color: var(--navy); margin-bottom: 8px; }
.product-card-btn { display: inline-block; padding: 6px 16px; background: var(--navy); color: var(--white); border-radius: 4px; font-size: .8rem; font-weight: 600; }

/* ── CATALOG LAYOUT ── */
.catalog-wrap { display: flex; gap: 32px; padding: 60px 0; }
.catalog-sidebar { width: 260px; flex-shrink: 0; }
.catalog-main { flex: 1; min-width: 0; }

.sidebar-menu { list-style: none; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.sidebar-menu li { border-bottom: 1px solid var(--gray-100); }
.sidebar-menu li:last-child { border-bottom: none; }
.sidebar-menu a { display: block; padding: 12px 16px; font-size: .9rem; color: var(--gray-700); font-weight: 500; }
.sidebar-menu a:hover, .sidebar-menu .active > a { background: var(--navy); color: var(--white); }
.sidebar-menu .sub-menu { display: none; background: var(--gray-50); }
.sidebar-menu .current-cat .sub-menu, .sidebar-menu .active .sub-menu { display: block; }
.sidebar-menu .sub-menu a { padding-left: 32px; font-size: .85rem; font-weight: 400; }

.sidebar-contact { margin-top: 20px; padding: 20px; background: var(--navy); color: var(--white); border-radius: var(--radius); }
.sidebar-contact h4 { margin-bottom: 12px; font-size: 1rem; }
.sidebar-contact p { font-size: .85rem; margin-bottom: 6px; opacity: .9; }

/* ── SINGLE PRODUCT ── */
.single-product { padding: 60px 0; margin-top: var(--header-h); }
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.product-gallery img { width: 100%; border-radius: var(--radius); }
.product-info h1 { font-size: 1.8rem; margin-bottom: 12px; }
.product-meta { color: var(--gray-500); font-size: .9rem; margin-bottom: 20px; }
.product-specs { margin: 24px 0; }
.product-specs table { width: 100%; border-collapse: collapse; }
.product-specs td { padding: 8px 12px; border-bottom: 1px solid var(--gray-200); font-size: .9rem; }
.product-specs td:first-child { font-weight: 600; width: 40%; color: var(--gray-700); background: var(--gray-50); }
.quote-box { margin-top: 24px; padding: 20px; background: var(--gray-50); border-radius: var(--radius); border: 1px solid var(--gray-200); }

/* ── FOOTER ── */
.site-footer { background: var(--navy-dark); color: rgba(255,255,255,.8); padding: 48px 0 24px; font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; margin-bottom: 32px; }
.footer-grid h4 { color: var(--white); margin-bottom: 16px; font-size: 1rem; }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: rgba(255,255,255,.7); }
.footer-grid a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; text-align: center; font-size: .85rem; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .catalog-wrap { flex-direction: column; }
  .catalog-sidebar { width: 100%; }
  .sidebar-menu { display: flex; flex-wrap: wrap; }
  .sidebar-menu li { flex: 1; min-width: 150px; border-bottom: none; border-right: 1px solid var(--gray-100); }
  .product-detail { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --header-h: 60px; }
  .main-nav { display: none; position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0; background: var(--white); flex-direction: column; padding: 20px; overflow-y: auto; }
  .main-nav.open { display: flex; }
  .main-nav .sub-menu { position: static; box-shadow: none; padding-left: 16px; display: none; }
  .main-nav .has-dropdown.open .sub-menu { display: block; }
  .mobile-toggle { display: block; }
  .hero h1 { font-size: 2rem; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .product-detail { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 1.6rem; }
  .product-grid { grid-template-columns: 1fr; }
}

/* ── BREADCRUMB ── */
.breadcrumb {
  font-size: .85rem; color: var(--gray-500); padding: 16px 0; margin-bottom: 8px;
}
.breadcrumb a { color: var(--navy); }
.breadcrumb span { color: var(--gray-700); }

/* ── PAGINATION ── */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius); font-size: .9rem;
  font-weight: 500; color: var(--gray-700); background: var(--gray-50);
}
.pagination .current { background: var(--navy); color: var(--white); }
.pagination a:hover { background: var(--navy-light); color: var(--white); }

/* ── PRODUCT TABLE ── */
.product-info table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.product-info td { padding: 8px 12px; border-bottom: 1px solid var(--gray-200); font-size: .9rem; }
.product-info td:first-child { font-weight: 600; color: var(--navy); width: 35%; background: var(--gray-50); }
.product-info h2, .product-info h3 { color: var(--navy); margin: 20px 0 8px; font-size: 1.2rem; }

/* ── ANIMATIONS ── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.product-card { animation: fadeInUp .4s ease both; }
.product-card:nth-child(2) { animation-delay: .05s; }
.product-card:nth-child(3) { animation-delay: .1s; }
.product-card:nth-child(4) { animation-delay: .15s; }
.product-card:nth-child(5) { animation-delay: .2s; }
.product-card:nth-child(6) { animation-delay: .25s; }

/* ── CONTACT FORM ── */
.wpcf7-form { display: grid; gap: 12px; }
.wpcf7-form label { font-size: .85rem; font-weight: 600; color: var(--gray-700); }
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--gray-300); border-radius: var(--radius);
  font-size: .9rem; font-family: var(--font); transition: border-color .2s;
}
.wpcf7-form input:focus, .wpcf7-form textarea:focus { outline: none; border-color: var(--navy); }
.wpcf7-form .wpcf7-submit {
  padding: 12px 32px; background: var(--navy); color: var(--white); border: none;
  border-radius: var(--radius); font-size: .95rem; font-weight: 600; cursor: pointer;
}
.wpcf7-form .wpcf7-submit:hover { background: var(--navy-dark); }

/* ── ADMIN BAR OFFSET ── */
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }

/* ── MOBILE NAV (WP menu) ── */
@media (max-width: 768px) {
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav ul.sub-menu { display: flex; position: static; box-shadow: none; padding-left: 18px; background: transparent; min-width: 0; }
  .main-nav li.menu-item-has-children > a::after { content: ''; }
}


/* ── Page hero banner (16/08/2026) ── */
.page-hero { background-size: cover; background-position: center; margin-top: var(--header-h); padding: 54px 0; color: #fff; position: relative; }
.page-hero h1 { margin: 0; font-size: 1.9rem; color: #fff; }
.sub-banner { background-size: cover; background-position: center; }

/* ══════════ LAYOUT FIX 22/08/2026 — chuẩn desktop + mobile ══════════ */

/* --- Header: logo giới hạn trên MỌI trang --- */
img.custom-logo { display: block; height: 44px; width: auto; max-width: 100%; object-fit: contain; object-position: left center; }
.site-header .container { max-width: 1480px; }
.site-branding { flex-shrink: 1; min-width: 0; }
.main-nav { min-width: 0; }
.main-nav a { padding: 8px 10px; font-size: .88rem; }
.main-nav ul.sub-menu { min-width: 210px; }
.lang-switch { flex-shrink: 0; margin-left: 10px; gap: 3px; }
.lang-switch a { padding: 3px 7px; font-size: .75rem; }

/* --- An toàn nội dung: không tràn ngang --- */
img { max-width: 100%; height: auto; }
.entry-content, .product-info, .page-content, .site-main, .hero-content {
  overflow-wrap: break-word; word-break: break-word;
}
table { display: block; overflow-x: auto; max-width: 100%; }
pre { white-space: pre-wrap; word-break: break-word; }

/* --- Trang liên hệ: grid xếp cột trên mobile --- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }

/* --- Tablet & mobile: menu hamburger (dưới 1150px) --- */
@media (max-width: 1150px) {
  .main-nav {
    display: none; position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    background: var(--white); flex-direction: column; align-items: stretch;
    padding: 20px; overflow-y: auto; z-index: 999; box-shadow: 0 30px 60px rgba(10,31,54,.2);
  }
  .main-nav.open { display: flex; }
  .main-nav ul { flex-direction: column; width: 100%; gap: 0; }
  .main-nav a {
    padding: 13px 16px; font-size: 1.02rem; border-bottom: 1px solid var(--gray-100);
    border-radius: 0; white-space: normal;
  }
  .main-nav ul.sub-menu {
    position: static; box-shadow: none; min-width: 0; padding-left: 18px; display: none;
  }
  .main-nav li.menu-item-has-children:hover > ul.sub-menu { display: none; }
  .main-nav li.menu-item-has-children.open > ul.sub-menu { display: flex; }
  .mobile-toggle { display: block; margin-left: auto; }
}

/* --- Mobile (≤768px) --- */
@media (max-width: 768px) {
  img.custom-logo { height: 34px; }
  .topbar { display: none; }
  .container { padding: 0 16px; }
  .contact-grid { grid-template-columns: 1fr; gap: 24px; }
  .site-header .container { padding: 0 16px; }
  .single-product { padding: 36px 0; }
  .page-hero { padding: 40px 16px !important; }
  .page-hero h1 { font-size: 1.5rem; }
}

/* --- Mobile nhỏ (≤480px) --- */
@media (max-width: 480px) {
  img.custom-logo { height: 30px; max-width: 54vw; }
  .lang-switch a { padding: 3px 6px; font-size: .7rem; }
  .product-grid { grid-template-columns: 1fr; }
}

/* ── SEARCH BAR ── */
.search-toggle { background: none; border: none; font-size: 1.1rem; cursor: pointer; padding: 8px; color: var(--gray-700); }
.search-bar { position: fixed; top: var(--header-h); left: 0; right: 0; background: var(--white); box-shadow: 0 12px 30px rgba(10,31,54,.14); padding: 12px 0; z-index: 998; display: none; }
.search-bar.open { display: block; }
.search-form { display: flex; gap: 8px; max-width: 760px; margin: 0 auto; }
.search-field { flex: 1; padding: 10px 14px; border: 1px solid var(--gray-200); border-radius: var(--radius); font-size: .95rem; font-family: inherit; }
.search-submit { padding: 10px 22px; background: var(--navy); color: #fff; border: none; border-radius: var(--radius); font-weight: 600; cursor: pointer; font-size: .9rem; }
@media (max-width: 768px) { .search-form { max-width: 100%; padding: 0 16px; } }
