/* ===== BOTÓN WHATSAPP ===== */
#whatsapp-button {
  position: fixed !important;
  bottom: 25px;
  right: 25px;
  width: 70px;
  height: 70px;
  cursor: pointer;
  z-index: 10000;
  transition: all 0.5s ease;
}

#whatsapp-button img {
  width: 100%;
  height: 100%;
}

/* ===== CHAT WHATSAPP ===== */
#whatsapp-chat {
  position: fixed;
  bottom: 90px;
  right: 25px;
  width: 320px;
  background: #E5DDD5;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  z-index: 999;
}

#whatsapp-chat.show {
  display: flex;
}

/* ===== CHAT HEADER ===== */
.chat-header {
  background: #075E54;
  color: white;
  padding: 10px;
  display: flex;
  align-items: center;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-logo {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: white;
  padding: 4px;
}

.chat-title {
  font-weight: 600;
  font-size: 14px;
}

.chat-status {
  font-size: 12px;
  color: #c7ffc9;
}

/* ===== CHAT BODY ===== */
.chat-body {
  background: #ECE5DD;
  padding: 10px;
  height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message {
  padding: 8px 12px;
  border-radius: 8px;
  max-width: 75%;
  font-size: 14px;
  line-height: 1.4;
}

.message.received {
  background: #fff;
  color: #000;
  align-self: flex-start;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.message.sent {
  background: #DCF8C6;
  align-self: flex-end;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

/* ===== CHAT FOOTER ===== */
.chat-footer {
  display: flex;
  border-top: 1px solid #ccc;
  background: #f5f5f5;
}

#chat-input {
  flex: 1;
  border: none;
  padding: 10px;
  font-size: 14px;
  outline: none;
  background: transparent;
}

#chat-send {
  border: none;
  background: #25D366;
  color: white;
  font-size: 18px;
  padding: 0 15px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.3s ease;
}

#chat-send:hover {
  background: #20ba5a;
}

/* ===== BOTÓN EMAIL ===== */
.btn-floating.email {
  position: fixed;
  bottom: 110px;
  right: 32px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at 30% 30%, #1a1a1a, #000);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.4s ease;
  z-index: 1000;
}

.btn-floating.email:hover {
  transform: translateY(-3px) scale(1.07);
  background: radial-gradient(circle at 70% 70%, #222, #000);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.1);
}

.btn-floating.email svg {
  width: 30px;
  height: 30px;
  fill: #fff;
  transition: fill 0.3s ease;
}

.btn-floating.email:hover svg {
  fill: #eaeaea;
}

/* ===== MODAL EMAIL ===== */
.email-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  scroll-behavior: auto !important;
  overflow: hidden;
}

.email-modal.show {
  display: flex;
  opacity: 1;
  pointer-events: all;
  overflow-y: auto;
  scroll-behavior: auto !important;
  overscroll-behavior: contain;
  padding: 20px;
}

.email-modal-content {
  background: #fff;
  color: #111;
  padding: 25px 35px;
  border-radius: 16px;
  width: 90%;
  max-width: 450px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  transform: scale(1);
  transition: transform 0.2s ease;
  margin: auto;
}

.email-modal:not(.show) .email-modal-content {
  transform: scale(0.96);
}

/* Prevenir scroll cuando modal está activo */
body:has(.email-modal.show) {
  overflow: hidden;
}

.close-modal {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 26px;
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  transition: color 0.2s;
}

.close-modal:hover {
  color: #000;
}

.email-modal-content h2 {
  margin-bottom: 6px;
  margin-top: 8px;
  font-weight: 700;
  font-size: 1.4rem;
}

.email-modal-content p {
  font-size: 0.9rem;
  margin-bottom: 16px;
  color: #666;
}

.email-modal-content form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.email-modal-content input,
.email-modal-content textarea,
.email-modal-content select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 2px solid #e5e5e5;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: #fff;
}

.email-modal-content input:focus,
.email-modal-content textarea:focus,
.email-modal-content select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1);
  outline: none;
}

.email-modal-content input:invalid:not(:placeholder-shown),
.email-modal-content textarea:invalid:not(:placeholder-shown),
.email-modal-content select:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
}

.email-modal-content textarea {
  resize: vertical;
  min-height: 80px;
  max-height: 150px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #333;
  font-size: 14px;
}

.form-error {
  display: block;
  color: #ef4444;
  font-size: 13px;
  margin-top: 4px;
  min-height: 18px;
}

.form-note {
  font-size: 13px;
  color: #666;
  margin-top: 12px;
  text-align: center;
}

.send-btn {
  background-color: #000;
  color: #fff;
  border: none;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.25s, transform 0.2s;
  font-weight: 600;
  width: 100%;
  position: relative;
}

.send-btn:hover {
  background-color: var(--accent);
  transform: translateY(-2px);
}

.send-btn:active {
  transform: translateY(0);
}

.send-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  transform: none;
}

.btn-loader {
  display: none;
}

.send-btn.loading .btn-text {
  display: none;
}

.send-btn.loading .btn-loader {
  display: inline;
}

/* ===== MODAL COTIZACIÓN IGUAL AL ÍNDICE ===== */
.email-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.email-modal.show {
  display: flex;
  opacity: 1;
  overflow-y: auto;
  padding: 24px;
}

.email-modal-content {
  background: #fff;
  padding: 32px;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
  from { opacity: 0; transform: scale(0.95) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.close-modal {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 28px;
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  transition: color 0.2s;
  line-height: 1;
}

.close-modal:hover {
  color: #1d1d1f;
}

.email-modal-content h2 {
  font-size: 28px;
  font-weight: 700;
  color: #1d1d1f;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.email-modal-content > p {
  font-size: 15px;
  color: #6b7280;
  margin-bottom: 24px;
}

.email-modal-content form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.email-modal-content input,
.email-modal-content textarea,
.email-modal-content select {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  font-size: 15px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: all 0.2s ease;
  background: #fff;
}

.email-modal-content input:focus,
.email-modal-content textarea:focus,
.email-modal-content select:focus {
  border-color: var(--color-red-600);
  outline: none;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.email-modal-content textarea {
  resize: vertical;
  min-height: 100px;
}

.hidden-honey {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
}

/* ===== SISTEMA DE BOTONES GLOBALES (FASE 3) ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  line-height: 1.2;
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  background: var(--color-border) !important;
  color: var(--color-text-muted) !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Variantes */
.btn-primary {
  background: var(--color-red-600);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--color-red-800);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-secondary {
  background: var(--color-surface-dark);
  color: #ffffff;
}

.btn-secondary:hover {
  background: #000000;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-outline {
  background: transparent;
  color: var(--color-surface-dark);
  border-color: var(--color-border);
}

.btn-outline:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--color-surface-dark);
  transform: translateY(-2px);
}

/* ===== MODAL COTIZACIÓN UNIFICADO ===== */
/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  #whatsapp-chat {
    width: 90%;
    right: 5%;
    bottom: 80px;
  }

  .btn-floating.email {
    bottom: 100px;
    right: 5%;
    width: 60px;
    height: 60px;
  }

  .email-modal-content {
    width: 95%;
    max-width: 100%;
    padding: 20px;
    max-height: 90vh;
  }

  .email-modal-content h2 {
    font-size: 1.2rem;
    margin-top: 4px;
  }

  .email-modal-content p {
    font-size: 0.85rem;
    margin-bottom: 12px;
  }

  .quote-grid {
    grid-template-columns: 1fr;
  }

  .email-modal-content form {
    gap: 8px;
  }

  .email-modal-content input,
  .email-modal-content textarea,
  .email-modal-content select {
    padding: 9px 10px;
    font-size: 13px;
  }

  .send-btn {
    padding: 11px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  #whatsapp-button {
    width: 60px;
    height: 60px;
    bottom: 20px;
    right: 20px;
  }

  #whatsapp-chat {
    width: 95%;
    right: 2.5%;
    bottom: 75px;
    max-width: 100%;
  }

  .chat-body {
    height: 180px;
  }

  .btn-floating.email {
    width: 56px;
    height: 56px;
    bottom: 95px;
    right: 18px;
  }

  .btn-floating.email svg {
    width: 26px;
    height: 26px;
  }
}
