/**
 * Product quick view: trigger button on catalog cards + side drawer.
 *
 * The drawer is theme-owned chrome (no core off-canvas: its admin reset
 * fights the brand styles). Fragment content classes (sdt-qv__*) come from
 * sdt_custom's quick-view.html.twig.
 */

/* --- Trigger on the teaser card. */
.view-id-catalog .product-teaser-small {
  position: relative;
}

.view-id-catalog button.sdt-qv-trigger {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 10px rgba(0, 47, 133, 0.18);
  color: #16233f;
  font-family: "GeneralSans-Variable", system-ui, sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

.view-id-catalog .product-teaser-small:hover button.sdt-qv-trigger,
.view-id-catalog button.sdt-qv-trigger:focus-visible {
  opacity: 1;
  transform: none;
}

.view-id-catalog button.sdt-qv-trigger:hover {
  color: #1551c1;
}

.view-id-catalog button.sdt-qv-trigger.is-loading {
  opacity: 1;
  pointer-events: none;
}

.view-id-catalog button.sdt-qv-trigger.is-loading span::after {
  content: "…";
}

@media (max-width: 991.98px) {
  .view-id-catalog button.sdt-qv-trigger {
    opacity: 1;
    transform: none;
  }
}

/* --- Backdrop + panel. */
.sdt-qv-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1250;
  background: rgba(6, 11, 24, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}

body.sdt-qv-open .sdt-qv-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.sdt-qv {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1260;
  display: flex;
  flex-direction: column;
  width: min(820px, 96vw);
  background: #fff;
  box-shadow: -18px 0 40px rgba(6, 11, 24, 0.25);
  transform: translateX(102%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Width presets, mirroring the copilot drawer (small/medium/large). */
.sdt-qv--small { width: min(640px, 96vw); }
.sdt-qv--medium { width: min(820px, 96vw); }
.sdt-qv--large { width: min(1000px, 96vw); }

body.sdt-qv-open .sdt-qv {
  transform: none;
}

body.sdt-qv-open {
  overflow: hidden;
}

.sdt-qv__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f2;
}

.sdt-qv__head-label {
  font-family: "Parkinsans", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #49505e;
}

.sdt-qv__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: #eef1f6;
  color: #16233f;
  cursor: pointer;
}

.sdt-qv__close:hover {
  background: #e2ebfa;
  color: #1551c1;
}

.sdt-qv__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* --- Fragment content. */
.sdt-qv__gallery {
  display: flex;
  gap: 10px;
  padding: 18px 22px 0;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  cursor: grab;
}

.sdt-qv__gallery.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.sdt-qv__shot {
  flex: 0 0 auto;
  scroll-snap-align: start;
  -webkit-user-drag: none;
  user-select: none;
}

.sdt-qv__img {
  display: block;
  width: 560px;
  max-width: 82vw;
  height: 420px;
  object-fit: cover;
  border-radius: 12px;
  background: #eef1f6;
  -webkit-user-drag: none;
}

.sdt-qv__gallery[data-count="1"] .sdt-qv__shot,
.sdt-qv__gallery[data-count="1"] .sdt-qv__img {
  width: 100%;
}

.sdt-qv__body {
  padding: 22px;
}

.sdt-qv__badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e7f5ec;
  color: #187a41;
  font-family: "GeneralSans-Variable", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
}

.sdt-qv__title {
  margin: 0 0 12px;
  font-family: "Parkinsans", system-ui, sans-serif;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.2;
  text-wrap: balance;
}

.sdt-qv__title a {
  color: #16233f;
  text-decoration: none;
}

.sdt-qv__title a:hover {
  color: #1551c1;
  text-decoration: underline;
}

.sdt-qv__teaser {
  margin: 0 0 18px;
  font-size: 16px;
  line-height: 1.55;
  color: #3c4356;
}

.sdt-qv__materials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.sdt-qv__materials-label {
  font-family: "Parkinsans", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #49505e;
}

.sdt-qv__material {
  padding: 5px 12px;
  border: 1px solid #cdd9ee;
  border-radius: 999px;
  background: #f4f7fc;
  color: #1551c1;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.sdt-qv__material:hover {
  background: #e2ebfa;
}

.sdt-qv__specs {
  margin: 0 0 14px;
  border-top: 1px solid #e2e8f2;
}

.sdt-qv__spec {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid #e2e8f2;
}

.sdt-qv__spec dt {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: #49505e;
}

.sdt-qv__spec dd {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: #16233f;
  text-align: right;
}

.sdt-qv__custom {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f4f7fc;
  font-size: 13px;
  line-height: 1.5;
  color: #3c4356;
}

/* Sticky inside the scroll area: the CTAs stay visible while specs scroll. */
.sdt-qv__actions {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: auto;
  padding: 16px 22px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid #e2e8f2;
  background: #fff;
}

.sdt-qv__cta {
  display: block;
  flex: 1 1 50%;
  padding: 15px 18px;
  border-radius: 10px;
  background: #1551c1;
  color: #fff;
  font-family: "Parkinsans", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.sdt-qv__cta:hover {
  background: #0f409c;
  color: #fff;
}

.sdt-qv__full {
  display: block;
  flex: 1 1 50%;
  padding: 13px 18px;
  border: 2px solid #1551c1;
  border-radius: 10px;
  background: #fff;
  color: #1551c1;
  font-family: "Parkinsans", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.sdt-qv__full:hover {
  background: #e2ebfa;
  color: #1551c1;
}

@media (prefers-reduced-motion: reduce) {
  .sdt-qv,
  .sdt-qv-backdrop,
  .view-id-catalog button.sdt-qv-trigger {
    transition: none;
  }
}

/* Small screens: drawer full width, gallery and actions compact. */
@media (max-width: 767.98px) {
  .sdt-qv {
    width: 100vw;
  }

  .sdt-qv__img {
    height: 300px;
  }

  .sdt-qv__title {
    font-size: 24px;
  }

  .sdt-qv__actions {
    flex-direction: column;
    gap: 10px;
  }

  .sdt-qv__cta,
  .sdt-qv__full {
    width: 100%;
  }
}

/* Short content: push the sticky actions to the panel bottom anyway. */
.sdt-qv__content {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* Fancybox must cover the drawer (its default z-index sits below 1260).
   Set the v5 variable, not the property: the CDN stylesheet can load after
   this aggregate and would win the plain z-index tie by source order. */
:root {
  --fancybox-zIndex: 1300;
}

.fancybox__container {
  z-index: 1300;
}
