:root {
  --primary: #0369a1;
  --primary-hover: #0284c7;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
.container { max-width: 960px; margin: 0 auto; padding: 0 1.5rem; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 1.25rem 0; }
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.brand { font-size: 1.25rem; font-weight: 700; text-decoration: none; color: var(--text); letter-spacing: -0.02em; }
.brand span { color: var(--primary); }
.nav-links a { margin-left: 1.5rem; text-decoration: none; color: var(--text-muted); font-size: 0.95rem; font-weight: 500; }
.nav-links a:hover { color: var(--primary); }

.hero { padding: 4rem 0 3rem; text-align: left; }
.hero h1 { font-size: 2.25rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 1rem; color: #020617; }
.hero .lead { font-size: 1.15rem; color: var(--text-muted); max-width: 680px; }

.extensions-section { padding: 2rem 0 5rem; }
.extensions-section h2 { font-size: 1.4rem; margin-bottom: 1.5rem; border-bottom: 2px solid var(--border); padding-bottom: 0.5rem; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 2rem; display: flex; flex-direction: column; }
.card-muted { opacity: 0.65; border-style: dashed; }
.card h3 { font-size: 1.35rem; margin: 0.5rem 0 1rem; }
.card p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; }
.feature-bullets { list-style: disc; margin: 0 0 1.5rem 1.25rem; font-size: 0.9rem; color: var(--text-muted); }
.badge { align-self: flex-start; font-size: 0.75rem; text-transform: uppercase; font-weight: 700; background: #e0f2fe; color: var(--primary); padding: 0.2rem 0.5rem; border-radius: 4px; }
.badge-muted { background: #f1f5f9; color: #64748b; }

.card-actions { margin-top: auto; display: flex; gap: 0.75rem; flex-wrap: wrap; }
.btn { display: inline-block; padding: 0.65rem 1.25rem; font-size: 0.9rem; font-weight: 600; text-decoration: none; border-radius: 6px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { border: 1px solid var(--border); color: var(--text); background: #fff; }
.btn-outline:hover { background: #f1f5f9; }

.page-content { padding: 3rem 1.5rem; background: var(--surface); margin: 2rem auto; border-radius: 8px; border: 1px solid var(--border); }
.page-content h1 { font-size: 2rem; margin-bottom: 1.5rem; }
.page-content h2 { margin: 2rem 0 0.75rem; font-size: 1.35rem; }
.page-content h3 { margin: 1rem 0 0.75rem; }
.page-content p { margin-bottom: 1rem; }
.page-content ul, .page-content ol { margin: 0 0 1.5rem 1.5rem; }

.site-footer { border-top: 1px solid var(--border); padding: 2rem 0; font-size: 0.85rem; color: var(--text-muted); margin-top: 4rem; }
.footer-container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.disclaimer { font-size: 0.75rem; max-width: 450px; }

/* Documentation Image Styling */
.page-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.page-content figure {
  margin: 2rem 0;
  text-align: center;
}

.page-content figure img {
  margin-bottom: 0.5rem;
}

.page-content figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* --- Documentation Tables --- */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0 2.5rem;
  font-size: 0.9rem;
}
.doc-table th {
  background: #f1f5f9;
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  font-weight: 600;
  text-align: left;
  color: #334155;
}
.doc-table td {
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  vertical-align: top;
}
.badge-allowed {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 4px;
  background: #dcfce7;
  color: #166534;
}
.badge-blocked {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 4px;
  background: #fee2e2;
  color: #991b1b;
}

/* --- Clean Accordion FAQ --- */
.faq-group {
  margin: 2rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.faq-card {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  transition: background 0.15s ease;
}
.faq-card:last-child {
  border-bottom: none;
}
.faq-card summary {
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  user-select: none;
  color: #1e293b;
}
.faq-card summary::-webkit-details-marker {
  display: none;
}
.faq-card summary::after {
  content: "+";
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--primary);
  line-height: 1;
  transition: transform 0.2s ease;
}
.faq-card[open] summary::after {
  content: "−";
}
.faq-card[open] {
  background: #fbfcfe;
}
.faq-body {
  padding: 0 1.5rem 1.25rem;
  font-size: 0.925rem;
  color: #475569;
  line-height: 1.65;
}

/* --- Docs Hub Redesign --- */
.docs-hero {
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 3rem;
}
.docs-hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: #0f172a;
}
.docs-hero .lead {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.docs-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 2rem;
  margin-bottom: 3.5rem;
}

.doc-hub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.doc-hub-card:hover {
  border-color: #cbd5e1; /* Subtle border darkening, zero movement */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.doc-hub-header {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.doc-hub-meta h2 {
  font-size: 1.35rem;
  margin-top: 0.35rem;
  line-height: 1.3;
}
.doc-hub-meta h2 a {
  text-decoration: none;
  color: var(--text);
}
.doc-hub-meta h2 a:hover {
  color: var(--primary);
}

/* Product Icons */
.product-icon {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
}
.product-icon.sm {
  width: 44px;
  height: 44px;
}
.product-icon-placeholder {
  width: 56px;
  height: 56px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.product-icon-placeholder.sm {
  width: 44px;
  height: 44px;
}

.card-header-with-icon {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.card-header-with-icon h3 {
  margin: 0.25rem 0 0;
  font-size: 1.25rem;
}

.doc-hub-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* Quick Links inside Card */
.doc-quick-links {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.75rem;
  margin-top: auto;
}
.quick-links-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
}
.doc-quick-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.doc-quick-links li {
  margin-bottom: 0.4rem;
}
.doc-quick-links li:last-child {
  margin-bottom: 0;
}
.doc-quick-links a {
  font-size: 0.85rem;
  color: #334155;
  text-decoration: none;
  font-weight: 500;
  display: inline-block;
}
.doc-quick-links a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.doc-hub-footer .btn {
  width: 100%;
  text-align: center;
}

/* Support Callout Banner */
.support-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 1.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.support-banner-content h3 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}
.support-banner-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* --- Developer Hook Cards --- */
.hook-group-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  margin: 2.5rem 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hook-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.hook-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hook-card:hover {
  border-color: #cbd5e1;
}

.hook-card summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  user-select: none;
  background: #ffffff;
}

.hook-card summary::-webkit-details-marker {
  display: none;
}

.hook-title-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hook-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.hook-badge-action {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.hook-badge-filter {
  background: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
}

.hook-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
}

.hook-toggle {
  font-size: 1.25rem;
  color: #94a3b8;
  line-height: 1;
}

.hook-card[open] summary {
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.hook-card[open] .hook-toggle::after {
  content: "−";
}

.hook-card:not([open]) .hook-toggle::after {
  content: "+";
}

.hook-details {
  padding: 1.25rem;
  font-size: 0.925rem;
  color: #334155;
  background: #ffffff;
}

.hook-desc {
  margin-bottom: 1rem;
  line-height: 1.5;
}

.hook-params-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.hook-params-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  border: 1px solid #f1f5f9;
  border-radius: 6px;
  background: #f8fafc;
}

.hook-params-list li {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.85rem;
}

.hook-params-list li:last-child {
  border-bottom: none;
}

.param-type {
  color: #0369a1;
  font-weight: 600;
}

.param-var {
  color: #b91c1c;
}

/* --- Option Cards for Strategies & Features --- */
.strategy-cards {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 1.5rem 0 2.5rem;
}

.strategy-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--border);
}

.strategy-card.is-default {
  border-left-color: var(--primary);
  background: #ffffff;
}

.strategy-card h4 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #1e293b;
}

.strategy-card p {
  margin-bottom: 0.5rem;
  font-size: 0.925rem;
  color: #475569;
}

.strategy-card .card-tip {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* --- Code Blocks & Syntax Highlighting --- */
.page-content pre {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background-color: #0f172a; /* Deep slate background if theme doesn't override */
  color: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  overflow-x: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* Ensure code inside pre doesn't inherit inline styles */
.page-content pre code {
  background: transparent;
  padding: 0;
  border: none;
  border-radius: 0;
  color: inherit;
  font-size: inherit;
}

/* --- Inline Code (e.g., `WC_Order`, `edit_shop_order`) --- */
.page-content :not(pre) > code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85em;
  background-color: #f1f5f9;
  color: #0369a1;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

/* --- Blockquotes & Example Callout Boxes --- */
.page-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background-color: #f0fdf4; /* Soft mint/green tint */
  border-left: 4px solid #22c55e;
  border-radius: 0 6px 6px 0;
  color: #166534;
  font-size: 0.925rem;
}

.page-content blockquote p {
  margin: 0;
}

/* Prevent table blowout on mobile */
@media (max-width: 640px) {
  .doc-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
}

/* Quick Jump TOC */
.doc-toc {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.85rem 1.25rem;
  margin: 2rem 0;
  font-size: 0.9rem;
}
.toc-title {
  font-weight: 700;
  color: #334155;
  margin-right: 0.5rem;
}
.toc-links a {
  text-decoration: none;
  color: var(--primary);
  font-weight: 500;
}
.toc-links a:hover {
  text-decoration: underline;
}
