/* ===== S.Y. Solutions — Modern Corporate Theme ===== */
:root {
  --primary: #0066cc;
  --primary-dark: #004999;
  --primary-light: #3389d9;
  --accent: #20aafb;
  --accent-light: #e8f5ff;
  --ink: #0f1a2b;
  --ink-2: #334258;
  --muted: #6b7a90;
  --line: #e5eaf2;
  --bg: #ffffff;
  --bg-soft: #f6f9fd;
  --bg-dark: #0e1a2e;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 20px rgba(15, 26, 43, 0.06);
  --shadow-lg: 0 20px 60px rgba(15, 26, 43, 0.12);
  --font-th: 'IBM Plex Sans Thai', 'Sarabun', sans-serif;
  --font-en: 'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-th), var(--font-en);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
html[lang="en"] body { font-family: var(--font-en), var(--font-th); }

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.3; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.8rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.15rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 14px 24px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand-logo { height: 44px; width: auto; }
.brand-text strong { display: block; font-size: 1.05rem; color: var(--primary); line-height: 1.2; }
.brand-text small { font-size: .78rem; color: var(--muted); }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  color: var(--ink-2); padding: 10px 16px; border-radius: 8px;
  font-weight: 500; font-size: .95rem; transition: all .2s;
}
.site-nav a:hover { color: var(--primary); background: var(--accent-light); }
.site-nav a.active { color: var(--primary); background: var(--accent-light); }
.lang-switch {
  margin-left: 8px; border: 1.5px solid var(--primary) !important;
  color: var(--primary) !important; padding: 6px 14px !important;
  font-size: .85rem !important;
}
.lang-switch:hover { background: var(--primary) !important; color: #fff !important; }
.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  flex-direction: column; gap: 4px; padding: 8px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }

/* ===== Hero ===== */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #0a1930 0%, #0066cc 50%, #20aafb 100%);
  color: #fff; padding: 80px 0 100px;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,.12) 0, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(32,170,251,.35) 0, transparent 45%);
  pointer-events: none;
}
.hero::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 2; max-width: 780px; }
.hero h1 { color: #fff; margin-bottom: .5em; }
.hero p { font-size: 1.1rem; color: rgba(255,255,255,.92); margin-bottom: 2rem; }
.hero .badge {
  display: inline-block; padding: 6px 14px; background: rgba(255,255,255,.15);
  backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.25);
  color: #fff; border-radius: 999px; font-size: .85rem; margin-bottom: 1.5rem;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 28px; font-size: 1rem; font-weight: 600;
  border-radius: 999px; border: 2px solid transparent; cursor: pointer;
  transition: all .2s; text-decoration: none;
}
.btn-primary { background: #fff; color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn-outline:hover { background: #fff; color: var(--primary); }
.btn-filled { background: var(--primary); color: #fff; }
.btn-filled:hover { background: var(--primary-dark); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-group { display: flex; flex-wrap: wrap; gap: 14px; }

/* ===== Page Header (inner pages) ===== */
.page-hero {
  background: linear-gradient(135deg, #0a1930 0%, #0066cc 100%);
  color: #fff; padding: 70px 0 60px; position: relative; overflow: hidden;
}
.page-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 50%, rgba(32,170,251,.3), transparent 50%);
}
.page-hero h1 { color: #fff; position: relative; }
.page-hero p { color: rgba(255,255,255,.9); max-width: 720px; position: relative; font-size: 1.05rem; }

/* ===== Sections ===== */
section { padding: 70px 0; }
.section-title { text-align: center; margin-bottom: 14px; }
.section-sub { text-align: center; color: var(--muted); max-width: 720px; margin: 0 auto 50px; }
.bg-soft { background: var(--bg-soft); }

/* ===== Stats ===== */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  margin-top: -55px; position: relative; z-index: 3;
}
.stat-card {
  background: #fff; border-radius: var(--radius-lg);
  padding: 28px 20px; text-align: center;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
}
.stat-num {
  font-size: 2.5rem; font-weight: 800; color: var(--primary);
  line-height: 1; margin-bottom: 6px;
}
.stat-label { font-size: .88rem; color: var(--muted); }

/* ===== Service Cards ===== */
.services-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px;
}
.service-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px 26px; transition: all .25s;
  display: flex; flex-direction: column;
}
.service-card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}
.service-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--accent-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.service-icon svg { width: 28px; height: 28px; }
.service-card h3 { color: var(--ink); margin-bottom: 10px; }
.service-card p { font-size: .95rem; color: var(--ink-2); margin: 0; }
.service-card.has-image { padding: 0; overflow: hidden; }
.service-card.has-image .service-img { width: 100%; height: 180px; object-fit: cover; }
.service-card.has-image .service-body { padding: 24px 26px; }

/* ===== Product Cards ===== */
.products-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px;
}
.product-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; transition: all .25s;
  display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-img-wrap {
  width: 100%; aspect-ratio: 16/10; overflow: hidden;
  background: linear-gradient(135deg, #e8f5ff, #d4eaff);
  display: flex; align-items: center; justify-content: center;
}
.product-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.product-img-wrap .placeholder { color: var(--primary); opacity: .4; }
.product-img-wrap .placeholder svg { width: 80px; height: 80px; }
.product-body { padding: 22px 26px; flex: 1; display: flex; flex-direction: column; }
.product-body h3 { color: var(--ink); margin-bottom: 8px; }
.product-body p { font-size: .93rem; color: var(--ink-2); margin: 0; }

/* ===== Client Grid ===== */
.clients-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.client-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; min-height: 110px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  transition: all .2s;
}
.client-card:hover { border-color: var(--primary-light); transform: translateY(-2px); box-shadow: var(--shadow); }
.client-card img { max-height: 72px; max-width: 100%; object-fit: contain; filter: grayscale(30%); transition: filter .2s; }
.client-card:hover img { filter: grayscale(0); }
.client-card .client-name {
  font-weight: 600; color: var(--ink-2); font-size: .95rem; line-height: 1.3;
}

/* ===== Why-Us ===== */
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.why-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; text-align: center;
}
.why-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.why-icon svg { width: 32px; height: 32px; }
.why-card h3 { margin-bottom: 8px; }
.why-card p { font-size: .93rem; color: var(--muted); margin: 0; }

/* ===== Contact ===== */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; align-items: start;
}
.contact-info {
  background: var(--bg-soft); border-radius: var(--radius-lg); padding: 32px;
}
.contact-info h3 { margin-bottom: 18px; }
.info-item { display: flex; gap: 14px; margin-bottom: 18px; }
.info-item .info-icon {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 10px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.info-item .info-icon svg { width: 20px; height: 20px; }
.info-item .info-label { font-size: .82rem; color: var(--muted); margin-bottom: 2px; }
.info-item .info-value { color: var(--ink); font-weight: 500; }

.contact-form {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 32px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: .9rem; font-weight: 500;
  color: var(--ink-2); margin-bottom: 6px;
}
.form-group label .req { color: #d33; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 11px 14px; font: inherit; font-size: .95rem;
  border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); transition: border-color .2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,102,204,.12);
}
.form-group textarea { resize: vertical; min-height: 130px; }

.alert {
  padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-size: .95rem;
}
.alert-success { background: #e6f7ed; color: #1f6b3f; border: 1px solid #b8e6c9; }
.alert-error { background: #fdecec; color: #9b2020; border: 1px solid #f2b8b8; }

/* ===== Footer ===== */
.site-footer { background: var(--bg-dark); color: rgba(255,255,255,.8); margin-top: 60px; }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1.5fr; gap: 40px;
  padding: 60px 24px 40px;
}
.footer-col h4 { color: #fff; font-size: 1rem; margin-bottom: 18px; }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.footer-logo { height: 38px; filter: brightness(0) invert(1); opacity: .9; }
.footer-brand strong { color: #fff; font-size: 1.05rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a { color: rgba(255,255,255,.7); font-size: .95rem; }
.footer-col ul a:hover { color: var(--accent); }
.footer-col address { font-style: normal; font-size: .92rem; line-height: 1.8; }
.footer-col address a { color: rgba(255,255,255,.8); }
.footer-col address a:hover { color: var(--accent); }
.footer-col p { font-size: .93rem; color: rgba(255,255,255,.65); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 20px 0; text-align: center; font-size: .88rem;
  color: rgba(255,255,255,.5);
}

/* ===== Product Detail Modal ===== */
.product-card .btn-outline {
  margin-top: auto; align-self: flex-start;
  padding: 8px 16px; font-size: .88rem;
  border: 1.5px solid var(--primary); color: var(--primary);
  background: transparent; border-radius: 999px; font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.product-card .btn-outline:hover { background: var(--primary); color: #fff; }
.product-body { gap: 10px; }

.modal {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal.open { display: flex; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 26, 43, .65);
  backdrop-filter: blur(4px);
  animation: fadeIn .2s ease;
}
.modal-dialog {
  position: relative;
  background: #fff; border-radius: var(--radius-lg);
  width: 100%; max-width: 720px;
  max-height: 90vh; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  animation: slideUp .25s ease;
}
.modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.95); border: 1px solid var(--line);
  font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--line); }
.modal-header {
  padding: 32px 32px 8px; flex-shrink: 0;
}
.modal-eyebrow {
  font-size: .8rem; color: var(--primary); text-transform: uppercase;
  letter-spacing: .08em; font-weight: 600; margin-bottom: 6px;
}
.modal-header h2 { margin: 0; font-size: 1.5rem; color: var(--ink); }
.modal-body {
  padding: 16px 32px 24px; overflow-y: auto; flex: 1;
  color: var(--ink-2); line-height: 1.7;
}
.modal-image {
  background: linear-gradient(135deg, #e8f5ff, #d4eaff);
  border-radius: 12px; overflow: hidden; margin-bottom: 20px;
  aspect-ratio: 16/9;
}
.modal-image img { width: 100%; height: 100%; object-fit: cover; }
.modal-summary {
  font-size: 1.02rem; color: var(--ink);
  padding: 14px 18px; background: var(--bg-soft); border-radius: 10px;
  border-left: 3px solid var(--primary); margin: 0 0 20px;
}
.modal-detail { font-size: .97rem; }
.modal-detail h3, .modal-detail h4 { color: var(--ink); margin: 20px 0 10px; }
.modal-detail p { margin: 0 0 12px; }
.modal-detail ul, .modal-detail ol { padding-left: 20px; margin: 0 0 12px; }
.modal-detail li { margin-bottom: 6px; }
.modal-detail a { color: var(--primary); text-decoration: underline; }
.modal-detail table {
  width: 100%; border-collapse: collapse; margin: 12px 0;
  font-size: .92rem;
}
.modal-detail th, .modal-detail td {
  border: 1px solid var(--line); padding: 8px 12px; text-align: left;
}
.modal-detail th { background: var(--bg-soft); font-weight: 600; color: var(--ink); }
.modal-footer {
  padding: 20px 32px; border-top: 1px solid var(--line);
  background: var(--bg-soft);
  display: flex; gap: 10px; justify-content: flex-end; flex-shrink: 0;
}
.modal-footer .btn { padding: 10px 20px; font-size: .92rem; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
body.modal-open { overflow: hidden; }
@media (max-width: 600px) {
  .modal { padding: 10px; }
  .modal-dialog { max-height: 95vh; }
  .modal-header { padding: 24px 20px 8px; }
  .modal-body { padding: 12px 20px 20px; }
  .modal-footer { padding: 16px 20px; flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; justify-content: center; }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); margin-top: -40px; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
}
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; flex-direction: column; align-items: stretch;
    padding: 10px; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 16px; }
  .hero { padding: 60px 0 80px; }
  .form-row { grid-template-columns: 1fr; }
  .brand-text small { display: none; }
  section { padding: 50px 0; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-num { font-size: 2rem; }
}
