/* --------------------------------------------------------------------------
   Base layout and shared visibility
   -------------------------------------------------------------------------- */

[hidden] {
  display: none !important;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body > .min-h-screen,
header,
main,
footer,
section {
  width: 100%;
  min-width: 0;
}

.container-page {
  min-width: 0;
  max-width: min(var(--container-7xl), 100vw);
}

body.nav-open {
  overflow: hidden;
}

/* Database-rendered services and article content */

.article-copy {
  color: var(--foreground);
  font-size: 1.05rem;
  line-height: 1.85;
}

.article-copy p {
  margin: 0 0 1.4rem;
}

@media (min-width: 1024px) {
  .managed-service--reverse .managed-service__lead {
    order: 2;
  }
}

/* --------------------------------------------------------------------------
   Mobile navigation drawer
   -------------------------------------------------------------------------- */

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.mobile-nav__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgb(15 23 42 / 0.62);
  backdrop-filter: blur(3px);
}

.mobile-nav__panel {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(88vw, 23rem);
  overflow-y: auto;
  background: var(--background);
  box-shadow: -24px 0 64px rgb(15 23 42 / 0.2);
  padding: 1.25rem;
  animation: mobile-panel-in 180ms ease-out both;
}

.mobile-nav__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.mobile-nav__title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.mobile-nav__close,
.contact-shortcuts__close {
  display: inline-grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--background);
  color: var(--foreground);
  font-size: 1.65rem;
  line-height: 1;
}

.mobile-nav__links {
  display: grid;
  gap: 0.25rem;
  padding: 1rem 0;
}

.mobile-nav__links a {
  border-radius: 0.75rem;
  color: var(--foreground);
  font-weight: 650;
  padding: 0.8rem 0.9rem;
}

.mobile-nav__links a:hover,
.mobile-nav__links a[aria-current="page"] {
  color: var(--brand);
  background: var(--muted);
}

.mobile-nav__quote {
  display: block;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-foreground);
  font-weight: 700;
  padding: 0.85rem 1rem;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Floating contact shortcuts
   -------------------------------------------------------------------------- */

.contact-shortcuts {
  position: fixed;
  right: 1.25rem;
  bottom: 5.25rem;
  z-index: 70;
  width: min(calc(100vw - 2.5rem), 21rem);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--card);
  color: var(--foreground);
  box-shadow: 0 24px 70px rgb(15 23 42 / 0.24);
  padding: 1.25rem;
  animation: contact-panel-in 160ms ease-out both;
}

.contact-shortcuts__close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 2rem;
  height: 2rem;
  font-size: 1.25rem;
}

.contact-shortcuts strong {
  display: block;
  padding-right: 2rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
}

.contact-shortcuts p {
  margin: 0.4rem 0 1rem;
  color: var(--muted-foreground);
  font-size: 0.85rem;
  line-height: 1.55;
}

.contact-shortcuts a {
  display: block;
  margin-top: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.7rem 0.9rem;
  color: var(--foreground);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}

.contact-shortcuts a:first-of-type {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--brand-foreground);
}

/* --------------------------------------------------------------------------
   Product catalogue controls
   -------------------------------------------------------------------------- */

.catalogue-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 18rem) auto;
  gap: 0.5rem 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.catalogue-field {
  display: grid;
  gap: 0.45rem;
}

.catalogue-tools label {
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 700;
}

.catalogue-tools input,
.catalogue-tools select {
  width: 100%;
  min-height: 3rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--foreground);
  padding: 0.7rem 1rem;
  outline: none;
}

.catalogue-tools input:focus,
.catalogue-tools select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(223 34 37 / 0.16);
}

.catalogue-status {
  color: var(--muted-foreground);
  font-size: 0.8rem;
  white-space: nowrap;
  padding-bottom: 0.85rem;
}

.catalogue-empty {
  border: 1px dashed var(--border);
  border-radius: 1rem;
  margin-top: 1.5rem;
  padding: 2.5rem 1rem;
  text-align: center;
}

.catalogue-empty strong,
.catalogue-empty span {
  display: block;
}

.catalogue-empty span {
  margin-top: 0.35rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   FAQ feedback and shared notifications
   -------------------------------------------------------------------------- */

.faq-answer {
  animation: faq-answer-in 150ms ease-out both;
}

.site-toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  z-index: 100;
  width: max-content;
  max-width: calc(100vw - 2rem);
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--ink);
  color: var(--ink-foreground);
  box-shadow: 0 16px 50px rgb(15 23 42 / 0.25);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 650;
  text-align: center;
  animation: toast-in 180ms ease-out both;
}

.site-toast--leaving {
  opacity: 0;
  transition: opacity 200ms ease;
}

a[aria-disabled="true"] {
  opacity: 0.55;
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */

@keyframes mobile-panel-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes contact-panel-in {
  from { opacity: 0; transform: translateY(0.5rem) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes faq-answer-in {
  from { opacity: 0; transform: translateY(-0.25rem); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 0.5rem); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* --------------------------------------------------------------------------
   Responsive and accessibility preferences
   -------------------------------------------------------------------------- */

@media (min-width: 1024px) {
  .mobile-nav {
    display: none !important;
  }
}

@media (max-width: 639px) {
  .catalogue-tools {
    grid-template-columns: 1fr;
  }

  [data-content-filters="products"] {
    display: none;
  }

  .catalogue-status {
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-nav__panel,
  .contact-shortcuts,
  .faq-answer,
  .site-toast {
    animation: none;
  }
}
