/*!
 * Point AI — Makeup virtual try-on, page integration styles  v1.0.0
 * Everything is scoped to .pai-* / [data-pointai-*] so it can't affect the shop's own styles.
 * Theme it by overriding the variables on #pointai-makeup-tryon (see INTEGRATION.md).
 */
.pai-root {
  --pai-width: 440px;           /* drawer width */
  --pai-height: 680px;          /* height of the try-on area in inline mode */
  --pai-z: 2147483000;          /* above shop headers / chat widgets */
  --pai-bg: #fbfaf8;
  --pai-ink: #2f2c28;
  --pai-text: #1e1e1e;
  --pai-muted: rgba(30, 30, 30, 0.5);
  --pai-soft: #f3f3ee;
  --pai-radius: 20px;
  --pai-font: inherit;          /* uses the shop's font by default */
  --pai-title-font: inherit;
  --pai-shadow: -12px 0 48px rgba(0, 0, 0, 0.14);
}
.pai-root, .pai-root * { box-sizing: border-box; }
.pai-root button { font: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0; cursor: pointer; }
.pai-root button:focus-visible { outline: 2px solid #91b2ff; outline-offset: 2px; }

/* ---- Panel (shared) ----------------------------------------------------------- */
.pai-panel {
  display: flex;
  flex-direction: column;
  background: var(--pai-bg);
  color: var(--pai-text);
  font-family: var(--pai-font);
  line-height: 1.35;
}
.pai-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; }
.pai-titles { min-width: 0; }
.pai-eyebrow { margin: 0; font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pai-muted); }
.pai-title { margin: 3px 0 0; font-family: var(--pai-title-font); font-size: 22px; font-weight: 500; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pai-close { flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--pai-soft) !important; color: var(--pai-ink) !important; }
.pai-stage { position: relative; flex: 1; min-height: 320px; margin: 0 14px; border-radius: var(--pai-radius); overflow: hidden; background: #d9d2c8; }
.pai-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.pai-foot { display: flex; flex-direction: column; gap: 8px; padding: 12px 18px 14px; }
.pai-foot[hidden] { display: none; }
.pai-wear-head { display: flex; align-items: center; justify-content: space-between; }
.pai-root .pai-link { font-size: 12px; color: var(--pai-muted) !important; text-decoration: underline; text-underline-offset: 2px; }
.pai-root .pai-link[hidden] { display: none; }
.pai-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; }
.pai-none { font-size: 13px; color: var(--pai-muted); line-height: 30px; }
.pai-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 30px; padding: 0 5px 0 12px; border-radius: 999px; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07); font-size: 12px; }
.pai-chip.is-pending { opacity: 0.6; }
.pai-chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pai-chip-x { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--pai-soft) !important; font-size: 14px !important; line-height: 1; }
.pai-powered { margin: 2px 0 0; font-size: 11px; color: var(--pai-muted); text-align: right; }
.pai-powered strong { font-weight: 600; color: var(--pai-text); }

/* ---- Drawer mode (default) ------------------------------------------------------ */
.pai-mode-drawer .pai-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: var(--pai-z);
  width: var(--pai-width);
  max-width: 100vw;
  box-shadow: var(--pai-shadow);
  transform: translateX(105%);
  /* Kept laid out (not display:none) so the iframe has its real size when it starts. */
  visibility: hidden;
  transition: transform 0.35s ease, visibility 0s linear 0.35s;
}
.pai-mode-drawer.pai-left .pai-panel { right: auto; left: 0; transform: translateX(-105%); box-shadow: 12px 0 48px rgba(0, 0, 0, 0.14); }
.pai-mode-drawer.pai-open .pai-panel { transform: none; visibility: visible; transition: transform 0.35s ease, visibility 0s; }

/* ---- Inline mode: the try-on sits where the mount div is ------------------------- */
.pai-mode-inline .pai-panel { position: relative; height: var(--pai-height); border-radius: calc(var(--pai-radius) + 6px); }

/* ---- Phones: full-screen drawer, page behind doesn't scroll ----------------------- */
@media (max-width: 640px) {
  .pai-mode-drawer .pai-panel { width: 100vw; }
  .pai-head { padding: 12px 14px 8px; }
  .pai-stage { margin: 0 10px; }
  .pai-foot { padding: 10px 14px 12px; }
  html.pai-drawer-open, html.pai-drawer-open body { overflow: hidden; }
}

/* ---- Try-on buttons on the shop page (the library sets data-pointai-state) ---------
   The shop styles its own buttons; these are only light, overridable state hints. */
[data-pointai-tryon] { cursor: pointer; }
[data-pointai-tryon][data-pointai-state='pending'] { opacity: 0.75; }
[data-pointai-tryon][data-pointai-state='unavailable'] { opacity: 0.45; cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) {
  .pai-mode-drawer .pai-panel { transition: none; }
}
