/* =============================================================================
   Services hub + detail + home services section — SW Mechanics
   Linked from Services/Index.cshtml, Details.cshtml, PageSection/Services.cshtml
   Dark theme lives here (do not rely on themes.css / site.css edits)
   ============================================================================= */

.services-hub .section-services--page,
.services-hub .services-guide,
.services-detail .page-content-block {
  position: relative;
  z-index: 1;
}

.ambient-page.services-hub .section-services--page {
  padding-top: var(--sp-section-y-sm, clamp(2.5rem, 5vw, 3.5rem));
  padding-bottom: var(--sp-section-y-md, clamp(3.5rem, 6vw, 5rem));
  background: transparent;
  margin-top: 0;
}

.section-services .section-header {
  margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem);
}

.section-services .section-header .section-title {
  max-width: 22ch;
  margin-left: auto;
  margin-right: auto;
}

.section-services--page .section-header .section-subtitle {
  max-width: 40rem;
  font-size: 1.0625rem;
  line-height: 1.7;
}

.section-services--page .section-header .section-subtitle a {
  color: var(--sp-primary-dark, #0284c7);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(14, 165, 233, 0.35);
  text-underline-offset: 0.18em;
}

.section-services--page .section-header .section-subtitle a:hover {
  color: var(--sp-primary);
  text-decoration-color: var(--sp-primary);
}

/* ── Catalog grid ────────────────────────────────────────────────────────── */

.services-catalog {
  align-items: stretch;
}

.services-catalog > [class*="col-"] {
  display: flex;
}

.services-catalog .service-card-premium {
  width: 100%;
}

/* ── Service cards ───────────────────────────────────────────────────────── */

.section-services .service-card-premium {
  background: var(--sp-white, #fff);
  border: 1px solid var(--sp-border, rgba(15, 23, 42, 0.08));
  border-radius: var(--sp-radius-xl, 2rem);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.section-services .service-card-premium:hover {
  border-color: rgba(14, 165, 233, 0.28);
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.1),
    0 0 0 1px rgba(14, 165, 233, 0.12);
}

.section-services .service-card-premium__media {
  height: auto;
  aspect-ratio: 16 / 9;
  max-height: 180px;
}

.section-services .service-card-premium__body {
  padding: 1.75rem 1.35rem 1.35rem;
  gap: 0.35rem;
}

.section-services .service-card-premium__title {
  font-family: var(--sp-font-display);
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--sp-text);
  margin-bottom: 0.4rem;
}

.section-services .service-card-premium__text {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--sp-text-muted);
  margin-bottom: 1rem;
}

.section-services .service-card-premium__footer {
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
  padding-top: 1rem;
  margin-top: auto;
}

.section-services .service-card-premium__price {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--sp-primary-dark, #0284c7);
}

.section-services .service-card-premium__price small {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0;
}

.section-services .service-card-premium__footer .d-flex {
  width: 100%;
  gap: 0.5rem;
}

.section-services .service-card-premium__footer .btn-sp {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  white-space: nowrap;
}

/* ── CTAs ────────────────────────────────────────────────────────────────── */

.services-hub__cta,
.services-section-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin-top: clamp(1.75rem, 4vw, 2.75rem);
}

.section-services .cta-strip--featured,
.services-hub .cta-strip--featured,
.services-detail .cta-strip--featured {
  width: 100%;
  max-width: 42rem;
  margin-inline: auto;
  padding: 0.9rem 1.15rem;
  border-radius: var(--sp-radius-xl, 2rem);
  background: var(--sp-white, #fff);
  border: 1px solid var(--sp-border, #e2e8f0);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.section-services .cta-strip--featured .btn-sp,
.services-hub .cta-strip--featured .btn-sp {
  min-height: 48px;
  font-weight: 700;
}

/* ── Service guide (long-form SEO, kept visible) ─────────────────────────── */

.services-guide {
  padding-top: var(--sp-section-y-sm, clamp(2.5rem, 5vw, 3.5rem));
  padding-bottom: var(--sp-section-y-md, clamp(3.5rem, 6vw, 5rem));
}

.services-guide__header {
  max-width: 42rem;
  margin: 0 auto 1.75rem;
  text-align: center;
}

.services-guide__header .section-title {
  max-width: 22ch;
  margin-left: auto;
  margin-right: auto;
}

.services-guide__lead {
  margin: 0 auto 1.25rem;
  max-width: 38rem;
  font-size: clamp(1.0625rem, 2vw, 1.2rem);
  font-weight: 600;
  line-height: 1.55;
  color: var(--sp-text);
}

.services-guide__intro {
  text-align: left;
}

.services-guide__intro p {
  margin-bottom: 1rem;
  color: var(--sp-text-muted);
  font-size: 1.0625rem;
  line-height: 1.75;
}

.services-guide__intro p:last-child {
  margin-bottom: 0;
}

.services-guide__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 auto 2rem;
  max-width: 48rem;
}

.services-guide__nav-label {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sp-text-muted);
  margin-right: 0.15rem;
}

.services-guide__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--sp-border, rgba(15, 23, 42, 0.08));
  background: var(--sp-glass-strong, rgba(255, 255, 255, 0.82));
  color: var(--sp-text);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color var(--sp-transition, 0.35s ease), color var(--sp-transition, 0.35s ease), background var(--sp-transition, 0.35s ease);
}

.services-guide__nav a:hover {
  border-color: var(--sp-primary);
  color: var(--sp-primary);
  background: var(--sp-primary-soft);
}

.services-guide__nav a:focus-visible {
  outline: 2px solid var(--sp-primary);
  outline-offset: 2px;
}

.services-guide__panel,
.services-guide__header {
  scroll-margin-top: calc(var(--sp-header-h, 72px) + 1rem);
}

.services-guide__panel {
  background: var(--sp-white, #fff);
  border: 1px solid var(--sp-border, rgba(15, 23, 42, 0.08));
  border-radius: var(--sp-radius-xl, 2rem);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.05);
  padding: clamp(1.35rem, 3vw, 2rem) clamp(1.25rem, 3vw, 2.15rem);
  margin-bottom: 1.15rem;
}

.services-guide__panel:last-child {
  margin-bottom: 0;
}

.services-guide__title {
  font-family: var(--sp-font-display);
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--sp-text);
  margin: 0 0 1rem;
}

.services-guide .services-seo-block__h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--sp-text);
  margin-top: 1.5rem;
  margin-bottom: 0.65rem;
}

.services-guide .cms-content p {
  margin-bottom: 1rem;
  color: var(--sp-text-muted);
  font-size: 1.03125rem;
  line-height: 1.75;
}

.services-guide .cms-content p:last-child {
  margin-bottom: 0;
}

.services-guide .cms-content a {
  color: var(--sp-primary-dark, #0284c7);
  font-weight: 600;
}

.services-seo-list {
  margin: 0.75rem 0 1rem;
  padding: 0;
  list-style: none;
}

.services-seo-list li {
  position: relative;
  margin-bottom: 0.7rem;
  padding-left: 1.5rem;
  color: var(--sp-text-muted);
  line-height: 1.65;
}

.services-seo-list li:last-child {
  margin-bottom: 0;
}

.services-seo-list li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.55em;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--sp-primary);
  box-shadow: 0 0 0 4px var(--sp-primary-soft);
}

.services-guide__actions {
  margin: 1.35rem 0 0;
}

.services-guide .link-sp {
  color: var(--sp-primary-dark, #0284c7);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(14, 165, 233, 0.35);
  text-underline-offset: 0.18em;
}

.services-guide .link-sp:hover {
  color: var(--sp-primary);
  text-decoration-color: var(--sp-primary);
}

/* ── Comparison table ────────────────────────────────────────────────────── */

.services-guide__table-wrap {
  margin-top: 0.25rem;
  border-radius: var(--sp-radius-lg, 1.5rem);
  border: 1px solid var(--sp-border, #e2e8f0);
  overflow: hidden;
}

.services-comparison-table {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--sp-text);
}

.services-comparison-table thead th {
  background: var(--sp-surface-2, #f1f5f9);
  color: var(--sp-text);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom-color: var(--sp-border, #e2e8f0);
  padding: 0.85rem 1rem;
}

.services-comparison-table td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  border-color: var(--sp-border, #e2e8f0);
  color: var(--sp-text-muted);
}

.services-comparison-table tbody tr:nth-child(even) td {
  background: rgba(241, 245, 249, 0.55);
}

.services-comparison-table td:first-child {
  font-weight: 700;
  color: var(--sp-text);
}

/* ── Guide FAQs ──────────────────────────────────────────────────────────── */

.services-faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.services-faq-item {
  margin: 0;
  padding: 1rem 1.15rem;
  border: 1px solid var(--sp-border, #e2e8f0);
  border-radius: var(--sp-radius-lg, 1.5rem);
  background: var(--sp-surface-2, #f8fafc);
}

.services-faq-item__q {
  font-size: 1.03125rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.4;
  color: var(--sp-text);
  margin: 0 0 0.4rem;
}

.services-faq-item__a {
  color: var(--sp-text-muted);
  margin: 0;
  line-height: 1.65;
  font-size: 0.96875rem;
}

/* ── Service detail ──────────────────────────────────────────────────────── */

.services-detail__wrap {
  padding-top: var(--sp-section-y-sm, clamp(2.5rem, 5vw, 3.5rem));
  padding-bottom: var(--sp-section-y-md, clamp(3.5rem, 6vw, 5rem));
}

.services-detail__media {
  margin: 0 0 1.5rem;
  border-radius: var(--sp-radius-xl, 2rem);
  overflow: hidden;
  box-shadow: var(--sp-shadow, 0 8px 32px rgba(15, 23, 42, 0.08));
}

.services-detail__image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
}

.services-detail__copy {
  font-size: 1.0625rem;
  line-height: 1.75;
}

.services-detail__inline-cta {
  margin-top: 1.5rem;
}

.services-detail__sidebar {
  padding: var(--sp-card-pad, clamp(1.5rem, 3vw, 2.25rem));
}

.services-detail__price {
  font-family: var(--sp-font-display);
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--sp-primary);
  margin: 0 0 0.15rem;
}

.services-detail__perks li {
  display: flex;
  align-items: flex-start;
  line-height: 1.45;
}

.services-detail__sidebar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.services-detail__sidebar-actions .btn-sp {
  flex: 1 1 calc(50% - 0.6rem);
  min-width: 8.5rem;
  justify-content: center;
}

@media (min-width: 992px) {
  .services-detail__sidebar {
    position: sticky;
    top: calc(var(--sp-header-h, 72px) + 1.25rem);
  }
}

/* ── Dark theme ──────────────────────────────────────────────────────────── */

html[data-site-theme="dark"] .section-services,
html[data-site-theme="dark"] .services-hub .section-services--page,
html[data-site-theme="dark"] .services-guide,
html[data-site-theme="dark"] .services-detail {
  background: transparent;
}

html[data-site-theme="dark"] .section-services .section-title,
html[data-site-theme="dark"] .services-guide__title,
html[data-site-theme="dark"] .services-guide__lead,
html[data-site-theme="dark"] .services-guide .services-seo-block__h3,
html[data-site-theme="dark"] .section-services .service-card-premium__title {
  color: var(--sp-text);
}

html[data-site-theme="dark"] .section-services--page .section-header .section-subtitle a,
html[data-site-theme="dark"] .services-guide .cms-content a,
html[data-site-theme="dark"] .services-guide .link-sp {
  color: var(--sp-primary);
  text-decoration-color: rgba(56, 189, 248, 0.4);
}

html[data-site-theme="dark"] .section-services .service-card-premium {
  background: rgba(30, 41, 59, 0.88);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

html[data-site-theme="dark"] .section-services .service-card-premium:hover {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(56, 189, 248, 0.2);
}

html[data-site-theme="dark"] .section-services .service-card-premium__price {
  color: var(--sp-primary);
}

html[data-site-theme="dark"] .section-services .cta-strip--featured,
html[data-site-theme="dark"] .services-hub .cta-strip--featured,
html[data-site-theme="dark"] .services-detail .cta-strip--featured,
html[data-site-theme="dark"] .section-services .cta-strip--featured:not(.cta-strip--inline),
html[data-site-theme="dark"] .services-hub .cta-strip--featured:not(.cta-strip--inline) {
  background: rgba(30, 41, 59, 0.96) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.32) !important;
}

html[data-site-theme="dark"] .services-guide__panel,
html[data-site-theme="dark"] .services-guide__nav a {
  background: rgba(30, 41, 59, 0.82);
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-site-theme="dark"] .services-guide__nav a:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--sp-primary);
}

html[data-site-theme="dark"] .services-guide .cms-content p,
html[data-site-theme="dark"] .services-guide__intro p,
html[data-site-theme="dark"] .services-seo-list li,
html[data-site-theme="dark"] .services-faq-item__a {
  color: #cbd5e1;
}

html[data-site-theme="dark"] .services-guide__table-wrap {
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-site-theme="dark"] .services-comparison-table {
  color: var(--sp-text);
  --bs-table-bg: transparent;
  --bs-table-color: var(--sp-text);
  --bs-table-border-color: rgba(255, 255, 255, 0.1);
}

html[data-site-theme="dark"] .services-comparison-table thead th {
  background: rgba(15, 23, 42, 0.65);
  color: #e2e8f0;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

html[data-site-theme="dark"] .services-comparison-table td {
  border-color: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  background: transparent;
}

html[data-site-theme="dark"] .services-comparison-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.04);
}

html[data-site-theme="dark"] .services-comparison-table td:first-child {
  color: #f1f5f9;
}

html[data-site-theme="dark"] .services-faq-item {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-site-theme="dark"] .services-faq-item__q {
  color: #f1f5f9;
}

html[data-site-theme="dark"] .services-detail .service-detail-sidebar {
  background: rgba(30, 41, 59, 0.96);
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-site-theme="dark"] .services-detail__price {
  color: var(--sp-primary);
}

html[data-site-theme="dark"] .section-services .btn-sp-outline-dark {
  background: rgba(255, 255, 255, 0.06);
  color: var(--sp-text);
  border-color: rgba(255, 255, 255, 0.14);
}

html[data-site-theme="dark"] .section-services .btn-sp-outline-dark:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ── Mobile stacking ─────────────────────────────────────────────────────── */

@media (max-width: 991.98px) {
  .section-services .cta-strip--featured,
  .services-hub .cta-strip--featured {
    flex-direction: column;
    align-items: stretch;
    border-radius: 1.25rem;
    padding: 0.85rem;
  }

  .section-services .cta-strip--featured .btn-sp,
  .services-hub .cta-strip--featured .btn-sp,
  .services-detail .cta-strip--inline .btn-sp,
  .services-detail__sidebar-actions .btn-sp {
    width: 100%;
    flex: 1 1 100%;
  }

  .services-guide__header {
    text-align: left;
  }

  .services-guide__header .section-title {
    margin-left: 0;
    margin-right: 0;
    max-width: none;
  }

  .services-guide__nav {
    justify-content: flex-start;
  }

  .services-detail__inline-cta {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 767.98px) {
  .services-comparison-table thead {
    display: none;
  }

  .services-comparison-table,
  .services-comparison-table tbody,
  .services-comparison-table tr,
  .services-comparison-table td {
    display: block;
    width: 100%;
  }

  .services-comparison-table tbody tr {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--sp-border, #e2e8f0);
  }

  html[data-site-theme="dark"] .services-comparison-table tbody tr {
    border-bottom-color: rgba(255, 255, 255, 0.08);
  }

  .services-comparison-table tbody tr:last-child {
    border-bottom: 0;
  }

  .services-comparison-table td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0;
    border: 0;
    background: transparent !important;
  }

  .services-comparison-table td::before {
    content: attr(data-label);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sp-text-muted);
    flex: 0 0 42%;
  }

  .services-comparison-table td:first-child {
    font-size: 1.03125rem;
    margin-bottom: 0.25rem;
  }

  .services-comparison-table td:first-child::before {
    display: none;
  }

  .services-guide__table-wrap {
    overflow: visible;
  }

  .services-guide__panel {
    padding: 1.25rem 1.1rem;
    border-radius: 1.25rem;
  }
}

@media (max-width: 575.98px) {
  .section-services .service-card-premium__body {
    padding: 1.5rem 1.15rem 1.15rem;
  }

  .section-services .service-card-premium__footer .d-flex {
    flex-direction: column;
  }

  .section-services .service-card-premium__footer .btn-sp {
    width: 100%;
  }

  .services-guide__nav-label {
    flex: 1 0 100%;
    margin-bottom: 0.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .section-services .service-card-premium,
  .section-services .service-card-premium__media img,
  .services-guide__nav a {
    transition: none;
  }

  .section-services .service-card-premium:hover {
    transform: none;
  }
}
