/**
 * External Links Popup Styles
 * Portable CSS for use in other projects
 * 
 * Customize colors, fonts, and dimensions as needed for your brand
 */

/* Base popup styles */

#ext-pop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  -webkit-backdrop-filter: blur(2px);
          backdrop-filter: blur(2px);
}

#ext-pop.visible {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

/* Ensure popup is visible when needed */

#ext-pop[style*="display: block"] {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

/* Modal dialog */

#ext-pop .internal {
  position: relative;
  background-color: #FFFAF4;
  max-width: 90vw;
  max-height: 90vh;
  width: 600px;
  min-height: 300px;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: popupFadeIn 0.3s ease-out;
}

@keyframes popupFadeIn {
  from {
      opacity: 0;
      transform: scale(0.9);
  }
  to {
      opacity: 1;
      transform: scale(1);
  }
}

/* Header */

#ext-pop .internal header {
  background-color: #FFFAF4;
  padding: 20px 30px;
  border-bottom: 1px solid #E0E0E0;
  position: relative;
}

#ext-pop .internal header h2 {
  text-transform: uppercase;
  margin: 0;
  padding-right: 40px;
}

/* Close button */

#ext-pop .internal header .close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

#ext-pop .internal header .close:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

#ext-pop .internal header .close::before,
#ext-pop .internal header .close::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 2px;
  background-color: #000041;
  border-radius: 1px;
}

#ext-pop .internal header .close::before {
  transform: rotate(45deg);
}

#ext-pop .internal header .close::after {
  transform: rotate(-45deg);
}

/* Content */

#ext-pop .internal p {
  padding: 20px 30px;
  margin: 0;
}

/* Navigation/Buttons */

#ext-pop .internal nav {
  padding: 0 30px 30px;
  display: flex;
  gap: 15px;
  justify-content: flex-end;
}

/* Sold out state */

#ext-pop.sold-out .internal:not(.sold-out) {
  display: none;
}

#ext-pop:not(.sold-out) .internal.sold-out {
  display: none;
}

#ext-pop.sold-out .internal.sold-out {
  display: block;
}

/* Sold out specific styles */

#ext-pop .internal.sold-out header h2 {
  color: #d32f2f;
}

#ext-pop .internal.sold-out #close-sold-out {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  color: #666;
  cursor: pointer;
  border-radius: 4px;
}

#ext-pop .internal.sold-out #close-sold-out:hover {
  background-color: #eeeeee;
}

/* Responsive design */

@media (max-width: 768px) {
  #ext-pop .internal {
      width: 95vw;
      margin: 20px;
  }
  
  #ext-pop .internal header,
  #ext-pop .internal p,
  #ext-pop .internal nav {
      padding-left: 20px;
      padding-right: 20px;
  }
  
  #ext-pop .internal header h2 {
      font-size: 14px;
      padding-right: 30px;
  }
  
  #ext-pop .internal nav {
      flex-direction: column;
  }
  
  #ext-pop .internal nav a,
  #ext-pop .internal nav button {
      width: 100%;
      margin: 0;
  }
}

@media (max-width: 480px) {
  #ext-pop .internal {
      width: 100vw;
      height: 100vh;
      max-width: none;
      max-height: none;
      border-radius: 0;
  }
}

/* Accessibility improvements */

#ext-pop .internal:focus {
  outline: none;
}

#ext-pop .internal .close:focus {
  outline: 2px solid #000041;
  outline-offset: 2px;
}

#ext-pop .internal nav a:focus,
#ext-pop .internal nav button:focus {
  outline: 2px solid #000041;
  outline-offset: 2px;
}

/* Print styles */

@media print {
  #ext-pop {
      display: none !important;
  }
}
