/* ── Variables ───────────────────────────────────────────────────────────── */
:root {
  --blue:        #1a4b8c;
  --blue-dark:   #0f2f5e;
  --blue-light:  #2d6cc0;
  --accent:      #e8f0fe;
  --white:       #ffffff;
  --gray-light:  #f5f7fa;
  --gray:        #e0e4ed;
  --text:        #1a1a2e;
  --text-muted:  #555e7a;
  --radius:      8px;
  --shadow:      0 2px 12px rgba(26,75,140,0.10);
  --transition:  0.2s ease;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Segoe UI', system-ui, sans-serif; color: var(--text); background: var(--white); line-height: 1.6; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-light); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ── Container ───────────────────────────────────────────────────────────── */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 5rem 0; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn-primary { background: var(--blue); color: var(--white); border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: var(--white); }
.btn-outline { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn-outline:hover { background: var(--blue); color: var(--white); }
.btn-outline-white { background: var(--white); color: var(--blue); border-color: var(--white); }
.btn-outline-white:hover { background: transparent; color: var(--white); border-color: var(--white); }
.btn-link { color: var(--blue); font-weight: 600; font-size: 0.9rem; display: inline-block; margin-top: 0.5rem; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.logo { font-size: 1.4rem; font-weight: 700; white-space: nowrap; }
.logo-kbs    { color: var(--blue); }
.logo-gypsum { color: var(--text); }

.main-nav { flex: 1; }
.main-nav ul { display: flex; gap: 0.25rem; }
.main-nav a {
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius);
  font-weight: 500;
  color: var(--text);
  transition: background var(--transition), color var(--transition);
}
.main-nav a:hover { background: var(--accent); color: var(--blue); }

.header-phone {
  font-weight: 700;
  color: var(--blue);
  white-space: nowrap;
  font-size: 0.95rem;
}
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--blue); }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 60%, var(--blue-light) 100%);
  color: var(--white);
  padding: 5rem 0 4rem;
}
.hero-content h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.2; margin-bottom: 1rem; }
.hero-content p  { font-size: 1.15rem; opacity: 0.9; max-width: 560px; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ── Page hero (inner pages) ─────────────────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  color: var(--white);
  padding: 3.5rem 0 3rem;
}
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: 0.5rem; }
.page-hero p  { opacity: 0.85; font-size: 1.05rem; }

/* ── Section title ───────────────────────────────────────────────────────── */
.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2.5rem;
  color: var(--text);
}
.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--blue);
  margin: 0.6rem auto 0;
  border-radius: 2px;
}

/* ── Product grid ────────────────────────────────────────────────────────── */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }
.product-card {
  background: var(--white);
  border: 1px solid var(--gray);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
  color: var(--text);
}
.product-card:hover { box-shadow: 0 8px 24px rgba(26,75,140,0.15); transform: translateY(-3px); }
.product-card-img { height: 180px; background: var(--gray-light); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.product-card-body { padding: 1.25rem; display: flex; flex-direction: column; flex: 1; }
.product-card-body h3 { font-size: 1.05rem; margin: 0.35rem 0; }
.product-card-body p  { font-size: 0.875rem; color: var(--text-muted); flex: 1; }
.product-sku { font-size: 0.78rem; font-weight: 600; color: var(--blue); text-transform: uppercase; letter-spacing: 0.04em; }

/* ── Badge ───────────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.78rem; font-weight: 600; margin: 0.4rem 0; }
.badge-green { background: #d4edda; color: #155724; }
.badge-red   { background: #f8d7da; color: #721c24; }

/* ── Category filter ─────────────────────────────────────────────────────── */
.category-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.filter-btn {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  border: 2px solid var(--blue);
  color: var(--blue);
  font-weight: 500;
  font-size: 0.9rem;
  transition: background var(--transition), color var(--transition);
}
.filter-btn:hover, .filter-btn.active { background: var(--blue); color: var(--white); }

/* ── Product detail ──────────────────────────────────────────────────────── */
.product-detail { padding-top: 1rem; }
.back-link { display: inline-block; margin-bottom: 1.5rem; color: var(--text-muted); font-size: 0.9rem; }
.back-link:hover { color: var(--blue); }
.product-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.product-detail-image { border-radius: var(--radius); overflow: hidden; background: var(--gray-light); min-height: 320px; display: flex; align-items: center; justify-content: center; }
.product-detail-image img { width: 100%; object-fit: cover; }
.product-detail-info h1 { font-size: 1.8rem; margin: 0.5rem 0; }
.product-description { color: var(--text-muted); margin: 1rem 0; }
.spec-table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; }
.spec-table th, .spec-table td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid var(--gray); font-size: 0.9rem; }
.spec-table th { background: var(--accent); color: var(--blue); font-weight: 600; width: 40%; }
.product-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }

/* ── Why us / Features ───────────────────────────────────────────────────── */
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; }
.feature-card { background: var(--white); border: 1px solid var(--gray); border-radius: var(--radius); padding: 2rem 1.5rem; text-align: center; transition: box-shadow var(--transition); }
.feature-card:hover { box-shadow: var(--shadow); }
.feature-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--blue); }
.feature-card p { font-size: 0.9rem; color: var(--text-muted); }

/* ── CTA banner ──────────────────────────────────────────────────────────── */
.cta-banner { background: linear-gradient(135deg, var(--blue-dark), var(--blue)); }
.cta-inner { text-align: center; color: var(--white); }
.cta-inner h2 { font-size: 2rem; margin-bottom: 0.75rem; }
.cta-inner p  { opacity: 0.9; margin-bottom: 1.5rem; font-size: 1.05rem; }

/* ── Services ────────────────────────────────────────────────────────────── */
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem; }
.service-card { background: var(--white); border: 1px solid var(--gray); border-radius: var(--radius); padding: 2rem; text-align: center; box-shadow: var(--shadow); }
.service-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.service-card h3 { color: var(--blue); margin-bottom: 0.5rem; }
.service-card p  { color: var(--text-muted); font-size: 0.9rem; }

/* ── About ───────────────────────────────────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.about-text h2 { color: var(--blue); margin-bottom: 0.75rem; }
.about-text p  { color: var(--text-muted); margin-bottom: 1rem; }
.about-list li { padding: 0.4rem 0; font-size: 0.95rem; }
.about-stats { display: flex; flex-direction: column; gap: 1rem; }
.stat-card { background: var(--accent); border-radius: var(--radius); padding: 1.75rem; text-align: center; border-left: 4px solid var(--blue); }
.stat-number { font-size: 2.5rem; font-weight: 700; color: var(--blue); }
.stat-label  { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.25rem; }

/* ── Gallery placeholder ─────────────────────────────────────────────────── */
.gallery-placeholder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.gallery-placeholder {
  background: var(--gray-light);
  border-radius: var(--radius);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  border: 2px dashed var(--gray);
}

/* ── Contact ─────────────────────────────────────────────────────────────── */
.contact-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 3rem; align-items: start; }
.contact-info h2 { color: var(--blue); margin-bottom: 1rem; }
.contact-info p  { margin-bottom: 0.75rem; color: var(--text-muted); }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group label { font-weight: 600; font-size: 0.9rem; }
.form-group input,
.form-group textarea,
.form-group select {
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--gray);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  transition: border-color var(--transition);
  background: var(--white);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { outline: none; border-color: var(--blue); }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert { padding: 1rem 1.25rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-weight: 500; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ── Field validation ────────────────────────────────────────────────────── */
.field-error { color: #c0392b; font-size: 0.82rem; margin-top: 0.2rem; }
.input-invalid { border-color: #e74c3c !important; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer { background: var(--blue-dark); color: #cbd5e8; padding: 3.5rem 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2.5rem; padding-bottom: 2.5rem; }
.footer-brand p { font-size: 0.9rem; margin-top: 0.75rem; opacity: 0.8; }
.footer-logo { font-size: 1.3rem; font-weight: 700; }
.footer-links h4, .footer-contact h4 { color: var(--white); margin-bottom: 1rem; font-size: 1rem; }
.footer-links ul li { margin-bottom: 0.5rem; }
.footer-links a, .footer-contact a { color: #a0b4d6; font-size: 0.9rem; }
.footer-links a:hover, .footer-contact a:hover { color: var(--white); }
.footer-contact p { font-size: 0.9rem; margin-bottom: 0.5rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 1.25rem 0; text-align: center; font-size: 0.85rem; opacity: 0.6; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .product-detail-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .main-nav { display: none; }
  .main-nav.open { display: block; position: absolute; top: 100%; left: 0; right: 0; background: var(--white); border-top: 1px solid var(--gray); padding: 1rem; box-shadow: var(--shadow); }
  .main-nav.open ul { flex-direction: column; gap: 0.25rem; }
  .nav-toggle { display: block; }
  .header-inner { flex-wrap: wrap; position: relative; }
  .footer-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
}
