/* GlamHair Virtual Try-On — storefront launcher styles */

.glamhair-tryon-launch {
  display: block;
  margin: 16px 0;
}

.glamhair-tryon-button,
.glamhair-tryon-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  /* Palette "roses": principale #d19486, hover #b28077. */
  background: #d19486;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  max-width: 100%;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.glamhair-tryon-button:hover,
.glamhair-tryon-btn:hover {
  background: #b28077;
  color: #fff;
}

/* Native placement: above the add-to-cart row. */
.glamhair-tryon-native {
  display: flex;
  justify-content: center;
  /* Hugs the text: no stretching to the column width. */
  width: fit-content !important;
  min-width: 0 !important;
  max-width: 100%;
  flex: 0 0 auto;
  margin: 0 0 12px;
  background: #d19486;
  color: #fff;
  border-radius: 6px;
  padding: 0.7rem 0.8rem;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.glamhair-tryon-native:hover {
  background: #b28077;
}

.glamhair-tryon-ai-icon {
  flex: 0 0 auto;
  width: 1.15em;
  height: 1.15em;
}

.glamhair-tryon-spark {
  font-size: 1rem;
}

.glamhair-tryon-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.glamhair-tryon-modal {
  position: relative;
  width: 480px;
  max-width: 100%;
  height: 860px;
  /* dvh = the visible viewport: on phones 90vh is taller than the screen
     area left by the browser bars, and the popup came out cut. */
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.glamhair-tryon-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.glamhair-tryon-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.glamhair-tryon-close:hover {
  background: rgba(0, 0, 0, 0.75);
}

/* Phones: the popup takes the whole visible screen. */
@media (max-width: 600px) {
  .glamhair-tryon-overlay {
    padding: 0;
    align-items: stretch;
  }

  .glamhair-tryon-modal {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
  }

  .glamhair-tryon-close {
    top: max(8px, env(safe-area-inset-top));
  }
}

/* The app's dialog has its own X while it is open: one close button only. */
.glamhair-tryon-modal.glamhair-dialog-open .glamhair-tryon-close {
  display: none;
}

/* Phones: full label "PROVA LE EXTENSION SU DI TE" on one line. */
@media (max-width: 420px) {
  .glamhair-tryon-native {
    padding: 0.65rem 0.9rem;
    font-size: 0.82rem;
    letter-spacing: 0;
    gap: 0.4rem;
  }
}
@media (max-width: 340px) {
  .glamhair-tryon-native {
    font-size: 0.74rem;
  }
}
