/**
 * EUWOO Footer Styles
 * ---
 * Design tokens from DNA.md (primary navy, accent gold, cta red)
 * Tailwind utility classes handle most layout; this file covers
 * the chat panel, floating actions, and footer-specific overrides.
 */

/* ==========================================================================
   1. Footer Logo Sizing
   ========================================================================== */

.footer-logo {
  width: clamp(132px, 14vw, 188px);
  height: auto;
}

.euwoo-footer-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 3rem !important;
}

.euwoo-footer-grid > * {
  min-width: 0;
}

@media (min-width: 768px) {
  .euwoo-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1024px) {
  .euwoo-footer-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    column-gap: 4rem !important;
    row-gap: 3rem !important;
  }
}

/* ==========================================================================
   2. Floating Action Buttons (FAB Group)
   ========================================================================== */

.euwoo-fab-group {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.euwoo-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease, box-shadow 0.25s ease;
}

.euwoo-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.24);
}

/* Back to Top */
.euwoo-fab--top {
  width: 48px;
  height: 48px;
  background-color: #1A1A2E;
  color: #ffffff;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
}

.euwoo-fab--top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.euwoo-fab--top:hover {
  background-color: #16213E;
  transform: translateY(0) scale(1.08);
}

/* WhatsApp FAB */
.euwoo-fab--wa {
  width: 56px;
  height: 56px;
  background-color: #25D366;
  color: #ffffff;
}

.euwoo-fab--wa:hover {
  background-color: #20b858;
}

/* ==========================================================================
   3. WhatsApp Chat Panel
   ========================================================================== */

.euwoo-wa-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 140px);
}

.euwoo-wa-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Panel Header */
.euwoo-wa-panel__header {
  background-color: #1A1A2E;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.euwoo-wa-panel__header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.euwoo-wa-panel__avatar {
  width: 42px;
  height: 42px;
  background-color: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.euwoo-wa-panel__title {
  display: block;
  color: #ffffff;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
}

.euwoo-wa-panel__subtitle {
  display: block;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  line-height: 1.4;
}

.euwoo-wa-panel__close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.euwoo-wa-panel__close:hover {
  color: #ffffff;
}

/* Panel Body */
.euwoo-wa-panel__body {
  background-color: #f0ebe3;
  padding: 20px;
  overflow-y: auto;
  flex: 1 1 auto;
}

/* Welcome Bubble */
.euwoo-wa-panel__bubble {
  background-color: #ffffff;
  padding: 14px 18px;
  border-radius: 2px 12px 12px 12px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.euwoo-wa-panel__bubble p {
  color: #334155;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

/* Form */
.euwoo-wa-panel__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.euwoo-wa-panel__input,
.euwoo-wa-panel__textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #d4d0c8;
  border-radius: 8px;font-size: 14px;
  background-color: #ffffff;
  color: #1E293B;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  font-family: inherit;
}

.euwoo-wa-panel__input::placeholder,
.euwoo-wa-panel__textarea::placeholder {
  color: #94A3B8;
}

.euwoo-wa-panel__input:focus,
.euwoo-wa-panel__textarea:focus {
  border-color: #25D366;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.12);
}

.euwoo-wa-panel__textarea {
  min-height: 72px;
  resize: vertical;
}

/* Validation hint */
.euwoo-wa-panel__input:invalid:not(:placeholder-shown),
.euwoo-wa-panel__textarea:invalid:not(:placeholder-shown) {
  border-color: #C0392B;
}

/* Submit Button */
.euwoo-wa-panel__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  margin-top: 4px;
  background-color: #25D366;
  color: #ffffff;
  border: none;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.euwoo-wa-panel__submit:hover {
  background-color: #20b858;
}

.euwoo-wa-panel__submit:active {
  transform: scale(0.97);
}

/* Panel Footer */
.euwoo-wa-panel__footer {
  background-color: #ffffff;
  border-top: 1px solid #e2e0db;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
}

.euwoo-wa-panel__online-dot {
  width: 8px;
  height: 8px;
  background-color: #25D366;
  border-radius: 50%;
  animation: euwoo-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes euwoo-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.euwoo-wa-panel__online-text {
  color: #25D366;
  font-weight: 600;
  font-size: 11px;
}

.euwoo-wa-panel__divider {
  color: #CBD5E1;
  font-size: 14px;
}

.euwoo-wa-panel__mini-logo {
  width: clamp(72px, 9vw, 96px);
  height: auto;
}

/* ==========================================================================
   4. Industrial Grid Background (footer texture)
   ========================================================================== */

.industrial-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ==========================================================================
   5. Responsive Adjustments
   ========================================================================== */

@media (max-width: 767px) {
  .euwoo-wa-panel {
    right: 12px;
    bottom: 88px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 120px);
  }

  .euwoo-fab-group {
    bottom: 16px;
    right: 16px;
    gap: 10px;
  }

  .euwoo-fab--wa {
    width: 52px;
    height: 52px;
  }

  .euwoo-fab--top {
    width: 44px;
    height: 44px;
  }

  .euwoo-wa-panel__body {
    padding: 16px;
  }

  .euwoo-wa-panel__header {
    padding: 14px 16px;
  }

  .euwoo-wa-panel__footer {
    padding: 8px 16px;
  }
}

@media (max-width: 480px) {
  .footer-logo {
    width: clamp(110px, 30vw, 148px);
  }
}
