.favorites-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: var(--ink);
  flex: none;
}
.favorites-link svg,
.favorite-button svg {
  width: 23px;
  height: 23px;
  flex: none;
}
.favorites-count {
  position: absolute;
  right: -2px;
  top: -3px;
  background: var(--brand-blue);
  color: #fff;
  border: 2px solid var(--surface, #fff);
  font-size: 10px;
  min-width: 18px;
  border-radius: 50%;
  text-align: center;
}
.product-card,
.saved-product {
  position: relative;
}
.favorite-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface, #fff);
  color: var(--ink);
  width: 40px;
  height: 40px;
  cursor: pointer;
}
.favorite-button.saved {
  color: #d93659;
}
.favorite-button.saved svg {
  fill: currentColor;
}
.product-card > .favorite-button,
.saved-product > .favorite-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  box-shadow: 0 3px 10px #15234b16;
}
.product-social {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.product-social button {
  border: 1px solid var(--line);
  background: var(--surface, #fff);
  color: var(--ink);
  border-radius: 9px;
  padding: 11px 13px;
  min-height: 42px;
  font: inherit;
  font-size: 12px;
}
.product-social .favorite-button {
  width: auto;
  height: auto;
}
.product-social .favorite-button.saved {
  color: #d93659;
}
.saved-main {
  padding-block: 48px 70px;
}
.saved-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
}
.saved-heading h1,
.saved-heading h2 {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  margin: 8px 0;
}
.saved-heading p {
  color: var(--muted);
  font-size: 14px;
}
.saved-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.saved-product {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface, #fff);
  overflow: hidden;
  min-width: 0;
}
.saved-product > a {
  display: block;
  padding: 16px;
}
.saved-product img {
  width: 100%;
  height: 165px;
  object-fit: contain;
  background: white;
  border-radius: 10px;
}
.saved-product h3 {
  font-size: 14px;
  line-height: 1.5;
  margin: 16px 0 8px;
  overflow-wrap: anywhere;
}
.saved-product a > span {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-blue);
}
.saved-placeholder {
  display: grid;
  place-items: center;
  height: 165px;
}
.saved-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 42px 24px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  line-height: 1.7;
}
.recent-section {
  padding-block: 45px;
  border-top: 1px solid var(--line);
}
#historico {
  margin-top: 56px;
}
.customer-feedback {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 14px 20px;
  border-radius: 12px;
  background: #20294a;
  color: white;
  z-index: 10000;
  display: none;
  box-shadow: 0 5px 22px #0003;
}
.customer-feedback.show {
  display: block;
}
.support-widget {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 80;
}
.support-launcher {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 0;
  border-radius: 50px;
  padding: 16px 20px;
  background: #343dc1;
  color: #fff;
  box-shadow: 0 8px 28px #151c5550;
  font-weight: 700;
  cursor: pointer;
}
.support-launcher svg {
  width: 25px;
  height: 25px;
}
.support-window {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 360px;
  max-width: calc(100vw - 28px);
  background: var(--surface, #fff);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 15px 60px #17234735;
  overflow: hidden;
}
.support-heading {
  display: flex;
  align-items: start;
  gap: 16px;
  justify-content: space-between;
  padding: 18px;
  background: #343dc1;
  color: white;
}
.support-heading strong,
.support-heading small {
  display: block;
}
.support-heading small {
  font-size: 11px;
  line-height: 1.5;
  margin-top: 5px;
  max-width: 250px;
  color: #e0e4ff;
}
.support-heading button {
  background: transparent;
  color: white;
  border: 0;
  font-size: 24px;
  cursor: pointer;
}
.support-messages {
  height: 260px;
  max-height: 35dvh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.support-messages > p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.support-bubble {
  max-width: 92%;
  padding: 12px 14px;
  border-radius: 13px;
  background: var(--soft);
  align-self: flex-start;
  overflow-wrap: anywhere;
}
.support-bubble.customer {
  align-self: flex-end;
  background: #edf0ff;
  color: #20294a;
}
.support-bubble strong {
  font-size: 11px;
}
.support-bubble p {
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 5px 0;
}
.support-bubble small {
  font-size: 10px;
  opacity: 0.7;
}
.support-compose {
  padding: 14px;
  border-top: 1px solid var(--line);
}
.support-compose label {
  font-size: 12px;
  display: block;
  margin-bottom: 7px;
}
.support-compose textarea {
  width: 100%;
  padding: 10px;
  background: var(--surface, #fff);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 9px;
  resize: vertical;
  font: inherit;
  font-size: 13px;
}
.support-compose .button {
  width: 100%;
  margin-top: 8px;
  min-height: 38px;
  font-size: 12px;
  background: #343dc1;
  color: #fff;
}
.support-status:not(:empty) {
  font-size: 12px;
  color: #a32645;
  padding: 8px 14px;
}
.support-window[hidden],
.support-compose[hidden] {
  display: none !important;
}
.chat-admin-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
}
.chat-thread-list {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 650px;
  overflow: auto;
}
.chat-thread {
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 14px;
  background: var(--admin-surface);
  color: var(--admin-text);
  text-align: left;
}
.chat-thread.active {
  border-color: #646ddd;
  background: var(--admin-soft);
}
.chat-thread strong,
.chat-thread span {
  display: block;
}
.chat-thread span {
  font-size: 12px;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 215px;
}
.chat-thread b {
  color: #d93659;
  font-size: 11px;
}
.chat-admin-conversation {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 15px;
  overflow: hidden;
  min-width: 0;
}
.chat-admin-conversation > h3 {
  padding: 20px;
  margin: 0;
  font-size: 16px;
  border-bottom: 1px solid var(--admin-border);
}
.chat-admin-conversation .support-messages {
  height: 360px;
  max-height: 55dvh;
}
.chat-admin-conversation .support-bubble.team {
  align-self: flex-end;
  background: #343dc1;
  color: white;
}
.chat-admin-conversation .support-bubble.customer {
  align-self: flex-start;
}
.chat-admin-conversation .support-status {
  padding: 12px;
}
.chat-admin-conversation .support-compose textarea {
  background: var(--admin-soft);
}
[data-theme='dark'] .favorite-button,
[data-theme='dark'] .product-social button,
[data-theme='dark'] .saved-product,
[data-theme='dark'] .support-window,
[data-theme='dark'] .support-compose textarea {
  background: #182139;
  color: #e8ecff;
}
[data-theme='dark'] .favorite-button.saved {
  color: #ff8ba4;
}
[data-theme='dark'] .saved-product a > span {
  color: #b2baff;
}
[data-theme='dark'] .support-bubble.customer {
  background: #29345d;
  color: #e8ecff;
}
[data-theme='dark'] .support-bubble.team {
  background: #232d4a;
}
[data-theme='dark'] .support-status {
  color: #ffb1c0;
}
@media (max-width: 800px) {
  .saved-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .saved-heading {
    align-items: start;
    flex-direction: column;
  }
  .chat-admin-layout {
    grid-template-columns: 1fr;
  }
  .chat-thread-list {
    max-height: 180px;
  }
  .support-launcher span {
    display: none;
  }
  .support-launcher {
    padding: 14px;
  }
  .support-widget {
    right: 14px;
    bottom: 16px;
  }
  .saved-product img {
    height: 125px;
  }
  .saved-product > a {
    padding: 12px;
  }
  .saved-product h3 {
    font-size: 12px;
  }
  .favorites-link {
    width: 32px;
  }
  .site-actions {
    gap: 7px !important;
  }
  .product-social {
    gap: 7px;
  }
  .product-social button {
    font-size: 11px;
    padding: 10px;
  }
}

.support-state {
  padding: 0 16px;
  font-size: 0.8rem;
  color: var(--muted, #65708a);
}
.support-state:empty {
  display: none;
}
.chat-state {
  font-size: 0.9rem;
  padding: 0 20px;
}
.chat-admin-conversation [data-end-chat] {
  margin: 0 20px 16px;
}
.continue-shopping {
  margin-top: 10px;
}
.product-buy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.product-buy small {
  font-size: 0.8rem;
  font-weight: 500;
}

[data-end-chat][hidden] {
  display: none !important;
}
.support-window {
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
}
