/* ============================================================
   product-sales.css — Public product sales flow
   Product-page hero, quote CTAs, delivery/installation areas and
   the product-quote page. Reuses the site's own buttons
   (.btn-primary / .btn-secondary / .btn-white), the reveal
   animations from animations.css and the tokens in variables.css.
   ============================================================ */

/* ── Product page hero ────────────────────────────────────── */
.sales-hero {
  max-width: var(--max-width, 1540px);
  margin: 0 auto;
  padding: calc(var(--header-offset, 110px) + 2.5rem) var(--space-md, 1.5rem) 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: var(--space-xl, 4rem);
  align-items: center;
}

.sales-hero .product-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  padding: 0;
}

.sales-hero .service-eyebrow {
  margin-bottom: 1.1rem;
}

.sales-hero h1 {
  font-family: var(--font-display, inherit);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--color-black, #1a1a1a);
  margin: 0 0 1rem;
  overflow-wrap: anywhere;
}

.sales-description {
  max-width: 620px;
  font-size: clamp(1.03rem, 0.98rem + 0.28vw, 1.15rem);
  color: var(--color-gray-600, #6b7280);
  line-height: 1.68;
}

.sales-hero-image {
  background: var(--color-white, #fff);
  border: 1px solid var(--color-gray-200, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
}

.sales-hero-image img {
  display: block;
  width: 100%;
  height: clamp(260px, 30vw, 440px);
  padding: 1.5rem;
  object-fit: contain;
}

/* ── Hero 3D model (hero-3d.js): photo first, then the model crossfades in ── */
.sales-hero-image {
  position: relative;
}

.sales-hero-3d-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.05rem;
  border: 0;
  border-radius: var(--radius-pill, 100px);
  background: rgba(17, 17, 17, 0.84);
  color: var(--color-white, #fff);
  font-family: var(--font-body, inherit);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  transition: background 0.2s ease, transform 0.2s ease;
}

.sales-hero-3d-btn:hover {
  background: #000;
  transform: translateY(-1px);
}

.sales-hero-3d-btn:focus-visible {
  outline: 3px solid var(--color-accent-light, #bae6fd);
  outline-offset: 2px;
}

.sales-hero-3d-btn:disabled {
  cursor: progress;
}

.sales-hero-3d-btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

/* The model loads hidden over the photo, then the two crossfade (.is-ready).
   It takes no touches until it is live, so page swipes never get caught. */
.sales-hero-image .sales-hero-3d {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: auto;
  max-width: none;
  height: auto;
  margin: 0;
  padding: 0;
  border-radius: inherit;
  background: var(--color-white, #fff);
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}

.sales-hero-image > img {
  transition: opacity 0.7s ease;
}

.sales-hero-image.is-ready .sales-hero-3d {
  opacity: 1;
}

.sales-hero-image.is-ready > img {
  opacity: 0;
}

.sales-hero-image.is-live .sales-hero-3d {
  pointer-events: auto;
}

/* The status pill is a label, not a control. */
span.sales-hero-3d-btn {
  cursor: default;
  pointer-events: none;
}

/* MyAR frames carry a margin of their own; crop it like the tab viewers did. */
.sales-hero-3d--myar iframe {
  width: 112%;
  height: 112%;
  top: -6%;
  left: -6%;
}

/* Information tab of the steel tiles: the model moved to the hero, the two photos share the row. */
.product-info-media.product-info-media--photos {
  grid-template-columns: 1fr;
}

.product-info-media--photos .product-info-images-vertical {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto;
}

.product-info-media--photos .product-info-images-vertical img {
  height: clamp(150px, 24vw, 320px);
}

/* ── Availability chips + actions ─────────────────────────── */
.sales-availability {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.65rem;
  padding: 0;
  margin: 1.5rem 0;
  list-style: none;
}

.sales-availability li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.9rem;
  background: var(--color-white, #fff);
  border: 1px solid var(--color-gray-200, #e5e7eb);
  border-radius: var(--radius-pill, 100px);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-gray-700, #374151);
}

.sales-availability li::before {
  content: '\2713';
  font-weight: 800;
  color: var(--color-black, #1a1a1a);
}

.sales-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.sales-note {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--color-gray-500, #6b7280);
  line-height: 1.6;
}

.sales-note a {
  color: var(--color-black, #1a1a1a);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Delivery / installation areas ────────────────────────── */
.sales-areas {
  max-width: var(--max-width, 1540px);
  margin: 0 auto;
  padding: var(--space-lg, 3rem) var(--space-md, 1.5rem) 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md, 1.5rem);
}

.sales-areas > div {
  background: var(--color-white, #fff);
  border: 1px solid var(--color-gray-200, #e5e7eb);
  border-radius: 12px;
  padding: 1.75rem 2rem;
}

.sales-areas h2 {
  font-family: var(--font-display, inherit);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 0.6rem;
}

.sales-areas p {
  margin: 0;
  color: var(--color-gray-600, #6b7280);
  line-height: 1.7;
}

/* ── CTA banner with three actions (pricing / install / call) ── */
.cta-banner--sales .cta-banner-inner {
  gap: 2rem;
}

.cta-banner--sales .cta-banner-text {
  flex: 1 1 300px;
  min-width: 240px;
}

.cta-banner--sales .cta-banner-text p {
  max-width: 420px;
}

/* The phone number rides under the banner text; the two buttons are the purchase paths. */
.cta-banner--sales .cta-banner-text .cta-banner-call {
  margin-top: 0.6rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.72);
}

.cta-banner-call a {
  color: var(--color-white, #fff);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.cta-banner-actions--sales {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
  flex: 0 1 auto;
  max-width: 620px;
  margin-left: auto;
  margin-right: clamp(6rem, 13vw, 11rem); /* clears the rotated warranty stamp */
}

/* ── Products catalogue hero ──────────────────────────────── */
.product-sales-index .service-pan-wrapper {
  padding-top: calc(var(--header-offset, 110px) + 3.5rem);
}

.product-sales-index .service-headline {
  font-size: clamp(1.9rem, 4.2vw, 3.4rem);
}

.product-sales-index .pan-header {
  margin-bottom: 1rem;
}

.product-sales-index .sales-availability,
.product-sales-index .sales-actions {
  justify-content: center;
}

.product-sales-index .sales-note {
  text-align: center;
}

/* ── Product quote page ───────────────────────────────────── */
.product-inquiry-page .service-pan-wrapper {
  padding-top: calc(var(--header-offset, 110px) + 3.5rem);
  padding-bottom: 0;
}

.product-inquiry-page .pan-header {
  margin-bottom: 0.5rem;
}

.product-inquiry-page .sales-availability {
  justify-content: center;
  margin: 1.75rem 0 0;
}

.product-inquiry-page .contact-section {
  padding-bottom: var(--space-lg, 3rem);
}

.product-inquiry-page .sales-areas {
  padding-top: 0;
  padding-bottom: var(--space-xl, 4rem);
}

#contact-form,
#request-pricing {
  scroll-margin-top: calc(var(--header-offset, 110px) + 1rem);
}

/* ── Thank You page (conversion landing after an accepted request) ── */
.thank-you {
  padding: calc(var(--header-offset, 110px) + 4rem) var(--space-md, 1.5rem) var(--space-xl, 4rem);
  text-align: center;
}

.thank-you-inner {
  max-width: 640px;
  margin: 0 auto;
}

.thank-you-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 1.25rem;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  font-size: 1.9rem;
  font-weight: 800;
}

.thank-you .service-sub {
  margin: 1rem auto 2rem;
}

.thank-you .sales-actions {
  justify-content: center;
}

.thank-you [hidden] {
  display: none !important;
}

.product-inquiry-page .form-group {
  min-width: 0;
}

.product-inquiry-page .form-group select {
  text-overflow: ellipsis;
}

/* ── Soft-opening dropdowns (product-select.js) ───────────── */
.nice-select {
  position: relative;
}

.nice-select-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  background: var(--color-white);
  font: inherit;
  font-size: 1rem;
  color: var(--color-black);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.nice-select-toggle:hover {
  border-color: var(--color-gray-300);
}

.nice-select-toggle:focus-visible,
.nice-select-toggle[aria-expanded="true"] {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

.nice-select-toggle.is-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.nice-select-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nice-select-toggle.is-placeholder .nice-select-value {
  color: var(--color-gray-500);
}

.nice-select-toggle svg {
  flex: none;
  color: #8a8a8a;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.nice-select-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.nice-select-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: 12px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px) scale(0.985);
  transform-origin: top center;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.nice-select-panel.is-above {
  top: auto;
  bottom: calc(100% + 6px);
  transform: translateY(6px) scale(0.985);
  transform-origin: bottom center;
}

.nice-select-panel.is-open {
  opacity: 1;
  transform: none;
}

.nice-select-filter {
  display: block;
  width: 100%;
  padding: 0.7rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--color-gray-200);
  border-radius: 0;
  font: inherit;
  font-size: 0.95rem;
  color: var(--color-black);
  outline: none;
  appearance: none;
}

.nice-select-filter::placeholder {
  color: var(--color-gray-500);
}

.nice-select-list {
  position: relative;
  max-height: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 0.4rem 0;
  list-style: none;
  outline: none;
}

.nice-select-group {
  padding: 0.65rem 1rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gray-500);
}

.nice-select-list [role="option"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
  color: var(--color-black);
  cursor: pointer;
}

.nice-select-list [role="option"].is-active {
  background: var(--color-gray-100);
}

.nice-select-list [role="option"][aria-selected="true"] {
  font-weight: 600;
}

.nice-select-list [role="option"][aria-selected="true"]::after {
  content: '\2713';
  font-size: 0.85rem;
}

.nice-select-list .nice-select-placeholder {
  color: var(--color-gray-500);
}

.nice-select-empty {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--color-gray-500);
}

.nice-select-native {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.form-success {
  animation: sales-success 0.22s ease-out;
}

@keyframes sales-success {
  from { transform: translateY(6px); }
  to { transform: translateY(0); }
}

/* ── Phone ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sales-hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: calc(var(--header-offset, 110px) + 1.25rem) var(--space-md, 1rem) 2rem;
  }

  .sales-hero-image {
    order: -1;
  }

  /* Short photo so title, chips and both purchase buttons fit the first phone screen. */
  .sales-hero-image img {
    height: 150px;
    padding: 0.75rem;
  }

  .sales-hero h1 {
    font-size: clamp(1.9rem, 8vw, 2.6rem);
  }

  .sales-availability {
    gap: 0.5rem;
    margin: 1.25rem 0;
  }

  .sales-availability li {
    font-size: 0.8rem;
    padding: 0.38rem 0.8rem;
  }

  .sales-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .sales-actions .btn-primary,
  .sales-actions .btn-secondary {
    width: 100%;
    /* "Get Product + Installation Quote" stays on one line at 360 px. */
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    letter-spacing: 0.01em;
    text-align: center;
  }

  .sales-areas {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: var(--space-lg, 2rem) var(--space-md, 1rem) 0;
  }

  .sales-areas > div {
    padding: 1.35rem 1.25rem;
  }

  .cta-banner--sales .cta-banner-inner {
    flex-direction: column;
  }

  .cta-banner--sales .cta-banner-text {
    flex: none;
    min-width: 0;
  }

  .cta-banner--sales .cta-banner-text p {
    white-space: normal;
    max-width: none;
  }

  .cta-banner-actions--sales {
    flex-direction: column;
    gap: 0.55rem;
    margin-right: 0;
  }

  .cta-banner--sales .cta-banner-actions .btn-primary,
  .cta-banner--sales .cta-banner-actions .btn-white {
    width: 100%;
    flex: none;
    padding: 0.7rem 0.8rem;
  }

  .product-inquiry-page .form-row {
    grid-template-columns: 1fr;
  }

  .product-inquiry-page .sales-areas {
    padding-bottom: var(--space-lg, 2rem);
  }
}

@media (max-width: 768px) {
  .nice-select-list {
    max-height: 50vh;
  }
}

/* ── Phone: compact product page ───────────────────────────
   Reading order breadcrumb → category → name → photo → description →
   availability → buttons. The copy column dissolves (display: contents)
   so the photo can sit under the name without touching the 117 pages'
   markup; desktop keeps its two columns. Sizes step down from the
   desktop scale so the page reads like a phone page. */
@media (max-width: 768px) {
  .sales-hero {
    display: flex;
    flex-direction: column;
    align-items: stretch; /* the desktop grid's align-items: center would centre every line */
    gap: 0;
    padding: calc(var(--header-offset, 80px) + 1rem) var(--space-md, 1rem) 1.75rem;
  }

  .sales-hero .sales-hero-copy {
    display: contents;
  }

  .sales-hero .product-breadcrumb { order: 1; margin: 0 0 0.7rem; font-size: 0.8rem; }
  .sales-hero .service-eyebrow { order: 2; align-self: flex-start; margin: 0 0 0.65rem; padding: 0.35rem 0.8rem; font-size: 0.7rem; }
  .sales-hero h1 { order: 3; margin: 0 0 0.85rem; font-size: clamp(1.65rem, 7.4vw, 2.1rem); }
  .sales-hero .sales-hero-image { order: 4; margin: 0 0 1rem; }
  .sales-hero .sales-description { order: 5; margin: 0; font-size: 0.95rem; line-height: 1.55; }
  .sales-hero .sales-availability { order: 6; margin: 0.9rem 0 1rem; gap: 0.4rem; }
  .sales-hero .sales-actions { order: 7; }
  .sales-hero .sales-note { order: 8; }

  /* Above the fold on arrival: no staggered fade leaving a hole where the photo goes. */
  .sales-hero .sales-hero-image.reveal-up {
    opacity: 1;
    transform: none;
    transition: none;
  }

  /* Wide box. The photo is trimmed to the product (images/products/hero/), so it fills
     the box at about the size the model shows. */
  .sales-hero .sales-hero-image img {
    height: auto;
    aspect-ratio: 16 / 9;
    padding: 0.6rem;
  }

  /* The model is drawn as if the box were square (the size that reads well on a phone),
     centred, with the top and bottom cropped by the wide box. */
  .sales-hero .sales-hero-image .sales-hero-3d iframe {
    top: 50%;
    height: auto;
    aspect-ratio: 1 / 1;
    transform: translateY(-50%);
  }

  .sales-hero-3d-btn {
    right: 8px;
    bottom: 8px;
    padding: 0.5rem 0.95rem;
    font-size: 0.8rem;
  }

  .sales-availability li {
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
  }

  .sales-actions {
    gap: 0.55rem;
  }

  .sales-actions .btn-primary,
  .sales-actions .btn-secondary {
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    font-size: 0.95rem;
  }

  .sales-note {
    margin-top: 0.75rem;
    font-size: 0.82rem;
  }

  /* Product tabs: three across (two short rows) and body text at phone size. */
  .product-tabs-section .product-tabs-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .product-tabs-section .product-tabs-nav .product-tab-btn {
    min-height: 2.6rem;
    padding: 0.45rem 0.35rem;
    font-size: 0.66rem;
    line-height: 1.2;
  }

  .product-tabs-section .product-info-text {
    font-size: 0.95rem;
    line-height: 1.65;
  }

  .sales-areas > div {
    padding: 1.1rem 1.15rem;
  }

  .sales-areas h2 {
    font-size: 0.95rem;
  }

  .sales-areas p {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  /* The site-wide phone banner shrinks text to ~11 px; the sales banner has room to read normally. */
  .cta-banner--sales .cta-banner-text h2 {
    font-size: 1.15rem;
  }

  .cta-banner--sales .cta-banner-text p {
    font-size: 0.85rem;
    line-height: 1.45;
  }

  .cta-banner--sales .cta-banner-actions .btn-primary,
  .cta-banner--sales .cta-banner-actions .btn-white {
    padding: 0.75rem 0.8rem;
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .form-success {
    animation: none;
  }

  .nice-select-panel,
  .nice-select-toggle svg,
  .sales-hero-3d-btn,
  .sales-hero-image .sales-hero-3d,
  .sales-hero .sales-hero-image img {
    transition: none;
  }
}
