/**
 * @file
 * Exit Intent Popup Styles.
 * Merged from theme SCSS, favoring theme rules.
 */

/* Exit container base styles */
.exit-container {
  background: #000 !important;
  max-height: 90vh !important; /* Use viewport height instead of fixed height */
  max-width: 840px !important;
  width: 840px !important;
  margin: 0 auto !important;
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 10000 !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
  display: none !important; /* Hidden by default to prevent flash */
  visibility: hidden !important; /* Hidden by default to prevent flash */
  opacity: 0 !important; /* Hidden by default to prevent flash */
  overflow-y: auto !important; /* Add vertical scrollbar when needed */
}

/* Override overflow-hidden class to ensure scrollbars appear */
.exit-container.overflow-hidden {
  overflow-y: auto !important;
}

/* Even more specific override for Bootstrap classes */
.exit-container[class*="overflow-hidden"] {
  overflow-y: auto !important;
}

.block-exit-popup {
  min-height: 400px; /* Set a minimum height for the block */
  max-height: 720px !important;
}

/* Exit intent popup base styles */
.exit-intent-popup {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 9999 !important;
  /* Removed dark background - now just a transparent overlay for blur */
  /* Let JavaScript control visibility instead of CSS */
}

/* Force hide when popup should be closed */
.exit-intent-popup.hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  z-index: -1 !important;
}

/* Ensure popup is visible and above blur when shown */
.exit-intent-popup:not(.hidden) {
  z-index: 9999 !important;
}





/* Exit container base styles - consolidated */
.exit-container {
  background: #000 !important;
  max-height: 720px !important;
  max-width: 840px !important;
  width: 840px !important;
  margin: 0 auto !important;
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 10000 !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
  display: none !important; /* Hidden by default to prevent flash */
  visibility: hidden !important; /* Hidden by default to prevent flash */
  opacity: 0 !important; /* Hidden by default to prevent flash */
}

/* Force show when JavaScript sets inline styles */
.exit-container[style*="display: block"] {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Show exit intent popup when triggered */
.exit-intent-popup.show {
  visibility: visible;
  opacity: 1;
  background: rgba(0, 0, 0, 0.8);
}

/* Blur specific regions when popup is shown */
.blur-region {
  filter: blur(12px) !important;
  -webkit-filter: blur(12px) !important;
  transition: filter 0.3s ease;
  /* Add a subtle darkening effect to make content readable */
  filter: blur(12px) brightness(0.8) !important;
  -webkit-filter: blur(12px) brightness(0.8) !important;
}

/* Prevent body scrolling when popup is active */
body.popup-open {
  overflow: hidden !important;
  /* Store original scroll position to prevent jumping */
}

/* Alternative approach: prevent scrolling on html and body */
html.popup-open,
body.popup-open {
  overflow: hidden !important;
  height: 100% !important;
  /* Prevent iOS Safari bouncing */
  position: relative !important;
  -webkit-overflow-scrolling: touch;
}

/* Blur the main content when popup is open */
body.popup-open #main-wrapper {
  filter: blur(8px) !important;
  -webkit-filter: blur(8px) !important;
  transition: filter 0.3s ease;
}

/* Remove form padding in popups for cleaner look */
.exit-intent-popup .webform-submission-form {
  padding: 0 !important;
  background: transparent !important;
}

/* Remove margin from webform flex containers in popups */
.exit-intent-popup .webform-flex--container {
  margin: 0 !important;
}

/* Remove bottom margin from webform flexbox containers in popups for consistent spacing */
.exit-intent-popup .webform-flexbox {
  margin-bottom: 0 !important;
}

/* Ensure consistent spacing between form elements in popups */
.exit-intent-popup .webform-flexbox + .webform-flexbox {
  margin-top: 1.5rem !important;
}

/* Close button styling */
.exit-popup-close {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 1000;
  background: transparent;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.exit-popup-close:hover {
  transform: scale(1.1);
}

.exit-popup-close:focus {
  outline: 2px solid #3B82F6;
  outline-offset: 2px;
}

.exit-popup-close svg {
  transition: transform 0.2s ease;
}

.exit-popup-close:hover svg {
  transform: rotate(90deg);
}

.exit-popup-image-col {
  flex: 0 0 50%;
  min-width: 0;
  max-width: 50%;
  height: 100%;
  display: flex;
  align-items: stretch;
}

/* Mobile responsive: hide image column and make content full width */
@media (max-width: 767px) {
  .exit-intent-popup .exit-popup-image-col {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    max-width: 0 !important;
    flex: 0 0 0 !important;
  }
  
  .exit-intent-popup .exit-popup-content-col {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    min-width: 100% !important;
  }
}

/* Force mobile responsive with higher specificity */
.exit-intent-popup .exit-popup-image-col.mobile-hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  width: 0 !important;
  max-width: 0 !important;
  flex: 0 0 0 !important;
}

.exit-intent-popup .exit-popup-content-col.mobile-full {
  flex: 0 0 100% !important;
  max-width: 100% !important;
  width: 100% !important;
  min-width: 100% !important;
}

/* Override hardcoded container widths for mobile */
.exit-intent-popup .exit-container.mobile-responsive {
  max-width: 95% !important;
  width: 95% !important;
  margin: 0 auto !important;
}

/* Ensure mobile content column doesn't overflow */
.exit-intent-popup .exit-popup-content-col.mobile-full {
  padding: 2rem !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.exit-popup-image {
  width: 100%;
  height: 100%;
  display: flex;
}

.exit-popup-image .field--name-field-image {
  width: 100%;
  height: 100%;
  display: flex;
}

.exit-popup-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
}

.exit-popup-body,
.exit-popup-webform {
  margin-bottom: 1.5rem;
}

@media (max-width: 767px) {
  .exit-popup-image,
  .exit-popup-body,
  .exit-popup-webform {
    padding: 1rem 0;
  }
}

.block-exit-popup .row.align-items-stretch {
  min-height: 100%;
  height: 100%;
}

.block-exit-popup .col-md-6 {
  height: 100%;
}

.block-exit-popup .col-md-6.bg-black {
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center; /* Optional: vertically center content */
}

.exit-popup-flex-row {
  min-height: 400px; /* Ensure flex row has height */
  width: 100%;
  height: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

.exit-popup-image-col {
  flex: 0 0 50%;
  min-width: 0;
  max-width: 50%;
  display: flex;
  align-items: stretch;
  min-height: 400px; /* Ensure image column has height */
  align-self: stretch; /* Make column stretch to match tallest sibling */
}

@media (min-width: 768px) {
  .exit-popup-image-col {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (max-width: 767px) {
  .exit-popup-image-col {
    display: none; /* Hide image column on mobile */
  }
}

.exit-popup-content-col {
  flex: 0 0 50%;
  min-width: 0;
  max-width: 50%;
  min-height: 400px; /* Ensure content column has height */
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  background: #000;
  color: #fff;
}

@media (min-width: 768px) {
  .exit-popup-content-col {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (max-width: 767px) {
  .exit-popup-content-col {
    flex: 1 1 100%; /* Take full width on mobile */
    max-width: 100%;
  }
}

.exit-popup-image {
  width: 100%;
  display: flex;
  align-items: stretch;
  min-height: 400px; /* Ensure image container has height */
  position: relative; /* For absolute positioning of image */
  overflow: hidden; /* Prevent image overflow */
  height: 100%; /* Take full height of parent column */
}

.exit-intent-popup.show .exit-popup-image {
  height: 100%;
  min-height: 100%;
}

.exit-popup-image img {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  min-height: 400px !important; /* Ensure image has minimum height */
  object-fit: cover;
  display: block;
  position: absolute; /* Position absolutely within parent */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.exit-intent-popup.show .exit-popup-image img {
  height: 100% !important;
  min-height: 100% !important;
  width: 100% !important;
  max-width: 100% !important;
  object-fit: cover;
  position: absolute; /* Position absolutely within parent */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.exit-container {
  max-width: 840px !important;
  margin: 0 auto;
  min-height: 400px; /* Ensure container has height */
  height: auto; /* Let height be determined by content */
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  display: flex; /* Make container a flex container */
  flex-direction: row; /* Horizontal layout */
}

/* Add max-height for medium screens and larger */
@media (min-width: 768px) {
  .exit-container {
    max-height: 730px;
    max-width: 840px !important;
    width: 840px !important;
    overflow-y: auto !important;
  }
}

/* Add max-height for small screens and below */
@media (max-width: 767px) {
  .exit-container {
    max-height: 700px;
    max-width: 95% !important;
    width: 95% !important;
    overflow-y: auto !important;
  }
}

.exit-intent-popup.show .exit-container {
  max-width: 840px !important;
  width: 840px !important;
  height: auto;
  margin: 0 auto !important;
  border-radius: 0 !important;
}

/* Override Bootstrap container class when popup is shown */
.exit-intent-popup.show .container.exit-container {
  max-width: 900px !important;
  width: 900px !important;
  margin: 0 auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Override Bootstrap responsive container rules when popup is shown */
@media (min-width: 36rem) {
  .exit-intent-popup.show .container.exit-container {
    max-width: 900px !important;
    width: 900px !important;
  }
}
@media (min-width: 48rem) {
  .exit-intent-popup.show .container.exit-container {
    max-width: 900px !important;
    width: 900px !important;
  }
}
@media (min-width: 62rem) {
  .exit-intent-popup.show .container.exit-container {
    max-width: 900px !important;
    width: 900px !important;
  }
}
@media (min-width: 75rem) {
  .exit-intent-popup.show .container.exit-container {
    max-width: 900px !important;
    width: 900px !important;
  }
}
@media (min-width: 87.5rem) {
  .exit-intent-popup.show .container.exit-container {
    max-width: 900px !important;
    width: 900px !important;
  }
}

.webform-submission-exit-form {
  background: none !important;
  padding: 0 !important;
}

/* Center the popup container */
.exit-intent-popup .exit-container {
  max-width: 840px !important;
  width: 840px !important;
  margin: 0 auto !important;
  position: fixed !important;
}

/* Override Bootstrap container class specifically for exit popup */
.exit-intent-popup .container.exit-container {
  max-width: 900px !important;
  width: 900px !important;
  margin: 0 auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Override Bootstrap responsive container rules for exit popup */
@media (min-width: 36rem) {
  .exit-intent-popup .container.exit-container {
    max-width: 900px !important;
    width: 900px !important;
  }
}
@media (min-width: 48rem) {
  .exit-intent-popup .container.exit-container {
    max-width: 900px !important;
    width: 900px !important;
  }
}
@media (min-width: 62rem) {
  .exit-intent-popup .container.exit-container {
    max-width: 900px !important;
    width: 900px !important;
  }
}
@media (min-width: 75rem) {
  .exit-intent-popup .container.exit-container {
    max-width: 900px !important;
    width: 900px !important;
  }
}
@media (min-width: 87.5rem) {
  .exit-intent-popup .container.exit-container {
    max-width: 900px !important;
    width: 900px !important;
  }
} 