@import url("/css/design_v2/color.css");
@import url("/css/design_v2/font.css");
@import url("/css/design_v2/standards.css");
@import url("/css/design_v2/breakpoints.css");

.pp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--Space-XS);
  box-sizing: border-box;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.5;
  font-weight: var(--Font-Weight-500);
  transition: var(--Transition-Transform), var(--Transition-Border), var(--Transition-Color), var(--Transition-Background);
  border: var(--Border-Width-1) var(--Border-Style) transparent;
  background: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
  -webkit-font-synthesis: none;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform;
}

/* Apply border-radius only to non-link buttons */
.pp-btn:not(.pp-btn--variant-link) {
  border-radius: var(--Radius-Pill);
}

/* Optional hover background override mappings */
.pp-btn--hoverbg-white {
  --pp-btn-hover-bg: var(--Color-Primary-White);
}

.pp-btn--hoverbg-neutral-500 {
  --pp-btn-hover-bg: var(--Color-Primary-Neutral-500);
}

/* Ensure no underline for anchors in any state (except link variant) */
.pp-btn:link:not(.pp-btn--variant-link),
.pp-btn:visited:not(.pp-btn--variant-link),
.pp-btn:hover:not(.pp-btn--variant-link),
.pp-btn:active:not(.pp-btn--variant-link),
.pp-btn:focus:not(.pp-btn--variant-link) {
  text-decoration: none;
}

.pp-btn--size-sm {
  padding: var(--Space-XXS) var(--Space-M);
}

.pp-btn--size-md {
  padding: var(--Space-XS) var(--Space-LM);
}

.pp-btn--size-lg {
  padding: var(--Space-S) var(--Space-L);
}

/* Primary variant */
.pp-btn--variant-primary.pp-btn--color-red {
  background: var(--Color-Primary-Red-600);
  color: var(--Color-Primary-White);
  border-color: var(--Color-Primary-Red-600);
}

.pp-btn--variant-primary.pp-btn--color-white {
  background: var(--Color-Primary-White);
  color: var(--Color-Primary-Red-600);
  border-color: var(--Color-Primary-White);
}

.pp-btn--variant-primary.pp-btn--color-navy {
  background: var(--Color-Secondary-Navy-600);
  color: var(--Color-Primary-White);
  border-color: var(--Color-Secondary-Navy-600);
}

.pp-btn--variant-secondary.pp-btn--color-red {
  background: var(--Color-Primary-Neutral-500);
  color: var(--Color-Primary-Red-600);
  border-color: var(--Color-Primary-Neutral-500);
}

.pp-btn--variant-secondary.pp-btn--color-navy {
  background: var(--Color-Primary-Neutral-500);
  color: var(--Color-Secondary-Navy-600);
  border-color: var(--Color-Primary-Neutral-500);
}

.pp-btn--variant-outline.pp-btn--color-red {
  background: transparent;
  color: var(--Color-Primary-Red-600);
  border-color: var(--Color-Primary-Red-600);
}

.pp-btn--variant-outline.pp-btn--color-white {
  background: transparent;
  color: var(--Color-Primary-White);
  border-color: var(--Color-Primary-White);
}

.pp-btn--variant-outline.pp-btn--color-navy {
  background: transparent;
  color: var(--Color-Secondary-Navy-600);
  border-color: var(--Color-Secondary-Navy-600);
}

.pp-btn--variant-link.pp-btn--color-red {
  background: transparent;
  color: var(--Color-Primary-Red-600);
  border-color: transparent;
  padding: 0;
  text-decoration: underline;
}

.pp-btn--variant-link.pp-btn--color-white {
  background: transparent;
  color: var(--Color-Primary-White);
  border-color: transparent;
  padding: 0;
  text-decoration: underline;
}

.pp-btn--variant-link.pp-btn--color-navy {
  background: transparent;
  color: var(--Color-Text-Navy-500);
  border-color: transparent;
  padding: 0;
  text-decoration: underline;
}

.pp-btn--variant-primary.pp-btn--color-red:hover:not(.is-disabled) {
  background: var(--pp-btn-hover-bg, var(--Color-Primary-Red-600-Hover));
  border-color: var(--pp-btn-hover-bg, var(--Color-Primary-Red-600-Hover));
  box-shadow: var(--Shadow-200);
  transform: translateY(-1px);
  font-weight: var(--Font-Weight-500);
}

.pp-btn--variant-primary.pp-btn--color-white:hover:not(.is-disabled) {
  background: var(--pp-btn-hover-bg, var(--Color-Primary-White-Hover));
  border-color: var(--pp-btn-hover-bg, var(--Color-Primary-White-Hover));
  box-shadow: var(--Shadow-200);
  transform: translateY(-1px);
  font-weight: var(--Font-Weight-500);
}

.pp-btn--variant-primary.pp-btn--color-navy:hover:not(.is-disabled) {
  background: var(--pp-btn-hover-bg, var(--Color-Secondary-Navy-600-Hover));
  border-color: var(--pp-btn-hover-bg, var(--Color-Secondary-Navy-600-Hover));
  box-shadow: var(--Shadow-200);
  transform: translateY(-1px);
  font-weight: var(--Font-Weight-500);
}

.pp-btn--variant-secondary.pp-btn--color-red:hover:not(.is-disabled) {
  background: var(--pp-btn-hover-bg, var(--Color-Primary-Neutral-500-Hover));
  border-color: var(--pp-btn-hover-bg, var(--Color-Primary-Neutral-500-Hover));
  box-shadow: var(--Shadow-100);
  font-weight: var(--Font-Weight-500);
}

.pp-btn--variant-secondary.pp-btn--color-navy:hover:not(.is-disabled) {
  background: var(--pp-btn-hover-bg, var(--Color-Primary-Neutral-500-Hover));
  border-color: var(--pp-btn-hover-bg, var(--Color-Primary-Neutral-500-Hover));
  box-shadow: var(--Shadow-100);
  font-weight: var(--Font-Weight-500);
}

.pp-btn--variant-outline.pp-btn--color-red:hover:not(.is-disabled) {
  background: var(--pp-btn-hover-bg, color-mix(in srgb, var(--Color-Primary-Red-600) var(--Opacity-Hover-Overlay-Light), transparent));
  border-color: var(--pp-btn-hover-bg, var(--Color-Primary-Red-600));
  box-shadow: var(--Shadow-100);
  font-weight: var(--Font-Weight-500);
}

.pp-btn--variant-outline.pp-btn--color-white:hover:not(.is-disabled) {
  background: var(--pp-btn-hover-bg, color-mix(in srgb, var(--Color-Primary-White) var(--Opacity-Hover-Overlay-Light), transparent));
  border-color: var(--pp-btn-hover-bg, var(--Color-Primary-White));
  box-shadow: var(--Shadow-100);
  font-weight: var(--Font-Weight-500);
}

.pp-btn--variant-outline.pp-btn--color-navy:hover:not(.is-disabled) {
  background: var(--pp-btn-hover-bg, color-mix(in srgb, var(--Color-Secondary-Navy-600) var(--Opacity-Hover-Overlay-Light), transparent));
  border-color: var(--pp-btn-hover-bg, var(--Color-Secondary-Navy-600));
  box-shadow: var(--Shadow-100);
  font-weight: var(--Font-Weight-500);
}

.pp-btn--variant-link.pp-btn--color-red:hover:not(.is-disabled) {
  color: var(--Color-Primary-Red-600-Hover);
  text-decoration: underline;
}

.pp-btn--variant-link.pp-btn--color-white:hover:not(.is-disabled) {
  opacity: 0.8;
  text-decoration: underline;
}

.pp-btn--variant-link.pp-btn--color-navy:hover:not(.is-disabled) {
  color: var(--Color-Primary-Red-600);
  text-decoration: underline;
}

.pp-btn--variant-primary:active:not(.is-disabled) {
  transform: translateY(0);
  box-shadow: var(--Shadow-100);
  font-weight: var(--Font-Weight-500);
}

.pp-btn--variant-secondary:active:not(.is-disabled),
.pp-btn--variant-outline:active:not(.is-disabled),
.pp-btn--variant-link:active:not(.is-disabled) {
  opacity: var(--Opacity-Active);
  font-weight: var(--Font-Weight-500);
}

.pp-btn:focus-visible {
  outline: var(--Focus-Outline-Width) solid var(--Color-Secondary-Yellow-500);
  outline-offset: var(--Focus-Outline-Offset);
  font-weight: var(--Font-Weight-500);
}

.pp-btn.is-disabled,
.pp-btn[aria-disabled="true"],
.pp-btn:disabled {
  opacity: var(--Opacity-Disabled);
  cursor: not-allowed;
  pointer-events: none;
  font-weight: var(--Font-Weight-500);
}

/* Optional hover text color override mappings */
.pp-btn--hovertext-red:hover:not(.is-disabled) {
  color: var(--Color-Primary-Red-600) !important;
}

.pp-btn--hovertext-white:hover:not(.is-disabled) {
  color: var(--Color-Primary-White) !important;
}

/* Optional no underline for link variant */
.pp-btn--variant-link.pp-btn--no-underline {
  text-decoration: none;
}

.pp-btn--variant-link.pp-btn--no-underline:hover:not(.is-disabled) {
  text-decoration: none;
}

@media (max-width: 599px) {
  .pp-btn--size-lg {
    padding: var(--Space-XS) var(--Space-LM);
  }
}
