/* ─── สไตล์ชีทเฉพาะหน้ารายละเอียดข้อมูลบริษัท: companies-detail.css ─── */

.cd-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 0;
  min-height: 78vh;
  box-sizing: border-box;
}

/* Back button */
.cd-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.97rem;
  font-family: inherit;
  margin-bottom: 1.5rem;
  transition: all 0.15s;
  text-decoration: none;
}

.cd-back-btn .material-icons {
  font-size: 1.1rem;
}

.cd-back-btn:hover {
  border-color: #111;
  color: #111;
  background: #f9fafb;
}

/* Hero */
.cd-hero {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: #fff;
  border: 1px solid #e5e7eb;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .05);
}

.cd-hero-icon {
  width: 64px;
  height: 64px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cd-hero-icon .material-icons {
  font-size: 2.2rem;
  color: #9ca3af;
}

.cd-hero-info {
  flex: 1;
  min-width: 0;
}

.cd-hero-info h1 {
  font-size: 1.54rem;
  font-weight: 700;
  color: #111;
  margin: 0.5rem 0 1rem;
  line-height: 1.4;
}

.cd-type-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.83rem;
  font-weight: 600;
}

.cd-type-badge.badge-green {
  background: #dcfce7;
  color: #16a34a;
}

.cd-type-badge.badge-blue {
  background: #dbeafe;
  color: #1d4ed8;
}

.cd-type-badge.badge-orange {
  background: #ffedd5;
  color: #ea580c;
}

.cd-type-badge.badge-gray {
  background: #f3f4f6;
  color: #6b7280;
}

.cd-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.cd-meta-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.94rem;
  color: #6b7280;
}

.cd-meta-item .material-icons {
  font-size: 1.1rem;
}

/* Grid */
.cd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

.cd-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
}

.cd-card.cd-card-full {
  grid-column: span 2;
}

.cd-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.99rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f3f4f6;
}

.cd-card-title .material-icons {
  font-size: 1.21rem;
  color: #9ca3af;
}

.cd-rows {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cd-row {
  display: flex;
  gap: 1rem;
  align-items: baseline;
}

.cd-row.cd-row-block {
  flex-direction: column;
  gap: 0.35rem;
}

.cd-label {
  font-size: 0.88rem;
  color: #9ca3af;
  white-space: nowrap;
  min-width: 120px;
  flex-shrink: 0;
}

.cd-value {
  font-size: 0.99rem;
  color: #1f2937;
  word-break: break-word;
}

.cd-value.mono {
  font-family: monospace;
  letter-spacing: 0.05em;
}

.cd-value.highlight {
  font-weight: 700;
  color: #111;
  font-size: 1.1rem;
}

.cd-objective {
  line-height: 1.7;
  color: #4b5563;
  font-size: 0.97rem;
}

/* Action card */
.cd-card-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 1rem;
  grid-row: span 2;
}

.cta-logo-wrap {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cta-logo-wrap .cta-logo {
  height: 100%;
  width: auto;
  object-fit: contain;
}

.cta-price {
  font-size: 1.05rem;
  color: #555;
  font-family: 'Prompt', sans-serif;
}

.cta-price span {
  color: #e53935;
  font-weight: 700;
  font-size: 1.21rem;
}

.cd-action-btns {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.cd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1rem;
  font-size: 0.99rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  font-family: inherit;
  border: none;
  box-sizing: border-box;
}

.cd-btn .material-icons {
  font-size: 1.21rem;
}

.cd-btn.cd-btn-primary {
  background: #111;
  color: #fff;
  border: 2px solid #111;
}

.cd-btn.cd-btn-primary:hover {
  background: #333;
  border-color: #333;
}

.cd-btn.cd-btn-outline {
  background: transparent;
  color: #111;
  border: 2px solid #d1d5db;
}

.cd-btn.cd-btn-outline:hover {
  border-color: #111;
  background: #f9fafb;
}

/* Loading / Error */
.cd-loading,
.cd-error {
  text-align: center;
  padding: 5rem 1rem;
  color: #9ca3af;
}

.cd-loading .spin {
  animation: spin 1s linear infinite;
  font-size: 2.75rem;
  display: block;
  margin: 0 auto 1rem;
}

.cd-error .material-icons {
  font-size: 3.5rem;
  color: #ef4444;
  margin-bottom: 1rem;
  display: block;
}

.cd-error button {
  background: none;
  border: 1px solid #cbd5e1;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  font-family: inherit;
  margin-top: 1rem;
}

.cd-error button:hover {
  border-color: #111;
  color: #111;
}

/* ─── Nearby Section ─── */
.nearby-section {
  background-color: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 4rem 1.5rem;
  margin-top: 4rem;
}

.nearby-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.nearby-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.5rem 0;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .cd-grid {
    grid-template-columns: 1fr;
  }
  .cd-card.cd-card-full {
    grid-column: span 1;
  }
  .cd-card-actions {
    grid-row: auto;
  }
}

@media (max-width: 600px) {
  .cd-page {
    padding-top: 6rem;
  }
  .cd-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .cd-meta-row {
    justify-content: center;
  }
}
