﻿/* ============================================================
   CASA PIETREFITTE - Assistente Virtuale (chat.css)
   ============================================================ */

.pietrefitte-chat-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 233, 184, 0.95);
  cursor: pointer;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #C69353 0%, #AF7D3F 55%, #8A5F2D 100%);
  box-shadow: 0 8px 26px rgba(138, 95, 45, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  padding: 10px;
}

.pietrefitte-chat-btn::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  animation: pietrefittePulse 2.6s ease-out infinite;
}

@keyframes pietrefittePulse {
  0% { box-shadow: 0 0 0 0 rgba(198, 147, 83, 0.6); }
  70% { box-shadow: 0 0 0 18px rgba(198, 147, 83, 0); }
  100% { box-shadow: 0 0 0 0 rgba(198, 147, 83, 0); }
}

.pietrefitte-chat-btn:hover {
  transform: scale(1.08) translateY(-3px);
  box-shadow: 0 12px 32px rgba(138, 95, 45, 0.6);
}

.pietrefitte-chat-btn svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.22));
}

.pietrefitte-chat-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFE9B8, #E8B45A);
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.pietrefitte-chat-hint {
  position: fixed;
  bottom: 36px;
  right: 106px;
  background: #FFFFFF;
  color: #2A302B;
  font-size: 0.9rem;
  padding: 10px 16px;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
  z-index: 1050;
  font-family: 'Plus Jakarta Sans', sans-serif;
  border: 1px solid #EFE8DC;
  line-height: 1.4;
  animation: fadeInHint 0.5s ease;
}

@keyframes fadeInHint {
  from { opacity: 0; transform: translateX(15px); }
  to { opacity: 1; transform: translateX(0); }
}

.pietrefitte-chat-panel {
  position: fixed;
  bottom: 102px;
  right: 24px;
  width: min(390px, calc(100vw - 28px));
  max-height: min(600px, calc(100vh - 130px));
  background: #FDFBF7;
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  z-index: 1060;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Plus Jakarta Sans', sans-serif;
  border: 1px solid #EFE8DC;
  animation: popInChat 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popInChat {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.pietrefitte-chat-head {
  background: linear-gradient(135deg, #4A5D4E 0%, #324036 100%);
  color: #FFFFFF;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pietrefitte-chat-head .pietrefitte-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 233, 184, 0.7);
}

.pietrefitte-chat-head h5 {
  margin: 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.1;
  color: #FFFFFF;
  letter-spacing: 0.5px;
}

.pietrefitte-chat-head small {
  opacity: 0.88;
  font-size: 0.76rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.pietrefitte-chat-close {
  margin-left: auto;
  background: none;
  border: none;
  color: #FFFFFF;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  transition: transform 0.2s;
}

.pietrefitte-chat-close:hover {
  transform: scale(1.15);
}

.pietrefitte-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pietrefitte-msg {
  max-width: 86%;
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 0.93rem;
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: break-word;
}

.pietrefitte-msg.bot {
  background: #FFFFFF;
  color: #2A302B;
  border: 1px solid #EAE3DA;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.pietrefitte-msg.user {
  background: #C69353;
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  box-shadow: 0 2px 6px rgba(198, 147, 83, 0.25);
}

.pietrefitte-msg.bot a {
  color: #C69353;
  font-weight: 600;
  text-decoration: underline;
}

.pietrefitte-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #25D366;
  color: #FFFFFF !important;
  border-radius: 25px;
  padding: 8px 16px;
  margin-top: 8px;
  font-weight: 700;
  text-decoration: none !important;
  font-size: 0.88rem;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.pietrefitte-wa-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.45);
}

.pietrefitte-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-self: flex-start;
  max-width: 96%;
}

.pietrefitte-chip {
  background: #FFFFFF;
  border: 1px solid #C69353;
  color: #C69353;
  border-radius: 20px;
  padding: 6px 13px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.pietrefitte-chip:hover {
  background: #C69353;
  color: #FFFFFF;
  transform: translateY(-1px);
}

.pietrefitte-chip.gold {
  background: linear-gradient(135deg, #FFE9B8, #E8B45A);
  border-color: #D9A54A;
  color: #5A3F1A;
  font-weight: 700;
}

.pietrefitte-chip.gold:hover {
  filter: brightness(1.05);
  color: #3D290F;
}

.pietrefitte-form {
  background: #FFFFFF;
  border: 1px solid #EAE3DA;
  border-radius: 16px;
  padding: 14px;
  align-self: flex-start;
  max-width: 92%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.pietrefitte-form label {
  font-size: 0.8rem;
  color: #5E6660;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-weight: 600;
}

.pietrefitte-form input, .pietrefitte-form select {
  border: 1px solid #DCE0DD;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.9rem;
  font-family: inherit;
  color: #2A302B;
}

.pietrefitte-form button {
  background: #C69353;
  color: #FFFFFF;
  border: none;
  border-radius: 25px;
  padding: 10px;
  font-size: 0.92rem;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.2s;
}

.pietrefitte-form button:hover {
  background: #AF7D3F;
}

.pietrefitte-typing {
  display: inline-flex;
  gap: 5px;
  align-self: flex-start;
  background: #FFFFFF;
  border: 1px solid #EAE3DA;
  border-radius: 16px;
  padding: 14px 16px;
}

.pietrefitte-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #C69353;
  animation: pietrefitteBlink 1.2s infinite;
}

.pietrefitte-typing span:nth-child(2) { animation-delay: 0.2s; }
.pietrefitte-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pietrefitteBlink {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.1); }
}

.pietrefitte-chat-foot {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #EAE3DA;
  background: #FFFFFF;
}

.pietrefitte-chat-foot input {
  flex: 1;
  border: 1px solid #DCE0DD;
  border-radius: 25px;
  padding: 9px 16px;
  font-size: 0.92rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.pietrefitte-chat-foot input:focus {
  border-color: #C69353;
}

.pietrefitte-chat-foot button {
  background: #C69353;
  border: none;
  color: #FFFFFF;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.15rem;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s;
}

.pietrefitte-chat-foot button:hover {
  background: #AF7D3F;
  transform: scale(1.05);
}

.pietrefitte-chat-brand {
  text-align: center;
  font-size: 0.74rem;
  color: #8C948E;
  background: #FFFFFF;
  padding: 0 8px 10px;
}

@media (max-width: 768px) {
  .pietrefitte-chat-btn {
    bottom: 16px;
    right: 16px;
    width: 58px;
    height: 58px;
    padding: 8px;
  }
  
  .pietrefitte-chat-hint {
    bottom: 26px;
    right: 84px;
    font-size: 0.82rem;
    padding: 8px 12px;
  }
  
  .pietrefitte-chat-panel {
    bottom: 16px;
    right: 14px;
    left: auto;
    width: min(360px, calc(100vw - 28px));
    height: min(530px, calc(100vh - 40px));
    max-height: calc(100vh - 40px);
    border-radius: 18px;
  }
}
