:root {
  --wc-chatbot-primary: #000000;
  --wc-chatbot-accent: #fdd700;
  --wc-chatbot-bg: #ffffff;
  --wc-chatbot-text: #333333;
  --wc-chatbot-light: #f5f5f7;
  --wc-chatbot-border: #e0e0e0;
  --wc-chatbot-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  --wc-chatbot-radius: 16px;
  --wc-chatbot-radius-sm: 12px;
  --wc-chatbot-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#wc-chatbot-widget {
  position: fixed;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

#wc-chatbot-widget.wc-chatbot-position-bottom-left {
  bottom: 20px;
  left: 20px;
}

#wc-chatbot-widget.wc-chatbot-position-bottom-right {
  bottom: 20px;
  right: 20px;
}

.wc-chatbot-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--wc-chatbot-primary), var(--wc-chatbot-accent));
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: var(--wc-chatbot-shadow);
  transition: var(--wc-chatbot-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.wc-chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(233, 69, 96, 0.3);
}

.wc-chatbot-toggle-icon,
.wc-chatbot-toggle-close {
  position: absolute;
  transition: var(--wc-chatbot-transition);
}

.wc-chatbot-toggle-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

#wc-chatbot-widget.active .wc-chatbot-toggle-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

#wc-chatbot-widget.active .wc-chatbot-toggle-close {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.wc-chatbot-container {
  position: absolute;
  bottom: 75px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 550px;
  max-height: calc(100vh - 100px);
  background: var(--wc-chatbot-bg);
  border-radius: var(--wc-chatbot-radius);
  box-shadow: var(--wc-chatbot-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: var(--wc-chatbot-transition);
}

#wc-chatbot-widget.wc-chatbot-position-bottom-right .wc-chatbot-container {
  right: 0;
}

#wc-chatbot-widget.wc-chatbot-position-bottom-left .wc-chatbot-container {
  left: 0;
}

#wc-chatbot-widget.active .wc-chatbot-container {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.wc-chatbot-header {
  background: linear-gradient(135deg, var(--wc-chatbot-primary), var(--wc-chatbot-accent));
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.wc-chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wc-chatbot-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.wc-chatbot-header-text {
  display: flex;
  flex-direction: column;
}

.wc-chatbot-header-title {
  font-weight: 600;
  font-size: 15px;
}

.wc-chatbot-header-status {
  font-size: 12px;
  opacity: 0.85;
  color: #90ee90;
}

.wc-chatbot-header-close {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 4px;
}

.wc-chatbot-header-close:hover {
  opacity: 1;
}

.wc-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.wc-chatbot-messages::-webkit-scrollbar {
  width: 4px;
}

.wc-chatbot-messages::-webkit-scrollbar-thumb {
  background: var(--wc-chatbot-border);
  border-radius: 4px;
}

.wc-chatbot-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: var(--wc-chatbot-radius-sm);
  font-size: 14px;
  line-height: 1.5;
  animation: wc-chatbot-message-in 0.3s ease-out;
  word-wrap: break-word;
}

@keyframes wc-chatbot-message-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.wc-chatbot-message.bot {
  align-self: flex-start;
  background: var(--wc-chatbot-light);
  color: var(--wc-chatbot-text);
  border-bottom-left-radius: 4px;
}

.wc-chatbot-message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--wc-chatbot-primary), var(--wc-chatbot-accent));
  color: white;
  border-bottom-right-radius: 4px;
}

.wc-chatbot-message.error {
  background: #fff3f3;
  color: #c0392b;
  border: 1px solid #ffcdd2;
}

.wc-chatbot-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.wc-chatbot-option-btn {
  background: white;
  border: 2px solid var(--wc-chatbot-border);
  border-radius: var(--wc-chatbot-radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: var(--wc-chatbot-transition);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--wc-chatbot-text);
}

.wc-chatbot-option-btn:hover {
  border-color: var(--wc-chatbot-accent);
  background: #fff5f7;
  transform: translateX(4px);
}

.wc-chatbot-option-btn .icon {
  font-size: 18px;
  flex-shrink: 0;
}

.wc-chatbot-option-btn.primary {
  background: linear-gradient(135deg, var(--wc-chatbot-primary), var(--wc-chatbot-accent));
  color: white;
  border: none;
}

.wc-chatbot-option-btn.primary:hover {
  opacity: 0.9;
  transform: translateX(4px);
}

.wc-chatbot-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.wc-chatbot-options-grid .wc-chatbot-option-btn {
  flex-direction: column;
  text-align: center;
  padding: 16px 8px;
}

.wc-chatbot-options-grid .wc-chatbot-option-btn .icon {
  font-size: 24px;
}

.wc-chatbot-order-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.wc-chatbot-order-item {
  background: white;
  border: 2px solid var(--wc-chatbot-border);
  border-radius: var(--wc-chatbot-radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: var(--wc-chatbot-transition);
}

.wc-chatbot-order-item:hover {
  border-color: var(--wc-chatbot-accent);
  box-shadow: 0 2px 8px rgba(233, 69, 96, 0.1);
}

.wc-chatbot-order-item-id {
  font-weight: 600;
  color: var(--wc-chatbot-primary);
}

.wc-chatbot-order-item-status {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

.wc-chatbot-tracking {
  background: #e8f5e9;
  border-radius: var(--wc-chatbot-radius-sm);
  padding: 12px;
  margin-top: 8px;
}

.wc-chatbot-tracking a {
  color: var(--wc-chatbot-accent);
  text-decoration: none;
  font-weight: 600;
}

.wc-chatbot-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.wc-chatbot-form input {
  padding: 12px 14px;
  border: 2px solid var(--wc-chatbot-border);
  border-radius: var(--wc-chatbot-radius-sm);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.wc-chatbot-form input:focus {
  outline: none;
  border-color: var(--wc-chatbot-accent);
}

.wc-chatbot-form button {
  background: linear-gradient(135deg, var(--wc-chatbot-primary), var(--wc-chatbot-accent));
  color: white;
  border: none;
  padding: 12px;
  border-radius: var(--wc-chatbot-radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.wc-chatbot-form button:hover {
  opacity: 0.9;
}

.wc-chatbot-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wc-chatbot-typing {
  display: none;
  padding: 12px 16px;
  align-self: flex-start;
  background: var(--wc-chatbot-light);
  border-radius: var(--wc-chatbot-radius-sm);
  border-bottom-left-radius: 4px;
  margin: 0 16px 8px;
}

.wc-chatbot-typing.active {
  display: flex;
  gap: 4px;
}

.wc-chatbot-typing span {
  width: 8px;
  height: 8px;
  background: var(--wc-chatbot-accent);
  border-radius: 50%;
  animation: wc-chatbot-typing-bounce 1.4s infinite ease-in-out both;
}

.wc-chatbot-typing span:nth-child(1) { animation-delay: -0.32s; }
.wc-chatbot-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes wc-chatbot-typing-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

.wc-chatbot-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--wc-chatbot-border);
  background: white;
  flex-shrink: 0;
}

.wc-chatbot-menu-btn {
  width: 100%;
  padding: 10px;
  background: var(--wc-chatbot-light);
  border: none;
  border-radius: var(--wc-chatbot-radius-sm);
  font-size: 13px;
  cursor: pointer;
  color: var(--wc-chatbot-text);
  transition: background 0.2s;
  font-weight: 500;
}

.wc-chatbot-menu-btn:hover {
  background: var(--wc-chatbot-border);
}

@media (max-width: 480px) {
  .wc-chatbot-container {
    width: calc(100vw - 40px);
    height: calc(100vh - 100px);
    max-height: 500px;
  }
  #wc-chatbot-widget.wc-chatbot-position-bottom-left,
  #wc-chatbot-widget.wc-chatbot-position-bottom-right {
    bottom: 10px;
    left: 10px;
    right: 10px;
  }
  .wc-chatbot-options-grid {
    grid-template-columns: 1fr;
  }
}

@keyframes wc-chatbot-widget-in {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

#wc-chatbot-widget {
  animation: wc-chatbot-widget-in 0.5s ease-out;
}

/* Ajustes de contraste para paleta Amarillo + Negro */

/* Botones primarios: fondo amarillo, texto negro */
.wc-chatbot-option-btn.primary {
  background: var(--wc-chatbot-accent) !important;
  color: #000000 !important;
  border: 2px solid var(--wc-chatbot-accent) !important;
  font-weight: 700 !important;
}

.wc-chatbot-option-btn.primary:hover {
  background: #000000 !important;
  color: var(--wc-chatbot-accent) !important;
  border-color: #000000 !important;
}

/* Header: degradado negro a amarillo oscuro */
.wc-chatbot-header {
  background: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #2d2d2d 100%) !important;
  border-bottom: 3px solid var(--wc-chatbot-accent);
}

/* Toggle button: amarillo con icono negro */
.wc-chatbot-toggle {
  background: var(--wc-chatbot-accent) !important;
  color: #000000 !important;
}

.wc-chatbot-toggle:hover {
  box-shadow: 0 12px 40px rgba(253, 215, 0, 0.4) !important;
}

/* Indicador de escritura: puntos amarillos */
.wc-chatbot-typing span {
  background: var(--wc-chatbot-accent) !important;
}

/* Formulario submit: amarillo, texto negro */
.wc-chatbot-form button {
  background: var(--wc-chatbot-accent) !important;
  color: #000000 !important;
  font-weight: 700 !important;
}

.wc-chatbot-form button:hover {
  background: #000000 !important;
  color: var(--wc-chatbot-accent) !important;
}

/* Input focus: borde amarillo */
.wc-chatbot-form input:focus {
  border-color: var(--wc-chatbot-accent) !important;
  box-shadow: 0 0 0 3px rgba(253, 215, 0, 0.2);
}

/* Mensaje de usuario: amarillo, texto negro */
.wc-chatbot-message.user {
  background: var(--wc-chatbot-accent) !important;
  color: #000000 !important;
  font-weight: 500;
}

/* Tracking box: fondo amarillo claro */
.wc-chatbot-tracking {
  background: rgba(253, 215, 0, 0.15) !important;
  border-left: 3px solid var(--wc-chatbot-accent);
}

.wc-chatbot-tracking a {
  color: #000000 !important;
  font-weight: 700;
  text-decoration: underline;
}

/* Menu button: hover amarillo */
.wc-chatbot-menu-btn:hover {
  background: var(--wc-chatbot-accent) !important;
  color: #000000 !important;
  font-weight: 600;
}

/* Scrollbar amarillo */
.wc-chatbot-messages::-webkit-scrollbar-thumb {
  background: var(--wc-chatbot-accent) !important;
}

/* Animacion del toggle */
@keyframes wc-chatbot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(253, 215, 0, 0.4); }
  50% { box-shadow: 0 0 0 15px rgba(253, 215, 0, 0); }
}

#wc-chatbot-widget:not(.active) .wc-chatbot-toggle {
  animation: wc-chatbot-pulse 2s infinite;
}
