/* Widget comercial Vitrocar — shell exterior.
   Cabecera única dentro del iframe (?embed=1).
   El launcher queda encima del WhatsApp fijo (right 22 / bottom 22, alto ~52). */
.vc-chat {
  --vc-green: #86bd18;
  --vc-green-dark: #659408;
  --vc-navy: #10283b;
  --vc-ink: #102334;
  --vc-muted: #66727d;
  --vc-line: #e7ecef;
  --vc-safe-bottom: env(safe-area-inset-bottom, 0px);
  position: fixed;
  right: 22px;
  bottom: calc(92px + var(--vc-safe-bottom));
  z-index: 110;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color: var(--vc-ink);
}
.vc-chat, .vc-chat * { box-sizing: border-box; }

.vc-chat-launcher {
  width: 58px;
  height: 58px;
  border: 2px solid var(--vc-green);
  border-radius: 50%;
  background: var(--vc-navy);
  color: #fff;
  box-shadow: 0 12px 34px rgba(16, 40, 59, .28);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.vc-chat-launcher:hover { background: #16364d; }
.vc-chat-launcher:focus-visible { outline: 3px solid var(--vc-green); outline-offset: 3px; }

.vc-chat-invite {
  position: absolute;
  right: 0;
  bottom: 70px;
  width: min(280px, calc(100vw - 36px));
  background: #fff;
  border: 1px solid var(--vc-line);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(12, 34, 48, .16);
  padding: 14px 36px 14px 14px;
}
.vc-chat-invite[hidden],
.vc-chat-panel[hidden],
.vc-chat-recovery[hidden] { display: none !important; }
.vc-chat-invite p { margin: 0; font-size: 14px; line-height: 1.4; }
.vc-chat-invite button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--vc-muted);
  cursor: pointer;
  font-size: 18px;
}

.vc-chat-panel {
  position: absolute;
  right: 0;
  bottom: 70px;
  width: min(380px, calc(100vw - 28px));
  /* Hueco = offset del root (92) + bottom del panel (70) + margen */
  --vc-panel-chrome: 170px;
  height: min(640px, calc(100vh - var(--vc-panel-chrome)));
  height: min(640px, calc(100dvh - var(--vc-panel-chrome) - var(--vc-safe-bottom)));
  max-height: calc(100dvh - var(--vc-panel-chrome) - var(--vc-safe-bottom));
  min-height: min(280px, calc(100dvh - var(--vc-panel-chrome) - var(--vc-safe-bottom)));
  background: #fff;
  border: 1px solid var(--vc-line);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(12, 34, 48, .22);
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.vc-chat-frame {
  flex: 1 1 auto;
  min-height: 220px;
  height: 100%;
  position: relative;
  z-index: 1;
  border: 0;
  width: 100%;
  background: #f5f7f8;
}

.vc-chat-recovery {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--vc-muted);
  background: #f5f7f8;
  border-top: 1px solid var(--vc-line);
}
.vc-chat-recovery p { margin: 0 0 8px; line-height: 1.4; }
.vc-chat-recovery a {
  color: var(--vc-navy);
  font-weight: 700;
  text-decoration: underline;
}

.vc-chat-panel.is-recovery .vc-chat-frame {
  min-height: 160px;
}

@media (max-width: 500px) {
  .vc-chat {
    right: 14px;
    bottom: calc(78px + var(--vc-safe-bottom));
  }
  .vc-chat-panel {
    /* root 78 + panel bottom 70 + margen 8 */
    --vc-panel-chrome: 156px;
    width: calc(100vw - 20px);
    height: calc(100vh - var(--vc-panel-chrome));
    height: calc(100dvh - var(--vc-panel-chrome) - var(--vc-safe-bottom));
    max-height: calc(100dvh - var(--vc-panel-chrome) - var(--vc-safe-bottom));
    min-height: min(260px, calc(100dvh - var(--vc-panel-chrome) - var(--vc-safe-bottom)));
    border-radius: 16px;
  }
  .vc-chat-frame { min-height: min(200px, 100%); }
}

@media (max-height: 520px) {
  .vc-chat-panel {
    --vc-panel-chrome: 140px;
    height: calc(100vh - var(--vc-panel-chrome));
    height: calc(100dvh - var(--vc-panel-chrome) - var(--vc-safe-bottom));
    max-height: calc(100dvh - var(--vc-panel-chrome) - var(--vc-safe-bottom));
    min-height: min(220px, calc(100dvh - var(--vc-panel-chrome) - var(--vc-safe-bottom)));
  }
  .vc-chat-frame { min-height: min(180px, 100%); }
}
