/**
 * Newsletter Popup Styles - Bottom Popup Design
 * For WordPress Child Theme
 */

/* Overlay */
#newsletter-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 999999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#newsletter-popup.active {
  display: flex;
  opacity: 1;
}

/* Popup Container - Bottom positioned, full width */
.newsletter-popup-container {
  position: relative;
  background: #ffffff;
  width: 100%;
  max-width: 100%;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.3s ease;
  padding: 16px 32px 20px;
  box-sizing: border-box;
}

/* Inner content wrapper to constrain form width */
.newsletter-popup-inner {
  max-width: 500px;
  margin: 0 auto;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Close Button - Top right X */
.newsletter-popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: opacity 0.2s ease;
}

.newsletter-popup-close:hover {
  opacity: 0.7;
}

.newsletter-popup-close::before,
.newsletter-popup-close::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 1.5px;
  background-color: #333;
}

.newsletter-popup-close::before {
  transform: rotate(45deg);
}

.newsletter-popup-close::after {
  transform: rotate(-45deg);
}

/* Logo */
.newsletter-popup-logo {
  text-align: center;
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.newsletter-popup-logo img {
  height: 40px;
  width: auto;
  display: block;
  margin: 0 auto;
}

/* Header Text */
.newsletter-popup-header {
  text-align: center;
  margin-bottom: 12px;
}

.newsletter-popup-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  color: #333;
  line-height: 1.4;
}

/* Content - Form area */
.newsletter-popup-content {
  margin-bottom: 12px;
}

/* Brevo Form Overrides for compact display */
.newsletter-popup-content .sib-form {
  text-align: center;
  background-color: transparent !important;
}

.newsletter-popup-content #sib-container {
  max-width: 100% !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

.newsletter-popup-content .sib-form-block {
  padding: 0 !important;
}

.newsletter-popup-content .sib-input {
  margin: 0 !important;
}

.newsletter-popup-content .form__entry {
  margin: 0 !important;
  padding: 0 !important;
}

.newsletter-popup-content .entry__field input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ccc;
  border-radius: 0;
  font-size: 14px;
  box-sizing: border-box;
  text-align: center;
}

.newsletter-popup-content .entry__field input::placeholder {
  color: #999;
  text-align: center;
}

.newsletter-popup-content .entry__field input:focus {
  outline: none;
  border-color: #333;
}

/* Hide the original Brevo submit button by default */
.newsletter-popup-content .sib-form-block__button {
  display: none !important;
}

/* Show submit button when form is revealed */
.newsletter-popup-content.form-revealed .sib-form-block__button {
  display: inline-block !important;
  width: 100%;
  padding: 12px 24px;
  background-color: #222d5f !important;
  color: #fff !important;
  border: none;
  border-radius: 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
}

/* Hide intro text in form */
.newsletter-popup-content .sib-text-form-block {
  display: none !important;
}

/* Hide error/success messages until needed */
.newsletter-popup-content .sib-form-message-panel {
  display: none;
  margin-bottom: 12px;
  max-width: 100% !important;
}

.newsletter-popup-content .sib-form-message-panel[style*="display: block"] {
  display: block !important;
}

/* Action Buttons Container */
.newsletter-popup-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Hide actions when form submit is revealed */
.newsletter-popup-actions.hidden {
  display: none;
}

/* Yes Button - Primary action */
.newsletter-popup-btn-yes {
  width: 100%;
  padding: 14px 24px;
  background-color: #222d5f;
  color: #ffffff;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.newsletter-popup-btn-yes:hover {
  background-color: #1a2249;
}

/* No Button - Secondary action */
.newsletter-popup-btn-no {
  width: 100%;
  padding: 14px 24px;
  background-color: #ffffff;
  color: #333;
  border: 1px solid #333;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.newsletter-popup-btn-no:hover {
  background-color: #f5f5f5;
}

/* Responsive Design */
@media only screen and (max-width: 640px) {
  .newsletter-popup-container {
    padding: 14px 20px 18px;
  }

  .newsletter-popup-header h2 {
    font-size: 16px;
  }

  .newsletter-popup-btn-yes,
  .newsletter-popup-btn-no {
    padding: 12px 20px;
    font-size: 13px;
  }
}

/* Prevent body scroll when popup is active */
body.newsletter-popup-active {
  overflow: hidden;
}