/*
 * Focused conversion-surface refinements.
 *
 * Loaded after the base and redesign styles so the live consent component,
 * floating contact action, and systems archive can be tuned without
 * disturbing the established SONIFRA design system.
 */

/* Homepage: remove the duplicated material rail and keep one clear browsing path. */
@media (min-width: 861px) {
  .cwp-material-home .cwp-header--material .cwp-nav {
    gap: clamp(20px, 1.6vw, 28px);
    font-size: 14px;
  }

  .cwp-material-home .cwp-header--material .cwp-nav .cwp-nav__submenu a {
    min-height: 42px;
    padding: 12px 14px;
  }

  .cwp-material-home .cwp-material-hero__stage {
    grid-template-columns: minmax(410px, 0.72fr) minmax(0, 1.28fr);
  }

  .cwp-material-home .cwp-system-selector {
    grid-template-columns: minmax(200px, 0.34fr) minmax(0, 1.66fr);
  }

  .cwp-material-home .cwp-application-stories {
    grid-template-columns: minmax(0, 1fr);
  }
}

.cwp-material-home .cwp-system-choice--pet {
  color: #fff;
}

/* Local preview only: mirror the layout supplied by the Complianz plugin. */
.cmplz-cookiebanner[data-cwp-consent-preview] {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 99999;
  display: grid;
  grid-template-columns: 1fr;
  color: #171918;
  background: #fff;
}

.cmplz-cookiebanner[data-cwp-consent-preview] .cmplz-header,
.cmplz-cookiebanner[data-cwp-consent-preview] .cmplz-buttons,
.cmplz-cookiebanner[data-cwp-consent-preview] .cmplz-documents {
  display: flex;
}

.cmplz-cookiebanner[data-cwp-consent-preview] .cmplz-header {
  justify-content: space-between;
}

.cmplz-cookiebanner[data-cwp-consent-preview] .cmplz-close {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
}

.cmplz-cookiebanner[data-cwp-consent-preview] .cmplz-buttons {
  align-items: stretch;
}

.cmplz-cookiebanner[data-cwp-consent-preview] .cmplz-btn {
  border: 1px solid #deddd8;
  color: #171918;
  background: #f6f5f2;
}

.cmplz-cookiebanner[data-cwp-consent-preview] .cmplz-documents {
  align-items: center;
}

.cmplz-cookiebanner[data-cwp-consent-preview] .cmplz-link {
  color: #595d5a;
  text-decoration: underline;
}

/* Bring product comparison into the first desktop viewport. */
.cwp-page-hero--systems {
  min-height: clamp(360px, 27vw, 410px);
  padding-top: clamp(72px, 6vw, 94px);
  padding-bottom: 50px;
}

.cwp-page-hero--systems h1 {
  max-width: 640px;
  margin-bottom: 18px;
  font-size: clamp(40px, 4.2vw, 60px);
}

.cwp-page-hero--systems > p:last-child {
  max-width: 560px;
  font-size: 16px;
  line-height: 1.5;
}

.cwp-page-hero--systems + .cwp-catalog {
  padding-top: clamp(44px, 4vw, 60px);
}

/* Compact, brand-aligned Complianz first layer. Expanded preferences remain available. */
#cmplz-cookiebanner-container .cmplz-cookiebanner.banner-1 {
  width: min(460px, calc(100vw - 32px)) !important;
  max-height: calc(100dvh - 32px) !important;
  padding: 14px 16px 12px !important;
  gap: 10px !important;
  border: 1px solid rgba(21, 23, 22, 0.16) !important;
  border-radius: 2px !important;
  box-shadow: 0 18px 46px rgba(21, 23, 22, 0.22) !important;
  font-family: inherit !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-header {
  min-height: 24px !important;
  align-items: center !important;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-title {
  font-size: 14px !important;
  font-weight: 650 !important;
  line-height: 1.2 !important;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-close {
  width: 24px !important;
  height: 24px !important;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-message {
  font-size: 11.5px !important;
  line-height: 1.45 !important;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons {
  display: flex !important;
  gap: 6px !important;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-btn {
  flex: 1 1 0 !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 40px !important;
  padding: 0 10px !important;
  border-radius: 1px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-accept {
  color: #fff !important;
  background: #cf473d !important;
  border-color: #cf473d !important;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-accept:hover,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-accept:focus-visible {
  background: #b83d34 !important;
  border-color: #b83d34 !important;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-documents {
  gap: 10px !important;
  justify-content: flex-end !important;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-documents .cmplz-link {
  font-size: 10.5px !important;
}

/* A quieter floating contact control; the accessible label remains on the link. */
.cwp-whatsapp-contact {
  width: 50px;
  height: 50px;
  min-height: 50px;
  padding: 0;
  justify-content: center;
  color: #fff;
  background: #1b392c;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  box-shadow: 0 12px 30px rgba(21, 23, 22, 0.2);
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  bottom: var(--cwp-floating-contact-bottom, 22px);
}

.cwp-site-footer__contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 20px;
  font-size: 12px;
}

.cwp-site-footer__contact a {
  color: inherit;
  text-underline-offset: 3px;
}

.cwp-whatsapp-contact svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
}

.cwp-whatsapp-contact span {
  position: absolute;
  left: calc(100% + 10px);
  padding: 7px 9px;
  color: #fff;
  background: #171918;
  border-radius: 2px;
  opacity: 0;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.cwp-whatsapp-contact:hover,
.cwp-whatsapp-contact:focus-visible {
  color: #fff;
  background: #176b45;
  box-shadow: 0 16px 34px rgba(21, 23, 22, 0.26);
  transform: translateY(-2px);
}

.cwp-whatsapp-contact:hover span,
.cwp-whatsapp-contact:focus-visible span {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 820px) {
  .cwp-page-hero {
    --cwp-page-hero-image: url("../images/hero-slat-sm.webp");
  }

  .cwp-page-hero--systems {
    --cwp-page-hero-image: url("../images/system-slat-detail-sm.webp");
  }

  .cwp-page-hero--finishes {
    --cwp-page-hero-image: url("../images/hero-finishes-materials-sm.webp");
  }

  .cwp-page-hero--applications {
    --cwp-page-hero-image: url("../images/application-public-slat-sm.webp");
  }

  .cwp-page-hero--projects {
    --cwp-page-hero-image: url("../images/material-walnut-smoke-sm.webp");
  }

  .cwp-page-hero--resources {
    --cwp-page-hero-image: url("../images/hero-resources-assembly-sm.webp");
  }

  .cwp-page-hero--factory {
    --cwp-page-hero-image: url("../images/hero-about-coordination-sm.webp");
  }

  .cwp-page-hero--quote {
    --cwp-page-hero-image: url("../images/hero-quote-project-review-sm.webp");
  }

  .cwp-page-hero--distributor {
    --cwp-page-hero-image: url("../images/application-office-sm.webp");
  }

  .cwp-page-hero--faq {
    --cwp-page-hero-image: url("../images/application-education-slat-sm.webp");
  }

  .cwp-page-hero--insights {
    --cwp-page-hero-image: url("../images/hero-insights-studio-sm.webp");
  }

  .cwp-home-faq {
    background-image: url("../images/hero-slat-sm.webp");
  }

  .cwp-page-hero--systems {
    min-height: 500px;
    padding: 206px 20px 36px;
  }

  .cwp-page-hero--systems::before {
    height: 180px;
  }

  .cwp-page-hero--systems::after {
    top: 146px;
  }

  .cwp-page-hero--systems h1 {
    margin-bottom: 16px;
    font-size: clamp(36px, 10vw, 44px);
    line-height: 1;
  }

  .cwp-page-hero--systems > p:last-child {
    font-size: 14px;
    line-height: 1.48;
  }

  .cwp-page-hero--systems + .cwp-catalog {
    padding-top: 40px;
  }
}

@media (max-width: 600px) {
  #cmplz-cookiebanner-container .cmplz-cookiebanner.banner-1 {
    right: 8px !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    left: 8px !important;
    width: auto !important;
    max-height: calc(100dvh - 16px - env(safe-area-inset-bottom)) !important;
    padding: 12px 12px 10px !important;
    gap: 8px !important;
  }

  #cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-header {
    min-height: 20px !important;
  }

  #cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-title {
    font-size: 13px !important;
  }

  #cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-message {
    font-size: 11px !important;
    line-height: 1.38 !important;
  }

  #cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 5px !important;
  }

  #cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-btn {
    width: 100% !important;
    min-height: 42px !important;
    padding: 0 5px !important;
    font-size: 10.5px !important;
  }

  #cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-documents {
    gap: 8px !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
  }

  #cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-documents .cmplz-link {
    font-size: 10px !important;
  }

  .cwp-whatsapp-contact {
    bottom: var(--cwp-floating-contact-bottom, 14px);
    left: 14px;
    width: 46px;
    height: 46px;
    min-height: 46px;
    padding: 0;
  }

  .cwp-whatsapp-contact span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cwp-whatsapp-contact,
  .cwp-whatsapp-contact span {
    transition: none;
  }
}
