/* ── KV Electronics Static Site — Shared Styles ── */

:root {
  --primary:       #0042aa;
  --primary-dark:  #003090;
  --primary-light: #e8f0fe;
  --accent:        #0042aa;
  --text-dark:     #1e293b;
  --text-muted:    #64748b;
  --border:        #e2e8f0;
  --footer-bg:     #1e293b;
}

/* ── Base ── */
body { font-family: 'Sarabun', sans-serif; color: var(--text-dark); }
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

/* ── Navbar ── */
.kv-navbar { background: #fff; padding: 8px 0; }
.kv-navbar.shadow-sm { box-shadow: 0 1px 4px rgba(0,0,0,.08) !important; }
.navbar-brand img { height: 50px; width: auto; }
.nav-link { font-size: 16px; font-weight: 500; color: var(--text-dark) !important; transition: color .2s; }
.nav-link:hover, .nav-link:focus { color: var(--primary) !important; }
.nav-link.active { color: var(--primary) !important; font-weight: 600; }
.navbar-kv-cta {
  background: var(--primary);
  color: #fff !important;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 18px;
  text-decoration: none;
  transition: opacity .2s;
  white-space: nowrap;
}
.navbar-kv-cta:hover { opacity: .85; color: #fff !important; }

/* Dropdown */
.dropdown-menu { border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.12); border: 1px solid rgba(0,0,0,.07); padding: 6px 0; min-width: 200px; overflow: visible; }
.dropdown-item { font-size: 15px; padding: 9px 16px; color: var(--text-dark); }
.dropdown-item:hover, .dropdown-item:focus, .dropdown-item.active { background: var(--primary-light) !important; color: var(--primary) !important; }
.dropdown-view-all { display: block; font-size: 13px; padding: 8px 16px; color: var(--primary); font-weight: 500; text-decoration: none; }
.dropdown-view-all:hover { background: var(--primary-light); }

/* Submenu */
.dropdown-submenu { position: relative; }
.dropdown-submenu > .dropdown-menu { display: none; position: absolute; top: -4px; left: 100%; min-width: 220px; border-radius: 8px; }
.dropdown-submenu > a::after { content: ''; display: inline-block; width: 0; height: 0; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 5px solid #6c757d; float: right; margin-top: 5px; }
@media (min-width: 992px) {
  .dropdown-submenu:hover > .dropdown-menu { display: block; }
}

/* Sticky hide-on-scroll */
.kv-navbar { position: sticky; top: 0; z-index: 1030; transition: transform .25s; }
.kv-navbar.nav-hidden { transform: translateY(-100%); }

/* ── Hero ── */
.hero-section {
  background: var(--primary);
  color: #fff;
  padding: 100px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 1;
}
.hero-section .container { position: relative; z-index: 2; }
.hero-section h1 { font-size: clamp(32px,5vw,52px); font-weight: 700; }
.hero-section p { font-size: clamp(16px,2vw,20px); opacity: .9; }

/* ── Page Banner (inner pages) ── */
.page-banner {
  background: var(--primary);
  color: #fff;
  padding: 60px 0;
  position: relative;
  overflow: hidden;
}
.page-banner .bg-layer {
  position: absolute; inset: -30px;
  background-size: cover; background-position: center;
  filter: blur(8px); transform: scale(1.15); z-index: 0; opacity: .9;
}
.page-banner .overlay { position: absolute; inset: 0; z-index: 1; }
.page-banner .content { position: relative; z-index: 2; }
.page-banner h1 { font-size: clamp(28px,5vw,42px); font-weight: 700; }
.breadcrumb-kv { display: inline-flex; align-items: center; gap: 8px; color: rgba(255,255,255,.85); font-size: 15px; flex-wrap: wrap; }
.breadcrumb-kv a { color: #fff; text-decoration: underline; }

/* ── Stats bar ── */
.stats-bar { background: var(--primary); color: #fff; padding: 28px 0; }
.stat-item { text-align: center; padding: 10px 20px; }
.stat-item .stat-num { font-size: 2.2rem; font-weight: 700; line-height: 1; }
.stat-item .stat-label { font-size: 14px; opacity: .85; margin-top: 4px; }

/* ── Section ── */
.section { padding: 72px 0; }
.section-sm { padding: 48px 0; }
.section-title { font-size: 2rem; font-weight: 700; color: var(--text-dark); margin-bottom: 12px; }
.section-subtitle { color: var(--text-muted); font-size: 17px; max-width: 680px; margin: 0 auto 40px; }
.section-light { background: #f8fafc; }

/* ── Product / Category cards ── */
.product-card {
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  transition: transform .2s, box-shadow .2s;
  background: #fff; display: flex; flex-direction: column; height: 100%;
  border: 1px solid var(--border);
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,.14) !important; }
.product-card img { width: 100%; height: 220px; object-fit: cover; }
.product-card .card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.product-card .card-title { font-size: 17px; font-weight: 600; margin-bottom: 8px; color: var(--text-dark); }
.product-card .card-text { font-size: 14px; color: var(--text-muted); flex: 1; }
.product-card .card-link { display: inline-block; margin-top: 14px; font-weight: 600; font-size: 14px; color: var(--primary); text-decoration: none; }
.product-card .card-link:hover { text-decoration: underline; }

.category-card {
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 2px 16px rgba(0,0,0,.08);
  transition: transform .2s, box-shadow .2s;
  background: #fff; display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--border);
}
.category-card:hover { transform: translateY(-5px); box-shadow: 0 14px 44px rgba(0,0,0,.14); color: inherit; }
.category-card img { width: 100%; height: 200px; object-fit: cover; }
.category-card .cat-body { padding: 20px 22px; }
.category-card .cat-name { font-size: 19px; font-weight: 700; color: var(--text-dark); margin-bottom: 6px; }
.category-card .cat-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 14px; }
.category-card .cat-count { font-size: 13px; color: var(--primary); font-weight: 600; }

/* ── Product detail ── */
.product-gallery-main {
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,.08);
  height: 420px; cursor: zoom-in;
}
.product-gallery-main img { width: 100%; height: 100%; object-fit: contain; transition: opacity .35s; }
.gallery-thumbs { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.gallery-thumb {
  width: 80px; height: 60px; object-fit: cover; border-radius: 8px;
  border: 2px solid var(--border); cursor: pointer; transition: border-color .2s;
}
.gallery-thumb.active { border-color: var(--primary); }

.spec-table { width: 100%; border-collapse: collapse; }
.spec-table tr { border-bottom: 1px solid var(--border); }
.spec-table tr:last-child { border-bottom: none; }
.spec-table td { padding: 11px 0; vertical-align: top; }
.spec-table .spec-label { color: var(--text-muted); width: 45%; font-size: 14px; }
.spec-table .spec-val { color: var(--text-dark); font-weight: 500; font-size: 14px; white-space: pre-line; }

/* ── Buttons ── */
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-primary { border-color: var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-kv { display: inline-flex; align-items: center; gap: 8px; padding: 12px 28px; border-radius: 8px; font-weight: 600; font-size: 15px; text-decoration: none; transition: opacity .2s; }
.btn-kv-primary { background: var(--primary); color: #fff; }
.btn-kv-primary:hover { opacity: .88; color: #fff; }
.btn-kv-outline { border: 2px solid var(--primary); color: var(--primary); }
.btn-kv-outline:hover { background: var(--primary); color: #fff; }

/* ── About / content sections ── */
.cert-card { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 20px; text-align: center; }
.cert-card .cert-icon { font-size: 28px; margin-bottom: 8px; }
.cert-card .cert-title { font-weight: 700; font-size: 15px; color: var(--text-dark); }
.cert-card .cert-desc { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── CTA section ── */
.cta-section { background: var(--primary); color: #fff; padding: 72px 0; text-align: center; }
.cta-section h2 { font-size: 2rem; font-weight: 700; margin-bottom: 16px; }
.cta-section p { font-size: 17px; opacity: .9; max-width: 600px; margin: 0 auto 32px; }

/* ── Contact ── */
.contact-card { background: #f8fafc; border-radius: 12px; padding: 40px; }
.contact-info-item { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 28px; }
.contact-icon { width: 50px; height: 50px; min-width: 50px; border-radius: 50%; background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.contact-info-item h4 { margin: 0 0 6px; font-size: 17px; color: var(--text-dark); }
.contact-info-item p { margin: 0; color: var(--text-muted); line-height: 1.7; }
.contact-info-item a { color: var(--text-muted); text-decoration: none; }
.contact-info-item a:hover { color: var(--primary); }

/* Form */
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: #374151; }
.form-control, .form-select { padding: 12px 16px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 15px; font-family: inherit; width: 100%; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,66,170,.1); outline: none; }
.form-control.error { border-color: #dc2626; }
.form-error { color: #dc2626; font-size: 12px; display: none; margin-top: 4px; }
textarea.form-control { min-height: 130px; resize: vertical; }

/* Social buttons */
.social-btn { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-decoration: none; transition: transform .2s; }
.social-btn:hover { transform: scale(1.12); }

/* ── Footer ── */
.kv-footer { background: var(--footer-bg); color: #cbd5e1; padding: 56px 0 24px; }
.kv-footer h5 { color: #fff; font-size: 15px; font-weight: 600; margin-bottom: 16px; }
.kv-footer a { color: #94a3b8; text-decoration: none; }
.kv-footer a:hover { color: var(--primary); }
.kv-footer .footer-divider { border-color: #334155; }
.kv-footer .footer-bottom { color: #94a3b8; font-size: 13px; text-align: center; padding-top: 20px; }
.footer-contact-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px;
  background: #0f172a; border: 1px solid #334155;
  color: #fff; text-decoration: none; font-size: 13px; transition: background .2s;
}
.footer-contact-chip:hover { background: #1e293b; color: #fff; }

/* ── Related products ── */
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.related-card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.related-card img { width: 100%; height: 160px; object-fit: cover; }
.related-card .rc-body { padding: 16px; }
.related-card h3 { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
.related-card p { font-size: 13px; color: var(--text-muted); margin: 0 0 12px; }
.related-card a { font-size: 13px; font-weight: 600; color: var(--primary); text-decoration: none; }
.related-card a:hover { text-decoration: underline; }

/* ── ISO badges ── */
.iso-badge { filter: grayscale(1); opacity: .7; transition: filter .3s, opacity .3s; cursor: default; }
.iso-badge:hover { filter: grayscale(0); opacity: 1; }

/* ── Utilities ── */
.text-primary-kv { color: var(--primary); }
.bg-primary-kv { background: var(--primary); }
.rounded-12 { border-radius: 12px; }
