/* ============================================
   Button System
   Based on Figma design system
   BEM naming: btn, btn_modifier
   ============================================ */

/* ============================================
   BASE BUTTON STYLES
   ============================================ */

html body .btn {
  font-family: var(--font-family-body);
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border: none;
  overflow: hidden;
  transition: color 0.15s ease, background-color 0.15s ease,
    border-color 0.15s ease, outline-color 0.15s ease, outline-width 0.15s ease;
  appearance: none;
  text-box: trim-both cap alphabetic;
  &:active,
  &:focus {
    outline: none !important;
  }
  &:focus-visible {
    outline: 5px auto -webkit-focus-ring-color !important;
  }
}

/* ============================================
   BUTTON SIZES
   ============================================ */

/* Large */
html body .btn_large {
  padding: 20px;
  border-radius: 15px;
  font-size: var(--font-size-body-m);
}

/* Medium */
html body .btn_medium {
  padding: 15px 20px;
  border-radius: 10px;
  font-size: var(--font-size-body-s);
}

/* Small */
html body .btn_small {
  padding: 15px;
  border-radius: 7px;
  font-size: var(--font-size-caption);
}

/* ============================================
   BUTTON LEVELS (VARIANTS)
   ============================================ */

/* Primary - Orange background */
html body .btn_primary {
  background-color: var(--color-brand-orange);
  color: var(--color-white);
  border: 1px solid var(--color-brand-orange);
}

html body .btn_primary:hover {
  background-color: var(--color-brand-orange-hover);
  border-color: var(--color-brand-orange-hover);
}

html body .btn_primary:disabled,
html body .btn_primary.btn_disabled {
  background-color: var(--color-med-grey);
  color: var(--color-white);
  border-color: var(--color-med-grey);
  cursor: not-allowed;
}

/* Secondary - Black background */
html body .btn_secondary {
  background-color: var(--color-black-bg);
  color: var(--color-white);
  border: 1px solid var(--color-black-bg);
}

html body .btn_secondary:hover {
  background-color: var(--color-black-txt);
  border-color: var(--color-black-txt);
}

html body .btn_secondary:disabled,
html body .btn_secondary.btn_disabled {
  background-color: var(--color-med-grey);
  color: var(--color-white);
  border-color: var(--color-med-grey);
  cursor: not-allowed;
}

/* Tertiary - Outline style */
html body .btn_tertiary {
  background-color: transparent;
  color: var(--color-black-txt);
  border: 0;
  outline: 1px solid var(--color-black-bg) !important;
  &:active,
  &:focus {
    outline: 1px solid var(--color-black-bg) !important;
  }
  &:focus-visible {
    outline: 5px auto -webkit-focus-ring-color !important;
  }
}

html body .btn_tertiary:hover {
  outline-width: 2px !important;
}

html body .btn_tertiary:disabled,
html body .btn_tertiary.btn_disabled {
  outline-color: var(--color-med-grey);
  color: var(--color-med-grey);
  cursor: not-allowed;
}

/* Tertiary Light - Outline style */
html body .btn_tertiary-light {
  background-color: transparent;
  color: var(--color-white);
  border: 0;
  outline: 1px solid var(--color-white) !important;
  transition: outline-width 0.3s ease;
  &:active,
  &:focus {
    outline: 1px solid var(--color-white) !important;
  }
  @media (hover: hover) {
    &:focus-visible,
    &:hover {
      outline-width: 2px !important;
    }
  }
}

html body .btn_tertiary-light:disabled,
html body .btn_tertiary-light.btn_disabled {
  outline-color: var(--color-med-grey);
  color: var(--color-med-grey);
  cursor: not-allowed;
}

/* Link - Text only */
html body .btn_link {
  background-color: transparent;
  color: var(--color-blue);
  padding: 0;
  border-radius: 0;
  font-size: var(--font-size-body-s);
  overflow: visible;
}

html body .btn_link_small {
  font-size: var(--font-size-caption);
}

html body .btn_link:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  color: var(--color-blue);
}

html body .btn_link:disabled,
html body .btn_link.btn_disabled {
  color: var(--color-med-grey);
  cursor: not-allowed;
}

html body .btn_view-all {
  padding: 20px;
  border-radius: 15px;
  font-size: var(--font-size-body-m);
  background-color: transparent;
  color: var(--color-black-txt);
  border: 0;
  outline: 1px solid var(--color-black-bg) !important;
  text-align: center;
  text-transform: uppercase;
  @media (min-width: 1280px) {
    color: var(--color-blue);
    padding: 0;
    outline: none !important;
    border-radius: 0;
    font-size: var(--font-size-body-s);
    overflow: visible;
  }
  &:active,
  &:focus,
  &:focus-visible,
  &:hover {
    outline: 1px solid var(--color-black-bg) !important;
    @media (hover: hover) {
      outline: none !important;
      @media (min-width: 1280px) {
        text-decoration: underline;
        text-decoration-thickness: 2px;
        text-underline-offset: 3px;
        color: var(--color-blue);
      }
    }
  }
}
