/* === New Brand World - Twilio webchat typography === */
.new_brand_world #twilio-webchat-widget-root h2.css-1a52grp,
.new_brand_world #twilio-webchat-widget-root h3.css-11qrk9w {
  font-family: 'IQOS-Bold';
}

.new_brand_world #twilio-webchat-widget-root h3.css-11qrk9w {
  margin: 0 0 1.25rem;
}

.new_brand_world #twilio-webchat-widget-root p.css-1xtudba {
  margin: 0 0 1.5rem;
}

.new_brand_world #twilio-webchat-widget-root p.css-1d806x2 {
  margin: 1.5rem 0 0;
}

.new_brand_world #twilio-webchat-widget-root textarea {
  letter-spacing: normal;
}

/* === Twilio webchat widget root === */
#twilio-webchat-widget-root .root-container-outer {
  z-index: 1002;
  right: 0;
}

/* === Twilio bugfixes === */
#twilio-customer-frame textarea {
  letter-spacing: unset;
}

.Twilio.Twilio-MessageBubble {
  overflow-x: visible;
}

.Twilio-PreEngagementCanvas textarea[name="aiBotInputName"] {
  height: auto;
}

.Twilio-PreEngagementCanvas textarea[name="aiBotInputName"][readonly] {
  color: #222;
}

/* === Chatbot buttons === */
.twilioChatBotButton {
  border-radius: 30px;
  border: solid 1px #34303d;
  word-break: break-word;
  width: 140px;
  height: fit-content;
  min-height: 40px;
  margin: 4px 4px 0 4px;
  font-size: 12px;
  color: #34303d;
  line-height: 1.43;
  text-align: center;
}

.twilioChatBotButton:hover,
.twilioChatBotButtonNBW:hover {
  background-color: #00d2d2 !important;
  border-color: #e5e5e5;
}

.twilioChatBotButton:focus,
.twilioChatBotButtonNBW:focus {
  background-color: #34303d;
  color: #fffdfb !important;
}

/* === Attachment icon states === */
.disableAttachmentIcon {
  pointer-events: none;
  color: grey !important;
  cursor: default !important;
}

.enableAttachmentIcon {
  pointer-events: auto;
  color: black !important;
  cursor: pointer !important;
}

/* === Star rating === */
.star-rating {
  display: flex;
  align-items: center;
  width: auto;
  flex-direction: row-reverse;
  justify-content: space-between;
  position: relative;
  margin: 40px auto;
}

.star-rating input {
  display: none;
}

.star-rating > label {
  width: 30px;
  height: 30px;
  font-family: Verdana;
  font-size: 30px;
  color: black;
  transition: 0.2s ease;
}

.star-rating label::before {
  content: '\2606';
  position: absolute;
  top: 0;
  line-height: 26px;
}

.star-rating label:hover,
#twilio-customer-frame .star-rating > label:hover,
#twilio-customer-frame .star-rating > input:checked ~ label:hover:before {
  color: white;
  transition: 0.2s ease;
}

.star-rating label:active::before {
  transform: scale(1.1);
}

.star-rating input:checked ~ label:before,
#twilio-customer-frame .star-rating input:checked ~ label:before {
  content: '\2605';
}

#twilio-customer-frame .star-rating > input[type=radio] + label:before {
  border: unset;
}

#twilio-customer-frame .star-rating > input[type=radio] + label:after {
  border: unset;
  background-color: unset;
}

/* === Widget container === */
.twilio-box.js-twilio-box {
  z-index: 1000;
}

.twilio-box {
  position: fixed;
  display: flex;
  flex-direction: column;
  bottom: 2rem;
  max-height: 80vh;
  max-width: 100%;
  width: 20rem;
  height: 36.875rem;
  padding: 0.625rem;
  right: -20rem;
  background-color: #34303d;
  border-radius: 0.75rem;
  transition: right 0.1s ease;
}

.twilio-box.opened {
  right: 0;
}

/* === Open button === */
.twilio-box__btn-open {
  position: absolute;
  font-size: 16px;
  border-radius: 1.25rem;
  padding: 0.3125rem 0.9375rem;
  color: #fffdfb;
  background-color: #000;
  top: 50%;
  left: 0;
  cursor: pointer;
  transform-origin: left top;
  transform: rotate(-90deg) translate(-50%, -100%);
}

/* === Header === */
.twilio-box__header {
  color: #fffdfb;
  padding: 0.625rem 1.25rem 1.25rem;
}

.twilio-box__logo {
  max-height: 0.875rem;
}

.new_brand_world h1.twilio-box__title {
  font-size: 1.75rem;
  margin-bottom: 0.625rem;
  margin-top: 1.125rem;
}

.twilio-box__header .twilio-box__title {
  margin-top: 19px;
  font-family: "iqos-bold";
}

.twilio-box__text {
  font-size: 1rem;
  margin: 0;
}

/* === Body === */
.twilio-box__body {
  background-color: #fffdfb;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  flex-grow: 1;
  border-radius: 0.25rem;
}

.new_brand_world p.twilio-box__body-text {
  font-size: 0.875rem;
  text-align: center;
  margin-top: 0;
  margin-bottom: 1.875rem;
}

.twilio-box__img {
  max-width: 2.5rem;
}

.twilio-box__img-wrapper {
  width: 4.375rem;
  height: 4.375rem;
  background-color: #f6f4f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === Init button === */
.twilio-box__btn-init {
  margin-top: auto;
}

.twilio-box__btn-init:disabled,
.twilio-box .twilio-box__btn-init:disabled {
  background-color: #b8b7bb !important;
  color: #7b7881 !important;
  border: none !important;
  pointer-events: none;
}

/* === Close button === */
.twilio-box__close {
  position: absolute;
  width: 20px;
  height: 20px;
  top: 10px;
  right: 10px;
  cursor: pointer;
  color: #fffdfb;
}

.twilio-box__close::before,
.twilio-box__close::after {
  content: ' ';
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 2px;
  width: 1px;
  height: 23px;
  background-color: #fffdfb;
  transform-origin: center;
  transform: translate(-50%, -50%) rotate(45deg);
}

.twilio-box__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* === Loader === */
.twilio-box__loader-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background-color: #fffdfb;
  display: none;
  justify-content: center;
  align-items: center;
  border-radius: 20px;
  z-index: 1;
}

.twilio-box__loader-wrapper.show {
  display: flex !important;
}

.twilio-box__loader {
  border: 2px solid #00d1d2;
  border-top: 2px solid #e1e0e2;
  border-radius: 50%;
  width: 4.375rem;
  height: 4.375rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* === Generic button === */
.button {
  position: relative;
  cursor: pointer;
  border-radius: 24px;
  padding: 0.625rem 2rem;
  letter-spacing: 0.5px;
  text-align: center;
  font-weight: normal;
  font-size: 1rem;
  z-index: 1;
  height: 2.75rem;
  min-height: 2.75rem;
  max-height: 2.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 300ms, border-color 300ms, background-color 300ms;
}

.button__primary--dark:disabled {
  background-color: #b8b7bb !important;
  color: #7b7881 !important;
  border: none;
}

/* === Twilio Flex overrides === */
.Twilio.Twilio-EntryPoint {
  display: none;
}

.Twilio.Twilio-MainContainer {
  z-index: 1002 !important;
  right: 0;
}

/* === New Brand World overrides === */
.new_brand_world .cta.primary-dark.neutral-bg:after {
  background-color: #00d1d2 !important;
  border: none !important;
}
