/* Plan Detail Page */

.plan-detail-section {
  overflow: visible !important;
}

.plan-detail-section ~ *,
.plan-breadcrumb ~ * {
  overflow: visible;
}

body:has(.plan-detail-section) main {
  overflow: visible !important;
}

.plan-breadcrumb {
  padding: 16px 0;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--gray-600);
}

.breadcrumb-nav a {
  color: var(--navy);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb-nav a:hover {
  color: var(--gold);
}

.breadcrumb-nav span {
  color: var(--gray-400);
}

.breadcrumb-current {
  font-weight: 600;
  color: var(--gray-800) !important;
}

/* Layout */
.plan-detail-section {
  padding: 40px 0 80px;
}

.plan-detail-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
}

/* Sidebar */
.plan-sidebar {
  position: sticky;
  top: 88px;
  align-self: start;
}

.plan-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 3px solid var(--gray-200);
}

.plan-sidebar-link {
  display: block;
  padding: 14px 20px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--gray-600);
  text-decoration: none;
  border-left: 3px solid transparent;
  margin-left: -3px;
  transition: all 0.2s ease;
}

.plan-sidebar-link:hover {
  color: var(--navy);
  background: var(--gray-50);
}

.plan-sidebar-link.active {
  color: var(--navy);
  font-weight: 700;
  border-left-color: var(--gold);
  background: rgba(200,155,60,0.04);
}

/* Hidden section — keep label visible but faded (CMS preview) */
.plan-sidebar-link.is-nav-hidden {
  color: #cbd5e1;
  opacity: 0.55;
  font-weight: 500;
}

.plan-sidebar-link.is-nav-hidden:hover,
.plan-sidebar-link.is-nav-hidden.active {
  color: #94a3b8;
  border-left-color: #e2e8f0;
  background: transparent;
}

.plan-sidebar-back {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 12px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--navy);
  text-decoration: none;
  transition: color 0.2s;
}

.plan-sidebar-back:hover {
  color: var(--gold);
}

.plan-sidebar-back svg {
  width: 16px;
  height: 16px;
}

/* Content */
.plan-content {
  min-width: 0;
}

.plan-section {
  margin-bottom: 56px;
}

.plan-section h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gray-100);
}

/* Hero Card */
.plan-hero-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
  margin-bottom: 32px;
}

.plan-hero-img {
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 16/10;
}

.plan-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.plan-tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--white);
  background: var(--tag-color, var(--navy));
  margin-bottom: 12px;
}

.plan-hero-meta-right {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.plan-hero-meta-right .stat-pair {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.plan-hero-meta-right .stat-item {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--gray-600);
  font-weight: 500;
  white-space: nowrap;
  line-height: 1;
}

.plan-hero-meta-right .stat-item svg {
  display: block;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--navy);
  opacity: 0.75;
}

.plan-hero-meta-right .view-num,
.plan-hero-meta-right .share-num {
  color: var(--navy);
  font-weight: 700;
}

.plan-hero-meta-right .view-label,
.plan-hero-meta-right .share-label {
  color: var(--gray-600);
  font-weight: 500;
}

.plan-views {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--gray-600);
  font-weight: 500;
  white-space: nowrap;
}

.plan-views svg {
  color: var(--navy);
  opacity: 0.75;
}

.plan-views .view-num {
  color: var(--navy);
  font-weight: 700;
}

.plan-share-icons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.plan-share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  padding: 0;
  border-radius: 50%;
  color: var(--white);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.plan-share-icon svg {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.plan-share-icon:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.plan-share-facebook {
  background: #1877F2;
}

.plan-share-line {
  background: #06C755;
}

.plan-share-email {
  background: var(--navy);
}

.plan-hero-info h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 12px;
}

.plan-hero-desc {
  font-size: 1rem;
  color: var(--gray-600);
  line-height: 1.7;
  margin-bottom: 24px;
}

.plan-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-brochure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--navy);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-brochure:hover {
  border-color: var(--navy);
  background: var(--gray-50);
}

.btn-brochure svg {
  width: 16px;
  height: 16px;
}

/* Rich overview body from CMS (HTML + images) */
.plan-overview-body {
  margin: 28px 0 8px;
  color: var(--gray-700, #334155);
  font-size: 1rem;
  line-height: 1.75;
}

.plan-overview-body:empty,
.plan-overview-body[hidden] {
  display: none !important;
}

.plan-overview-body h2 {
  margin: 1.25em 0 0.5em;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy, #0b2e59);
}

.plan-overview-body h3 {
  margin: 1.1em 0 0.4em;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--navy, #0b2e59);
}

.plan-overview-body p {
  margin: 0 0 0.9em;
}

.plan-overview-body ul,
.plan-overview-body ol {
  margin: 0 0 1em;
  padding-left: 1.35em;
}

.plan-overview-body li {
  margin: 0.25em 0;
}

.plan-overview-body img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border-radius: 12px;
}

.plan-overview-body a {
  color: var(--navy, #0b2e59);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Freeform content blocks inserted before/after plan sections */
.plan-content-block {
  margin: 28px 0;
  color: var(--gray-700, #334155);
  font-size: 1rem;
  line-height: 1.75;
}

.plan-content-block:empty {
  display: none !important;
}

.plan-content-block h2 {
  margin: 1.25em 0 0.5em;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy, #0b2e59);
}

.plan-content-block h3 {
  margin: 1.1em 0 0.4em;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--navy, #0b2e59);
}

.plan-content-block p {
  margin: 0 0 0.9em;
}

.plan-content-block ul,
.plan-content-block ol {
  margin: 0 0 1em;
  padding-left: 1.35em;
}

.plan-content-block li {
  margin: 0.25em 0;
}

.plan-content-block img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border-radius: 12px;
}

.plan-content-block a {
  color: var(--navy, #0b2e59);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Stats — 4 ต่อแถว; ใบที่ 5+ ขึ้นแถวใหม่เริ่มคอลัมน์แรก */
.plan-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.plan-stat {
  text-align: center;
  padding: 20px 12px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
}

.plan-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(11,46,89,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  margin: 0 auto 10px;
}

.plan-stat-icon svg {
  width: 20px;
  height: 20px;
}

.plan-stat-num {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 4px;
}

.plan-stat-label {
  font-size: 0.78rem;
  color: var(--gray-600);
}

/* Highlights */
.plan-highlights-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.plan-highlight {
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
}

.plan-highlight:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border-color: var(--gold);
}

.plan-highlight-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(11,46,89,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  margin-bottom: 14px;
}

.plan-highlight-icon svg {
  width: 24px;
  height: 24px;
}

.plan-highlight h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}

.plan-highlight p {
  font-size: 0.85rem;
  color: var(--gray-600);
  line-height: 1.6;
}

/* Plan Info Table */
.plan-info-table {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

.plan-info-table table {
  width: 100%;
  border-collapse: collapse;
}

.plan-info-table tr {
  border-bottom: 1px solid var(--gray-100);
}

.plan-info-table tr:last-child {
  border-bottom: none;
}

.plan-info-table td {
  padding: 16px 20px;
  font-size: 0.9rem;
  color: var(--gray-800);
  vertical-align: top;
}

.plan-info-label {
  font-weight: 600;
  color: var(--navy) !important;
  width: 200px;
  background: var(--gray-50);
}

/* Suitable */
.plan-suitable-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.plan-suitable-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.plan-suitable-item:hover {
  background: var(--white);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.plan-suitable-item > svg {
  width: 24px;
  height: 24px;
  color: var(--gold);
  flex-shrink: 0;
  margin-top: 2px;
}

.plan-suitable-item h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}

.plan-suitable-item p {
  font-size: 0.85rem;
  color: var(--gray-600);
  line-height: 1.5;
}

/* FAQ */
.plan-faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-faq-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s;
}

.plan-faq-item[open] {
  border-color: var(--navy);
}

.plan-faq-item summary {
  padding: 18px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s;
}

.plan-faq-item summary::-webkit-details-marker {
  display: none;
}

.plan-faq-item summary::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--gray-400);
  transition: transform 0.2s;
}

.plan-faq-item[open] summary::after {
  content: '−';
  color: var(--navy);
}

.plan-faq-item summary:hover {
  background: var(--gray-50);
}

.plan-faq-answer {
  padding: 0 24px 20px;
}

.plan-faq-answer p {
  font-size: 0.88rem;
  color: var(--gray-600);
  line-height: 1.7;
}

/* CTA */
.plan-cta {
  margin-top: 40px;
}

/* Hidden in CMS preview — faded so it remains editable */
.plan-cta.is-section-hidden {
  opacity: 0.45;
  filter: grayscale(0.25);
  outline: 2px dashed #94a3b8;
  outline-offset: 4px;
}

.plan-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 40px;
  background: var(--navy);
  border-radius: var(--radius-xl);
  color: var(--white);
}

.plan-cta-inner h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.plan-cta-inner p {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.7);
}

.plan-cta-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 1024px) {
  .plan-detail-layout {
    grid-template-columns: 180px 1fr;
    gap: 32px;
  }

  .plan-hero-card {
    grid-template-columns: 1fr;
  }

  .plan-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .plan-detail-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .plan-sidebar {
    position: static;
  }

  .plan-sidebar-nav {
    flex-direction: row;
    border-left: none;
    border-bottom: 2px solid var(--gray-200);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .plan-sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .plan-sidebar-link {
    border-left: none;
    border-bottom: 3px solid transparent;
    margin-left: 0;
    margin-bottom: -2px;
    white-space: nowrap;
    padding: 12px 16px;
    font-size: 0.82rem;
  }

  .plan-sidebar-link.active {
    border-left-color: transparent;
    border-bottom-color: var(--gold);
  }

  .plan-sidebar-back {
    display: none;
  }

  .plan-hero-info h1 {
    font-size: 1.5rem;
  }

  .plan-highlights-grid {
    grid-template-columns: 1fr;
  }

  .plan-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .plan-cta-inner {
    flex-direction: column;
    text-align: center;
    padding: 24px;
  }

  .plan-cta-actions {
    flex-direction: column;
    width: 100%;
  }
}
