/*
 * Shared product-mode component
 *
 * Products and Build Your Order intentionally share this workspace and switch.
 * Page-specific catalog and builder styles remain in their own stylesheets.
 */

body.product-mode-page .product-mode-workspace {
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  width: 100vw;
  max-width: 100vw;
  min-width: 0;
  margin: 0 0 64px calc(50% - 50vw);
  padding: clamp(18px, 2vw, 38px) clamp(20px, 3vw, 56px) 0;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 180ms ease, transform 180ms ease;
  animation: product-mode-workspace-enter 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.product-mode-page .product-mode-surface {
  box-sizing: border-box;
  width: 100%;
  min-height: calc(100svh - 188px);
  margin: 0;
  padding: clamp(32px, 3.5vw, 62px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

/* The red divider is deliberately fixed at the center; it never represents state. */
body.product-mode-page .product-mode-switch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 460px);
  margin: 0 auto clamp(34px, 3vw, 48px);
  overflow: hidden;
  border: 1px solid rgba(235, 234, 229, 0.34);
  border-radius: 0;
  background: #0d0f0f;
  box-shadow: none;
}

body.product-mode-page .product-mode-switch::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 50%;
  z-index: 2;
  width: 6px;
  background: #d93629;
  pointer-events: none;
  transform: translateX(-50%);
}

body.product-mode-page .product-mode-switch__link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 62px;
  padding: 0 18px;
  color: #f7f6f1;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.015em;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 160ms ease, color 160ms ease;
}

body.product-mode-page .product-mode-switch__link[aria-current="page"] {
  background: #222625;
  color: #ffffff;
}

body.product-mode-page .product-mode-switch__link:focus-visible {
  position: relative;
  z-index: 3;
  outline: 2px solid #f7f6f1;
  outline-offset: -5px;
}

body.product-mode-page.product-mode-leaving .product-mode-workspace {
  opacity: 0;
  transform: translateY(10px);
}

@keyframes product-mode-workspace-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  body.product-mode-page .product-mode-workspace {
    width: 100vw;
    max-width: 100vw;
    margin: 0 0 44px calc(50% - 50vw);
    padding: 12px;
  }

  body.product-mode-page .product-mode-surface {
    min-height: calc(100svh - 156px);
    padding: 26px 18px 32px;
  }

  body.product-mode-page .product-mode-switch {
    width: 100%;
    margin-bottom: 30px;
  }

  body.product-mode-page .product-mode-switch__link {
    min-height: 56px;
    padding-inline: 8px;
    font-size: clamp(0.9rem, 3.8vw, 1rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.product-mode-page .product-mode-workspace,
  body.product-mode-page .product-mode-switch__link {
    animation: none;
    transition: none;
  }
}
