/* ================================================================
   WATERRIFF XL — MODERN FEATURES CSS
   Upload this file and link in index.html <head>
   Does NOT touch any existing styles.
   ================================================================ */

/* SCROLL REVEAL */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* BACK TO TOP */
.back-to-top {
  position: fixed;
  bottom: 96px;
  right: 30px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--uba-red, #0241b4);
  color: #ffffff;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 3px 14px rgba(2,65,180,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 9979;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover {
  background: var(--uba-red-hover, #0237a0);
  transform: translateY(-2px);
}

/* COOKIE CONSENT */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1e1e1e;
  color: #ffffff;
  padding: 20px 30px;
  z-index: 9990;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
  transform: translateY(100%);
  transition: transform 0.4s ease;
}
.cookie-consent.show {
  transform: translateY(0);
}
.cookie-consent__inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.cookie-consent__inner p {
  font-size: 0.9rem;
  color: #cccccc;
  flex: 1;
  min-width: 250px;
}
.cookie-consent__inner p i {
  color: var(--uba-red, #0241b4);
  margin-right: 8px;
}
.cookie-consent__inner a {
  color: var(--uba-red, #0241b4);
  text-decoration: underline;
}
.cookie-consent__actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.cookie-consent__accept {
  padding: 10px 24px;
  border: none;
  border-radius: 4px;
  background: var(--uba-red, #0241b4);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}
.cookie-consent__accept:hover {
  background: var(--uba-red-hover, #0237a0);
}
.cookie-consent__decline {
  padding: 10px 24px;
  border: 1.5px solid #666;
  border-radius: 4px;
  background: transparent;
  color: #cccccc;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}
.cookie-consent__decline:hover {
  border-color: #fff;
  color: #fff;
}

/* LOADING OVERLAY */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30,30,30,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.loading-overlay.show {
  display: flex;
}
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: var(--uba-red, #0241b4);
  border-radius: 50%;
  animation: modernSpin 0.8s linear infinite;
}
@keyframes modernSpin {
  to { transform: rotate(360deg); }
}

/* CHAT WIDGET */
.chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9980;
}
.chat-widget__toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--uba-red, #0241b4);
  color: #ffffff;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  box-shadow: 0 4px 20px rgba(2,65,180,0.4);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.chat-widget__toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 25px rgba(2,65,180,0.5);
}
.chat-widget__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modernBadgePulse 2s infinite;
}
@keyframes modernBadgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
.chat-widget__window {
  position: absolute;
  bottom: 75px;
  right: 0;
  width: 400px;
  max-height: 560px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: modernChatSlideUp 0.3s ease;
}
.chat-widget__window.open {
  display: flex;
}
@keyframes modernChatSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-widget__header {
  background: #1e1e1e;
  color: #ffffff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-widget__header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-widget__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  position: relative;
}
.chat-widget__online {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #1e1e1e;
}
.chat-widget__header-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}
.chat-widget__header-info span {
  font-size: 0.75rem;
  color: #aaaaaa;
}
.chat-widget__header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-widget__whatsapp {
  color: #25d366;
  font-size: 1.2rem;
  transition: color 0.2s;
}
.chat-widget__whatsapp:hover { color: #128c7e; }
.chat-widget__minimize {
  background: none;
  border: none;
  color: #aaaaaa;
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.2s;
}
.chat-widget__minimize:hover { color: #ffffff; }
.chat-widget__messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  min-height: 200px;
  max-height: 300px;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-msg {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-wrap: break-word;
}
.chat-msg.bot {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  color: #333;
}
.chat-msg.user {
  background: var(--uba-red, #0241b4);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-msg.bot .chat-label {
  font-size: 0.7rem;
  color: var(--uba-red, #0241b4);
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}
.chat-msg.typing {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  align-self: flex-start;
  padding: 16px 20px;
}
.chat-typing-dots {
  display: flex;
  gap: 5px;
}
.chat-typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #aaa;
  animation: modernTypingBounce 1.4s infinite;
}
.chat-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes modernTypingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}
.chat-widget__prechat {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-widget__prechat-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e1e1e;
  margin-bottom: 4px;
}
.chat-widget__prechat input {
  padding: 10px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}
.chat-widget__prechat input:focus {
  outline: none;
  border-color: var(--uba-red, #0241b4);
}
.chat-widget__start-btn {
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--uba-red, #0241b4);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s;
}
.chat-widget__start-btn:hover {
  background: var(--uba-red-hover, #0237a0);
}
.chat-widget__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #aaa;
  font-size: 0.8rem;
}
.chat-widget__divider::before,
.chat-widget__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}
.chat-widget__whatsapp-full {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  color: #333;
  font-weight: 500;
  font-size: 0.88rem;
  transition: all 0.2s;
}
.chat-widget__whatsapp-full:hover {
  border-color: #25d366;
  color: #25d366;
}
.chat-widget__whatsapp-full i {
  font-size: 1.1rem;
  color: #25d366;
}
.chat-widget__input {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
}
.chat-widget__input input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}
.chat-widget__input input:focus {
  outline: none;
  border-color: var(--uba-red, #0241b4);
}
.chat-widget__input button {
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: var(--uba-red, #0241b4);
  color: #ffffff;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}
.chat-widget__input button:hover {
  background: var(--uba-red-hover, #0237a0);
}

/* TOAST */
@keyframes modernToastSlide {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* RESPONSIVE */
@media (max-width: 480px) {
  .chat-widget__window {
    width: calc(100vw - 32px);
    right: -8px;
  }
  .cookie-consent__inner {
    flex-direction: column;
    text-align: center;
  }
}
