/* ============================================
   KDS Instrument - Modern Stylesheet v2.0
   www.kdsinstrument.com
   ============================================ */

/* --- CSS Variables --- */
:root {
  --primary: #1a2a3a;
  --primary-light: #243447;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #dbeafe;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --bg: #f8fafc;
  --bg-white: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.2s ease;
  --max-width: 1200px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* --- Top Bar --- */
.topbar {
  background: var(--primary);
  color: #fff;
  font-size: 0.8125rem;
  padding: 8px 0;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.topbar a { color: #cbd5e1; }
.topbar a:hover { color: #fff; }
.topbar-contact { display: flex; gap: 20px; flex-wrap: wrap; }
.topbar-lang a { margin-left: 12px; padding: 2px 8px; border-radius: 4px; border: 1px solid transparent; }
.topbar-lang a.active { border-color: #fff; color: #fff; }

/* --- Header --- */
.header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  padding-bottom: 12px;
}
.logo img { height: 48px; width: auto; }

/* --- Navigation --- */
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  display: block;
  padding: 8px 14px;
  color: var(--text);
  font-weight: 500;
  font-size: 0.9375rem;
  border-radius: var(--radius);
  position: relative;
  white-space: nowrap;
}
.nav > li { position: relative; list-style: none; }
.nav > li > a:hover { background: var(--bg); color: var(--accent); }
.nav > li > a.active { background: var(--accent); color: #fff; }

/* Dropdown */
.nav .dropdown { display: none; }
.nav > li:hover > .dropdown {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  padding: 8px 0;
  z-index: 200;
}
.nav .dropdown li { list-style: none; }
.nav .dropdown a {
  padding: 8px 18px;
  font-size: 0.875rem;
  font-weight: 400;
  border-radius: 0;
}
.nav .dropdown a:hover { background: var(--accent-light); }

/* Mobile language switcher */
.mobile-lang {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}
.mobile-lang:hover { background: var(--accent); color: #fff; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: var(--transition);
}

/* --- Header Search --- */
.header-search {
  flex: 1;
  max-width: 360px;
  margin: 0 16px;
}
.search-wrapper {
  position: relative;
  width: 100%;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
  z-index: 1;
}
.search-input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: all var(--transition);
}
.search-input:focus {
  border-color: var(--accent);
  background: var(--bg-white);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.search-input::placeholder {
  color: var(--text-light);
}

/* Search Dropdown */
.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 420px;
  overflow-y: auto;
  z-index: 300;
}
.search-dropdown.active {
  display: block;
}
.search-dropdown-empty {
  padding: 16px 18px;
  color: var(--text-light);
  font-size: 0.875rem;
  text-align: center;
}
.search-dropdown-group {
  padding: 8px 0 0;
}
.search-dropdown-group:first-child {
  padding-top: 4px;
}
.search-dropdown-group-label {
  padding: 6px 18px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
}
.search-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
  color: var(--text);
}
.search-dropdown-item:hover,
.search-dropdown-item.active {
  background: var(--accent-light);
}
.search-dropdown-item-img {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: contain;
  background: var(--bg);
  flex-shrink: 0;
}
.search-dropdown-item-info {
  min-width: 0;
}
.search-dropdown-item-name {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-dropdown-item-cat {
  font-size: 0.75rem;
  color: var(--text-light);
}
.search-dropdown-more {
  display: block;
  text-align: center;
  padding: 8px;
  font-size: 0.8125rem;
  color: var(--accent);
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.search-dropdown-more:hover {
  background: var(--accent-light);
}
.search-highlight {
  color: var(--accent);
  font-weight: 700;
}

/* Mobile: move search below nav */
@media (max-width: 768px) {
  .header-search {
    order: 3;
    max-width: 100%;
    margin: 8px 0 0;
    width: 100%;
  }
  .header .container {
    flex-wrap: wrap;
  }
  .search-dropdown {
    position: fixed;
    top: auto;
    left: 12px;
    right: 12px;
    max-height: 50vh;
  }
}

/* --- Hero Section --- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 80px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><rect fill="none"/><circle cx="1000" cy="100" r="200" fill="rgba(255,255,255,0.03)"/><circle cx="200" cy="400" r="300" fill="rgba(255,255,255,0.03)"/></svg>');
  pointer-events: none;
}
.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
  position: relative;
}
.hero p {
  font-size: 1.125rem;
  color: #cbd5e1;
  max-width: 640px;
  margin: 0 auto 32px;
  position: relative;
}
.hero-cta {
  display: inline-flex;
  gap: 12px;
  position: relative;
  flex-wrap: wrap;
  justify-content: center;
}
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
  text-align: center;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,0.3); }
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: #fff; color: #fff; }

/* --- Section --- */
.section { padding: 64px 0; }
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary);
}
.section-subtitle { color: var(--text-secondary); margin-bottom: 32px; }

/* --- Product Grid (Homepage) --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.product-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}
.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.product-card-img {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
}
.product-card-img img { max-height: 180px; object-fit: contain; }
.product-card-body { padding: 16px 20px 20px; }
.product-card-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.product-card-body p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Category Grid (Product Listing) --- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.category-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
}
.category-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.category-card-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.25rem;
  flex-shrink: 0;
}
.category-card h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

/* --- Product Detail --- */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.product-gallery { position: sticky; top: 100px; }
.product-gallery-main {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  margin-bottom: 12px;
}
.product-gallery-main img { max-height: 320px; object-fit: contain; }
.product-gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.product-gallery-thumbs img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition);
  flex-shrink: 0;
}
.product-gallery-thumbs img:hover, .product-gallery-thumbs img.active { border-color: var(--accent); }

.product-info h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 8px; }
.product-info .breadcrumb {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-bottom: 16px;
}
.product-info .breadcrumb a { color: var(--text-secondary); }

.product-description {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

.product-features { margin-bottom: 24px; }
.product-features h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
.product-features ul { list-style: none; }
.product-features li {
  padding: 6px 0;
  padding-left: 24px;
  position: relative;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}
.product-features li::before {
  content: '•';
  position: absolute;
  left: 8px;
  color: var(--accent);
  font-weight: bold;
}

/* --- Specs Table --- */
.specs-section { margin-top: 32px; }
.specs-section h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.specs-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.specs-table thead { background: var(--primary); color: #fff; }
.specs-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.specs-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.specs-table tbody tr:hover { background: var(--accent-light); }
.specs-table tbody tr:last-child td { border-bottom: none; }

/* --- Inquiry Button --- */
.inquiry-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  margin-top: 16px;
}
.inquiry-btn:hover { background: var(--accent-hover); color: #fff; }

/* --- Related Products --- */
.related-section { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* --- About Section (Homepage) --- */
.about-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.about-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.about-image img { width: 100%; height: 340px; object-fit: cover; }
.about-content h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: 16px; }
.about-content p { color: var(--text-secondary); line-height: 1.7; margin-bottom: 16px; }

/* --- Page Header (Internal Pages) --- */
.page-header {
  background: var(--primary);
  color: #fff;
  padding: 40px 0;
  text-align: center;
}
.page-header h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 8px; }
.page-header .breadcrumb { font-size: 0.875rem; color: #cbd5e1; }
.page-header .breadcrumb a { color: #94a3b8; }

/* --- Content Page --- */
.content-page { max-width: 800px; margin: 40px auto; }
.content-page h2 { font-size: 1.25rem; font-weight: 600; margin: 24px 0 12px; }
.content-page p { color: var(--text-secondary); line-height: 1.7; margin-bottom: 16px; }

/* --- Contact Page --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.contact-info h2, .contact-form h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.contact-info-item {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-start;
}
.contact-info-item .icon {
  width: 40px;
  height: 40px;
  background: var(--accent-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.125rem;
  flex-shrink: 0;
}
.contact-info-item div { color: var(--text-secondary); font-size: 0.9375rem; }
.contact-info-item div strong { display: block; color: var(--text); margin-bottom: 2px; }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 4px;
  color: var(--text);
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: var(--font);
  transition: border-color var(--transition);
  background: var(--bg-white);
}
.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-group textarea { min-height: 120px; resize: vertical; }

/* --- News List --- */
.news-list { max-width: 800px; margin: 0 auto; }
.news-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.news-item:first-child { padding-top: 0; }
.news-date {
  display: block;
  text-align: right;
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 4px;
}
.news-item h3 { font-size: 0.95rem; font-weight: 500; }
.news-item h3 a { color: var(--text); }
.news-item h3 a:hover { color: var(--accent); }

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  margin-top: 32px;
}
.pagination a {
  color: var(--accent);
  font-weight: 500;
  font-size: 0.9375rem;
}

/* --- Footer --- */
.footer {
  background: var(--primary);
  color: #cbd5e1;
  padding: 48px 0 24px;
  margin-top: 64px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer h3 {
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.footer p, .footer a { font-size: 0.875rem; color: #94a3b8; }
.footer a:hover { color: #fff; }
.footer ul { list-style: none; }
.footer li { margin-bottom: 8px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 32px;
  padding-top: 16px;
  text-align: center;
  font-size: 0.8125rem;
  color: #64748b;
}

/* --- WhatsApp Float --- */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  width: 56px;
  height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition);
}
.whatsapp-float:hover { transform: scale(1.1); }
.whatsapp-float svg { width: 28px; height: 28px; fill: #fff; }

/* --- Utility --- */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.bg-light { background: var(--bg); }
.rounded { border-radius: var(--radius-lg); }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .product-detail { grid-template-columns: 1fr; gap: 24px; }
  .product-gallery { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .about-section { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
}

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 20px;
    box-shadow: var(--shadow-lg);
  }
  .nav.open { display: flex; }
  .nav > li > a { padding: 10px 0; border-radius: 0; }
  .nav > li:hover > .dropdown {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 16px;
  }
  .nav .dropdown { display: block; }

  .hero { padding: 48px 0; }
  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: 1rem; }

  .product-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .product-card-img { height: 160px; }

  .section { padding: 40px 0; }
  .section-title { font-size: 1.375rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .topbar { display: none; }
  .mobile-lang { display: flex; }
}

@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; align-items: center; }
  .btn { width: 100%; }
}

/* --- Mobile Nav Overlay --- */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 99;
}
.mobile-nav-overlay.open { display: block; }
