/* ============================================================
   ===== PROJECT (PRODUCT) PAGES — dropdown nav + landing =====
   ============================================================
   Linked from product pages and from index.html (for the
   "โปรเจคต์" dropdown in the main navbar).
   ============================================================ */

/* ===== Dropdown menu (desktop) ===== */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  display: inline-flex; align-items: center; gap: 0.32rem;
  font-family: var(--font-display); font-weight: 500;
  font-size: 0.92rem; color: var(--ink-2);
  padding: 0.25rem 0; cursor: pointer;
  position: relative;
}
.nav-dropdown-toggle svg { transition: transform .25s; }
.nav-dropdown:hover .nav-dropdown-toggle,
.nav-dropdown-toggle.active { color: var(--green); }
.nav-dropdown:hover .nav-dropdown-toggle svg { transform: rotate(180deg); }
.nav-dropdown-toggle.active::after {
  content: ''; position: absolute; left: 0; right: 16px; bottom: -4px;
  height: 2px; background: var(--green); border-radius: 2px;
}
.nav-dropdown-menu {
  position: absolute; top: calc(100% + 12px); left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 340px; padding: 0.6rem; z-index: 100;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.nav-dropdown-menu::before {
  content: ''; position: absolute; top: -7px; left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px; height: 12px; background: #fff;
  border-left: 1px solid var(--border); border-top: 1px solid var(--border);
}
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.dd-item {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.7rem 0.85rem; border-radius: 10px;
  color: var(--ink); transition: background .15s;
}
.dd-item:hover { background: var(--green-50); }
.dd-item.active { background: var(--green-50); }
.dd-emoji { font-size: 1.4rem; flex-shrink: 0; line-height: 1; width: 32px; text-align: center; }
.dd-text { display: flex; flex-direction: column; }
.dd-text strong {
  font-family: var(--font-display); font-weight: 600; font-size: 0.92rem;
  color: var(--ink); line-height: 1.3;
}
.dd-text small { font-size: 0.78rem; color: var(--ink-2); line-height: 1.35; }
.dd-item.dd-all {
  margin-top: 0.35rem; padding-top: 0.85rem;
  border-top: 1px dashed var(--border);
  font-family: var(--font-display); font-weight: 600;
  color: var(--green); font-size: 0.88rem;
  justify-content: space-between;
}
.dd-item.dd-all:hover { color: var(--green-dark); background: var(--green-50); }

/* ===== Mobile dropdown (accordion) ===== */
.mob-group {
  display: flex; flex-direction: column;
  border-bottom: 1px solid var(--border);
}
.mob-group-toggle {
  display: flex; justify-content: space-between; align-items: center;
  background: none; border: none; width: 100%;
  padding: 0.85rem 0; color: var(--ink-2);
  font-family: var(--font-display); font-weight: 500; font-size: 0.95rem;
  cursor: pointer;
}
.mob-group-toggle svg { transition: transform .25s; }
.mob-group.open .mob-group-toggle { color: var(--green); }
.mob-group.open .mob-group-toggle svg { transform: rotate(180deg); }
.mob-group-items {
  display: none; flex-direction: column;
  padding: 0 0 0.6rem 0.85rem;
  border-left: 2px solid var(--green-100); margin-left: 0.25rem;
}
.mob-group.open .mob-group-items { display: flex; }
.mob-sub {
  display: block; padding: 0.55rem 0.6rem; font-size: 0.92rem;
  color: var(--ink-2); border-radius: 6px;
}
.mob-sub.active { color: var(--green); background: var(--green-50); }
.mob-sub-all { color: var(--green); font-weight: 600; }

/* ===== Breadcrumb ===== */
.breadcrumb {
  padding: calc(78px + var(--topbar-h, 40px) + 1rem) 0 0.5rem;
  background: var(--bg-soft);
}
.breadcrumb ol {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
  font-size: 0.85rem; color: var(--ink-2);
}
.breadcrumb a { color: var(--ink-2); transition: color .15s; }
.breadcrumb a:hover { color: var(--green); }
.breadcrumb [aria-current="page"] { color: var(--ink); font-weight: 500; }
.breadcrumb .bc-sep { color: #c8d4cd; }

/* ===== Product hero ===== */
.product-hero {
  padding: 1.5rem 0 4rem;
  background:
    radial-gradient(900px 400px at 90% 0%, var(--green-50), transparent 60%),
    linear-gradient(180deg, var(--bg-soft), var(--bg) 80%);
}
.ph-grid { display: grid; gap: 2.5rem; align-items: center; }
@media(min-width: 980px) {
  .ph-grid { grid-template-columns: 1.05fr 0.95fr; gap: 3.5rem; }
}
.ph-text .badge { margin-bottom: 1.1rem; }
.ph-text h1 {
  font-size: 2rem; font-weight: 700;
  margin-bottom: 1.15rem; line-height: 1.18;
}
@media(min-width: 640px) { .ph-text h1 { font-size: 2.7rem; } }
@media(min-width: 1024px) { .ph-text h1 { font-size: 3.2rem; } }
.ph-desc {
  color: var(--ink-2); font-size: 1.04rem;
  margin-bottom: 1.75rem; max-width: 560px;
}
.ph-btns { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 2.2rem; }
.ph-stats {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem 1.5rem;
  padding-top: 1.5rem; border-top: 1px solid var(--border);
}
@media(min-width: 640px) { .ph-stats { grid-template-columns: repeat(4, 1fr); } }
.ph-stat { display: flex; flex-direction: column; }
.phs-n {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.65rem; color: var(--ink); line-height: 1;
}
.phs-n small { font-size: 1rem; color: var(--ink-2); font-weight: 600; margin-left: 1px; }
.phs-l { color: var(--ink-2); font-size: 0.8rem; margin-top: 0.35rem; }

.ph-visual { position: relative; }
.ph-photo {
  position: relative; border-radius: 22px; overflow: hidden;
  box-shadow: var(--shadow-lg); aspect-ratio: 16 / 10;
  background: var(--bg-soft);
}
.ph-photo img { width: 100%; height: 100%; object-fit: cover; }
.ph-photo::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(13,58,38,.45));
}
.ph-live-badge {
  position: absolute; top: 1rem; right: 1rem; z-index: 2;
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(255,255,255,.95); backdrop-filter: blur(6px);
  padding: 0.35rem 0.75rem; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.72rem;
  color: var(--green-dark); letter-spacing: 0.1em;
}
.ph-live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 0 rgba(31,157,85,.5);
  animation: phLivePulse 1.8s ease-in-out infinite;
}
@keyframes phLivePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(31,157,85,.55); }
  50% { box-shadow: 0 0 0 8px rgba(31,157,85,0); }
}
.ph-photo-caption {
  text-align: center; color: var(--ink-2); font-size: 0.82rem;
  margin-top: 0.85rem; font-style: italic;
}

/* ===== Why grid (4 cards) ===== */
.why-grid {
  display: grid; gap: 1.5rem; grid-template-columns: 1fr;
}
@media(min-width: 700px) { .why-grid { grid-template-columns: repeat(2, 1fr); } }
.why-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.75rem; box-shadow: var(--shadow-sm);
  transition: box-shadow .25s, transform .25s;
  display: flex; flex-direction: column; gap: 0.8rem;
}
.why-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.wc-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--green-50); color: var(--green);
}
.wc-icon svg { width: 26px; height: 26px; }
.wc-icon.orange { background: #fff4e6; color: #f59e0b; }
.wc-icon.purple { background: #f3e8ff; color: #8b5cf6; }
.wc-icon.green { background: var(--green-50); color: var(--green); }
.why-card h3 { font-size: 1.2rem; font-weight: 600; }
.why-card p { color: var(--ink-2); font-size: 0.95rem; line-height: 1.7; }
.wc-kpi {
  margin-top: auto; padding-top: 1rem;
  border-top: 1px dashed var(--border);
  display: flex; align-items: baseline; gap: 0.7rem;
}
.wc-num {
  font-family: var(--font-display); font-weight: 700;
  font-size: 2rem; color: var(--green); line-height: 1;
}
.wc-num small { font-size: 1rem; }
.wc-txt { color: var(--ink-2); font-size: 0.85rem; }

/* ===== Dashboard preview + gauges ===== */
.dash-preview {
  border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  background: var(--bg);
}
.dash-preview img { width: 100%; display: block; }
.dash-caption {
  text-align: center; color: var(--ink-2); font-size: 0.85rem;
  margin-top: 0.85rem; font-style: italic;
}
.gauge-stats {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 2.5rem;
}
@media(min-width: 980px) { .gauge-stats { grid-template-columns: repeat(4, 1fr); } }
.gs-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; display: flex; flex-direction: column; align-items: center;
  gap: 0.85rem; text-align: center;
}
.gs-ring {
  width: 110px; height: 110px; border-radius: 50%;
  background: conic-gradient(var(--gs-color, var(--green)) calc(var(--gs-pct, 0) * 1%), #eef3f0 0);
  display: flex; align-items: center; justify-content: center;
  position: relative; transition: background .3s;
}
.gs-ring::before {
  content: ''; position: absolute; inset: 8px;
  background: #fff; border-radius: 50%;
}
.gs-info { display: flex; flex-direction: column; align-items: center; }
.gs-num {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.45rem; color: var(--ink); line-height: 1;
}
.gs-num small { font-size: 0.85rem; color: var(--ink-2); margin-left: 1px; }
.gs-lbl { color: var(--ink-2); font-size: 0.82rem; margin-top: 0.35rem; }

/* ===== Features grid (6 cards) ===== */
.feat-grid {
  display: grid; gap: 1.25rem; grid-template-columns: 1fr;
}
@media(min-width: 700px) { .feat-grid { grid-template-columns: repeat(2, 1fr); } }
@media(min-width: 1024px) { .feat-grid { grid-template-columns: repeat(3, 1fr); } }
.feat-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow-sm);
  transition: box-shadow .25s, transform .25s, border-color .25s;
}
.feat-card:hover {
  box-shadow: var(--shadow-md); transform: translateY(-3px);
  border-color: var(--green-100);
}
.fc-icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--green-50); display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem; color: var(--green);
}
.fc-icon svg { width: 22px; height: 22px; }
.feat-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.feat-card p { color: var(--ink-2); font-size: 0.92rem; line-height: 1.6; }

/* ===== Six Big Losses bars ===== */
.losses-bars {
  display: flex; flex-direction: column; gap: 1.5rem;
  max-width: 920px; margin: 0 auto;
}
.lb-row {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem 1.75rem; box-shadow: var(--shadow-sm);
}
.lb-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.85rem;
}
.lb-name { font-size: 1.05rem; color: var(--ink); }
.lb-name strong { font-family: var(--font-display); font-weight: 600; }
.lb-name span { color: var(--ink-2); font-size: 0.9rem; margin-left: 0.4rem; }
.lb-pct {
  font-family: var(--font-display); font-weight: 700;
  font-size: 2rem; line-height: 1;
}
.lb-pct.lb-green { color: var(--green); }
.lb-pct.lb-orange { color: #f59e0b; }
.lb-pct.lb-red { color: #ef4444; }
.lb-meter {
  height: 8px; background: #eef3f0;
  border-radius: 999px; overflow: hidden; margin-bottom: 0.95rem;
}
.lb-fill { height: 100%; border-radius: 999px; transition: width 1s ease; }
.lb-green-fill { background: linear-gradient(90deg, var(--green), var(--green-dark)); }
.lb-orange-fill { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.lb-red-fill { background: linear-gradient(90deg, #ef4444, #f87171); }
.lb-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }

/* ===== ROI grid ===== */
.roi-grid {
  display: grid; gap: 1.5rem; grid-template-columns: 1fr;
  max-width: 1000px; margin: 0 auto;
}
@media(min-width: 800px) { .roi-grid { grid-template-columns: 1fr 1.1fr; } }
.roi-inputs {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.75rem; box-shadow: var(--shadow-sm);
}
.ri-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0.7rem 0; border-bottom: 1px dashed var(--border);
}
.ri-row:last-of-type { border-bottom: none; }
.ri-lbl { color: var(--ink-2); font-size: 0.92rem; }
.ri-val {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.5rem; color: var(--ink);
}
.ri-note { color: var(--ink-2); font-size: 0.78rem; margin-top: 1rem; font-style: italic; }
.roi-outputs { display: flex; flex-direction: column; gap: 0.7rem; }
.ro-line {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 0.95rem 1.25rem;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-display);
}
.ro-line span { color: var(--ink-2); font-size: 0.92rem; }
.ro-line strong { font-size: 1.4rem; color: var(--ink); font-weight: 700; }
.ro-big-red { background: #fef2f2; border-color: #fecaca; }
.ro-big-red span { color: #991b1b; }
.ro-big-red strong { color: #ef4444; font-size: 1.65rem; }
.ro-big-orange { background: #fffbeb; border-color: #fde68a; }
.ro-big-orange span { color: #92400e; }
.ro-big-orange strong { color: #f59e0b; font-size: 1.65rem; }
.ro-callout {
  background: var(--green-50); border: 1px solid var(--green-100); border-radius: 14px;
  padding: 1.1rem 1.35rem; margin-top: 0.3rem;
}
.ro-callout h4 {
  font-size: 1.05rem; font-weight: 600; color: var(--green-dark);
  margin-bottom: 0.4rem;
}
.ro-callout p { color: var(--ink-2); font-size: 0.9rem; line-height: 1.6; }

/* ===== Notification channels ===== */
.ch-grid {
  display: grid; gap: 1.25rem; grid-template-columns: 1fr;
  max-width: 1000px; margin: 0 auto;
}
@media(min-width: 700px) { .ch-grid { grid-template-columns: repeat(3, 1fr); } }
.ch-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 2rem 1.5rem; text-align: center; box-shadow: var(--shadow-sm);
  transition: box-shadow .25s, transform .25s;
}
.ch-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.ch-icon {
  width: 60px; height: 60px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
}
.ch-icon svg { width: 28px; height: 28px; }
.ch-icon.ch-green { background: var(--green-50); color: var(--green); }
.ch-icon.ch-blue { background: #e0f2fe; color: #0ea5e9; }
.ch-icon.ch-orange { background: #fff4e6; color: #f97316; }
.ch-card h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.45rem; }
.ch-card p { color: var(--ink-2); font-size: 0.9rem; line-height: 1.6; }

/* ===== AI Assistant split ===== */
.ai-split {
  display: grid; gap: 2.5rem; align-items: center; grid-template-columns: 1fr;
}
@media(min-width: 900px) {
  .ai-split { grid-template-columns: 1.1fr 1fr; gap: 3.5rem; }
}
.ai-text .badge { margin-bottom: 1rem; }
.ai-text h2 { font-size: 1.85rem; margin-bottom: 0.95rem; font-weight: 700; }
@media(min-width: 640px) { .ai-text h2 { font-size: 2.3rem; } }
.ai-lead { color: var(--ink-2); font-size: 1.02rem; margin-bottom: 1.5rem; line-height: 1.7; }
.ai-bullets { display: flex; flex-direction: column; gap: 0.85rem; }
.ai-bullets li {
  position: relative; padding-left: 2rem;
  color: var(--ink); font-size: 0.96rem; line-height: 1.7;
}
.ai-bullets li::before {
  content: '\2713'; position: absolute; left: 0; top: 0;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700;
}
.ai-bullets li strong { font-family: var(--font-display); font-weight: 600; }
.ai-photo {
  border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}
.ai-photo img { width: 100%; display: block; }

/* ===== Architecture grid ===== */
.arch-grid {
  display: grid; gap: 1.25rem; grid-template-columns: 1fr;
}
@media(min-width: 640px) { .arch-grid { grid-template-columns: repeat(2, 1fr); } }
@media(min-width: 1024px) { .arch-grid { grid-template-columns: repeat(4, 1fr); } }
.arch-col {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow-sm);
  transition: box-shadow .25s, transform .25s, border-color .25s;
}
.arch-col:hover {
  box-shadow: var(--shadow-md); transform: translateY(-3px);
  border-color: var(--green-100);
}
.ac-head {
  display: flex; align-items: center; gap: 0.85rem; margin-bottom: 1rem;
  padding-bottom: 0.9rem; border-bottom: 1px dashed var(--border);
}
.ac-num {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.4rem; color: var(--green);
  background: var(--green-50); padding: 0.3rem 0.55rem; border-radius: 8px;
}
.arch-col h3 { font-size: 1.05rem; font-weight: 600; }
.ac-list { display: flex; flex-direction: column; gap: 0.55rem; }
.ac-list li {
  font-size: 0.9rem; color: var(--ink);
  display: flex; align-items: flex-start; gap: 0.6rem;
}
.ac-list li::before {
  content: '\2713'; color: var(--green); font-weight: 700; flex-shrink: 0;
}

/* ===== Product CTA banner ===== */
.product-cta { padding: 4rem 0; }
.pc-card {
  background: linear-gradient(135deg, var(--green), var(--green-deep));
  border-radius: 24px; padding: 3.5rem 2.5rem; text-align: center; color: #fff;
  box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
.pc-card::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(600px 300px at 20% 0%, rgba(255,255,255,.12), transparent 60%),
    radial-gradient(500px 300px at 80% 100%, rgba(255,255,255,.08), transparent 60%);
  pointer-events: none;
}
.pc-card > * { position: relative; z-index: 1; }
.pc-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.9rem; background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25); border-radius: 999px;
  color: #fff; font-family: var(--font-display); font-weight: 500;
  font-size: 0.82rem; margin-bottom: 1.25rem;
}
.pc-card h2 {
  color: #fff; font-size: 2rem; font-weight: 700;
  line-height: 1.2; margin-bottom: 1.1rem;
}
@media(min-width: 640px) { .pc-card h2 { font-size: 2.6rem; } }
.pc-soft { opacity: 0.75; }
.pc-card p {
  color: rgba(255,255,255,.92); max-width: 680px; margin: 0 auto 2rem;
  font-size: 1.02rem; line-height: 1.7;
}
.pc-btns { display: flex; gap: 0.85rem; justify-content: center; flex-wrap: wrap; }
.btn-outline-light {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: transparent; color: #fff;
  padding: 0.8rem 1.5rem; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
  border: 1.5px solid rgba(255,255,255,.4); transition: all .2s;
}
.btn-outline-light:hover { background: rgba(255,255,255,.12); border-color: #fff; }

/* ===== Other projects cards ===== */
.other-grid {
  display: grid; gap: 1.25rem; grid-template-columns: 1fr;
}
@media(min-width: 640px) { .other-grid { grid-template-columns: repeat(2, 1fr); } }
@media(min-width: 1024px) { .other-grid { grid-template-columns: repeat(4, 1fr); } }
.other-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.75rem; text-align: center; box-shadow: var(--shadow-sm);
  transition: all .25s; display: flex; flex-direction: column;
}
.other-card:hover {
  box-shadow: var(--shadow-md); transform: translateY(-4px);
  border-color: var(--green-100);
}
.oc-emoji { font-size: 2.5rem; margin-bottom: 0.65rem; line-height: 1; }
.other-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.45rem; }
.other-card p { color: var(--ink-2); font-size: 0.88rem; line-height: 1.6; margin-bottom: 1rem; }
.oc-link {
  margin-top: auto; color: var(--green);
  font-family: var(--font-display); font-weight: 600; font-size: 0.9rem;
}
.other-card:hover .oc-link { color: var(--green-dark); }

/* ===== Hide nav-new-badge on dropdown menus (kept only for legacy index nav) ===== */
.nav-new-badge { display: none; }

/* ===== Tighten nav-links gap on smaller desktop widths to fit the dropdown ===== */
@media(min-width: 1024px) and (max-width: 1199px) {
  .nav-links { gap: 1.4rem; }
}
