/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

@import "listing_requirements.css";

/* CanadaPost AddressComplete styles - must be !important to override admin styles */
.pca {
  z-index: 10000 !important;
}

.pcaautocomplete {
  z-index: 10000 !important;
  position: absolute !important;
  background-color: white !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 0.375rem !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
  font-family: ui-sans-serif, system-ui, sans-serif !important;
}

/* Hide empty dropdown lists */
.pca .pcalist:empty {
  display: none !important;
}

.pca .pcalist {
  max-height: 300px !important;
  overflow-y: auto !important;
  border-radius: 0.375rem !important;
  background-color: white !important;
}

.pca .pcaitem {
  padding: 8px 12px !important;
  font-family: ui-sans-serif, system-ui, sans-serif !important;
  font-size: 14px !important;
  cursor: pointer !important;
}

.pca .pcaitem:hover, .pca .pcaitem.selected {
  background-color: #f3f4f6 !important;
}

/* Footer styling - matches CP styling */
.pca .pcafooter {
  background-color: #f9fafb !important;
  font-family: ui-sans-serif, system-ui, sans-serif !important;
  padding: 4px 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-top: 1px solid #e5e7eb !important;
  border-radius: 0 0 0.375rem 0.375rem !important;
}

/* Replace the existing aclogo styles with these */
.aclogo, .aclogo.pcalogoen {
  background-image: url(//ws1.postescanada-canadapost.ca/images/icons/captureplus/address_complete_logo_en.png) !important;
  background-repeat: no-repeat !important;
  width: 112px !important;
  height: 15px !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

/* Add support for French logo if needed */
.aclogo.pcalogofr {
  width: 118px !important;
  background-image: url(//ws1.postescanada-canadapost.ca/images/icons/captureplus/address_complete_logo_fr.png) !important;
}

/* Ensure the footer is properly styled for the logo */
.pca .pcafooter.pca-showlogo {
  justify-content: space-between !important;
}

/* Remove incorrect sprite positioning */
.pcalogoen {
  width: 112px !important;
  height: 15px !important;
  background-position: initial !important;
}

/* Hide the country selector button */
.pca .pcafooter .pcaflagbutton {
  display: none !important;
}

/* Hide empty dropdown menu completely */
.pcaautocomplete:not(:has(.pcaitem)) {
  display: none !important;
}

/* Make sure the visual keyboard focus works properly */
.pca .pcafooter a:focus {
  outline: 2px solid #3b82f6 !important;
  outline-offset: 2px !important;
}

/* Accessibility - visually hide screen reader content */
.pca .pca-visually-hidden {
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  height: 1px !important;
  overflow: hidden !important;
  position: absolute !important;
  white-space: nowrap !important;
  width: 1px !important;
}